Skip to content

Conversation

@mdbooth
Copy link
Contributor

@mdbooth mdbooth commented Nov 21, 2025

What type of PR is this?

/kind bug

What this PR does / why we need it:

This change has no effect on the output of this kustomization because
the removed configuration was redundant. However, it fixes a bug which
can be triggered when using this kustomization as a base for another
kustomization.

kustomizeconfig contained 3 directives:

  • nameReference
  • namespace
  • varReference

varReference is redundant because vars are no longer used in this
kustomize: they are deprecated and usage was removed some time ago.

nameReference is redundant because the specified configuration is
already in kustomize's defaults. However, nameReference is the important
transformation here.

namespace is incorrect. It directs the namespace transformer to update
webhooks/clientConfig/service/namespace. However, this is not the
intended function of the namespace transformer: it should only set the
namespace directly on objects and allow references to be updated
automatically by nameReference. Configuring it to update a reference
directly leaves kustomize with inconsistent internal state. Depending on
execution order this can cause a subsequent transformation to fail to
update the reference when it makes further changes to the Service
object.

This issue is common amongst multiple providers, likely because it was present in an early version of the kubebuilder templates.

This PR is based on kubernetes-sigs/cluster-api-provider-azure#5982

Which issue(s) this PR fixes (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close the issue(s) when PR gets merged):
Fixes #

Special notes for your reviewer:

To confirm that the removed configuration was redundant:

  • Execute make release-manifests
  • Copy out/infrastructure-components.yaml to /tmp
  • Apply/revert this change
  • Execute make release-manifests again
  • diff the outputs and confirm that they are identical

Release note:

NONE

@k8s-ci-robot k8s-ci-robot added release-note-none Denotes a PR that doesn't merit a release note. kind/bug Categorizes issue or PR as related to a bug. labels Nov 21, 2025
@netlify
Copy link

netlify bot commented Nov 21, 2025

Deploy Preview for kubernetes-sigs-cluster-api-gcp ready!

Name Link
🔨 Latest commit 7571c03
🔍 Latest deploy log https://app.netlify.com/projects/kubernetes-sigs-cluster-api-gcp/deploys/69203f82816c030008fceb80
😎 Deploy Preview https://deploy-preview-1565--kubernetes-sigs-cluster-api-gcp.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@k8s-ci-robot k8s-ci-robot added size/S Denotes a PR that changes 10-29 lines, ignoring generated files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Nov 21, 2025
This change has no effect on the output of this kustomization because
the removed configuration was redundant. However, it fixes a bug which
can be triggered when using this kustomization as a base for another
kustomization.

kustomizeconfig contained 3 directives:

* nameReference
* namespace
* varReference

varReference is redundant because vars are no longer used in this
kustomize: they are deprecated and usage was removed some time ago.

nameReference is redundant because the specified configuration is
already in kustomize's defaults. However, nameReference is the important
transformation here.

namespace is incorrect. It directs the namespace transformer to update
webhooks/clientConfig/service/namespace. However, this is not the
intended function of the namespace transformer: it should only set the
namespace directly on objects and allow references to be updated
automatically by nameReference. Configuring it to update a reference
directly leaves kustomize with inconsistent internal state. Depending on
execution order this can cause a subsequent transformation to fail to
update the reference when it makes further changes to the Service
object.
@mdbooth mdbooth force-pushed the remove-invalid-kustomizeconfig branch from acd51d4 to 7571c03 Compare November 21, 2025 10:31
Copy link
Member

@damdo damdo left a comment

Choose a reason for hiding this comment

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

/approve

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Nov 21, 2025
@damdo
Copy link
Member

damdo commented Nov 21, 2025

/assign @salasberryfin

For the LGTM

Copy link
Contributor

@salasberryfin salasberryfin left a comment

Choose a reason for hiding this comment

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

Thanks @mdbooth.

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Nov 21, 2025
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: damdo, mdbooth, salasberryfin

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:
  • OWNERS [damdo,salasberryfin]

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot merged commit 9f76ba8 into kubernetes-sigs:main Nov 21, 2025
18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/bug Categorizes issue or PR as related to a bug. lgtm "Looks good to me", indicates that a PR is ready to be merged. release-note-none Denotes a PR that doesn't merit a release note. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants