Skip to content

Commit

Permalink
Merge pull request #48955 from mattmoyer/automated-cherry-pick-of-#48…
Browse files Browse the repository at this point in the history
…838-upstream-release-1.7

Automatic merge from submit-queue

Automated cherry pick of #48838

Cherry pick of #48838 on release-1.7.

#48838: kubeadm: add a warning about the default token TTL changing
  • Loading branch information
Kubernetes Submit Queue committed Jul 18, 2017
2 parents e76b450 + 5e6b017 commit 4ba75f9
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
6 changes: 6 additions & 0 deletions cmd/kubeadm/app/cmd/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,12 @@ func NewCmdInit(out io.Writer) *cobra.Command {
i, err := NewInit(cfgPath, internalcfg, skipPreFlight, skipTokenPrint)
kubeadmutil.CheckErr(err)
kubeadmutil.CheckErr(i.Validate(cmd))

// TODO: remove this warning in 1.9
if !cmd.Flags().Lookup("token-ttl").Changed {
fmt.Println("[kubeadm] WARNING: starting in 1.8, tokens expire after 24 hours by default (if you require a non-expiring token use --token-ttl 0)")
}

kubeadmutil.CheckErr(i.Run(out))
},
}
Expand Down
6 changes: 6 additions & 0 deletions cmd/kubeadm/app/cmd/token.go
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,12 @@ func NewCmdToken(out io.Writer, errW io.Writer) *cobra.Command {
client, err := kubeconfigutil.ClientSetFromFile(kubeConfigFile)
kubeadmutil.CheckErr(err)

// TODO: remove this warning in 1.9
if !tokenCmd.Flags().Lookup("ttl").Changed {
// sending this output to stderr s
fmt.Fprintln(errW, "[kubeadm] WARNING: starting in 1.8, tokens expire after 24 hours by default (if you require a non-expiring token use --ttl 0)")
}

err = RunCreateToken(out, client, token, tokenDuration, usages, description)
kubeadmutil.CheckErr(err)
},
Expand Down

0 comments on commit 4ba75f9

Please sign in to comment.