Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Switch to CreateOrPatch; ignore manager binary at root of project #1583

Merged
merged 1 commit into from
Jul 24, 2022

Conversation

akutz
Copy link
Contributor

@akutz akutz commented Jul 22, 2022

What this PR does / why we need it:
This patch updates instances of CreateOrUpdate to CreateOrPatch in order to avoid being destructive during mutation of existing resources. This patch also updates a few instances of the MutateFn to ensure labels/annotations/ownerrefs are updated instead of replaced when appropriate.

This patch also updates the project's .gitignore file to ignore the manager binary that gets created at the root of the project if go build is used to build the manager.

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

Special notes for your reviewer:

Please confirm that if this PR changes any image versions, then that's the sole change this PR makes.

Release note:

* Switch to controllerutil.CreateOrPatch for more surgical updates
* Ignore the manager binary when it is built at the root of the project with "go build"

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Jul 22, 2022
@akutz
Copy link
Contributor Author

akutz commented Jul 22, 2022

I'll look into the test failure tomorrow and update the PR.

@akutz akutz changed the title Switch to CreateOrPatch Switch to CreateOrPatch; ignore manager binary at root of project Jul 23, 2022
This patch updates instances of CreateOrUpdate to CreateOrPatch
in order to avoid being destructive during mutation of existing
resources.

This patch also updates the project's .gitignore file to ignore
the manager binary that gets created at the root of the project
if "go build" is used to build the manager.
@srm09
Copy link
Contributor

srm09 commented Jul 24, 2022

/lgtm
/approve

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: srm09

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:

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 added lgtm "Looks good to me", indicates that a PR is ready to be merged. approved Indicates a PR has been approved by an approver from all required OWNERS files. labels Jul 24, 2022
@k8s-ci-robot k8s-ci-robot merged commit cc73592 into kubernetes-sigs:main Jul 24, 2022
@akutz akutz deleted the feature/create-or-patch branch July 25, 2022 16:39
bryanv added a commit to bryanv/cluster-api-provider-vsphere that referenced this pull request Jul 27, 2022
When the switch to CreateOrPatch was added in kubernetes-sigs#1583, it supported
merging the existing annotations: this is needed for certain LB
like NSX-T which may add annotations - so remove leftover line
setting the VirtualMachineService annotations.
@srm09 srm09 added this to the v1.4.0 milestone Aug 10, 2022
srm09 added a commit that referenced this pull request Oct 3, 2022
…lease-1.3

Automated cherry pick of #1583: Switch to CreateOrPatch; ignore manager binary
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. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants