check labels/annotations in the beginning

This commit is contained in:
AxeZhan 2023-09-05 19:23:01 +08:00
parent ff3cb43c30
commit 059e8353b7

View File

@ -69,15 +69,22 @@ var _ = SIGDescribe("Kubectl rollout", func() {
}
origEnv := d.Spec.Template.Spec.Containers[0].Env
origLabels := d.Spec.Template.Labels
origAnnotations := d.Spec.Template.Annotations
for _, env := range origEnv {
if env.Name == "foo" && env.Value == "bar" {
framework.Failf("labeled deployment should not have an env named foo and valued bar at the beginning")
}
}
origLabels := d.Spec.Template.Labels
if len(origLabels) == 0 {
framework.Failf("original labels should not be empty in kubectl rollout test")
}
origAnnotations := d.Spec.Template.Annotations
if len(origAnnotations) == 0 {
framework.Failf("original annotations should not be empty in kubectl rollout test")
}
// do a small update
if _, err = e2ekubectl.RunKubectl(ns, "set", "env", "deployment/httpd-deployment", "foo=bar"); err != nil {
framework.Failf("kubectl failed set env for deployment")