Skip to content

Commit

Permalink
remove two step watch for console config
Browse files Browse the repository at this point in the history
  • Loading branch information
vareti committed Jul 8, 2020
1 parent 8bb2e80 commit ced98a2
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ func NewConfigObserver(
interestingNamespaces := []string{
"openshift-authentication",
"openshift-config",
"openshift-config-managed",
}

preRunCacheSynced := []cache.InformerSynced{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ func convertTemplatesWithBranding(cmLister corelistersv1.ConfigMapLister, config
}

func getConsoleBranding(cmLister corelistersv1.ConfigMapLister) (string, error) {
cm, err := cmLister.ConfigMaps("openshift-authentication").Get("v4-0-config-system-console-config")
cm, err := cmLister.ConfigMaps("openshift-config-managed").Get("console-config")
if errors.IsNotFound(err) {
return "", nil
}
Expand Down
11 changes: 2 additions & 9 deletions pkg/operator2/starter.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,10 @@ func RunOperator(ctx context.Context, controllerContext *controllercmd.Controlle
}

kubeInformersNamespaced := v1helpers.NewKubeInformersForNamespaces(kubeClient,
"kube-system",
"openshift-authentication",
"openshift-config",
"kube-system",
"openshift-config-managed",
)

// short resync period as this drives the check frequency when checking the .well-known endpoint. 20 min is too slow for that.
Expand Down Expand Up @@ -149,14 +150,6 @@ func RunOperator(ctx context.Context, controllerContext *controllercmd.Controlle
return err
}

// add syncing for the console-config ConfigMap (indirect watch for changes)
if err := resourceSyncer.SyncConfigMap(
resourcesynccontroller.ResourceLocation{Namespace: "openshift-authentication", Name: "v4-0-config-system-console-config"},
resourcesynccontroller.ResourceLocation{Namespace: "openshift-config-managed", Name: "console-config"},
); err != nil {
return err
}

versionGetter := status.NewVersionGetter()

operator := NewAuthenticationOperator(
Expand Down

0 comments on commit ced98a2

Please sign in to comment.