Skip to content
This repository has been archived by the owner on Nov 1, 2022. It is now read-only.

Added a readonly flag to the install command #2530

Merged
merged 3 commits into from
Nov 4, 2019

Conversation

sebikul
Copy link
Contributor

@sebikul sebikul commented Oct 18, 2019

Allow the daemon to be installed with the readonly flag present
using the install command. Modified the cmd flags and the deployment
template.

@sebikul
Copy link
Contributor Author

sebikul commented Oct 18, 2019

This change modifies the generated_templates.gogen.go file present in the repo. As it is a generated file, I decided against including it in this PR. Please let me know if it should also be added for this feature to be complete.

@sebikul sebikul force-pushed the feature/readonly-install-flag branch from c66106e to 8bec527 Compare October 21, 2019 18:44
@squaremo
Copy link
Member

This change modifies the generated_templates.gogen.go file present in the repo. As it is a generated file, I decided against including it in this PR. Please let me know if it should also be added for this feature to be complete.

Whether or not to commit generated files is often a unwelcome choice isn't it. The scheme we use is to commit the file, but check that it produces the right results (by running fluxctl install -o deploy ... and comparing to what's committed there). The easiest way to do it is to run

make check-generated

This will regenerate the particular file (as will make, if you've changed the templates). If it succeeds, then your change hasn't upset the expected output in deploy/.

You may find that it fails because you've introduced a whitespace change in the output -- use the whitespace-suppressing mustaches {{- (suppress preceding whitespace) and -}} (suppress following whitespace) in the template to avoid this, or if it's desired whitespace, commit the change to deploy/.

@@ -159,6 +159,9 @@ spec:

# Tell flux it has readonly access to the repo (default `false`)
# - --git-readonly
{{ if .GitReadOnly }}
Copy link
Member

Choose a reason for hiding this comment

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

For neatness in the output, it would be nice to output either the arg or it's commented-out analogue. E.g.,

{{ if .GitReadOnly }}
  - --git-readonly
{{ else }}
  # - --git-readonly
{{ end }}

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I've edited the template to take this into account, and also updated the generated template.

Copy link
Member

@squaremo squaremo left a comment

Choose a reason for hiding this comment

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

Yep; neatly minimised. Thank you @sebikul

Allow the daemon to be installed with the readonly flag present
using the install command. Modified the cmd flags and the deployment
template.
@squaremo squaremo force-pushed the feature/readonly-install-flag branch from 50421c6 to 5125d37 Compare November 4, 2019 16:20
@squaremo
Copy link
Member

squaremo commented Nov 4, 2019

I've rebased it as a prerequisite for merging .. waiting for CI to pass...

@squaremo squaremo merged commit 205705b into fluxcd:master Nov 4, 2019
@sebikul sebikul deleted the feature/readonly-install-flag branch November 4, 2019 18:01
@2opremio 2opremio added this to the 1.16.0 milestone Nov 21, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants