Skip to content
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 manage-cert-rotation: yes label to cs-ca-certificate CR #2467

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

qpdpQ
Copy link
Contributor

@qpdpQ qpdpQ commented Mar 26, 2025

What this PR does / why we need it:
add manage-cert-rotation: yes label to cs-ca-certificate CR
update operator code to ignore reconciling renewBefore field

Which issue(s) this PR fixes:
Fixes # https://github.ibm.com/IBMPrivateCloud/roadmap/issues/66198

Special notes for your reviewer:

How the test is done?
we could use this image to test quay.io/yuchen_li1/common-service-operator-amd64:dev

  1. update the RenewBefore time in cs-ca-certificate
  2. delete cs-operator pod to trigger a new reconcile
  3. updated renewBefore time shouldn't get reverted after a new reconcile

How to backport this PR to other branch:

  1. Add label to this PR with the target branch name backport <branch-name>
  2. The PR will be automatically created in the target branch after merging this PR
  3. If this PR is already merged, you can still add the label with the target branch name backport <branch-name> and leave a comment /backport to trigger the backport action

@ibm-ci-bot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: qpdpQ

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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

Signed-off-by: Allen Li <[email protected]>
@qpdpQ
Copy link
Contributor Author

qpdpQ commented Mar 26, 2025

test logs:

I0326 18:17:16.848615 1 init.go:1410] Deploying Cert Manager CRs
I0326 18:17:21.455972 1 request.go:601] Waited for 1.046490674s due to client-side throttling, not priority and fairness, request: GET:https://172.30.0.1:443/apis/monitoring.coreos.com/v1beta1?timeout=32s
I0326 18:17:27.509430 1 init.go:1443] Checking Cert Manager Certs and Issuers deployment
I0326 18:17:27.727635 1 init.go:473] create or update certificate
I0326 18:17:27.731036 1 init.go:490] ignore renewBefore
I0326 18:17:27.731059 1 init.go:491] renewBefore in cluster: 6000h0m0s
I0326 18:17:27.731066 1 init.go:492] renewBefore in code: 5840h0m0s

@@ -468,6 +468,27 @@ func (b *Bootstrap) CreateOrUpdateFromYaml(yamlContent []byte, alwaysUpdate ...b
obj.Object["spec"].(map[string]interface{})["config"] = sub.Object["spec"].(map[string]interface{})["config"]
}
update = !equality.Semantic.DeepEqual(sub.Object["spec"], obj.Object["spec"])
} else if gvk.Kind == "Certificate" {
Copy link
Contributor

Choose a reason for hiding this comment

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

Hi @qpdpQ

I am thinking that CS operator will never "update" a certificate resource given this resource does not have .metadata.annotations.version defined.

Can you have a test on CS operator without above particular Certificate Kind handling logic, and see if CS operator will update the certificate? Thank you!

@ibm-ci-bot ibm-ci-bot added size/L and removed size/S labels Mar 28, 2025
@qpdpQ
Copy link
Contributor Author

qpdpQ commented Mar 28, 2025

add a new field disableManageCertRotation in commonservice.spec it is set to false by default

@qpdpQ qpdpQ requested a review from Daniel-Fan March 28, 2025 15:30
@ibm-ci-bot ibm-ci-bot added size/M and removed size/L labels Mar 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants