Skip to content

Commit

Permalink
Changed time parameter type
Browse files Browse the repository at this point in the history
  • Loading branch information
akgalwas committed Sep 26, 2023
1 parent 8fd892a commit 5215be6
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions cmd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,15 +52,15 @@ func init() {
//+kubebuilder:scaffold:scheme
}

const defaultExpirationTimeInHours = 7 * 12 * time.Hour
const defaultExpirationTime = 7 * 12 * time.Hour

func main() {
var metricsAddr string
var enableLeaderElection bool
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.")
Expand All @@ -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,
}
Expand Down Expand Up @@ -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 {
Expand Down

0 comments on commit 5215be6

Please sign in to comment.