Created
May 8, 2022 22:20
-
-
Save jwillker/968fcdb922ebea9a94857b8acf3f6e88 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func assertName(t assert.TestingT, name string, deployment appsv1.Deployment) bool { | |
// Only assert if theres a want value to assert | |
// if not return true to don't fail the test | |
if name == "" { | |
return true | |
} | |
return assert.Equal( | |
t, | |
name, | |
deployment.Name, | |
"Rendered Deployment name is not the expected!", | |
) | |
} | |
func assertLabels(t assert.TestingT, labels map[string]string, deployment appsv1.Deployment) bool { | |
// Only assert if theres a want value to assert | |
// if not return true to don't fail the test | |
if labels != nil { | |
for k, v := range labels { | |
assert.Equal( | |
t, | |
v, | |
deployment.Labels[k], | |
"Rendered Deployment '%s' label is not the expected!", k, | |
) | |
} | |
} | |
return true | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment