Skip to content

Commit 30775bb

Browse files
authored
Merge branch 'kubernetes-sigs:master' into master
2 parents 13dd9d2 + f28fa7b commit 30775bb

File tree

11 files changed

+22
-22
lines changed

11 files changed

+22
-22
lines changed

docs/book/src/cronjob-tutorial/writing-tests.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,11 @@ This Status update example above demonstrates a general testing strategy for a c
2323
* Writing stubs for creating test objects
2424
* Isolating changes to an object to test specific controller behavior
2525

26-
## Advanced Examples
26+
<aside class="note">
27+
<h1>Examples</h1>
2728

28-
There are more involved examples of using envtest to rigorously test controller behavior. Examples include:
29+
You can use the plugin [DeployImage](../plugins/available/deploy-image-plugin-v1-alpha.md) to check examples. This plugin allows users to scaffold API/Controllers to deploy and manage an Operand (image) on the cluster following the guidelines and best practices. It abstracts the complexities of achieving this goal while allowing users to customize the generated code.
2930

30-
* Azure Databricks Operator: see their fully fleshed-out
31-
[`suite_test.go`](https://github.com/microsoft/azure-databricks-operator/blob/0f722a710fea06b86ecdccd9455336ca712bf775/controllers/suite_test.go)
32-
as well as any `*_test.go` file in that directory [like this
33-
one](https://github.com/microsoft/azure-databricks-operator/blob/0f722a710fea06b86ecdccd9455336ca712bf775/controllers/secretscope_controller_test.go).
31+
Therefore, you can check that a test using ENV TEST will be generated for the controller which has the purpose to ensure that the Deployment is created successfully. You can see an example of its code implementation under the `testdata` directory with the [DeployImage](../plugins/available/deploy-image-plugin-v1-alpha.md) samples [here](https://github.com/kubernetes-sigs/kubebuilder/blob/v3.7.0/testdata/project-v4-with-plugins/controllers/busybox_controller_test.go).
32+
33+
</aside>

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ godebug default=go1.23
66

77
require (
88
github.com/gobuffalo/flect v1.0.3
9-
github.com/onsi/ginkgo/v2 v2.23.1
9+
github.com/onsi/ginkgo/v2 v2.23.2
1010
github.com/onsi/gomega v1.36.2
1111
github.com/sirupsen/logrus v1.9.3
1212
github.com/spf13/afero v1.14.0

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@ github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
2424
github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
2525
github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
2626
github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
27-
github.com/onsi/ginkgo/v2 v2.23.1 h1:Ox0cOPv/t8RzKJUfDo9ZKtRvBOJY369sFJnl00CjqwY=
28-
github.com/onsi/ginkgo/v2 v2.23.1/go.mod h1:zXTP6xIp3U8aVuXN8ENK9IXRaTjFnpVB9mGmaSRvxnM=
27+
github.com/onsi/ginkgo/v2 v2.23.2 h1:LYLd7Wz401p0N7xR8y7WL6D2QZwKpbirDg0EVIvzvMM=
28+
github.com/onsi/ginkgo/v2 v2.23.2/go.mod h1:zXTP6xIp3U8aVuXN8ENK9IXRaTjFnpVB9mGmaSRvxnM=
2929
github.com/onsi/gomega v1.36.2 h1:koNYke6TVk6ZmnyHrCXba/T/MoLBXFjeC1PtvYgw0A8=
3030
github.com/onsi/gomega v1.36.2/go.mod h1:DdwyADRjrc825LhMEkD76cHR5+pUnjhUN8GlHlRPHzY=
3131
github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e/go.mod h1:pJLUxLENpZxwdsKMEsNbx1VGcRFpLqf3715MtcvvzbA=

pkg/plugins/golang/deploy-image/v1alpha1/scaffolds/internal/templates/controllers/controller-test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,9 +69,9 @@ import (
6969
"os"
7070
"time"
7171
72-
//nolint:golint
73-
. "github.com/onsi/ginkgo/v2"
74-
. "github.com/onsi/gomega"
72+
. "github.com/onsi/ginkgo/v2"
73+
. "github.com/onsi/gomega"
74+
7575
appsv1 "k8s.io/api/apps/v1"
7676
corev1 "k8s.io/api/core/v1"
7777
"k8s.io/apimachinery/pkg/api/errors"

pkg/plugins/golang/v4/scaffolds/internal/templates/controllers/controller_suitetest.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -138,8 +138,8 @@ import (
138138
"path/filepath"
139139
"testing"
140140
141-
. "github.com/onsi/ginkgo/v2"
142-
. "github.com/onsi/gomega"
141+
. "github.com/onsi/ginkgo/v2"
142+
. "github.com/onsi/gomega"
143143
144144
"k8s.io/client-go/kubernetes/scheme"
145145
"k8s.io/client-go/rest"

pkg/plugins/golang/v4/scaffolds/internal/templates/test/e2e/suite.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,8 @@ import (
5050
"os"
5151
"os/exec"
5252
53-
. "github.com/onsi/ginkgo/v2"
54-
. "github.com/onsi/gomega"
53+
. "github.com/onsi/ginkgo/v2"
54+
. "github.com/onsi/gomega"
5555
5656
"{{ .Repo }}/test/utils"
5757
)

pkg/plugins/golang/v4/scaffolds/internal/templates/webhooks/webhook_suitetest.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -190,8 +190,8 @@ import (
190190
"testing"
191191
"time"
192192
193-
. "github.com/onsi/ginkgo/v2"
194-
. "github.com/onsi/gomega"
193+
. "github.com/onsi/ginkgo/v2"
194+
. "github.com/onsi/gomega"
195195
196196
"k8s.io/client-go/kubernetes/scheme"
197197
"k8s.io/client-go/rest"

testdata/project-v4-multigroup/internal/controller/example.com/busybox_controller_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@ import (
2121
"os"
2222
"time"
2323

24-
//nolint:golint
2524
. "github.com/onsi/ginkgo/v2"
2625
. "github.com/onsi/gomega"
26+
2727
appsv1 "k8s.io/api/apps/v1"
2828
corev1 "k8s.io/api/core/v1"
2929
"k8s.io/apimachinery/pkg/api/errors"

testdata/project-v4-multigroup/internal/controller/example.com/memcached_controller_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@ import (
2121
"os"
2222
"time"
2323

24-
//nolint:golint
2524
. "github.com/onsi/ginkgo/v2"
2625
. "github.com/onsi/gomega"
26+
2727
appsv1 "k8s.io/api/apps/v1"
2828
corev1 "k8s.io/api/core/v1"
2929
"k8s.io/apimachinery/pkg/api/errors"

testdata/project-v4-with-plugins/internal/controller/busybox_controller_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@ import (
2121
"os"
2222
"time"
2323

24-
//nolint:golint
2524
. "github.com/onsi/ginkgo/v2"
2625
. "github.com/onsi/gomega"
26+
2727
appsv1 "k8s.io/api/apps/v1"
2828
corev1 "k8s.io/api/core/v1"
2929
"k8s.io/apimachinery/pkg/api/errors"

testdata/project-v4-with-plugins/internal/controller/memcached_controller_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@ import (
2121
"os"
2222
"time"
2323

24-
//nolint:golint
2524
. "github.com/onsi/ginkgo/v2"
2625
. "github.com/onsi/gomega"
26+
2727
appsv1 "k8s.io/api/apps/v1"
2828
corev1 "k8s.io/api/core/v1"
2929
"k8s.io/apimachinery/pkg/api/errors"

0 commit comments

Comments
 (0)