Skip to content
Merged
Show file tree
Hide file tree
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
10 changes: 7 additions & 3 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,20 @@ on:
branches:
- main
paths-ignore:
- '**/*.md'
- '**/*.txt'
- "**/*.md"
- "**/*.txt"

permissions:
contents: write
packages: write
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
push-container-image: true
22 changes: 22 additions & 0 deletions pkg/testutil/doc.go
Original file line number Diff line number Diff line change
@@ -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