Skip to content

feat(gitops-console-plugin): Configure SSL protocol and ciphersuites for plugin component#1224

Open
akhilnittala wants to merge 5 commits into
redhat-developer:masterfrom
akhilnittala:usr/akhil/GITOPS-10473
Open

feat(gitops-console-plugin): Configure SSL protocol and ciphersuites for plugin component#1224
akhilnittala wants to merge 5 commits into
redhat-developer:masterfrom
akhilnittala:usr/akhil/GITOPS-10473

Conversation

@akhilnittala

@akhilnittala akhilnittala commented Jul 18, 2026

Copy link
Copy Markdown
Member

What type of PR is this?
/kind enhancement

What does this PR do / why we need it:
Configure SSL Protocol and cipher suites based on apiserver tls minversion and ciphersuites
Have you updated the necessary documentation?

  • Documentation update is required by this PR.
  • Documentation has been updated.

Which issue(s) this PR fixes:

Fixes #?
https://redhat.atlassian.net/browse/GITOPS-10473
Test acceptance criteria:

  • Unit Test
  • E2E Test

How to test changes / Special notes to the reviewer:
deploy gitops operator and verify the ssl connection with apiserver tls minversion and ciphers

…for plugin component

Signed-off-by: akhil nittala <nakhil@redhat.com>
@openshift-ci openshift-ci Bot added the kind/enhancement New feature or request label Jul 18, 2026
@openshift-ci
openshift-ci Bot requested review from chetan-rns and svghadi July 18, 2026 11:27
@openshift-ci

openshift-ci Bot commented Jul 18, 2026

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign wtam2018 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

@coderabbitai

coderabbitai Bot commented Jul 18, 2026

Copy link
Copy Markdown

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository YAML (base), Organization UI (inherited)

Review profile: CHILL

Plan: Enterprise

Run ID: a5ed679b-0836-4d35-bc9f-0506fdbc524c

📥 Commits

Reviewing files that changed from the base of the PR and between 7f94dc5 and 288cb9b.

📒 Files selected for processing (1)
  • controllers/consoleplugin.go
🔗 Linked repositories identified

CodeRabbit considers these linked repositories for cross-repo context during reviews:

  • argoproj-labs/argocd-operator (manual)
🚧 Files skipped from review as they are similar to previous changes (1)
  • controllers/consoleplugin.go

📝 Walkthrough

Summary by CodeRabbit

  • New Features

    • GitOps plugin deployments now honor cluster TLS minimum version and configured cipher suites.
    • Plugin httpd.conf is generated dynamically with protocol/cipher options applied only when applicable.
    • Deployments now track plugin configuration changes using a deterministic httpd-cfg-hash annotation to trigger rollouts.
  • Bug Fixes

    • Improved reconciliation ensures both Deployment and ConfigMap updates reflect the generated plugin configuration content.
  • Tests

    • Expanded unit tests for TLS-to-plugin mapping, dynamic httpd.conf generation, deterministic ConfigMap hashing, and httpd-cfg-hash annotation add/update behavior.

Walkthrough

TLS settings now flow from the cluster TLS profile into the GitOps service controller, which generates a TLS-aware plugin ConfigMap. ConfigMap content is hashed into Deployment pod-template annotations to trigger updates when plugin configuration changes.

Changes

TLS-aware console plugin configuration

Layer / File(s) Summary
TLS settings propagation
controllers/gitopsservice_controller.go, cmd/main.go
ReconcileGitopsService stores TLS minimum version and cipher settings, populated from the cluster TLS profile during controller initialization.
TLS-aware plugin configuration
controllers/consoleplugin.go, controllers/consoleplugin_test.go
Plugin httpd.conf generation maps TLS versions and conditionally adds protocol and cipher directives, with tests covering configuration generation and TLS mapping.
ConfigMap hashing and Deployment reconciliation
controllers/consoleplugin.go, controllers/consoleplugin_test.go
The generated ConfigMap is shared by reconciliation paths, hashed from its data, and tracked in the Deployment pod-template annotation; tests cover updated reconciliation calls and hash changes.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Sequence Diagram(s)

