Skip to content

CM-830: Add TrustManager API type definitions - #484

Open
openshift-app-platform-shift[bot] wants to merge 1 commit into
cert-manager-1.18from
feature/api-types-1914-v2
Open

CM-830: Add TrustManager API type definitions#484
openshift-app-platform-shift[bot] wants to merge 1 commit into
cert-manager-1.18from
feature/api-types-1914-v2

Conversation

@openshift-app-platform-shift

Copy link
Copy Markdown

Summary

  • Introduces TrustManager CRD (trustmanagers.operator.openshift.io/v1alpha1) for deploying and managing the trust-manager operand via cert-manager-operator
  • Adds TrustManager FeatureGate (Alpha/TechPreview, default disabled) to operator feature gate configuration
  • Includes integration test suite (.testsuite.yaml) covering create/update validation scenarios
  • Generated deepcopy, CRD manifest, clientset, informers, listers, and apply configurations

Details

This PR implements the API types defined in Enhancement Proposal #1914 for integrating trust-manager with cert-manager-operator.

New Types

Type Description
TrustManager Cluster-scoped singleton CRD (name must be cluster)
TrustManagerSpec Spec with trustManagerConfig (required) and controllerConfig (optional)
TrustManagerConfig Operand behavior: log level/format, trust namespace, secret targets, default CA package, expired cert filtering, scheduling
SecretTargetsConfig Policy-driven secret write permissions with CEL cross-field validation
DefaultCAPackageConfig OpenShift trusted CA bundle injection configuration
TrustManagerControllerConfig Labels/annotations for operator-created resources
TrustManagerStatus Status with conditions, image, and policy reflection fields

Validation Rules

  • Singleton: XValidation enforces metadata.name == 'cluster'
  • Immutability: trustNamespace is immutable once set
  • Cross-field CEL: authorizedSecrets required when secretTargets.policy is Custom, forbidden otherwise
  • Enum validation on all policy fields (FilterExpiredCertificatesPolicy, SecretTargetsPolicy, DefaultCAPackagePolicy)
  • Bounds on logLevel (1-5), trustNamespace length (1-63), tolerations (max 50), nodeSelector (max 50)

Test plan

  • go build ./api/... passes
  • go vet ./api/... passes
  • make generate && make manifests produces no drift
  • Review generated CRD manifest for correctness
  • Integration test suite covers minimal create, all enum values, validation errors, immutability, and cross-field constraints

🤖 Generated with Claude Code

Introduces the TrustManager CRD (trustmanagers.operator.openshift.io/v1alpha1)
to support deploying and managing the trust-manager operand via cert-manager-operator.

This adds:
- TrustManager API types with spec/status fields for configuring trust-manager
  operand behavior (log level/format, trust namespace, secret targets,
  default CA package, filtering expired certificates, scheduling)
- TrustManager FeatureGate (Alpha/TechPreview, default disabled)
- Singleton enforcement via XValidation (name must be "cluster")
- Immutability on trustNamespace via XValidation
- Cross-field CEL validation on SecretTargetsConfig
- Integration test suite (.testsuite.yaml) covering create and update scenarios
- Generated deepcopy, CRD manifest, clientset, informers, listers, and
  apply configurations

Ref: openshift/enhancements#1914

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@openshift-ci-robot openshift-ci-robot added the jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. label Aug 27, 2026
@openshift-ci-robot

openshift-ci-robot commented Aug 27, 2026

Copy link
Copy Markdown

@openshift-app-platform-shift[bot]: This pull request references CM-830 which is a valid jira issue.

Details

In response to this:

Summary

  • Introduces TrustManager CRD (trustmanagers.operator.openshift.io/v1alpha1) for deploying and managing the trust-manager operand via cert-manager-operator
  • Adds TrustManager FeatureGate (Alpha/TechPreview, default disabled) to operator feature gate configuration
  • Includes integration test suite (.testsuite.yaml) covering create/update validation scenarios
  • Generated deepcopy, CRD manifest, clientset, informers, listers, and apply configurations

Details

This PR implements the API types defined in Enhancement Proposal #1914 for integrating trust-manager with cert-manager-operator.

New Types

Type Description
TrustManager Cluster-scoped singleton CRD (name must be cluster)
TrustManagerSpec Spec with trustManagerConfig (required) and controllerConfig (optional)
TrustManagerConfig Operand behavior: log level/format, trust namespace, secret targets, default CA package, expired cert filtering, scheduling
SecretTargetsConfig Policy-driven secret write permissions with CEL cross-field validation
DefaultCAPackageConfig OpenShift trusted CA bundle injection configuration
TrustManagerControllerConfig Labels/annotations for operator-created resources
TrustManagerStatus Status with conditions, image, and policy reflection fields

Validation Rules

  • Singleton: XValidation enforces metadata.name == 'cluster'
  • Immutability: trustNamespace is immutable once set
  • Cross-field CEL: authorizedSecrets required when secretTargets.policy is Custom, forbidden otherwise
  • Enum validation on all policy fields (FilterExpiredCertificatesPolicy, SecretTargetsPolicy, DefaultCAPackagePolicy)
  • Bounds on logLevel (1-5), trustNamespace length (1-63), tolerations (max 50), nodeSelector (max 50)

Test plan

  • go build ./api/... passes
  • go vet ./api/... passes
  • make generate && make manifests produces no drift
  • Review generated CRD manifest for correctness
  • Integration test suite covers minimal create, all enum values, validation errors, immutability, and cross-field constraints

🤖 Generated with Claude Code

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

@openshift-ci
openshift-ci Bot requested review from bharath-b-rh and swghosh August 27, 2026 10:01
@openshift-ci openshift-ci Bot added the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Aug 27, 2026
@openshift-ci

openshift-ci Bot commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: openshift-app-platform-shift[bot]
Once this PR has been reviewed and has the lgtm label, please assign trilokgeer 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

@openshift-ci

openshift-ci Bot commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

Hi @openshift-app-platform-shift[bot]. Thanks for your PR.

I'm waiting for a openshift member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work.

Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant