Copy installed plugins does not take `PLUGIN_DIR` ENV into account
casabre opened this issue · 1 comments
Describe the bug
I had to set the PLUGIN_DIR
ENV in order to avoid the issue #506. This is working fine so far but the copying stage fails with cp: cannot stat '/usr/share/jenkins/ref/plugins/*': No such file or directory
Version of Helm and Kubernetes
- Helm: unknown
- Kubernetes: v1.28.10+a2c84a5
Chart version
5.3.6
What happened?
I wanted to install just the CasC plugin through the initContainer. The downloading process worked fine but the copying process broke because it was looking in the wrong folder.
Having an empty list for `installPlugins` works fine because it is skipping the whole procedure
What you expected to happen?
Copying the downloaded and installed plugins from the correct PLUGIN_DIR
folder
How to reproduce it
controller:
initContainerEnv:
- name: CACHE_DIR
value: "/tmp/cache"
- name: PLUGIN_DIR
value: "/tmp/plugins"
installPlugins:
- configuration-as-code:1810.v9b_c30a_249a_4c
Anything else we need to know?
Had to strip some proxy and security settings because their are corporate internally. But I believe this shouldn't make a difference.
The PLUGIN_DIR
is not something managed by the chart. It's from the plugin manager installation tool: https://github.com/jenkinsci/plugin-installation-manager-tool?tab=readme-ov-file#cli-options and used to download the plugins
From what I remember /usr/share/jenkins/ref/plugins/*
comes from the base image to copy the existing plugins into the volume and it's done via the container image starting script, not the helm chart templates.
The guide also consider using a https://github.com/jenkinsci/helm-charts/blob/main/charts/jenkins/README.md#consider-using-a-custom-image where you install the plugin directly to the base image and perhaps grant write access to this directory
If you don't have any plugin on the base image perhaps mounting an emptyDir on /usr/share/jenkins/ref/plugins/*
could work.
To summarize nothing to fix here