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

Repairs cluster-name flag #155

Conversation

danibaeyens
Copy link
Contributor

Fixes #154.
cluster-name flag always overrides the automatically detected cluster name. Specially useful in cases where popeye is executed from a CronJob in the cluster via a ServiceAccount, and it doesn't use a config file.

@@ -377,13 +377,21 @@ func (p *Popeye) dumpPrometheus() error {
return pusher.Add()
}

func (p *Popeye) getClusterName() string {
if *p.flags.InClusterName != "" {
Copy link
Owner

Choose a reason for hiding this comment

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

@danibaeyens We should check for nil ptr here prior to the dereference in case the flag is not specified

@derailed derailed closed this May 4, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

--cluster-name flag is ignored
2 participants