Skip to content

Added env var config to plugin manager #3526

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

Nabsku
Copy link

@Nabsku Nabsku commented Jun 26, 2025

Summary

This PR adds the ability to configure the plugin manager via env vars. This allows the user to set a proxy or even set npm settings like the registry.

Changes

  • Added templating for env vars in the plugin manager

Steps to Test

  1. Set .Values.pluginsManager.env
  2. Watch the envs vars get populated

Nabsku added 2 commits June 26, 2025 11:09
Signed-off-by: Yannick Wahner <[email protected]>
@Copilot Copilot AI review requested due to automatic review settings June 26, 2025 09:29
Copy link

linux-foundation-easycla bot commented Jun 26, 2025

CLA Signed


The committers listed above are authorized under a signed CLA.

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: Nabsku
Once this PR has been reviewed and has the lgtm label, please assign joaquimrocha for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

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

@k8s-ci-robot k8s-ci-robot added the cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. label Jun 26, 2025
@k8s-ci-robot
Copy link
Contributor

Welcome @Nabsku!

It looks like this is your first PR to kubernetes-sigs/headlamp 🎉. Please refer to our pull request process documentation to help your PR have a smooth ride to approval.

You will be prompted by a bot to use commands during the review process. Do not be afraid to follow the prompts! It is okay to experiment. Here is the bot commands documentation.

You can also check if kubernetes-sigs/headlamp has its own contribution guidelines.

You may want to refer to our testing guide if you run into trouble with your tests not passing.

If you are having difficulty getting your pull request seen, please follow the recommended escalation practices. Also, for tips and tricks in the contribution process you may want to read the Kubernetes contributor cheat sheet. We want to make sure your contribution gets all the attention it needs!

Thank you, and welcome to Kubernetes. 😃

@k8s-ci-robot k8s-ci-robot added the size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. label Jun 26, 2025
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

Adds support for configuring the plugin manager via environment variables by updating Helm chart defaults and templates.

  • Introduces a commented-out env block in values.yaml for users to specify plugin manager env vars.
  • Updates the deployment template to render .Values.pluginsManager.env under the container spec.

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
charts/headlamp/values.yaml Added instructions for setting pluginsManager.env
charts/headlamp/templates/deployment.yaml Injects env: entries from .Values.pluginsManager.env
Comments suppressed due to low confidence (2)

charts/headlamp/templates/deployment.yaml:264

  • Wrap the env: block in a Helm conditional (e.g., {{- if .Values.pluginsManager.env }}) so it’s only rendered when env vars are defined. This prevents Helm from emitting null or an empty block when users don’t specify any env entries.
          env:

charts/headlamp/values.yaml:247

  • Provide a default empty array for pluginsManager.env (e.g., env: []) in the values file instead of only a commented example. This ensures toYaml always produces a valid list and avoids rendering null.
  # env:

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. and removed cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. labels Jun 26, 2025
@Nabsku
Copy link
Author

Nabsku commented Jun 26, 2025

Pull Request Overview

Adds support for configuring the plugin manager via environment variables by updating Helm chart defaults and templates.

  • Introduces a commented-out env block in values.yaml for users to specify plugin manager env vars.
  • Updates the deployment template to render .Values.pluginsManager.env under the container spec.

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
charts/headlamp/values.yaml Added instructions for setting pluginsManager.env
charts/headlamp/templates/deployment.yaml Injects env: entries from .Values.pluginsManager.env
Comments suppressed due to low confidence (2)

Just to address the two low confidence comments: I decided not to do that and follow the existing conventions in the pluginManager (see resources:). If wanted, I can of course add conditionals everywhere + apply that to the whole chart.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants