Skip to content

Commit

Permalink
fix: add missing namespace for console in managed cluster (#1552) (#1556
Browse files Browse the repository at this point in the history
)

- blackbox require this
- move into const in cluster pkg

Signed-off-by: Wen Zhou <[email protected]>
(cherry picked from commit 28d0fa1)
  • Loading branch information
zdtsw authored Jan 23, 2025
1 parent 6e2808c commit 33c2112
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
4 changes: 1 addition & 3 deletions controllers/dscinitialization/monitoring.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,6 @@ var (
prometheusManifestsPath = filepath.Join(deploy.DefaultManifestPath, ComponentName, "prometheus", "base")
prometheusConfigPath = filepath.Join(deploy.DefaultManifestPath, ComponentName, "prometheus", "apps")
networkpolicyPath = filepath.Join(deploy.DefaultManifestPath, ComponentName, "networkpolicy")
NameConsoleLink = "console"
NamespaceConsoleLink = "openshift-console"
)

// only when reconcile on DSCI CR, initial set to true
Expand Down Expand Up @@ -349,7 +347,7 @@ func configurePrometheus(ctx context.Context, dsciInit *dsciv1.DSCInitialization
func configureBlackboxExporter(ctx context.Context, dsciInit *dsciv1.DSCInitialization, r *DSCInitializationReconciler) error {
log := logf.FromContext(ctx)
consoleRoute := &routev1.Route{}
err := r.Client.Get(ctx, client.ObjectKey{Name: "console", Namespace: "openshift-console"}, consoleRoute)
err := r.Client.Get(ctx, client.ObjectKey{Name: cluster.NameConsoleLink, Namespace: cluster.NamespaceConsoleLink}, consoleRoute)
if err != nil {
if !k8serr.IsNotFound(err) {
return err
Expand Down
1 change: 1 addition & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -479,6 +479,7 @@ func getCommonCache(ctx context.Context, cli client.Client, platform cluster.Pla
if platform == cluster.ManagedRhoai {
namespaceConfigs["redhat-ods-monitoring"] = cache.Config{}
namespaceConfigs["redhat-ods-applications"] = cache.Config{}
namespaceConfigs[cluster.NamespaceConsoleLink] = cache.Config{}
return namespaceConfigs, nil
}
cNamespaceList := &corev1.NamespaceList{}
Expand Down
4 changes: 4 additions & 0 deletions pkg/cluster/const.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,8 @@ const (

// Default OpenShift version CR name.
OpenShiftVersionObj = "version"

// Managed cluster required route.
NameConsoleLink = "console"
NamespaceConsoleLink = "openshift-console"
)

0 comments on commit 33c2112

Please sign in to comment.