Skip to content

Commit

Permalink
Add resources for etcd
Browse files Browse the repository at this point in the history
Signed-off-by: Thibault Mange <[email protected]>
  • Loading branch information
thibaultmg committed Jun 3, 2024
1 parent 375b31f commit ffd6fab
Show file tree
Hide file tree
Showing 3 changed files with 443 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ import (
"sigs.k8s.io/controller-runtime/pkg/source"

"github.com/stolostron/multicluster-observability-operator/operators/endpointmetrics/pkg/hypershift"
"github.com/stolostron/multicluster-observability-operator/operators/endpointmetrics/pkg/microshift"
"github.com/stolostron/multicluster-observability-operator/operators/endpointmetrics/pkg/openshift"
"github.com/stolostron/multicluster-observability-operator/operators/endpointmetrics/pkg/rendering"
"github.com/stolostron/multicluster-observability-operator/operators/endpointmetrics/pkg/util"
Expand Down Expand Up @@ -247,6 +248,21 @@ func (r *ObservabilityAddonReconciler) Reconcile(ctx context.Context, req ctrl.R
if err != nil {
return ctrl.Result{}, fmt.Errorf("failed to render prometheus templates: %w", err)
}

if !isHubMetricsCollector {
microshiftVersion, err := microshift.IsMicroshiftCluster(ctx, r.Client)
if err != nil {
return ctrl.Result{}, fmt.Errorf("failed to check if the cluster is microshift: %w", err)
}

if len(microshiftVersion) > 0 {
mcs := microshift.NewMicroshift(namespace)
if err := mcs.Render(ctx, toDeploy); err != nil {
return ctrl.Result{}, fmt.Errorf("failed to render microshift templates: %w", err)
}
}
}

deployer := deploying.NewDeployer(r.Client)
for _, res := range toDeploy {
if res.GetNamespace() != namespace {
Expand Down
Loading

0 comments on commit ffd6fab

Please sign in to comment.