Repository navigation
Conversation
Dependency Review✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.Scanned FilesNone |
f04ff56 to
b1d74f9
Compare
b1d74f9 to
0203ece
Compare
0203ece to
6fc6499
Compare
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #13344 +/- ##
==========================================
+ Coverage 61.27% 61.37% +0.10%
==========================================
Files 749 750 +1
Lines 44490 44711 +221
==========================================
+ Hits 27261 27443 +182
- Misses 17229 17268 +39 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
6fc6499 to
d19c713
Compare
There was a problem hiding this comment.
🟡 Changes recommended
Authorization-mode resolution, owned-release validation, and purge error handling have unresolved correctness issues.
4 open issues
2 files not reviewed
pkg/cli/helm/mock_cluster.go: Generated filepkg/cli/helm/mock_helmclient.go: Generated file
What changed in this PR
Adds cert-manager lifecycle management to the Radius CLI as the first layer of component mTLS support. Authorization-enabled installations gain prerequisite setup without adding new flags.
Changes:
- Install, reuse, or upgrade cert-manager based on ownership and supported versions.
- Use stored Radius values when determining whether authorization requires cert-manager.
- Include rad-owned cert-manager in uninstall planning and retain it when other workloads depend on it.
| File | Description |
|---|---|
pkg/cli/helm/mock_helmclient.go |
Updates generated mocks for release labels. |
pkg/cli/helm/mock_cluster.go |
Adds the ownership-check mock. |
pkg/cli/helm/helmclient.go |
Supports Helm release labels during installation. |
pkg/cli/helm/helmclient_test.go |
Updates install calls for the new signature. |
pkg/cli/helm/helmaction.go |
Exposes stored values and release metadata; adds chart loading helper. |
pkg/cli/helm/helmaction_test.go |
Updates Helm install expectations. |
pkg/cli/helm/cluster.go |
Integrates cert-manager into cluster lifecycle operations. |
pkg/cli/helm/cluster_test.go |
Covers stored values and updated lifecycle calls. |
pkg/cli/helm/cert_manager.go |
Implements detection, ownership, mode resolution, and guarded removal. |
pkg/cli/helm/cert_manager_test.go |
Tests prerequisite decisions and uninstall safeguards. |
pkg/cli/cmd/upgrade/kubernetes/kubernetes.go |
Passes stored Radius values into upgrade options. |
pkg/cli/cmd/upgrade/kubernetes/kubernetes_test.go |
Verifies stored-value forwarding during upgrade. |
pkg/cli/cmd/uninstall/kubernetes/kubernetes.go |
Adds rad-owned cert-manager to the confirmation plan. |
pkg/cli/cmd/uninstall/kubernetes/kubernetes_test.go |
Updates ownership expectations and plan output. |
pkg/cli/cmd/install/kubernetes/kubernetes.go |
Passes stored Radius values into install options. |
pkg/cli/cmd/install/kubernetes/kubernetes_test.go |
Verifies stored-value forwarding during reinstall. |
Review effort: Balanced
Add failing tests for detecting cert-manager, installing a pinned version when it is missing and authorization is enabled, reusing a supported user installation, rejecting versions older than the minimum, and upgrading or uninstalling only releases rad owns. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Signed-off-by: sk593 <shruthikumar@microsoft.com>
When global.rbac.enabled or global.rbac.dryRun is set, rad install and rad upgrade kubernetes detect cert-manager before installing Radius. They install a pinned cert-manager (v1.21.2) when none exists, reuse a supported one (>= v1.20.0), and fail on an older one. A cert-manager rad installs carries the Helm release label app.kubernetes.io/managed-by=rad; only such releases are upgraded or uninstalled by rad. With authorization off nothing changes. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Signed-off-by: sk593 <shruthikumar@microsoft.com>
List a rad-installed cert-manager in the rad uninstall plan so users see it before confirming, and install it with crds.keep=false so uninstall also removes its CRDs. Otherwise a later install with authorization enabled finds cert-manager CRDs without a controller and stops. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Signed-off-by: sk593 <shruthikumar@microsoft.com>
Removing a rad-installed cert-manager deletes its CRDs, which deletes every Certificate, CertificateRequest, Issuer and ClusterIssuer in the cluster. Before uninstalling it, list those resources and keep cert-manager when any exist outside the Radius namespace, or when the check fails. Uninstall still succeeds and prints why it kept it. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Signed-off-by: sk593 <shruthikumar@microsoft.com>
…ails Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Signed-off-by: sk593 <shruthikumar@microsoft.com>
…uthiness rules Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Signed-off-by: sk593 <shruthikumar@microsoft.com>
…ts controller Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Signed-off-by: sk593 <shruthikumar@microsoft.com>
3a837d9 to
dad67b0
Compare
Radius functional test overviewClick here to see the test run details
Test Status⌛ Building Radius and pushing container images for functional tests... |

