Skip to content

fix(archive): make sure special commandline flags are accepted - #74

Merged
noelmcloughlin merged 1 commit into
saltstack-formulas:masterfrom
Ahummeling:fix-commandline-only-args
Feb 5, 2022
Merged

noelmcloughlin merged 1 commit into
saltstack-formulas:masterfrom
Ahummeling:fix-commandline-only-args

Conversation

@Ahummeling

@Ahummeling Ahummeling commented Feb 2, 2022 •

Copy link
Copy Markdown
Contributor

Attempt to resolve the issue of being unable to pass the
--storage.tsdb.retention.time flag.

Before these changes, adding service.args is not supported for archive installs. But this flag cannot be set in the environment file or the config file, because both are loaded after the daemon needed the flag I presume.

PR progress checklist (to be filled in by reviewers)

  • Changes to documentation are appropriate (or tick if not required)
  • Changes to tests are appropriate (or tick if not required)
  • Reviews completed

What type of PR is this?

Primary type

  • [build] Changes related to the build system
  • [chore] Changes to the build process or auxiliary tools and libraries such as documentation generation
  • [ci] Changes to the continuous integration configuration
  • [feat] A new feature
  • [fix] A bug fix
  • [perf] A code change that improves performance
  • [refactor] A code change that neither fixes a bug nor adds a feature
  • [revert] A change used to revert a previous commit
  • [style] Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc.)

Secondary type

  • [docs] Documentation changes
  • [test] Adding missing or correcting existing tests

Does this PR introduce a BREAKING CHANGE?

No.

Related issues and/or pull requests

#61

Describe the changes you're proposing

The idea is to basically compile a list of commandline flags that are to be passed to the executable. There are currently 3 cases, of which 2 are mutually exclusive. An argument is either requirement to be passed as commandline flag, this should always be possible. And then there's either a config file or not, if there's a config file, we pass the --config.file flag with the path to the file, if there's no config file, we join all the arguments that are given and pass those instead.

Pillar / config required to test the proposed changes

Debug log showing how the proposed changes work

Documentation checklist

  • Updated the README (e.g. Available states).
  • Updated pillar.example.

Testing checklist

  • Included in Kitchen (i.e. under state_top).
  • Covered by new/existing tests (e.g. InSpec, Serverspec, etc.).
  • Updated the relevant test pillar.

Additional context

@Ahummeling

Copy link
Copy Markdown
Contributor Author

Seems like the latest centos docker image isn't going to have a working package manager out of the box anymore, resulting in a test failing: Failed to download metadata for repo 'appstream': Cannot prepare internal mirrorlist: No URLs in mirrorlist

@myii

myii commented Feb 3, 2022

Copy link
Copy Markdown
Contributor

Seems like the latest centos docker image isn't going to have a working package manager out of the box anymore, resulting in a test failing: Failed to download metadata for repo 'appstream': Cannot prepare internal mirrorlist: No URLs in mirrorlist

@Ahummeling Yes, the updated CI matrix was pushed a little while ago. Would you mind rebasing this PR on top of that, in order to take advantage of that? That would involve removing the change you've proposed to .gitlab-ci.yml.

@noelmcloughlin Will you be able to review this PR?

Attempt to resolve the issue of being unable to pass the
`--storage.tsdb.retention.time` flag.

Signed-off-by: Arend Hummeling <arend@adivare.nl>
@Ahummeling
Ahummeling force-pushed the fix-commandline-only-args branch from 94839dd to 9529d5f Compare February 3, 2022 15:26
@Ahummeling

Copy link
Copy Markdown
Contributor Author

Ah thanks, I didn't notice a commit was pushed in the time between forking and pushing, should be cleaned up now.

@myii

myii commented Feb 3, 2022

Copy link
Copy Markdown
Contributor

Ah thanks, I didn't notice a commit was pushed in the time between forking and pushing, should be cleaned up now.

@Ahummeling Yep, all looking good now, thanks. Now we just need someone who's familiar with this formula to review it!

@noelmcloughlin

Copy link
Copy Markdown
Contributor

Thanks for the PR @Ahummeling and review @myii
This LGTM. I see the commandline flags being passed to systemd start command and CI is passing (service running).
start: /opt/prometheus/prometheus-v2.22.1/prometheus --config.file=/etc/prometheus/prometheus.yml --storage.tsdb.retention.time=150d

@noelmcloughlin
noelmcloughlin merged commit 5f59679 into saltstack-formulas:master Feb 5, 2022
@saltstack-formulas-travis

Copy link
Copy Markdown

🎉 This PR is included in version 5.6.3 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants