Skip to content

UPSTREAM: <carry>: Create TLS secret in PrepareTest when CapSnapshotMetadata is enabled - #31485

Open
RomanBednar wants to merge 1 commit into
openshift:mainfrom
RomanBednar:csi-snapshot-metadata-tls-secret-fix
Open

UPSTREAM: <carry>: Create TLS secret in PrepareTest when CapSnapshotMetadata is enabled#31485
RomanBednar wants to merge 1 commit into
openshift:mainfrom
RomanBednar:csi-snapshot-metadata-tls-secret-fix

Conversation

@RomanBednar

Copy link
Copy Markdown
Contributor

Summary

When CSI_PROW_ENABLE_SNAPSHOT_METADATA=true, PrepareTest() in csi.go keeps the csi-snapshot-metadata sidecar container and its csi-snapshot-metadata-server-certs volume, but never creates the TLS secret the volume references. Only the 2 CBT-specific tests create it via CreateSnapshotMetadataResources(), so all other CSI hostpath tests fail with FailedMount on the missing secret.

Changes

  • New helper CreateSnapshotMetadataTLSSecret() in snapshot-metadata.go — creates only the TLS secret (CA + server cert + secret) without the Service and SnapshotMetadataService CR that only CBT tests need.
  • Call from PrepareTest() in csi.go — after deploying manifests, creates the TLS secret when CapSnapshotMetadata is true.
  • Idempotent createTLSSecret() — handles AlreadyExists so CBT tests calling CreateSnapshotMetadataResources() after PrepareTest() don't fail on the duplicate secret.

Context

  • Companion to openshift/release#81061 which adds CSI_PROW_ENABLE_SNAPSHOT_METADATA=true to TechPreview CI jobs.
  • Root cause analysis: 64 CSI hostpath test failures all trace to FailedMount: secret "csi-snapshot-metadata-server-certs" not found.

Test plan

…etadata is enabled

When CSI_PROW_ENABLE_SNAPSHOT_METADATA=true, PrepareTest() keeps the
csi-snapshot-metadata sidecar and its volume but never creates the
TLS secret the volume references. Only the 2 CBT-specific tests
create it via CreateSnapshotMetadataResources(), so all other CSI
hostpath tests fail with FailedMount on the missing secret.

Add CreateSnapshotMetadataTLSSecret() that creates only the TLS
secret (CA + server cert + secret) without the Service and
SnapshotMetadataService CR that only CBT tests need. Call it from
PrepareTest() after deploying manifests when CapSnapshotMetadata
is true.

Make createTLSSecret() idempotent by handling AlreadyExists so
that CBT tests calling CreateSnapshotMetadataResources() after
PrepareTest() don't fail on the duplicate secret.
@openshift-merge-bot

Copy link
Copy Markdown
Contributor

Pipeline controller notification
This repo is configured to use the pipeline controller. Second-stage tests will be triggered either automatically or after lgtm label is added, depending on the repository configuration. The pipeline controller will automatically detect which contexts are required and will utilize /test Prow commands to trigger the second stage.

For optional jobs, comment /test ? to see a list of all defined jobs. To trigger manually all jobs from second stage use /pipeline required command.

This repository is configured in: automatic mode

@coderabbitai

coderabbitai Bot commented Aug 5, 2026

Copy link
Copy Markdown

Important

Review skipped

Review was skipped due to path filters

⛔ Files ignored due to path filters (2)
  • vendor/k8s.io/kubernetes/test/e2e/storage/drivers/csi.go is excluded by !**/vendor/**, !vendor/**
  • vendor/k8s.io/kubernetes/test/e2e/storage/utils/snapshot-metadata.go is excluded by !**/vendor/**, !vendor/**

CodeRabbit blocks several paths by default. You can override this behavior by explicitly including those paths in the path filters. For example, including **/dist/** will override the default block on the dist directory, by removing the pattern from both the lists.

⚙️ Run configuration

Configuration used: Repository YAML (base), Central YAML (inherited)

Review profile: CHILL

Plan: Enterprise

Run ID: 154b5dea-ea5a-476b-9173-db57256e5d5d

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

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

@openshift-ci openshift-ci Bot added the ready-for-human-review Indicates a PR has been reviewed by automated tools and is ready for human review label Aug 5, 2026
@openshift-ci

openshift-ci Bot commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: RomanBednar
Once this PR has been reviewed and has the lgtm label, please assign petr-muller 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 added the vendor-update Touching vendor dir or related files label Aug 5, 2026
@openshift-ci
openshift-ci Bot requested review from deads2k and sjenning August 5, 2026 09:19
@RomanBednar

Copy link
Copy Markdown
Contributor Author

/hold

TESTING ONLY - do not merge, this should go upstream once we have a working patch.

@openshift-ci openshift-ci Bot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Aug 5, 2026
@openshift-ci

openshift-ci Bot commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

@RomanBednar: The following tests failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/prow/go-verify-deps 71b70e0 link true /test go-verify-deps
ci/prow/verify-deps 71b70e0 link true /test verify-deps

Full PR test history. Your PR dashboard.

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. I understand the commands that are listed here.

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

Labels

do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. ready-for-human-review Indicates a PR has been reviewed by automated tools and is ready for human review vendor-update Touching vendor dir or related files

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant