-
Notifications
You must be signed in to change notification settings - Fork 94
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
✨ Add image pullSecret to hub controllers #397
✨ Add image pullSecret to hub controllers #397
Conversation
c35ab59
to
520c29c
Compare
/assign @qiujian16 |
we need to consider this together with #381, we basically want to sync secrets from one ns to another. I think we should handle them at the same time. cc @morvencao |
are you referring to #381 for syncing work-driver-config secret? |
520c29c
to
df85e19
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #397 +/- ##
==========================================
- Coverage 62.51% 62.51% -0.01%
==========================================
Files 134 134
Lines 11430 11438 +8
==========================================
+ Hits 7146 7151 +5
- Misses 3521 3523 +2
- Partials 763 764 +1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
...r/operators/clustermanager/controllers/clustermanagercontroller/clustermanager_controller.go
Outdated
Show resolved
Hide resolved
185e4bc
to
2d3b895
Compare
@@ -379,3 +383,15 @@ func cleanResources(ctx context.Context, kubeClient kubernetes.Interface, cm *op | |||
} | |||
return cm, reconcileContinue, nil | |||
} | |||
|
|||
func (n *clusterManagerController) getImagePullSecret(ctx context.Context) (string, error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do you still need this?
@@ -259,6 +259,10 @@ func (n *clusterManagerController) sync(ctx context.Context, controllerContext f | |||
config.RegistrationAPIServiceCABundle = encodedCaBundle | |||
config.WorkAPIServiceCABundle = encodedCaBundle | |||
|
|||
if config.ImagePullSecret, err = n.getImagePullSecret(ctx); err != nil { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why we need this step?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
will not add the pullsecretName to the sa if the imagepullSecret does not exist.
https://github.com/open-cluster-management-io/ocm/pull/397/files#diff-9f7acaff5c7d5c32d15173a975e8bed87d52c8add8e4bf8b4783854741c4cf39R6
if the imagepullSecret is not created but the name is fixed in the sa, a warning event will be output in the ns. The warning event can cause test case failure in openshift-conformance test suite.
There are 2 options here to avoid the warning event:
- create an empty pullsecret in the operator namespace.
- remove the pullsecret name from the sa if the pullsecret does not exist.
I chose option 2 in this PR.
the ApplyDirectly in libary-go does not update the imagepullsecret filed in the sa, I also create a new func ApplyServiceAccount to apply sa in the PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
moved the imagepullsecret to deployment and added a comment here
8319256
to
1237c43
Compare
Signed-off-by: Zhiwei Yin <zyin@redhat.com>
1237c43
to
61ae0d4
Compare
@qiujian16 @morvencao please take another look. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/approve
/lgtm
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: qiujian16, zhiweiyin318 The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
2636009
into
open-cluster-management-io:main
Summary
Support to sync the imagePullSecret
open-cluster-management-image-pull-credentials
in the operator ns to the hub namespace.Related issue(s)
Fixes #