Skip to content

Conversation

kmarteaux
Copy link
Contributor

RELNOTE: Implement new Pod container resource checks for ephemeral storage. Default tests for request and limit settings. Optional test to ensure matching ephemeral storage request and limit values.

@kmarteaux
Copy link
Contributor Author

Refactored the original implementation - moved the new checks to score/container.go and the associated tests to score/score_test.go. Split the resource checks into default (are they set) and optional (are they equal) as previously recommended. Removed the separate score/ephemeralstorage/ephemeralstorage.go and score/ephemeralstorage_test.go files. Updated score.go to remove ref to deleted files.


func TestPodContainerStorageEphemeralNoRequest(t *testing.T) {
t.Parallel()
testExpectedScore(t, "pod-ephemeral-storage-missing-request.yaml", "Container Ephemeral Storage Request and Limit", scorecard.GradeWarning)
Copy link
Owner

@zegl zegl Feb 4, 2022

Choose a reason for hiding this comment

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

Could we have a test that checks for "Container Ephemeral Storage Request and Limit" returning 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.

Additional test case (GradeAllOK) added.

@zegl
Copy link
Owner

zegl commented Feb 4, 2022

Thanks! Looks great 👍 , there's just one test case (the happy path) that isn't tested. Update the PR with that, and we're ready to ship!

…orage Request and Limit' returning GradeAllOK
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.

Great!

bors merge

@bors
Copy link
Contributor

bors bot commented Feb 4, 2022

Build succeeded:

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.

2 participants