Skip to content

Commit

Permalink
fixup! fixup! Add the trusted CA bundle in UWM Prometheus pods
Browse files Browse the repository at this point in the history
  • Loading branch information
rexagod committed Jun 19, 2023
1 parent ce96966 commit b152c8c
Showing 1 changed file with 0 additions and 27 deletions.
27 changes: 0 additions & 27 deletions pkg/tasks/prometheus_user_workload.go
Expand Up @@ -215,17 +215,6 @@ func (t *PrometheusUserWorkloadTask) create(ctx context.Context) error {
return errors.Wrap(err, "initializing UserWorkload CA bundle ConfigMap failed")
}

cbs := &caBundleSyncer{
client: t.client,
factory: t.factory,
prefix: "prometheus-user-workload",
}

trustedCA, err = cbs.syncTrustedCABundle(ctx, trustedCA)
if err != nil {
return errors.Wrap(err, "syncing UserWorkload trusted CA bundle ConfigMap failed")
}

secret, err := t.factory.PrometheusUserWorkloadAdditionalAlertManagerConfigsSecret()
if err != nil {
return errors.Wrap(err, "initializing UserWorkload Prometheus additionalAlertmanagerConfigs secret failed")
Expand Down Expand Up @@ -369,27 +358,11 @@ func (t *PrometheusUserWorkloadTask) destroy(ctx context.Context) error {
return errors.Wrap(err, "initializing UserWorkload CA bundle ConfigMap failed")
}

cbs := &caBundleSyncer{
client: t.client,
factory: t.factory,
prefix: "prometheus-user-workload",
}

hashedTrustedCA, err := cbs.syncTrustedCABundle(ctx, trustedCA)
if err != nil {
return errors.Wrap(err, "syncing UserWorkload trusted CA bundle ConfigMap failed")
}

err = t.client.DeleteConfigMap(ctx, trustedCA)
if err != nil {
return errors.Wrap(err, "deleting UserWorkload trusted CA Bundle ConfigMap failed")
}

err = t.client.DeleteHashedConfigMap(ctx, hashedTrustedCA.GetNamespace(), "prometheus-user-workload", hashedTrustedCA.Labels["monitoring.openshift.io/hash"])
if err != nil {
return errors.Wrap(err, "deleting UserWorkload trusted CA Bundle ConfigMap failed")
}

p, err := t.factory.PrometheusUserWorkload(s, nil)
if err != nil {
return errors.Wrap(err, "initializing UserWorkload Prometheus object failed")
Expand Down

0 comments on commit b152c8c

Please sign in to comment.