Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
Add logic to generate certificates using minimum durations #201
Add logic to generate certificates using minimum durations #201
Changes from all commits
93b410f
3755123
8d93d5f
09d3a4b
224f65e
b1dc092
599bcf4
f9fbbcd
be0337d
0d3c691
1315ba6
b6c3d8d
05d6183
bc228fc
f2d31ca
0f1cedd
408aa3d
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We took a guess on the version the new feature will be in. This might need to be updated.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Two things:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah this change is what I was thinking about as well. However, Jesse's initial proposal argues that accounting for duration in the
converge
mode (aka the existing behavior) is wrong to begin with. I personally don't have context on how consumers of credhub use theconverge
mode, but I believebosh
is the only credhub consumer that depends on this feature. So I'm kind of relying on the bosh team to judge whether the old behavior is a bug.Also I think bumping CredHub major to 3.0 is not the end of the world? We'll just have to bump CredHub in all the TAS versions from LTS 2.9 to LTS 3.0 (which shouldn't break TAS, bc TAS doesn't use CredHub's certificate feature anyway).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As a member of the BOSH team, I think I would consider the old behavior a bug. The behavior of
converge
is meant to cause a credential to regenerate when the properties declared for the variable have changed. For things like a change to common name or signing CA, it makes a lot of sense that converge mode would cause the certificate to be regenerated - the underlying identity of the certificate has changed. This does not seem the case with duration / expiration date.The cases this would be a breaking change would be as follows:
update_mode: converge
.update_mode: converge
for them using the new duration. The changes would cause it to not regenerate in this case.I am not aware of any product or customer relying on this behavior. It seems very narrow to me, and can be solved by other workflows (such as making an explicit
credhub generate
CLI or equivalent API call). That said, if someone is relying on it, it would be a breaking change for them.We added an explicit feature flag on a temporary branch earlier that would default back to the earlier converge behavior unless turned on. It wasn't difficult, but we're holding off on merging it into this PR. Let us know which direction you would like to go in (release a new major, deem this as a bug fix and not worry about it, or add an explicit feature flag) and we'll proceed accordingly.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, @bruce-ricard and I can discuss tomorrow and get back to you.
Meanwhile @ystros, can I ask for your input? It seems like the tension is between:
converge
was introduced, it was never meant for only extending cert duration, which is a narrow and invalid use case. Hence, the lack of a feature flag does not constitute a breaking change, but a bug fix. CredHub can include the current PR in Credhub 2.10. BOSH can include this in a patch as well.converge
mode to only extend cert duration is a valid use case that people rely on. So CredHub should 1) include a feature flag (with the default being the existing behavior) and include this in a CredHub 2.10 or 2) bump major to CredHub 3.0 and BOSH would need to do the same (right?).What I'm trying to get at, is BOSH team might have better insight on whether using the
converge
mode to only extend cert duration is a valid use case that people rely on (CredHub, AFAIK, does not have a standalone cert use case outside of BOSH). Or to phrase the question a little differently: When the current PR (aka no feature flag) is merged and released, would the resulting new BOSH version be considered having a breaking change & needs major version bump? What would the BOSH team's decision be in this scenario?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK right, fair enough. I actually talked with Jesse about that and I now remember suggesting that the current behavior is a bug...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
very hard to understand what is happening in this function with the
false, true
parameters.