Skip to content

OCPBUGS-70354: add serviceAccount to global-pull-secret-syncer#7439

Merged
openshift-merge-bot[bot] merged 2 commits intoopenshift:mainfrom
ehearne-redhat:add-sa-global-pull-secret-syncer
Mar 16, 2026
Merged

OCPBUGS-70354: add serviceAccount to global-pull-secret-syncer#7439
openshift-merge-bot[bot] merged 2 commits intoopenshift:mainfrom
ehearne-redhat:add-sa-global-pull-secret-syncer

Conversation

@ehearne-redhat
Copy link
Copy Markdown
Contributor

What this PR does / why we need it:

  • Adds a bespoke service account to global-pull-secret-syncer.
  • We should not use default service account for our components.

Which issue(s) this PR fixes:

Fixes https://issues.redhat.com/browse/OCPBUGS-70354 .

Special notes for your reviewer:

Checklist:

  • Subject and description added to both, commit and PR.
  • Relevant issues have been referenced.
  • This change includes docs.
  • This change includes unit tests.

@openshift-ci-robot openshift-ci-robot added jira/severity-critical Referenced Jira bug's severity is critical for the branch this PR is targeting. jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. jira/invalid-bug Indicates that a referenced Jira bug is invalid for the branch this PR is targeting. labels Jan 8, 2026
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Jan 8, 2026

Important

Review skipped

Auto reviews are limited based on label configuration.

🚫 Review skipped — only excluded labels are configured. (1)
  • do-not-merge/work-in-progress

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Walkthrough

Reconcile now creates/updates a ServiceAccount for the GlobalPullSecret before syncing the DaemonSet; the DaemonSet PodSpec sets the ServiceAccountName. An e2e test change allows partial node presence for the OpenshiftOVNKubeDaemonSet readiness check.

Changes

Cohort / File(s) Summary
ServiceAccount Manifest Definition
control-plane-operator/hostedclusterconfigoperator/controllers/resources/manifests/pullsecret.go
Added GlobalPullSecretServiceAccount() returning a corev1.ServiceAccount with Name = GlobalPullSecretDSName and Namespace = GlobalPullSecretNamespace.
ServiceAccount Reconciliation & DaemonSet
control-plane-operator/hostedclusterconfigoperator/controllers/globalps/globalps.go
reconcileGlobalPullSecret() now CreateOrUpdate(s) the ServiceAccount from GlobalPullSecretServiceAccount() at start; the reconciled DaemonSet PodSpec sets ServiceAccountName to GlobalPullSecretDSName.
E2E Test Readiness Adjustment
test/e2e/util/globalps.go
Changed readiness verifier to allow partial node presence for OpenshiftOVNKubeDaemonSet (AllowPartialNodes: true).

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Comment @coderabbitai help to get the list of available commands and usage tips.

@openshift-ci-robot
Copy link
Copy Markdown

@ehearne-redhat: This pull request references Jira Issue OCPBUGS-70354, 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:

What this PR does / why we need it:

  • Adds a bespoke service account to global-pull-secret-syncer.
  • We should not use default service account for our components.

Which issue(s) this PR fixes:

Fixes https://issues.redhat.com/browse/OCPBUGS-70354 .

Special notes for your reviewer:

Checklist:

  • Subject and description added to both, commit and PR.
  • Relevant issues have been referenced.
  • This change includes docs.
  • This change includes unit tests.

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.

@openshift-ci openshift-ci Bot added do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. do-not-merge/needs-area labels Jan 8, 2026
@ehearne-redhat
Copy link
Copy Markdown
Contributor Author

/jira refresh

@openshift-ci openshift-ci Bot requested review from enxebre and sjenning January 8, 2026 13:50
@openshift-ci-robot openshift-ci-robot added jira/valid-bug Indicates that a referenced Jira bug is valid for the branch this PR is targeting. and removed jira/invalid-bug Indicates that a referenced Jira bug is invalid for the branch this PR is targeting. labels Jan 8, 2026
@openshift-ci-robot
Copy link
Copy Markdown

@ehearne-redhat: This pull request references Jira Issue OCPBUGS-70354, 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)

No GitHub users were found matching the public email listed for the QA contact in Jira (yli2@redhat.com), skipping review request.

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.

@openshift-ci openshift-ci Bot added area/control-plane-operator Indicates the PR includes changes for the control plane operator - in an OCP release and removed do-not-merge/needs-area labels Jan 8, 2026
@ehearne-redhat ehearne-redhat force-pushed the add-sa-global-pull-secret-syncer branch from 72691f1 to f18dcd4 Compare January 9, 2026 09:12
@ehearne-redhat ehearne-redhat changed the title [WIP] OCPBUGS-70354: add serviceAccount to global-pull-secret-syncer OCPBUGS-70354: add serviceAccount to global-pull-secret-syncer Jan 9, 2026
@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 9, 2026
@ehearne-redhat
Copy link
Copy Markdown
Contributor Author

/retest

1 similar comment
@ehearne-redhat
Copy link
Copy Markdown
Contributor Author

/retest

@ehearne-redhat ehearne-redhat force-pushed the add-sa-global-pull-secret-syncer branch from f18dcd4 to d769440 Compare January 12, 2026 12:54
@openshift-ci openshift-ci Bot added the area/testing Indicates the PR includes changes for e2e testing label Jan 13, 2026
@ehearne-redhat ehearne-redhat force-pushed the add-sa-global-pull-secret-syncer branch from c4cee48 to a661ff1 Compare January 13, 2026 12:17
@ehearne-redhat
Copy link
Copy Markdown
Contributor Author

/retest

@ehearne-redhat ehearne-redhat force-pushed the add-sa-global-pull-secret-syncer branch from a661ff1 to 684e4b1 Compare February 11, 2026 14:02
@ehearne-redhat
Copy link
Copy Markdown
Contributor Author

/test verify-deps
/test e2e-v2-aws
/test e2e-kubevirt-aws-ovn-reduced
/test e2e-aws-upgrade-hypershift-operator
/test e2e-aws-4-21
/test e2e-aws
/test e2e-aks-4-21
/test e2e-aks

@ehearne-redhat
Copy link
Copy Markdown
Contributor Author

/test all

@ehearne-redhat
Copy link
Copy Markdown
Contributor Author

/retest

@ehearne-redhat
Copy link
Copy Markdown
Contributor Author

/test e2e-aks

@ehearne-redhat ehearne-redhat force-pushed the add-sa-global-pull-secret-syncer branch from 5da5668 to 7ac24b9 Compare February 26, 2026 11:16
@ehearne-redhat
Copy link
Copy Markdown
Contributor Author

/test e2e-aks
/test e2e-aws
/test e2e-aws-upgrade-hypershift-operator
/test e2e-kubevirt-aws-ovn-reduced
/test e2e-v2-aws

@ehearne-redhat
Copy link
Copy Markdown
Contributor Author

/retest

@ehearne-redhat
Copy link
Copy Markdown
Contributor Author

/test e2e-aws

@ehearne-redhat
Copy link
Copy Markdown
Contributor Author

/retest

@ehearne-redhat
Copy link
Copy Markdown
Contributor Author

/test e2e-aws

1 similar comment
@ehearne-redhat
Copy link
Copy Markdown
Contributor Author

/test e2e-aws

This fix adds a service account to global-pull-secret-syncer pod so it does not use default service account.
Add comprehensive unit test coverage for reconcileGlobalPullSecret()
function with test cases covering:
- Secret creation and merging when additional pull secret exists
- Error handling for missing secrets and invalid JSON
- InPlace NodePool handling
- DaemonSet and ServiceAccount creation and configuration

Set AllowPartialNodes to true for OVN daemonset in E2E validation
to fix test failures when checking for ready daemonsets.
@ehearne-redhat ehearne-redhat force-pushed the add-sa-global-pull-secret-syncer branch from 7ac24b9 to 95dcbb0 Compare March 5, 2026 10:39
@ehearne-redhat
Copy link
Copy Markdown
Contributor Author

/test e2e-aks
/test e2e-aws
/test e2e-aws-upgrade-hypershift-operator
/test e2e-kubevirt-aws-ovn-reduced
/test e2e-v2-aws

@ehearne-redhat
Copy link
Copy Markdown
Contributor Author

/test e2e-v2-aws

Copy link
Copy Markdown
Member

@bryan-cox bryan-cox left a comment

Choose a reason for hiding this comment

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

/approve

@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci Bot commented Mar 9, 2026

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: bryan-cox, ehearne-redhat

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

The pull request process is described 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 openshift-ci Bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Mar 9, 2026
@ehearne-redhat
Copy link
Copy Markdown
Contributor Author

global-pull-secret-syncer pod is running with service account in e2e-v2-aws

---
apiVersion: v1
kind: Pod
metadata:
  ...
  name: global-pull-secret-syncer-n84zk
  namespace: kube-system
  ...
  serviceAccount: global-pull-secret-syncer
  serviceAccountName: global-pull-secret-syncer
  ...
    ...
  phase: Running
...

/verified by ehearne-redhat

@openshift-ci-robot openshift-ci-robot added the verified Signifies that the PR passed pre-merge verification criteria label Mar 10, 2026
@openshift-ci-robot
Copy link
Copy Markdown

@ehearne-redhat: This PR has been marked as verified by ehearne-redhat.

Details

In response to this:

global-pull-secret-syncer pod is running with service account in e2e-v2-aws

---
apiVersion: v1
kind: Pod
metadata:
 ...
 name: global-pull-secret-syncer-n84zk
 namespace: kube-system
 ...
 serviceAccount: global-pull-secret-syncer
 serviceAccountName: global-pull-secret-syncer
 ...
   ...
 phase: Running
...

/verified by ehearne-redhat

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.

Copy link
Copy Markdown
Contributor

@everettraven everettraven left a comment

Choose a reason for hiding this comment

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

Aside from a minor comment on test structure, this LGTM.

If the HyperShift folks are happy with this PR, ship it :).

Comment on lines +36 to +44
expectGlobalSecretExists bool
expectOriginalSecretExists bool
expectDaemonSetExists bool
expectServiceAccountExists bool
expectError bool
validateDaemonSet func(*testing.T, *appsv1.DaemonSet)
validateGlobalSecret func(*testing.T, *corev1.Secret)
validateOriginalSecret func(*testing.T, *corev1.Secret)
validateServiceAccount func(*testing.T, *corev1.ServiceAccount)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I generally find that using the validate* pattern makes table-driven tests much harder to read because each test may end up with slightly different ways to validate something which is more logic overhead to have to follow when trying to understand if there are any testing gaps.

I prefer taking a more declarative approach where expect* and validate* fields here (aside from maybe expectError) becomes something like:

expectedDaemonSet *appsv1.DaemonSet
// and so on ...

@everettraven
Copy link
Copy Markdown
Contributor

Not blocking this PR on test changes and HCP folks seem happy with the changes.

Code changes LGTM.

/lgtm

@openshift-ci openshift-ci Bot added the lgtm Indicates that a PR is ready to be merged. label Mar 11, 2026
@openshift-ci-robot
Copy link
Copy Markdown

Scheduling tests matching the pipeline_run_if_changed or not excluded by pipeline_skip_if_only_changed parameters:
/test e2e-aks
/test e2e-aws
/test e2e-aws-upgrade-hypershift-operator
/test e2e-kubevirt-aws-ovn-reduced
/test e2e-v2-aws

@ehearne-redhat
Copy link
Copy Markdown
Contributor Author

/retest

@openshift-ci-robot
Copy link
Copy Markdown

/retest-required

Remaining retests: 0 against base HEAD 259cead and 2 for PR HEAD 95dcbb0 in total

@openshift-ci-robot
Copy link
Copy Markdown

/retest-required

Remaining retests: 0 against base HEAD 2172048 and 1 for PR HEAD 95dcbb0 in total

@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci Bot commented Mar 14, 2026

@ehearne-redhat: all tests passed!

Full PR test history. Your PR dashboard.

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. I understand the commands that are listed here.

@ehearne-redhat
Copy link
Copy Markdown
Contributor Author

/retest

@openshift-merge-bot openshift-merge-bot Bot merged commit 112c720 into openshift:main Mar 16, 2026
23 checks passed
@openshift-ci-robot
Copy link
Copy Markdown

@ehearne-redhat: Jira Issue Verification Checks: Jira Issue OCPBUGS-70354
✔️ This pull request was pre-merge verified.
✔️ All associated pull requests have merged.
✔️ All associated, merged pull requests were pre-merge verified.

Jira Issue OCPBUGS-70354 has been moved to the MODIFIED state and will move to the VERIFIED state when the change is available in an accepted nightly payload. 🕓

Details

In response to this:

What this PR does / why we need it:

  • Adds a bespoke service account to global-pull-secret-syncer.
  • We should not use default service account for our components.

Which issue(s) this PR fixes:

Fixes https://issues.redhat.com/browse/OCPBUGS-70354 .

Special notes for your reviewer:

Checklist:

  • Subject and description added to both, commit and PR.
  • Relevant issues have been referenced.
  • This change includes docs.
  • This change includes unit tests.

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. area/control-plane-operator Indicates the PR includes changes for the control plane operator - in an OCP release area/testing Indicates the PR includes changes for e2e testing jira/severity-critical Referenced Jira bug's severity is critical for the branch this PR is targeting. jira/valid-bug Indicates that a referenced Jira bug is valid for the branch this PR is targeting. jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. lgtm Indicates that a PR is ready to be merged. verified Signifies that the PR passed pre-merge verification criteria

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants