Skip to content

fix: sanitize colon in container name for tag+digest package refs#1

Closed
cahillsf wants to merge 26 commits into
mainfrom
stephen.cahill/fix-container-name-tag-digest
Closed

fix: sanitize colon in container name for tag+digest package refs#1
cahillsf wants to merge 26 commits into
mainfrom
stephen.cahill/fix-container-name-tag-digest

Conversation

@cahillsf
Copy link
Copy Markdown
Owner

Summary

Test plan

  • Added TagAndDigest test case to TestGenerateContainerName
  • Existing container name tests still pass

🤖 Generated with Claude Code

jcogilvie and others added 24 commits April 28, 2026 16:12
* fix: factor stdout/stderr into Options insteaad of passing as args

Signed-off-by: Jonathan Ogilvie <jonathan.ogilvie@sumologic.com>

* fix: factor stdout/stderr into Options insteaad of passing as args

Signed-off-by: Jonathan Ogilvie <jonathan.ogilvie@sumologic.com>

* fix: Apply suggestions from code review

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Signed-off-by: Jonathan Ogilvie <jonathan.ogilvie@sumologic.com>

* fix: add test coverage for empty output format

Signed-off-by: Jonathan Ogilvie <jonathan.ogilvie@sumologic.com>

* chore: ignore compiled Go test binaries

Signed-off-by: Jonathan Ogilvie <jonathan.ogilvie@sumologic.com>

---------

Signed-off-by: Jonathan Ogilvie <jonathan.ogilvie@sumologic.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…ntrib#293)

Signed-off-by: Stephen Cahill <stephen.cahill@datadoghq.com>
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…ntrib#284)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
…lane-contrib#286)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
…ssplane-contrib#287)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
…ane-contrib#288)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
…rity] (crossplane-contrib#292)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
…ity] (crossplane-contrib#297)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
…e-contrib#298)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
…to v2.2.1 (crossplane-contrib#301)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
…rossplane-contrib#299)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
…plane-contrib#300)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
crossplane-contrib#302)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
…splane-contrib#303)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
…splane-contrib#304)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
…ne-contrib#294)

* fix(diff): assign placeholder UID to owner refs for new XRs

When diffing a new XR against a cluster where composed resources
already exist (e.g. after `kubectl delete xr --cascade=orphan`),
every composed resource's dry-run apply failed with:

  metadata.ownerReferences.uid: Invalid value: "": must not be empty

The render pipeline emits empty UIDs on owner refs when the XR has
no cluster UID. UpdateOwnerRefs generates placeholder UIDs but was
a no-op because it was called with composite=nil. Pass the input XR
as the composite parent when xrDiff.Current is nil so UpdateOwnerRefs
runs. Skipped for generateName-only XRs whose synthetic display name
isn't a valid label selector value.

Adds a regression test that uses a dry-run apply mock mirroring the
apiserver's owner-ref UID validation.

Signed-off-by: Erlend Fonnes <erlend.fonnes@gmail.com>

* docs: correct generateName display-name example in comment

The comment showed "foo-(generated)" but the code appends
"(generated)" verbatim without an extra dash, producing names
like "foo(generated)". Aligns the example with the actual
format.

Signed-off-by: Erlend Fonnes <erlend.fonnes@gmail.com>

* fix: regenerate e2e expectations

Signed-off-by: Jonathan Ogilvie <jonathan.ogilvie@sumologic.com>

* test: replace mock-based UT with envtest IT for new XR + existing composed

  The UT in diff_calculator_test.go encoded assumptions about the
  Crossplane render pipeline (empty-UID ownerRefs) and the apiserver's
  validation of them by mocking DryRunApply to mirror apiserver behavior.

  Replace it with an integration test in diff_integration_test.go that
  exercises the real envtest apiserver and the real render pipeline
  end-to-end, so the bug and its fix are covered without encoding
  behavior of out-of-unit components.

Signed-off-by: Jonathan Ogilvie <jonathan.ogilvie@sumologic.com>

---------

Signed-off-by: Erlend Fonnes <erlend.fonnes@gmail.com>
Signed-off-by: Jonathan Ogilvie <jonathan.ogilvie@sumologic.com>
Co-authored-by: Jonathan Ogilvie <jonathan.ogilvie@sumologic.com>
…ntrib#295)

* feat: support ExtraResources in function-go-templating, fix render error handling, update golang

Signed-off-by: Jason Witkowski <jwitkowski@zscaler.com>

* fix: remove prefetching; add new IT cases for extra resources in fn-gotpl as the 2nd+ element in a pipeline

Signed-off-by: Jonathan Ogilvie <jonathan.ogilvie@sumologic.com>

---------

Signed-off-by: Jason Witkowski <jwitkowski@zscaler.com>
Signed-off-by: Jonathan Ogilvie <jonathan.ogilvie@sumologic.com>
Co-authored-by: Jason Witkowski <jwitkowski@zscaler.com>
Co-authored-by: Jonathan Ogilvie <jonathan.ogilvie@sumologic.com>
…-contrib#305)

* fix: version call to server should use kubeconfig context

Signed-off-by: Jonathan Ogilvie <jonathan.ogilvie@sumologic.com>

* fix: update readme for documenting kubecfg precedence

Signed-off-by: Jonathan Ogilvie <jonathan.ogilvie@sumologic.com>

* fix: go mod update

Signed-off-by: Jonathan Ogilvie <jonathan.ogilvie@sumologic.com>

* fix: adversarial review

Signed-off-by: Jonathan Ogilvie <jonathan.ogilvie@sumologic.com>

---------

Signed-off-by: Jonathan Ogilvie <jonathan.ogilvie@sumologic.com>
…b#283)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
….21.5 (crossplane-contrib#306)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
…plane-contrib#307)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
…e-contrib#308)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
…-contrib#310)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
@cahillsf cahillsf force-pushed the stephen.cahill/fix-container-name-tag-digest branch from 39d745b to 0efc56b Compare May 5, 2026 14:47
renovate Bot and others added 2 commits May 5, 2026 10:47
…-contrib#312)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
…st package refs

When a function package ref has both a tag and a digest
(e.g., func:v0.6.1-0@sha256:751a...), the SHA256 branch of
generateContainerName split on @sha256: but left the colon from the
tag in the function name, producing an invalid Docker container name.

Signed-off-by: Stephen Cahill <cahillsf9@gmail.com>
@cahillsf cahillsf force-pushed the stephen.cahill/fix-container-name-tag-digest branch from 0efc56b to cc93bda Compare May 5, 2026 17:04
@cahillsf
Copy link
Copy Markdown
Owner Author

cahillsf commented May 5, 2026

merged upstream crossplane-contrib#313

@cahillsf cahillsf closed this May 5, 2026
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