saltstack-formulas / prometheus-formula

Manage a Prometheus installation
Other
27 stars 51 forks source link

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

Closed Ahummeling closed 2 years ago

Ahummeling commented 2 years ago

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)


What type of PR is this?

Primary type

Secondary type

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

Testing checklist

Additional context

Ahummeling commented 2 years ago

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 commented 2 years ago

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?

Ahummeling commented 2 years ago

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

myii commented 2 years ago

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 commented 2 years ago

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

saltstack-formulas-travis commented 2 years ago

:tada: This PR is included in version 5.6.3 :tada:

The release is available on GitHub release

Your semantic-release bot :package::rocket: