-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
re-apply secret OwnerRef on pivot with correct UID #1435
re-apply secret OwnerRef on pivot with correct UID #1435
Conversation
/hold (need to do some validation from CAPV first) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/approve
/assign @detiber
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: andrewsykim, vincepri 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 |
cmd/clusterctl/phases/pivot.go
Outdated
for i := 0; i < len(secret.OwnerReferences); i++ { | ||
secret.OwnerReferences[i].UID = "" | ||
} | ||
// Clear the owner reference since it's UID is different per cluster |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// Clear the owner reference since it's UID is different per cluster | |
// Clear the owner reference since its UID is different per cluster |
f9fb83a
to
23840d6
Compare
lgtm based on a quick review |
Did a quick test on CAPV, seeing the owner ref applied correctly kind: Secret
metadata:
creationTimestamp: "2019-09-24T15:20:21Z"
name: management-cluster-kubeconfig
namespace: default
ownerReferences:
- apiVersion: cluster.x-k8s.io/v1alpha2
kind: Cluster
name: management-cluster
uid: d2a5e541-dede-11e9-8a41-005056b01c90
resourceVersion: "1122"
selfLink: /api/v1/namespaces/default/secrets/management-cluster-kubeconfig
uid: d2b4d231-dede-11e9-8a41-005056b01c90
type: Opaque |
/hold cancel |
@voor FYI, GitHub will only automatically close issues on merge if they're listed in the issue's description. It doesn't evaluate |
Signed-off-by: Andrew Sy Kim <[email protected]>
23840d6
to
60d8231
Compare
/lgtm |
Signed-off-by: Andrew Sy Kim [email protected]
What this PR does / why we need it:
In #1411, we started to only reset the secret owner ref's UID for clusters, which fails API validation (see here). In order to pass validation, we should create the secret without the owner ref and re-apply it afterwards using the target cluster's UID.
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 #1428