-
Notifications
You must be signed in to change notification settings - Fork 40k
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
Remove deprecated --require-kubeconfig flag, remove default --kubeconfig value #58367
Merged
k8s-github-robot
merged 2 commits into
kubernetes:master
from
zhangxiaoyu-zidif:do-issue-41161
Jan 29, 2018
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -48,7 +48,7 @@ import ( | |
// In general, please try to avoid adding flags or configuration fields, | ||
// we already have a confusingly large amount of them. | ||
type KubeletFlags struct { | ||
KubeConfig flag.StringFlag | ||
KubeConfig string | ||
BootstrapKubeconfig string | ||
RotateCertificates bool | ||
|
||
|
@@ -179,8 +179,6 @@ type KubeletFlags struct { | |
// schedulable. Won't have any effect if register-node is false. | ||
// DEPRECATED: use registerWithTaints instead | ||
RegisterSchedulable bool | ||
// RequireKubeConfig is deprecated! A valid KubeConfig is now required if --kubeconfig is provided. | ||
RequireKubeConfig bool | ||
// nonMasqueradeCIDR configures masquerading: traffic to IPs outside this range will use IP masquerade. | ||
NonMasqueradeCIDR string | ||
// This flag, if set, instructs the kubelet to keep volumes from terminated pods mounted to the node. | ||
|
@@ -213,9 +211,6 @@ func NewKubeletFlags() *KubeletFlags { | |
} | ||
|
||
return &KubeletFlags{ | ||
// TODO(#41161:v1.10.0): Remove the default kubeconfig path and --require-kubeconfig. | ||
RequireKubeConfig: false, | ||
KubeConfig: flag.NewStringFlag("/var/lib/kubelet/kubeconfig"), | ||
ContainerRuntimeOptions: *NewContainerRuntimeOptions(), | ||
CertDirectory: "/var/lib/kubelet/pki", | ||
RootDirectory: v1alpha1.DefaultRootDir, | ||
|
@@ -309,13 +304,14 @@ func (s *KubeletServer) AddFlags(fs *pflag.FlagSet) { | |
func (f *KubeletFlags) AddFlags(fs *pflag.FlagSet) { | ||
f.ContainerRuntimeOptions.AddFlags(fs) | ||
|
||
fs.Var(&f.KubeConfig, "kubeconfig", "Path to a kubeconfig file, specifying how to connect to the API server.") | ||
// TODO(#41161:v1.10.0): Remove the default kubeconfig path and --require-kubeconfig. | ||
fs.BoolVar(&f.RequireKubeConfig, "require-kubeconfig", f.RequireKubeConfig, "This flag is no longer necessary. It has been deprecated and will be removed in a future version.") | ||
fs.MarkDeprecated("require-kubeconfig", "You no longer need to use --require-kubeconfig. This will be removed in a future version. Providing --kubeconfig enables API server mode, omitting --kubeconfig enables standalone mode unless --require-kubeconfig=true is also set. In the latter case, the legacy default kubeconfig path will be used until --require-kubeconfig is removed.") | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Keep the same MarkDeprecated as long as we are still binding this flag There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. OK, done |
||
fs.StringVar(&f.KubeConfig, "kubeconfig", f.KubeConfig, "Path to a kubeconfig file, specifying how to connect to the API server. Providing --kubeconfig enables API server mode, omitting --kubeconfig enables standalone mode.") | ||
|
||
fs.MarkDeprecated("experimental-bootstrap-kubeconfig", "Use --bootstrap-kubeconfig") | ||
fs.StringVar(&f.BootstrapKubeconfig, "experimental-bootstrap-kubeconfig", f.BootstrapKubeconfig, "deprecated: use --bootstrap-kubeconfig") | ||
// TODO: when pull-kubernetes-e2e-kops-aws does not need this parameter, delete requireKubeConfig. | ||
var requireKubeConfig bool | ||
fs.BoolVar(&requireKubeConfig, "require-kubeconfig", requireKubeConfig, "This flag is no longer necessary. It has been deprecated and will be removed in a future version.") | ||
fs.MarkDeprecated("require-kubeconfig", "You no longer need to use --require-kubeconfig. This will be removed in a future version. Providing --kubeconfig enables API server mode, omitting --kubeconfig enables standalone mode unless --require-kubeconfig=true is also set. In the latter case, the legacy default kubeconfig path will be used until --require-kubeconfig is removed.") | ||
fs.StringVar(&f.BootstrapKubeconfig, "bootstrap-kubeconfig", f.BootstrapKubeconfig, "Path to a kubeconfig file that will be used to get client certificate for kubelet. "+ | ||
"If the file specified by --kubeconfig does not exist, the bootstrap kubeconfig is used to request a client certificate from the API server. "+ | ||
"On success, a kubeconfig file referencing the generated client certificate and key is written to the path specified by --kubeconfig. "+ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
leaving
--require-kubeconfig
bound to a local string and inert would let this PR merge (since it wouldn't matter whether kops passed the flag or not). I'd be ok with leaving it that way for a release (would let 1.10 kubelets come up even if people specified the deprecated flag). update the deprecated message to say the flag doesn't do anything any more and will be removed in the futureThere 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.
OK, I will add it back soon. Thanks =)