fix: propagate Connect/PM command/args overrides through Site CR - #157
Conversation
PR #156 added optional Command/Args fields to ConnectSpec and PackageManagerSpec so callers can drop the hardcoded tini entrypoint wrapper, but the Site CR's embedded InternalConnectSpec and InternalPackageManagerSpec types were never updated, so Site-managed deployments have no way to set them. Add Command/Args to both Internal*Spec types and thread them through to the child Connect/PackageManager CRs in the Site reconciler.
|
Claude finished @ssinnott's task in 1m 18s —— View job Code Review
The implementation is correct and follows existing patterns well. The propagation is a straight pass-through, the deep copy and generated code are consistent, and the tests cover both the propagation and the nil-default cases. One observation and one minor note:
The standalone
The Everything else looks good:
|
There was a problem hiding this comment.
Pull request overview
This PR extends the Site CRD’s embedded Connect and Package Manager specs to support command/args overrides, and propagates those fields into the child Connect / PackageManager CRs created by the SiteReconciler, aligning the Site-based deployment path with the standalone product CRDs.
Changes:
- Added
Command []string/Args []stringtoInternalConnectSpecandInternalPackageManagerSpec(Site API types) with matching CRD schema regeneration. - Threaded
site.Spec.Connect.Command/Argsandsite.Spec.PackageManager.Command/Argsthrough the Site reconciler into the child CR specs. - Added reconciler tests to validate propagation and default-nil behavior.
Reviewed changes
Copilot reviewed 6 out of 10 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
api/core/v1beta1/site_types.go |
Adds Command/Args to Site’s internal Connect/PM specs. |
api/core/v1beta1/zz_generated.deepcopy.go |
Regenerated deep-copies for the new slice fields. |
internal/controller/core/site_controller_connect.go |
Propagates Site Connect Command/Args into the child Connect CR. |
internal/controller/core/site_controller_package_manager.go |
Propagates Site Package Manager Command/Args into the child PackageManager CR. |
internal/controller/core/site_test.go |
Adds tests for propagation and default-nil behavior for both products. |
client-go/applyconfiguration/core/v1beta1/internalconnectspec.go |
Regenerates applyconfiguration for Site internal Connect spec with new fields. |
client-go/applyconfiguration/core/v1beta1/internalpackagemanagerspec.go |
Regenerates applyconfiguration for Site internal PM spec with new fields. |
config/crd/bases/core.posit.team_sites.yaml |
Regenerates Site CRD base schema to expose command/args. |
dist/chart/templates/crd/core.posit.team_sites.yaml |
Regenerates Helm-rendered Site CRD with command/args. |
internal/crdapply/bases/core.posit.team_sites.yaml |
Regenerates internal CRD-apply base with command/args. |
Files not reviewed (3)
- api/core/v1beta1/zz_generated.deepcopy.go: Generated file
- client-go/applyconfiguration/core/v1beta1/internalconnectspec.go: Generated file
- client-go/applyconfiguration/core/v1beta1/internalpackagemanagerspec.go: Generated file
Suppressed comments (2)
client-go/applyconfiguration/core/v1beta1/internalpackagemanagerspec.go:151
- Comment typo: use "objects can be built" (past participle) for grammatical correctness and consistency with other applyconfiguration comments.
client-go/applyconfiguration/core/v1beta1/internalconnectspec.go:181 - Comment typo: use "objects can be built" (past participle) for grammatical correctness and consistency with other applyconfiguration comments.
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| // WithCommand adds the given value to the Command field in the declarative configuration | ||
| // and returns the receiver, so that objects can be build by chaining "With" function invocations. | ||
| // If called multiple times, values provided by each call will be appended to the Command field. |
| // WithCommand adds the given value to the Command field in the declarative configuration | ||
| // and returns the receiver, so that objects can be build by chaining "With" function invocations. | ||
| // If called multiple times, values provided by each call will be appended to the Command field. |
## [1.30.2](v1.30.1...v1.30.2) (2026-08-14) ### Bug Fixes * propagate Connect/PM command/args overrides through Site CR ([#157](#157)) ([b92abfd](b92abfd))
Description
#156 added optional
Command []string/Args []stringfields toConnectSpecandPackageManagerSpecso the hardcoded tini-wrapper entrypoint (tini -- /usr/local/bin/startup.sh) can be overridden or dropped. It only touched the standaloneConnect/PackageManagerCRDs, though — theSiteCR's embeddedInternalConnectSpec/InternalPackageManagerSpectypes (api/core/v1beta1/site_types.go) have no equivalent fields, so anything deployed via aSite(which is how most consumers, including Posit's own agave environment, actually run these products) has no way to set them.This follows up #156 for the
Sitepath: addsCommand/Argsto bothInternal*Spectypes and threads them throughSiteReconciler.reconcileConnect/reconcilePackageManagerinto the childConnect/PackageManagerCRs it manages, using the exact same field docs/semantics as #156 (unset on both falls back to the legacy tini wrapper viaresolveEntrypoint— no default behavior change for existingSites).Motivation
posit-dev/images-connect-built images (the daily/preview channel) don't shiptini, so anySitetracking that channel crash-loops onexec: "tini": executable file not found in $PATHwith no way to work around it short of this fix.Code Flow
InternalConnectSpec.Command/.ArgsandInternalPackageManagerSpec.Command/.Argsadded (api/core/v1beta1/site_types.go).site_controller_connect.go/site_controller_package_manager.go: passsite.Spec.Connect.Command/Argsandsite.Spec.PackageManager.Command/Argsstraight through to the child CR's spec, mirroring every other pass-through field in those functions.zz_generated.deepcopy.go,client-go/applyconfiguration/...,config/crd/bases/core.posit.team_sites.yaml,dist/chart/templates/crd/core.posit.team_sites.yaml,internal/crdapply/bases/core.posit.team_sites.yaml(viamake generate-all manifests copy-crds helm-generate).Category of change
Purely additive — nil
Command/Argson aSite'sconnect/packageManagerspec continues to fall back to the legacy tini wrapper exactly as before.Checklist
just testand all tests passTesting
Added 4 reconciler tests mirroring #156's pattern:
TestSiteReconciler_ConnectCommandArgsPropagation/DefaultNilandTestSiteReconciler_PackageManagerCommandArgsPropagation/DefaultNil, covering both the explicit-override and default (nil, legacy-wrapper-preserving) cases for each product.