From 950ed38996cd530154732b37483afa1ad79ad8d7 Mon Sep 17 00:00:00 2001 From: Jordan Liggitt Date: Fri, 15 May 2020 14:09:53 -0400 Subject: [PATCH] Mark experimental-cluster-signing-duration deprecated, add --cluster-signing-duration --- cluster/gce/gci/configure-helper.sh | 2 +- cmd/kube-controller-manager/app/options/csrsigningcontroller.go | 2 ++ cmd/kube-controller-manager/app/options/options_test.go | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/cluster/gce/gci/configure-helper.sh b/cluster/gce/gci/configure-helper.sh index 31beef02235..f3833e94c84 100644 --- a/cluster/gce/gci/configure-helper.sh +++ b/cluster/gce/gci/configure-helper.sh @@ -1879,7 +1879,7 @@ function start-kube-controller-manager { params+=" --flex-volume-plugin-dir=${VOLUME_PLUGIN_DIR}" fi if [[ -n "${CLUSTER_SIGNING_DURATION:-}" ]]; then - params+=" --experimental-cluster-signing-duration=$CLUSTER_SIGNING_DURATION" + params+=" --cluster-signing-duration=$CLUSTER_SIGNING_DURATION" fi # Disable using HPA metrics REST clients if metrics-server isn't enabled, # or if we want to explicitly disable it by setting HPA_USE_REST_CLIENT. diff --git a/cmd/kube-controller-manager/app/options/csrsigningcontroller.go b/cmd/kube-controller-manager/app/options/csrsigningcontroller.go index 251de045c99..f9477449cc7 100644 --- a/cmd/kube-controller-manager/app/options/csrsigningcontroller.go +++ b/cmd/kube-controller-manager/app/options/csrsigningcontroller.go @@ -45,7 +45,9 @@ func (o *CSRSigningControllerOptions) AddFlags(fs *pflag.FlagSet) { fs.StringVar(&o.ClusterSigningCertFile, "cluster-signing-cert-file", o.ClusterSigningCertFile, "Filename containing a PEM-encoded X509 CA certificate used to issue cluster-scoped certificates") fs.StringVar(&o.ClusterSigningKeyFile, "cluster-signing-key-file", o.ClusterSigningKeyFile, "Filename containing a PEM-encoded RSA or ECDSA private key used to sign cluster-scoped certificates") + fs.DurationVar(&o.ClusterSigningDuration.Duration, "cluster-signing-duration", o.ClusterSigningDuration.Duration, "The length of duration signed certificates will be given.") fs.DurationVar(&o.ClusterSigningDuration.Duration, "experimental-cluster-signing-duration", o.ClusterSigningDuration.Duration, "The length of duration signed certificates will be given.") + fs.MarkDeprecated("experimental-cluster-signing-duration", "use --cluster-signing-duration") } // ApplyTo fills up CSRSigningController config with options. diff --git a/cmd/kube-controller-manager/app/options/options_test.go b/cmd/kube-controller-manager/app/options/options_test.go index 3cf81f70d2c..5240d15d510 100644 --- a/cmd/kube-controller-manager/app/options/options_test.go +++ b/cmd/kube-controller-manager/app/options/options_test.go @@ -88,7 +88,7 @@ var args = []string{ "--enable-garbage-collector=false", "--enable-hostpath-provisioner=true", "--enable-taint-manager=false", - "--experimental-cluster-signing-duration=10h", + "--cluster-signing-duration=10h", "--flex-volume-plugin-dir=/flex-volume-plugin", "--horizontal-pod-autoscaler-downscale-delay=2m", "--horizontal-pod-autoscaler-sync-period=45s",