Skip cacerts distribution for clusters without product claims#106
Skip cacerts distribution for clusters without product claims#106sridhargaddam wants to merge 3 commits into
Conversation
|
Just a note: this won't be needed if we proceed with #115 |
Since its still a draft and we have not yet finalized on the approach, let me update the current PR with your suggestion. |
f4a9b8d to
0440185
Compare
mkolesnik
left a comment
There was a problem hiding this comment.
Small comment otherwise LGTM
e049013 to
4861877
Compare
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: mkolesnik, sridhargaddam The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
/test integration |
4861877 to
b6a010c
Compare
|
New changes are detected. LGTM label has been removed. |
|
@jewertow I had to modify an existing integration test as we cannot have a namespace greater than 63 chars. PTAL, thanks. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository YAML (base), Central YAML (inherited) Review profile: CHILL Plan: Enterprise Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthrough
Sequence Diagram(s)sequenceDiagram
participant Controller
participant Cluster
participant cert-manager
Controller->>Cluster: getProductClaim
alt product claim present
Controller->>Cluster: apply operator ManifestWork
Controller->>cert-manager: ensureCertificateForCluster
Controller->>Cluster: ensureCacertsManifestWork
else product claim missing
Controller-->>Cluster: skip cert-manager work
end
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Suggested reviewers
🚥 Pre-merge checks | ✅ 8 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (8 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
The operator installation code skips clusters that are missing their product claim, but ensureCertificatesCreated and ensureCacertsDistributed were still processing them. This PR avoids creating certs and cacerts ManifestWorks for clusters without the product claims. Signed-off-by: Sridhar Gaddam <sgaddam@redhat.com>
The existing test for Subject/URI SAN used a 74-char cluster name without a product claim. This worked before because certificate creation was in a separate loop that didn't check product claims. Now that certificates are created inside the product-claim-gated loop, the cluster needs a product claim (which also means going through the operator ManifestWork step, which requires a namespace matching the cluster name). Since K8s limits namespace names to 63 characters, the original name/test-case can't work end-to-end. This PR shortens the cluster name to 62 characters so it's valid as a namespace, and use CreateK8sManagedCluster (which sets a product claim and creates the namespace). The OU truncation for names exceeding 64 characters remains covered by unit tests in certificate_test.go. Signed-off-by: Sridhar Gaddam <sgaddam@redhat.com>
b6a010c to
17e64d7
Compare
|
@mkolesnik I had to rebase this PR, can you reapprove? TIA |
mkolesnik
left a comment
There was a problem hiding this comment.
Small suggestion to make test more robust
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@test/integration/controller_test.go`:
- Around line 837-844: The `Consistently` assertion in this test relies on
default timing, so update the anonymous check around `k8sClient.List` to pass
explicit timeout and polling interval values. Keep the existing
certificate-listing logic intact, but make the wait parameters explicit in the
`Consistently` call to match the project’s Ginkgo timing guidelines and avoid
environment-dependent behavior.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository YAML (base), Central YAML (inherited)
Review profile: CHILL
Plan: Enterprise
Run ID: 74f360ac-4024-4ae9-82b3-bf97a529069c
📒 Files selected for processing (1)
test/integration/controller_test.go
a56683b to
a86b26b
Compare
a86b26b to
17e64d7
Compare
Signed-off-by: Sridhar Gaddam <sgaddam@redhat.com>
The operator installation code skips clusters that are
missing their product claim, but ensureCertificatesCreated
and ensureCacertsDistributed were still processing them.
This PR avoids creating certs and cacerts ManifestWorks
for clusters without the product claims.