Skip to content

Commit

Permalink
Add gke-autopilot namespaces to default ignored namespaces (#2098)
Browse files Browse the repository at this point in the history
* Add gke namespaces to ignored namespaces to fix e2e tests

* Extract timeout to constant

* Update test/helpers/kubeobjects/deployment/wait.go

Co-authored-by: Andrii Soldatenko <[email protected]>

* Update test/helpers/kubeobjects/deployment/wait.go

Co-authored-by: Andrii Soldatenko <[email protected]>

* Fix linting

---------

Co-authored-by: Andrii Soldatenko <[email protected]>
  • Loading branch information
waodim and andriisoldatenko authored Sep 8, 2023
1 parent 1b2fbda commit f2b7831
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
2 changes: 2 additions & 0 deletions src/api/v1beta1/dynakube/feature_flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,8 @@ func (dk *DynaKube) getDefaultIgnoredNamespaces() []string {
fmt.Sprintf("^%s$", dk.Namespace),
"^kube-.*",
"^openshift(-.*)?",
"^gke-.*",
"^gmp-.*",
}
return defaultIgnoredNamespaces
}
Expand Down
5 changes: 4 additions & 1 deletion test/helpers/kubeobjects/deployment/wait.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ package deployment
import (
"context"
"testing"
"time"

"github.com/stretchr/testify/require"
appsv1 "k8s.io/api/apps/v1"
Expand All @@ -17,6 +18,8 @@ import (
"sigs.k8s.io/e2e-framework/pkg/features"
)

const DeploymentAvailableTimeout = 15 * time.Minute

func WaitFor(name string, namespace string) features.Func {
return func(ctx context.Context, t *testing.T, envConfig *envconf.Config) context.Context {
resources := envConfig.Client().Resources()
Expand All @@ -34,5 +37,5 @@ func WaitFor(name string, namespace string) features.Func {
}

func WaitUntilReady(resource *resources.Resources, deployment *appsv1.Deployment) error {
return wait.For(conditions.New(resource).DeploymentConditionMatch(deployment, appsv1.DeploymentAvailable, corev1.ConditionTrue))
return wait.For(conditions.New(resource).DeploymentConditionMatch(deployment, appsv1.DeploymentAvailable, corev1.ConditionTrue), wait.WithTimeout(DeploymentAvailableTimeout))
}
2 changes: 2 additions & 0 deletions test/testdata/sample-app/pod-base.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,10 @@ spec:
resources:
requests:
memory: 64Mi
ephemeral-storage: 2Gi
limits:
memory: 128Mi
ephemeral-storage: 2Gi
restartPolicy: Always
tolerations:
- key: kubernetes.io/arch
Expand Down

0 comments on commit f2b7831

Please sign in to comment.