Skip to content

Commit

Permalink
increase pull secret ticker to every 6 hours
Browse files Browse the repository at this point in the history
  • Loading branch information
spowelljr committed Jan 22, 2024
1 parent 64df76f commit 9563c29
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions server.go
Original file line number Diff line number Diff line change
Expand Up @@ -181,22 +181,23 @@ func refreshAllPullSecrets() error {
return fmt.Errorf("listing namespaces: %v", err)
}
for _, ns := range namespaceList.Items {
if ns.Name == "kube-system" || ns.Name == "gcp-auth" {
if skipNamespace(ns.Name) {
continue
}
if err := deletePullSecret(clientset, ns); err != nil {
log.Println(err)
log.Print(err)
}
if err := createPullSecret(clientset, &ns, creds); err != nil {
log.Println(err)
log.Print(err)
}
}
return nil
}

// pullSecretTicker refreshes all the image registry pull secrets every hour
// pullSecretTicker refreshes all the image registry pull secrets every six hours
func pullSecretTicker() {
for range time.Tick(1 * time.Hour) {
for range time.Tick(6 * time.Hour) {
log.Print("refreshing image pull secrets")
if err := refreshAllPullSecrets(); err != nil {
log.Print(err)
}
Expand Down

0 comments on commit 9563c29

Please sign in to comment.