diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index bf93950c..01f55526 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -5,8 +5,8 @@ on: branches: - main paths-ignore: - - '**/*.md' - - '**/*.txt' + - "**/*.md" + - "**/*.txt" permissions: contents: write @@ -14,7 +14,11 @@ permissions: security-events: write jobs: + build: + name: Build + uses: ./.github/workflows/_reusable-build-changed.yaml + run: uses: ./.github/workflows/build-and-release.yaml with: - push-container-image: true \ No newline at end of file + push-container-image: true diff --git a/pkg/testutil/doc.go b/pkg/testutil/doc.go new file mode 100644 index 00000000..f7d62cfa --- /dev/null +++ b/pkg/testutil/doc.go @@ -0,0 +1,22 @@ +// Package testutil provides test utility for Kubernetes operators. The amin +// support is around envtest and resource watching logic, where you can use +// the following code to wait for the matching resource to appear. +// +// Example: +// +// watcher.SetCmpOpts(testutil.CompareSpecOnly()...) +// expectedSts := &appsv1.StatefulSet{ +// Spec: appsv1.StatefulSetSpec{Replicas: ptr.To(int32(3))}, +// } +// expectedSvc := &corev1.Service{...} +// +// err := watcher.WaitForMatch(expectedSts, expectedSvc) +// if err != nil { +// t.Errorf("Resources never reached expected state: %v", err) +// } +// +// This utility allows resource matching logic to be fully declarative, and +// while integration tests are more expensive to run in terms of time spent, +// this makes sure that there is no unnecessary sleep logic, and all the tests +// can be run in an event driven fashion. +package testutil