Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 4 additions & 20 deletions test/rekt/features/apiserversource/skip_permissions.go
Original file line number Diff line number Diff line change
Expand Up @@ -255,25 +255,17 @@ func SkipPermissionsEnabledWithRBACFeature() *feature.Feature {

var obj *appsv1.Deployment
for _, deployment := range objs.Items {
if strings.HasPrefix(deployment.Name, "apiserversource-two-") {
if strings.HasPrefix(deployment.Name, "apiserversource-two-") && deployment.Status.ReadyReplicas >= 1 {
obj = &deployment
break
}
}

if obj == nil {
t.Fatal("could not found a Deployment prefixed with 'apiserversource-two-'")
t.Fatal("could not find a Deployment prefixed with 'apiserversource-two-' with at least 1 readyReplica")
return
}

if obj.Status.ReadyReplicas != 1 {
t.Fatalf("Expected 1 ready replica, got: %d", obj.Status.ReadyReplicas)
}

if obj.Status.UnavailableReplicas != 0 {
t.Fatalf("Expected 0 unavailable replica, got: %d", obj.Status.UnavailableReplicas)
}

for _, envvar := range obj.Spec.Template.Spec.Containers[0].Env {
if envvar.Name == "K_SOURCE_CONFIG" {
var config apiserver.Config
Expand Down Expand Up @@ -482,25 +474,17 @@ func SkipPermissionsDisabledWithRBACFeature() *feature.Feature {

var obj *appsv1.Deployment
for _, deployment := range objs.Items {
if strings.HasPrefix(deployment.Name, "apiserversource-four-") {
if strings.HasPrefix(deployment.Name, "apiserversource-four-") && deployment.Status.ReadyReplicas >= 1 {
obj = &deployment
break
}
}

if obj == nil {
t.Fatal("could not found a Deployment prefixed with 'apiserversource-four-'")
t.Fatal("could not find a Deployment prefixed with 'apiserversource-four-' with at least 1 readyReplica")
return
}

if obj.Status.ReadyReplicas != 1 {
t.Fatalf("Expected 1 ready replica, got: %d", obj.Status.ReadyReplicas)
}

if obj.Status.UnavailableReplicas != 0 {
t.Fatalf("Expected 0 unavailable replica, got: %d", obj.Status.UnavailableReplicas)
}

for _, envvar := range obj.Spec.Template.Spec.Containers[0].Env {
if envvar.Name == "K_SOURCE_CONFIG" {
var config apiserver.Config
Expand Down
Loading