Skip to content

Conversation

@priyansh17
Copy link
Collaborator

@priyansh17 priyansh17 commented Jun 25, 2025

Summary

This PR enhances the Velero E2E test framework by adding support for custom pod labels and service account annotations. These can now be passed as CLI flags during test execution and will be propagated to the Velero deployment during installation.

Why is this change being made?

This change enables:

  • Workload Identity Configuration: Allows setting up workload identity for Velero in test environments by adding necessary annotations to the service account
  • Pod Labeling: Enables adding custom labels to Velero pods for test isolation, resource management, or compliance requirements
  • Enhanced Test Flexibility: Provides better control over Velero deployment configuration in different test environments

What changed?

Modified Files:

  1. test/Makefile - Added POD_LABELS and SA_ANNOTATIONS variables to pass to E2E tests
  2. test/e2e/e2e_suite_test.go - Added CLI flag definitions for --pod-labels and --sa-annotations
  3. test/types.go - Extended VeleroConfig struct with new fields
  4. test/util/velero/install.go - Added logic to append labels/annotations to velero install command
  5. test/util/velero/velero_utils.go - Maps configuration to install options

Usage Example:

make run-e2e POD_LABELS="app=velero,env=test" SA_ANNOTATIONS="iam.gke.io/[email protected]"

Testing

  • Tested E2E tests with custom labels and annotations
  • Verified labels appear on deployed Velero pods
  • Verified annotations appear on Velero service account
  • Tested with empty/unset values to ensure backward compatibility

Notes

  • Values are passed as comma-separated key=value pairs
  • No validation is currently performed on the format of labels/annotations
  • Empty values are handled gracefully (no flags added to install command)

Fixes: No specific GitHub issue

Please indicate you've done the following:

/kind changelog-not-required

@priyansh17
Copy link
Collaborator Author

/kind changelog-not-required

@codecov
Copy link

codecov bot commented Jun 25, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 60.29%. Comparing base (b0b5cc4) to head (3da348c).
Report is 3 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #9043   +/-   ##
=======================================
  Coverage   60.29%   60.29%           
=======================================
  Files         378      378           
  Lines       42729    42729           
=======================================
  Hits        25763    25763           
  Misses      15417    15417           
  Partials     1549     1549           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

…service account annotations

Signed-off-by: Priyansh Choudhary <[email protected]>
@blackpiglet blackpiglet added the kind/changelog-not-required PR does not require a user changelog. Often for docs, website, or build changes label Jun 26, 2025
Copy link
Collaborator

@kaovilai kaovilai left a comment

Choose a reason for hiding this comment

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

LGTM! Clean implementation that adds useful E2E test configuration options for pod labels and service account annotations.

@kaovilai kaovilai merged commit bd09744 into vmware-tanzu:main Jun 27, 2025
83 of 85 checks passed
@MaloLelandais MaloLelandais mentioned this pull request Jul 28, 2025
3 tasks
MaloLelandais pushed a commit to MaloLelandais/velero that referenced this pull request Jul 28, 2025
…9043)

* Add support for pod labels and service account annotations in Velero configuration
Signed-off-by: Priyansh Choudhary <[email protected]>

* Refactor Velero configuration to use string types for pod labels and service account annotations
Signed-off-by: Priyansh Choudhary <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

has-e2e-2tests kind/changelog-not-required PR does not require a user changelog. Often for docs, website, or build changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants