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

--cert-restart-on-secret-refresh not possible when not using different flag parsing framework #19

Open
stijndehaes opened this issue Jan 13, 2021 · 15 comments

Comments

@stijndehaes
Copy link
Contributor

I use a different flag framework to parse flags, and would like this to be a configuration option you pass to the rotator when starting up. However this might be a breaking change for other users. How do you feel about changing this?

@adrianludwin
Copy link
Contributor

adrianludwin commented Jan 13, 2021

What happens if we give the option to set this option when you're starting up the rotator? That way, if you never call flag.Parse(), you get to pick what you want the value to be. But if you do call flag.Parse() and don't pass in the override, then we'll maintain the current behaviour. What do you think?

@stijndehaes
Copy link
Contributor Author

stijndehaes commented Jan 14, 2021

@adrianludwin that would be fine for me.

So we add the option to the CertRotator struct and in the AddRotator call we do something like:

func AddRotator(mgr manager.Manager, cr *CertRotator) error {
  restartOnSecretRefresh = restartOnSecretRefresh || cr.restartOnSecretRefresh 
  ...
}

I can make a PR for this :)

@adrianludwin
Copy link
Contributor

Yup that lgtm (looks good to me)! Note that I'm not an owner of this project but I suspect that @maxsmythe , @ritazh etc would be happy with this as well.

@maxsmythe
Copy link
Contributor

Not sure I like the idea of mixing the two. Users who do use the standard flag parser may accidentally also set the config option, which would negate the config.

How do people feel about...

  1. Starting tagging commits with semver so that we can track non-backwards-compatible changes
  2. Removing the flag and implementing a config option, incrementing this semver

Projects using this would then be able to just implement their flag individually should they want to keep it.

I'm not sure how many consumers of this project there are, but hopefully the semver stuff will give them enough warning to avoid surprise.

@ritazh @shomron thoughts?

@adrianludwin
Copy link
Contributor

adrianludwin commented Jan 14, 2021 via email

@maxsmythe
Copy link
Contributor

Yeah, working with some of these other libraries that use flags... the batteries included approach works great until you need to change the shape of the batteries :p

@adrianludwin
Copy link
Contributor

adrianludwin commented Jan 15, 2021 via email

@stijndehaes
Copy link
Contributor Author

I would be all for doing semver and making this a breaking change in a major release or something similar :)

@ritazh
Copy link
Member

ritazh commented Jan 15, 2021

+1 on semver and start cutting releases for this project. It would make introducing breaking changes much easier.

@adrianludwin
Copy link
Contributor

@ritazh , @maxsmythe - what do we need to do to make this happen? I'm not an admin on this repo so I can't create a release myself. Can we just call what we currently have "v0.1.0" and then start working towards v0.2.0?

@ritazh
Copy link
Member

ritazh commented Jan 15, 2021

Since we don't have CI to automate releases yet until #14 is done, I could manually create/push a tag with the latest commit in master. This should also help unblock #18 WDYT @maxsmythe?

@maxsmythe
Copy link
Contributor

SGTM

@ritazh
Copy link
Member

ritazh commented Jan 21, 2021

Sorry for the delay.
First release 🎉
https://github.com/open-policy-agent/cert-controller/releases/tag/v0.1.0

@stijndehaes
Copy link
Contributor Author

I made a PR for making this option part of the CertRotator struct: #23

@maxsmythe
Copy link
Contributor

Thanks!

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

No branches or pull requests

4 participants