sequenceDiagram
  participant ClusterTLSProfile
  participant ReconcileGitopsService
  participant PluginConfigMap
  participant Deployment
  ClusterTLSProfile->>ReconcileGitopsService: Provide TLSMinVersion and TLSCiphers
  ReconcileGitopsService->>PluginConfigMap: Generate TLS-aware httpd.conf
  PluginConfigMap-->>ReconcileGitopsService: Return generated ConfigMap
  ReconcileGitopsService->>Deployment: Set httpd-cfg-hash on pod template
Loading

Suggested reviewers: chetan-rns, svghadi

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 40.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main change: configuring SSL protocol and cipher suites for the GitOps console plugin.
Description check ✅ Passed The description matches the changeset by describing TLS min version and cipher suite configuration for the plugin.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 3

🤖 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 `@controllers/consoleplugin.go`:
- Around line 539-540: In ReconcileGitopsService.reconcileConfigMap, update the
existing ConfigMap after copying Data and Labels by passing
existingPluginConfigMap to r.Client.Update instead of the newly generated
newPluginConfigMap, preserving its ResourceVersion.
- Line 437: Initialize existingSpecTemplate.ObjectMeta.Annotations as a writable
map when it is nil before assigning the "httpd-cfg-hash" entry, while preserving
the existing annotation update behavior.
- Around line 529-540: Replace the crypto/md5 import with crypto/sha256 in
controllers/consoleplugin.go at lines 5-5. Update getConfigMapHash at lines
529-540 to create a SHA-256 hash, collect and lexicographically sort cm.Data
keys before writing each key and value, and preserve the existing hexadecimal
string return format.
🪄 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), Organization UI (inherited)

Review profile: CHILL

Plan: Enterprise

Run ID: 23fb09a2-e4fc-4318-898d-224970c23815

📥 Commits

Reviewing files that changed from the base of the PR and between 8695d85 and 5bc4027.

📒 Files selected for processing (3)
  • cmd/main.go
  • controllers/consoleplugin.go
  • controllers/gitopsservice_controller.go
🔗 Linked repositories identified

CodeRabbit considers these linked repositories for cross-repo context during reviews:

  • argoproj-labs/argocd-operator (manual)

Comment thread controllers/consoleplugin.go
Comment thread controllers/consoleplugin.go Outdated
Comment thread controllers/consoleplugin.go
…for plugin component

Signed-off-by: akhil nittala <nakhil@redhat.com>

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🤖 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 `@controllers/consoleplugin_test.go`:
- Around line 2000-2020: Update getConfigMapHash to sort the keys of cm.Data
before writing key-value pairs into the hash, ensuring identical ConfigMaps
always produce the same hash and avoiding unnecessary rollouts.
- Around line 1931-1938: Update the TLS configuration logic exercised by the
“TLS 1.2 with cipher suites” test so TLSMinVersion VersionTLS12 emits an
additive protocol range including TLSv1.2 and TLSv1.3, rather than selecting
TLSv1.2 exclusively. Preserve the cipher-suite configuration and existing
behavior for other minimum versions.
🪄 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), Organization UI (inherited)

Review profile: CHILL

Plan: Enterprise

Run ID: 0729c3de-2de9-4c16-8c30-ff1b5044daa6

📥 Commits

Reviewing files that changed from the base of the PR and between 5bc4027 and a5d00ac.

📒 Files selected for processing (1)
  • controllers/consoleplugin_test.go
🔗 Linked repositories identified

CodeRabbit considers these linked repositories for cross-repo context during reviews:

  • argoproj-labs/argocd-operator (manual)

Comment thread controllers/consoleplugin_test.go
Comment thread controllers/consoleplugin_test.go
…for plugin component

Signed-off-by: akhil nittala <nakhil@redhat.com>
…for plugin component

Signed-off-by: akhil nittala <nakhil@redhat.com>

@aali309 aali309 left a comment

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.

Thanks @akhilnittala, the approach looks right, left a comment

Comment thread controllers/consoleplugin.go Outdated
…for plugin component

Signed-off-by: akhil nittala <nakhil@redhat.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind/enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants