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

✨ expose init-shared-path readOnly var #393

Merged
merged 4 commits into from
Jun 12, 2024

Conversation

vmdude
Copy link
Contributor

@vmdude vmdude commented Jun 12, 2024

what

By default init-shared-path is read-only mounted without the possibility to mount it read-write. This PR expose the readOnly setting of the volumeMount to be able to manage it through values file.

why

We used to build a custom atlantis image to be able to embed additional tools required by custom workflows defined server-side (like aws-cli or asdf to handle terraform, terragrunt, opentofu, kubectl and others). Although it works just fine, we had to maintain our custom image.
Since initConfig object, we have been able to move the instruction from our custom Dockerfile to the initConfig.script value.
The main issue is that the initConfig.sharedDir is mounted read-write on the init container, but is mounted read-only on the main container.
As we're using asdf is all our repositories with sometimes different versions for each tool, the atlantis image is installing these different versions of terraform/opentofu/... during the pre_workflow_hooks thanks to a .tool-versions in each repository. But asdf require to download and install each version where it was installed (ie in the sharedDir), thus require read-write volumeMount.

Today we're using kustomize to patch it so that it's mounted correctly, but we're hoping this could be handled directly through the chart itself:

- op: replace
  path: /spec/template/spec/containers/0/volumeMounts/3/readOnly
  value: false

@vmdude vmdude requested a review from a team as a code owner June 12, 2024 12:56
Copy link
Member

@GMartinez-Sisti GMartinez-Sisti left a comment

Choose a reason for hiding this comment

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

Thanks @vmdude! Also please bump minor since this is a new feature and run the helm-docs update (instructions on the README file).

charts/atlantis/values.schema.json Outdated Show resolved Hide resolved
@GMartinez-Sisti GMartinez-Sisti added the waiting-on-response Waiting for a response from the user label Jun 12, 2024
vmdude and others added 3 commits June 12, 2024 15:44
Co-authored-by: Gabriel Martinez <19713226+GMartinez-Sisti@users.noreply.github.com>
@vmdude
Copy link
Contributor Author

vmdude commented Jun 12, 2024

Thanks for your feedback, I just pushed the required modification

Copy link
Member

@GMartinez-Sisti GMartinez-Sisti left a comment

Choose a reason for hiding this comment

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

Thanks for the contribution 🙏

@GMartinez-Sisti GMartinez-Sisti merged commit 420b19d into runatlantis:main Jun 12, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
waiting-on-response Waiting for a response from the user
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants