Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Add deployment checks #576

Merged
merged 2 commits into from
Jan 5, 2024
Merged

Conversation

BigGold1310
Copy link
Contributor

Fixes #569
Fixes #570

RELNOTE: Adding Deployment checks verifying if update strategy and replicas are correct

…be Rolling if targeted by Service

Fixes zegl#570

Signed-off-by: BigGold1310 <cyrill.naef@gmail.com>
Copy link
Owner

@zegl zegl left a comment

Choose a reason for hiding this comment

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

Thanks for working on this!

In general this looks fantastic, just two changes:

  1. We should not require the deployment strategy to be explicitly set. RollingUpdate is the default value, and that should be OK for us.
  2. Some changes to the copy to make the warnings more actionable.


func TestServiceNotTargetsDeploymentStrategyNotRelevant(t *testing.T) {
t.Parallel()
// Expecting score 0 as it didn't cot rated
Copy link
Owner

Choose a reason for hiding this comment

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

cot?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Removed comment as it should be clear without it.

Comment on lines 31 to 33
func TestServiceTargetsDeploymentStrategyNotSet(t *testing.T) {
t.Parallel()
testExpectedScore(t, "service-target-deployment-strategy-not-set.yaml", "Deployment Strategy", scorecard.GradeWarning)
}
Copy link
Owner

Choose a reason for hiding this comment

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

RollingUpdate is the default strategy, I don't think that we should require users to explicitly set the strategy to get rid of the warning.

If no strategy is set, the grade should be GradeAllOK.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good point, updated to GradeAllOk

…if not HPA managed and targeted by Service

Fixes zegl#569

Signed-off-by: BigGold1310 <cyrill.naef@gmail.com>
@zegl zegl force-pushed the add-deployment-checks branch from c3959ae to 32ce7ab Compare January 5, 2024 08:15
@zegl
Copy link
Owner

zegl commented Jan 5, 2024

Thanks!

@zegl zegl merged commit 8e178b1 into zegl:master Jan 5, 2024
@BigGold1310 BigGold1310 deleted the add-deployment-checks branch January 5, 2024 08:27
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add check for update strategy Add check for replicas > 1
2 participants