Skip to content
This repository was archived by the owner on May 3, 2022. It is now read-only.

Rollout Blocks #151

Merged
merged 4 commits into from
Aug 28, 2019
Merged

Rollout Blocks #151

merged 4 commits into from
Aug 28, 2019

Conversation

ghost
Copy link

@ghost ghost commented Aug 8, 2019

This introduces RolloutBlocks as a CRD in shipper.
Blocking rollouts locally or globally is possible using a RolloutBlock object in the relevant namespace.

Closes #1

spec:
message: DNS issues, troubleshooting in progress
author:
type: user
Copy link
Contributor

Choose a reason for hiding this comment

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

There's no documentation on what are the possible types. And perhaps a little bit related, what do we use this for?

Copy link
Author

@ghost ghost Aug 8, 2019

Choose a reason for hiding this comment

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

It was suggested in the RFC, and I think it opens an opportunity for an automated rollout block, maybe...
It might be redundant, I'm not sure

Copy link
Contributor

Choose a reason for hiding this comment

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

I'm of the opinion that until we need and actually do something useful with it, we should keep it out. @parhamdoustdar @icanhazbroccoli can you guys weigh in on this?

}

existingRBs := rolloutblock.NewOverrideFromRolloutBlocks(append(nsRBs, gbRBs...))
obsoleteRbs := relOverrideRBs.Diff(existingRBs)
Copy link
Contributor

Choose a reason for hiding this comment

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

This bit looks very similar to what happens in the application controller. Maybe we should DRY it up?

Copy link
Author

@ghost ghost Aug 8, 2019

Choose a reason for hiding this comment

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

Tried, it did not go well. It is very similar, but removing the duplications removed only 4 lines and introduces ambiguity...

@ghost ghost force-pushed the hbarkal/1-rollout-blocks-1 branch from 8080bd6 to 812226d Compare August 9, 2019 10:33
@ghost ghost marked this pull request as ready for review August 9, 2019 10:35
@ghost ghost force-pushed the hbarkal/1-rollout-blocks-1 branch from 8a7fa52 to 6f52f9e Compare August 16, 2019 15:18
n, ok := rbsPerNamespace[ns.Name]
if !ok {
n = 0
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Minor: not needed: you can rely on golang map zero-value return, in this case it's going to be 0.0


rbsPerNamespace := make(map[string]float64)
for _, rolloutBlock := range rolloutBlocks {
rbsPerNamespace[rolloutBlock.Namespace]++
Copy link
Contributor

Choose a reason for hiding this comment

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

Minor: if I understand correctly, float64 is chosen because prometheus gauge wants it. In the other hand, the semantics of this value is a counter, which means an integer-like value is more natural for operations like ++. See https://stackoverflow.com/questions/8561393/is-using-increment-operator-on-floats-bad-style for more details. As I said, this is a matter of polishing the semantics of this method, so, not a blocker to me.

@ghost ghost force-pushed the hbarkal/1-rollout-blocks-1 branch from dcd337b to b3778e7 Compare August 22, 2019 08:34
@osdrv osdrv added this to the release-0.6 milestone Aug 22, 2019
@osdrv osdrv added the enhancement New feature or request label Aug 22, 2019
@ghost ghost force-pushed the hbarkal/1-rollout-blocks-1 branch from e938a5c to b652098 Compare August 26, 2019 11:45
Hilla Barkal added 3 commits August 26, 2019 15:20
create global rolloutblock namespace
create rolloutblock override annotation
create application condition type for rollout blocks
add rollout block override annotation to application object
blocking rollout or overriding according to rbs and annotations
add rollout block related errors
update rolloutblock object status according to overriding applications and releases
add tests for rollout block status
…nd statuses

add rollout block override annotation to release object
add validating path
add validation for application and release annotations
add validation for rolloutblock logic
collect rollout block in prometheus
give an example for a local rolloutblock in docs
rename application rollout blocked condition to fit conventions
add missing codegen files
rate limiting the release objects that on update are unchanged (#127)
update rolloutblock object if a release has added it to override annotation, or removed it from override annotation
renaming Application condition blocked by rollout block
make rolloutblock errors broadcast in webhook
@ghost ghost force-pushed the hbarkal/1-rollout-blocks-1 branch from 15f1022 to 7fedd38 Compare August 26, 2019 13:22
@juliogreff juliogreff merged commit 88a97e3 into master Aug 28, 2019
@juliogreff juliogreff deleted the hbarkal/1-rollout-blocks-1 branch September 19, 2019 13:21
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Rollout blocks
2 participants