Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ephemeral package with environment variable registration #2857

Closed
wants to merge 3 commits into from

Conversation

kidgilson
Copy link
Contributor

Change Overview

This PR introduces the ephemeral package meant to handle registering and applying ephemeral pod specific fields.

The first use-case was to introduce FIPS related environment variables that need to be set on all ephemeral pods to ensure the crypto backend (OpenSSL in this case) is started with the FIPS provider enabled and fails otherwise.

The registration mechanism leaves it open to register conditional or static environment variables with the appropriate helper functions to help apply them. The only conditional environment variable helper at this point is the OSEnvVar which looks to see if the environment variable is set on the OS and applies it to the ephemeral pod if so. This usage is the main need for setting the FIPS environment variables since they're already present on the parent pod launching the ephemeral pods.

All places that used the kube.PodOptions type had the ephemeral.GlobalEnvVars() function added which adds all registered environment variables to the pod.

Two convenience functions RegisterOSEnvVar and RegisterStaticEnvVar were added to help facilitate the registering of environment variables from packages which import this.

Pull request type

Please check the type of change your PR introduces:

  • 🚧 Work in Progress
  • 🌈 Refactoring (no functional changes, no api changes)
  • 🐹 Trivial/Minor
  • 🐛 Bugfix
  • 🌻 Feature
  • 🗺️ Documentation
  • 🤖 Test

Issues

Test Plan

  • 💪 Manual
  • ⚡ Unit test
  • 💚 E2E

@infraq infraq added this to In Progress in Kanister May 3, 2024
@kidgilson kidgilson force-pushed the add-ephemeral-package branch 2 times, most recently from e6910a7 to 2f79b66 Compare May 3, 2024 04:47
@kidgilson kidgilson changed the title Add ephemeral package Add ephemeral package with environment variable registration May 3, 2024
@kidgilson kidgilson marked this pull request as ready for review May 3, 2024 06:15
@kidgilson kidgilson requested a review from r4rajat May 3, 2024 06:30
@kidgilson
Copy link
Contributor Author

Closing in favor of #2874 which generalizes the ephemeral package for more uses.

@kidgilson kidgilson closed this May 8, 2024
Kanister automation moved this from In Progress to Done May 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development

Successfully merging this pull request may close these issues.

Add environment variable registration mechanism for ephemeral pods
2 participants