diff --git a/cmd/main.go b/cmd/main.go index 83add7b6..8145f397 100644 --- a/cmd/main.go +++ b/cmd/main.go @@ -52,7 +52,7 @@ func init() { //+kubebuilder:scaffold:scheme } -const defaultExpirationTimeInHours = 7 * 12 * time.Hour +const defaultExpirationTime = 7 * 12 * time.Hour func main() { var metricsAddr string @@ -60,7 +60,7 @@ func main() { var probeAddr string var gardenerKubeconfigPath string var gardenerProjectName string - var expirationInHours time.Duration + var expirationTime time.Duration flag.StringVar(&metricsAddr, "metrics-bind-address", ":8080", "The address the metric endpoint binds to.") flag.StringVar(&probeAddr, "health-probe-bind-address", ":8081", "The address the probe endpoint binds to.") @@ -69,7 +69,8 @@ func main() { "Enabling this will ensure there is only one active controller manager.") flag.StringVar(&gardenerKubeconfigPath, "gardener-kubeconfig-path", "/gardener/kubeconfig/kubeconfig", "Kubeconfig file for Gardener cluster") flag.StringVar(&gardenerProjectName, "gardener-project-name", "gardener-project", "Name of the Gardener project") - flag.DurationVar(&expirationInHours, "", defaultExpirationTimeInHours, "Dynamic kubeconfig expiration time in hours") + flag.DurationVar(&expirationTime, "kubeconfig-expiration-time", defaultExpirationTime, "Dynamic kubeconfig expiration time") + opts := zap.Options{ Development: true, } @@ -105,7 +106,7 @@ func main() { } gardenerNamespace := fmt.Sprintf("garden-%s", gardenerProjectName) - expirationInSeconds := int64(expirationInHours.Seconds()) + expirationInSeconds := int64(expirationTime.Seconds()) kubeconfigProvider, err := setupKubernetesKubeconfigProvider(gardenerKubeconfigPath, gardenerNamespace, expirationInSeconds) if err != nil {