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 d1ba20b
Showing 1 changed file with 1 addition and 23 deletions.
24 changes: 1 addition & 23 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,23 +358,12 @@ 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"])
err = t.client.DeleteHashedConfigMap(ctx, trustedCA.GetNamespace(), "prometheus-user-workload", "")
if err != nil {
return errors.Wrap(err, "deleting UserWorkload trusted CA Bundle ConfigMap failed")
}
Expand Down

0 comments on commit d1ba20b

Please sign in to comment.