Layer 1 of Stack A: Component identity (mTLS) for the internal component authorization design (#13086, follow-up #13230). Stacked on #13216 (top of Stack 0, now merged; A1 now targets main).
Summary
When authorization is turned on (
global.rbac.enabled=trueorglobal.rbac.dryRun=true, from--setor from values stored on the Radius release),rad install kubernetesandrad upgrade kubernetescheck for cert-manager before touching Radius. Based on the design's cluster-state table, they then install it, reuse it, or fail:cert-managerv1.21.2 (CRDs enabled) into namespacecert-manager, labeled as rad-owned.rad upgradeupgrades it with Radius. A laterrad installreuses it if the release is deployed and its controller is running; otherwise it repairs it withhelm upgrade.certificates.cert-manager.ioCRD present, no controllerThe mode follows the chart's rules: Go template truthiness for
enabled/dryRun(so1or"true\n"count as on), and--set global=nullorglobal.rbac=nullclears stored values.With the default mode (
off), install and upgrade make no cert-manager detection calls and no extra Helm calls; behavior is unchanged. There are no new flags.Reason for change
Component mTLS (Stack A) needs cert-manager to issue service identities. This layer only gets cert-manager onto the cluster safely. Nothing uses it yet.
Decisions
v1.21.2and minimum1.20.0(latest stable and oldest supported minor when selected per https://cert-manager.io/docs/releases/). Both are constants inpkg/cli/helm/cert_manager.go, with a link to the releases page. Detection reads the controller Deployment'sapp.kubernetes.io/versionlabel and falls back to its image tag.app.kubernetes.io/managed-by=rad, set at install. It is stored on the release secrets and carried acrosshelm upgrade. Only acert-manager/cert-managerrelease with this label is upgraded or uninstalled by rad.helm get metadatadoes not display this custom label; inspect the release Secrets as shown below.rad uninstall kubernetesalready removes Contour, so it can also remove a rad-owned cert-manager. A user-installed cert-manager is never removed.crds.keep=false, so its CRDs go with the release. Otherwise a later authz install would hit the "CRD without controller" guard.Keeping cert-manager: other workloads use it (N resources, e.g. ns/kind/name)), and still succeeds.cert-managerwhenever rad installed it, before this check runs. If the ownership lookup fails, the plan omits it with a warning and uninstall continues.getto the uninstall path, plus four list calls when the release is rad-owned.CheckRadiusInstallnow returns the user values already stored on the Radius release (from the existinghelm get, so no extra call). Install with--reinstalland upgrade without--reset-valuesuse them to work out the mode.How to test
Unit tests and lint:
Manual (kind on Podman, isolated
HOME; the images in the original run were Stack 0 builds loaded withkind load image-archive). With Podman 6, use kind v0.33.0; v0.29.0 fails to list clusters.When using
hack/authz/up.sh: build the CLI separately and exportRAD=/absolute/path/to/the/built/rad. Keep the file namedradfor the whole run: Helm uses the executable name as the server-side-apply field manager, so upgrading with a renamed binary fails withconflict with "rad". The kit builds images, not the CLI; an older rad on PATH can apply dry-run chart values without installing cert-manager. Use exactly--skip-buildonly after a successful complete image build/push. The kit invokes adockerexecutable; with Podman, a temporary docker-to-podman symlink works (a shell alias does not). For the kit's HTTP local registry, configure only that endpoint (for examplelocalhost:5003) as insecure inside the Podman VM; do not disable registry TLS globally. Preserve isolated HOME and unique cluster/registry names throughout the run. The full stack requires an A5 checkout; this A1 checkout only supplies the first layer.Results
These are completed implementation runs; the reviewer's ongoing walkthrough is not claimed complete.
go test ./pkg/cli/...(rerun after review fixes)managed-by=radlabel, Radius and Contour runningrad upgrade(stored dryRun) → rad-owned cert-manager upgraded with Radiusradius, contour, cert-manager; release and CRDs removedapp, then uninstall →Keeping cert-manager: other workloads use it (3 resources, e.g. app/Certificate/web-tls); release and Certificate kept, uninstall succeedsolder than the minimum supported version v1.20.0, Radius not installedapp.kubernetes.io/managed-by=rad;helm get metadataomits itUninstalling cert-manager..., release gone, CRDNotFoundNo contributor docs describe these install steps, so none were changed.
File change summary
pkg/cli/helm/cert_manager.gopkg/cli/helm/cluster.goClusterOptions.CertManager/RadiusReleaseValues,InstallState.RadiusValues,Interface.CertManagerInstalledByRad; cert-manager wired into install, upgrade, and uninstall.pkg/cli/helm/helmaction.goqueryReleaseValues/getReleaseexpose stored values and labels; genericloadChart.pkg/cli/helm/helmclient.goRunHelmInstallaccepts release labels.pkg/cli/helm/mock_*.gopkg/cli/cmd/{install,upgrade}/kubernetes/kubernetes.gopkg/cli/cmd/uninstall/kubernetes/kubernetes.gopkg/cli/**/*_test.go