Skip to content
This repository has been archived by the owner on Apr 25, 2023. It is now read-only.

Fix error on exiting #1332

Merged
merged 4 commits into from
Apr 19, 2021

Conversation

huiwq1990
Copy link
Contributor

What this PR does / why we need it:

When use kubefedctl join cluster setting error-on-existing=false and secret-name have specify value, it will case secret exist error. Join command demo:

kubefedctl join newdev --cluster-context newdev --host-cluster-context minikube --kubefed-namespace tpaas-federation --secret-name=minikube-newdev --error-on-existing=false -v 2

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:

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Dec 18, 2020
@huiwq1990
Copy link
Contributor Author

/assign @jimmidyson

Copy link
Contributor

@makkes makkes left a comment

Choose a reason for hiding this comment

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

I don't fully agree with the changes proposed herein as I believe the semantics and the implementation should be simpler:

  • If --error-on-existing is set to true and the secret exists, return an error.
  • If --error-on-existing is set to false and the secret exists, just update it.

My main concern is around the update logic that you're introducing here which in my opinion makes the interface more complicated for users to reason about (adding annotations) and error-prone, basically something that might not work as expected.

So in my humble opinion just updating the secret in any case if error-on-existing is set to false is just simpler and less error-prone.

pkg/kubefedctl/join.go Outdated Show resolved Hide resolved
@huiwq1990
Copy link
Contributor Author

huiwq1990 commented Dec 18, 2020

@makkes if we don't auto trigger clustercontroller reconcile, the joinedcluster will use old token until it restart or somethingelse trigger reconcile, it will confuse user find real reason if the token not work .

@fejta-bot
Copy link

Issues go stale after 90d of inactivity.
Mark the issue as fresh with /remove-lifecycle stale.
Stale issues rot after an additional 30d of inactivity and eventually close.

If this issue is safe to close now please do so with /close.

Send feedback to sig-contributor-experience at kubernetes/community.
/lifecycle stale

@k8s-ci-robot k8s-ci-robot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Mar 21, 2021
@hectorj2f
Copy link
Contributor

/remove-lifecycle stale

@makkes
Copy link
Contributor

makkes commented Mar 22, 2021

maybe @hectorj2f or @jimmidyson might want to chime in here as well.

@huiwq1990 huiwq1990 force-pushed the fix-errorOnExiting branch from 77af1e6 to fd3efad Compare March 22, 2021 14:06
@k8s-ci-robot k8s-ci-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Mar 22, 2021
@hectorj2f hectorj2f requested a review from makkes April 19, 2021 08:03
@makkes
Copy link
Contributor

makkes commented Apr 19, 2021

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Apr 19, 2021
Copy link
Contributor

@hectorj2f hectorj2f left a comment

Choose a reason for hiding this comment

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

/lgtm

@hectorj2f
Copy link
Contributor

/approve

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: hectorj2f, huiwq1990, makkes

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 the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Apr 19, 2021
@k8s-ci-robot k8s-ci-robot merged commit d0713fe into kubernetes-retired:master Apr 19, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
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 Indicates that a PR is ready to be merged. lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. 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.

6 participants