Skip to content

Comments

OCPBUGS-70352: handled dynamic secret for remote alertmanager#567

Open
mvazquezc wants to merge 1 commit intoopenshift-kni:mainfrom
mvazquezc:main
Open

OCPBUGS-70352: handled dynamic secret for remote alertmanager#567
mvazquezc wants to merge 1 commit intoopenshift-kni:mainfrom
mvazquezc:main

Conversation

@mvazquezc
Copy link

No description provided.

@openshift-ci openshift-ci bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jan 27, 2026
@openshift-ci
Copy link

openshift-ci bot commented Jan 27, 2026

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: mvazquezc
Once this PR has been reviewed and has the lgtm label, please assign marsik for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci
Copy link

openshift-ci bot commented Jan 27, 2026

Hi @mvazquezc. Thanks for your PR.

I'm waiting for a openshift-kni member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@openshift-ci openshift-ci bot added the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Jan 27, 2026
@mvazquezc mvazquezc marked this pull request as ready for review January 28, 2026 13:42
@openshift-ci openshift-ci bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jan 28, 2026
@openshift-ci openshift-ci bot requested review from ffromani and sabbir-47 January 28, 2026 13:42
bearerToken:
key: token
name: observability-alertmanager-accessor
name: {{ if (lookup "v1" "Namespace" "" "open-cluster-management-addon-observability") }}{{ (regexFind "hub-cluster-id(.*)" ((fromSecret "open-cluster-management-addon-observability" "hub-info-secret" "hub-info.yaml") | base64dec)) | replace "hub-cluster-id: " "observability-alertmanager-accessor-" }}{{ else }}observability-alertmanager-accessor{{ end }}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it possible to do a quick test on acm 2.14 that things are in order?
I'm curious what happens to this regexFind "hub-cluster-id(.*)" when its not available in the hub-info-secret in acm-2.14.
Does it go to the else block or return an empty string, making a secret name observability-alertmanager-accessor- which would be incorrect

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will test on 2.14 and report back results.

@mvazquezc
Copy link
Author

This has been validated in 2.14 and 2.15.

2.14

oc --kubeconfig abi -n openshift-monitoring get cm cluster-monitoring-config -o yaml
apiVersion: v1
data:
  config.yaml: |-
    alertmanagerMain:
      enabled: false
    telemeterClient:
      enabled: false
    nodeExporter:
      collectors:
        buddyinfo: {}
        cpufreq: {}
        ksmd: {}
        mountstats: {}
        netclass: {}
        netdev: {}
        processes: {}
        systemd: {}
        tcpstat: {}
    prometheusK8s:
      additionalAlertmanagerConfigs:
      - apiVersion: v2
        bearerToken:
          key: token
          name: observability-alertmanager-accessor
        scheme: https
        staticConfigs: [alertmanager-open-cluster-management-observability.apps.hub.5g-deployment.lab]
        tlsConfig:
          ca:
            key: service-ca.crt
            name: hub-alertmanager-router-ca
          insecureSkipVerify: false
      externalLabels:
        managed_cluster: 304779e6-6785-452b-a61c-670eafc2649c
      retention: 24h
kind: ConfigMap
metadata:
  annotations:
    ran.openshift.io/ztp-deploy-wave: "1"
  creationTimestamp: "2026-01-29T12:05:02Z"
  name: cluster-monitoring-config
  namespace: openshift-monitoring
  resourceVersion: "23301"
  uid: 03266338-772e-4b84-86be-8bae37b1c2bb

2.15

apiVersion: v1
data:
  config.yaml: |
    alertmanagerMain:
      enabled: false
    telemeterClient:
      enabled: false
    nodeExporter:
      collectors:
        buddyinfo: {}
        cpufreq: {}
        ksmd: {}
        mountstats: {}
        netclass: {}
        netdev: {}
        processes: {}
        systemd: {}
        tcpstat: {}
    prometheusK8s:
      additionalAlertmanagerConfigs:
      - apiVersion: v2
        bearerToken:
          key: token
          name: observability-alertmanager-accessor-1d70fd5186d445e4883
        scheme: https
        staticConfigs: [alertmanager-open-cluster-management-observability.apps.hub.5g-deployment.lab]
        tlsConfig:
          ca:
            key: service-ca.crt
            name: hub-alertmanager-router-ca-1d70fd5186d445e4883
          insecureSkipVerify: false
      externalLabels:
        managed_cluster: f9be5ddd-3497-42cb-ad10-7159011f3fcb
      retention: 24h
kind: ConfigMap
metadata:
  annotations:
    ran.openshift.io/ztp-deploy-wave: "1"
  creationTimestamp: "2026-01-29T14:30:31Z"
  name: cluster-monitoring-config
  namespace: openshift-monitoring
  resourceVersion: "13441"
  uid: 587851bd-1a3f-4020-ac90-bfb6f495a28e

@abraham2512
Copy link
Member

/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Jan 29, 2026
@abraham2512
Copy link
Member

abraham2512 commented Jan 29, 2026

Thanks for updating and verifying the fix with 2.14 and 2.15 @mvazquezc

@abraham2512
Copy link
Member

@abraham2512
Copy link
Member

@openshift-ci openshift-ci bot removed the lgtm Indicates that a PR is ready to be merged. label Jan 29, 2026
@abraham2512
Copy link
Member

/ok-to-test

@openshift-ci openshift-ci bot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Jan 29, 2026
ca:
key: service-ca.crt
name: hub-alertmanager-router-ca
name: (<hub_alertmanager_router_ca>.*)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

typo, missing ?

Signed-off-by: Mario Vazquez <mavazque@redhat.com>
@mvazquezc mvazquezc changed the title handled dynamic secret for remote alertmanager OCPBUGS-70352: handled dynamic secret for remote alertmanager Jan 29, 2026
@openshift-ci-robot
Copy link
Collaborator

@mvazquezc: This pull request references Jira Issue OCPBUGS-70352, which is invalid:

  • expected the bug to target the "4.22.0" version, but no target version was set

Comment /jira refresh to re-evaluate validity if changes to the Jira bug are made, or edit the title of this pull request to link to a different bug.

The bug has been updated to refer to the pull request using the external bug tracker.

Details

In response to this:

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

@abraham2512
Copy link
Member

/jira refresh

@openshift-ci-robot
Copy link
Collaborator

@abraham2512: This pull request references Jira Issue OCPBUGS-70352, which is valid. The bug has been moved to the POST state.

3 validation(s) were run on this bug
  • bug is open, matching expected state (open)
  • bug target version (4.22.0) matches configured target version for branch (4.22.0)
  • bug is in the state ASSIGNED, which is one of the valid states (NEW, ASSIGNED, POST)
Details

In response to this:

/jira refresh

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

@abraham2512
Copy link
Member

/cc @irinamihai @imiller0

@openshift-ci openshift-ci bot requested review from imiller0 and irinamihai January 29, 2026 20:54
@abraham2512
Copy link
Member

/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Jan 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

lgtm Indicates that a PR is ready to be merged. ok-to-test Indicates a non-member PR verified by an org member that is safe to test.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants