Skip to content

fix: propagate Connect/PM command/args overrides through Site CR - #157

Merged
stevenolen merged 1 commit into
mainfrom
fix/site-connect-pm-entrypoint-override
Aug 14, 2026
Merged

fix: propagate Connect/PM command/args overrides through Site CR#157
stevenolen merged 1 commit into
mainfrom
fix/site-connect-pm-entrypoint-override

Conversation

@ssinnott

Copy link
Copy Markdown
Contributor

Description

#156 added optional Command []string / Args []string fields to ConnectSpec and PackageManagerSpec so the hardcoded tini-wrapper entrypoint (tini -- /usr/local/bin/startup.sh) can be overridden or dropped. It only touched the standalone Connect/PackageManager CRDs, though — the Site CR's embedded InternalConnectSpec/InternalPackageManagerSpec types (api/core/v1beta1/site_types.go) have no equivalent fields, so anything deployed via a Site (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 Site path: adds Command/Args to both Internal*Spec types and threads them through SiteReconciler.reconcileConnect/reconcilePackageManager into the child Connect/PackageManager CRs it manages, using the exact same field docs/semantics as #156 (unset on both falls back to the legacy tini wrapper via resolveEntrypoint — no default behavior change for existing Sites).

Motivation

posit-dev/images-connect-built images (the daily/preview channel) don't ship tini, so any Site tracking that channel crash-loops on exec: "tini": executable file not found in $PATH with no way to work around it short of this fix.

Code Flow

  • InternalConnectSpec.Command/.Args and InternalPackageManagerSpec.Command/.Args added (api/core/v1beta1/site_types.go).
  • site_controller_connect.go / site_controller_package_manager.go: pass site.Spec.Connect.Command/Args and site.Spec.PackageManager.Command/Args straight through to the child CR's spec, mirroring every other pass-through field in those functions.
  • Regenerated: 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 (via make generate-all manifests copy-crds helm-generate).

Category of change

  • Breaking change

Purely additive — nil Command/Args on a Site's connect/packageManager spec continues to fall back to the legacy tini wrapper exactly as before.

Checklist

  • I have run just test and all tests pass
  • I have reviewed my own diff and added inline comments on lines I want reviewers to focus on or that I am uncertain about

Testing

Added 4 reconciler tests mirroring #156's pattern: TestSiteReconciler_ConnectCommandArgsPropagation/DefaultNil and TestSiteReconciler_PackageManagerCommandArgsPropagation/DefaultNil, covering both the explicit-override and default (nil, legacy-wrapper-preserving) cases for each product.

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.
@ssinnott
ssinnott requested review from stevenolen and a lite review from Copilot August 13, 2026 20:54
@ssinnott
ssinnott marked this pull request as ready for review August 13, 2026 20:56
@claude

claude Bot commented Aug 13, 2026

Copy link
Copy Markdown

Claude finished @ssinnott's task in 1m 18s —— View job


Code Review

  • Read review guidelines
  • Examine changed files
  • Post review feedback

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:

InternalConnectSpec / InternalPackageManagerSpec are missing Sleep

The standalone ConnectSpec and PackageManagerSpec both have a Sleep bool field that overrides Command/Args with "sleep infinity" (connect_types.go:121, packagemanager_types.go:77). InternalConnectSpec and InternalPackageManagerSpec don't expose it, so Site users have never been able to use it — that's a pre-existing gap, not introduced here. Worth noting in case a follow-up adds Sleep support to Site later; the Command/Args plumbing this PR adds is the right prerequisite.

// +optional is redundant for []string with omitempty (api/core/v1beta1/site_types.go:234,240,325,331)

The +optional marker is only meaningful when a field lacks omitempty (it tells controller-gen the field is not required). Since all four new fields already have omitempty, the annotation is a no-op. This matches how the standalone ConnectSpec/PackageManagerSpec annotate the same fields, so it's consistent — but it's cargo-culted boilerplate. Fine to leave as-is for consistency; mentioning it for awareness.

Everything else looks good:

  • Deep copy is correct (make + copy for each slice).
  • Apply-configuration methods match the generated pattern used elsewhere.
  • CRD YAML in all three locations (config/, dist/chart/, internal/crdapply/) is in sync.
  • Tests are clear and cover both the explicit-override and nil-default paths for each product.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 []string to InternalConnectSpec and InternalPackageManagerSpec (Site API types) with matching CRD schema regeneration.
  • Threaded site.Spec.Connect.Command/Args and site.Spec.PackageManager.Command/Args through 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.

Comment on lines +139 to +141
// 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.
Comment on lines +169 to +171
// 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.
@ssinnott
ssinnott requested a review from Lytol August 14, 2026 00:09

@Lytol Lytol left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚢 🇮🇹

@stevenolen
stevenolen added this pull request to the merge queue Aug 14, 2026
Merged via the queue into main with commit b92abfd Aug 14, 2026
12 checks passed
@stevenolen
stevenolen deleted the fix/site-connect-pm-entrypoint-override branch August 14, 2026 11:57
ian-flores pushed a commit that referenced this pull request Aug 14, 2026
## [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))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants