You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Pin reference for component-config-tutorial to use v3 of the kubebuilder book documentation since it is no longer supported in v4
* Updated link reference to kuttl to chainsaw
* Removed link to structured log in logging.md as the site is no longer available (www.client9.com)
Signed-off-by: Jordi Gil <[email protected]>
Copy file name to clipboardExpand all lines: website/content/en/docs/building-operators/golang/migration.md
+3-4
Original file line number
Diff line number
Diff line change
@@ -156,7 +156,7 @@ type MemcachedList struct {...}
156
156
157
157
### Webhooks
158
158
159
-
SDK version `1.0.0` and later has support for webhooks by the CLI. If your project doesn't require any webhooks, you can skip this section. However, if you have been using it via customizations in your project, you should use the tool to re-scaffold the webhooks.
159
+
SDK version `1.0.0` and later has support for webhooks by the CLI. If your project doesn't require any webhooks, you can skip this section. However, if you have been using it via customizations in your project, you should use the tool to re-scaffold the webhooks.
160
160
161
161
A webhook can only be scaffolded for a pre-existent API in your project. Then, for each case you will run the command `operator-sdk create webhook` providing the `--group`, `--kind` and `version` of the API based on the flags that need to be used.
162
162
@@ -225,7 +225,7 @@ In the Memcached example, they look like the following:
To update `config/rbac/role.yaml` after changing the markers, run `make manifests`.
228
+
To update `config/rbac/role.yaml` after changing the markers, run `make manifests`.
229
229
230
230
By default, new projects are cluster-scoped (i.e. they have cluster-scoped permissions and watch all namespaces). Read the [operator scope documentation][operator-scope] for more information about changing the scope of your operator.
By using the [InstrumentedEnqueueRequestForObject](https://pkg.go.dev/github.com/operator-framework/[email protected]/handler?tab=doc#InstrumentedEnqueueRequestForObject) you will be able to export metrics from your Custom Resources. In our example, it would look like:
333
+
By using the [InstrumentedEnqueueRequestForObject](https://pkg.go.dev/github.com/operator-framework/[email protected]/handler?tab=doc#InstrumentedEnqueueRequestForObject) you will be able to export metrics from your Custom Resources. In our example, it would look like:
334
334
335
335
```go
336
336
import (
@@ -445,7 +445,6 @@ For further steps regarding the deployment of the operator, creation of custom r
Copy file name to clipboardExpand all lines: website/content/en/docs/building-operators/golang/references/logging.md
+1-2
Original file line number
Diff line number
Diff line change
@@ -6,7 +6,7 @@ weight: 20
6
6
7
7
# Overview
8
8
9
-
Operator SDK-generated operators use the [`logr`][godoc_logr] interface to log. This log interface has several backends such as [`zap`][repo_zapr], which the SDK uses in generated code by default. [`logr.Logger`][godoc_logr_logger] exposes [structured logging][site_struct_logging] methods that help create machine-readable logs and adding a wealth of information to log records.
9
+
Operator SDK-generated operators use the [`logr`][godoc_logr] interface to log. This log interface has several backends such as [`zap`][repo_zapr], which the SDK uses in generated code by default. [`logr.Logger`][godoc_logr_logger] exposes structured logging methods that help create machine-readable logs and adding a wealth of information to log records.
10
10
11
11
## Default zap logger
12
12
@@ -258,7 +258,6 @@ If you do not want to use `logr` as your logging tool, you can remove `logr`-spe
Copy file name to clipboardExpand all lines: website/content/en/docs/building-operators/golang/testing.md
+5-5
Original file line number
Diff line number
Diff line change
@@ -1,7 +1,7 @@
1
1
---
2
2
title: Testing your Operator project
3
3
linkTitle: Testing with EnvTest
4
-
description: Learn how to ensure the quality of your Operator project
4
+
description: Learn how to ensure the quality of your Operator project
5
5
weight: 70
6
6
---
7
7
@@ -20,13 +20,13 @@ These tests are runnable as native Go tests:
20
20
go test controllers/ -v -ginkgo.v
21
21
```
22
22
23
-
The projects generated by using the SDK tool have a Makefile which contains the target tests which executes when you run `make test`. Note that this target will also execute when you run `make docker-build IMG=<some-registry>/<project-name>:<tag>`.
23
+
The projects generated by using the SDK tool have a Makefile which contains the target tests which executes when you run `make test`. Note that this target will also execute when you run `make docker-build IMG=<some-registry>/<project-name>:<tag>`.
24
24
25
-
Operator SDK adopted this stack to write tests for its operators. It might be useful to check [writing controller tests][writing-controller-tests] documentation and examples to learn how to better write tests for your operator. See, for example, that [controller-runtime](https://github.com/kubernetes-sigs/controller-runtime) is covered by tests using the same stack as well.
25
+
Operator SDK adopted this stack to write tests for its operators. It might be useful to check [writing controller tests][writing-controller-tests] documentation and examples to learn how to better write tests for your operator. See, for example, that [controller-runtime](https://github.com/kubernetes-sigs/controller-runtime) is covered by tests using the same stack as well.
26
26
27
27
## e2e Integration tests
28
28
29
-
-**For Golang-based operators**: you can create the e2e tests using Go. See the `test` directory for the Memcached sample
29
+
-**For Golang-based operators**: you can create the e2e tests using Go. See the `test` directory for the Memcached sample
30
30
under the [testdata/go/v3/memcached-operator][sample] to see an example of e2e tests.
31
31
-**For Ansible-based operators**: you can use [Molecule][molecule], an Ansible testing framework. For further information see [Testing with Molecule][molecule-tests].
32
32
-**For Helm-based operators**: you can also use [Chart tests][helm-chart-tests].
@@ -62,4 +62,4 @@ To implement application-specific tests, the SDK's test harness, [scorecard][sco
Copy file name to clipboardExpand all lines: website/content/en/docs/upgrading-sdk-version/v1.21.0.md
+1-1
Original file line number
Diff line number
Diff line change
@@ -18,7 +18,7 @@ such as `api/webhook_suitetest.go` directory as for your controllers in `control
18
18
19
19
_See [#4863](https://github.com/operator-framework/operator-sdk/pull/4863) for more details._
20
20
21
-
## For Golang-based operators, update Dockerfile if you are using the [declarative/v1 plugin](https://book.kubebuilder.io/plugins/declarative-v1.html)
21
+
## For Golang-based operators, update Dockerfile if you are using the [declarative/v1 plugin](https://book-v3.book.kubebuilder.io/plugins/declarative-v1.html)
22
22
23
23
If you are using the declarative/v1 plugin for your scaffolds, then following the steps to update the Dockerfile.
Copy file name to clipboardExpand all lines: website/content/en/docs/upgrading-sdk-version/v1.7.0.md
+23-23
Original file line number
Diff line number
Diff line change
@@ -5,13 +5,13 @@ weight: 998993000
5
5
6
6
## Add the manager config patch to config/default/kustomization.yaml
7
7
8
-
The scaffolded `--config` flag was not added to either ansible-/helm-operator binary when [config file](https://master.book.kubebuilder.io/component-config-tutorial/tutorial.html) support was originally added, so does not currently work. The `--config` flag supports configuration of both binaries by file; this method of configuration only applies to the underlying [controller manager](https://pkg.go.dev/sigs.k8s.io/controller-runtime/pkg/manager#Manager), not the operator as a whole. To optionally configure the operator's Deployment with a config file, make the following update to config/default/kustomization.yaml:
9
-
```diff
10
-
# If you want your controller-manager to expose the /metrics # endpoint w/o any authn/z, please comment the following line.
11
-
- manager_auth_proxy_patch.yaml
12
-
+# Mount the controller config file for loading manager configurations
13
-
+# through a ComponentConfig type
14
-
+- manager_config_patch.yaml
8
+
The scaffolded `--config` flag was not added to either ansible-/helm-operator binary when [config file](https://book-v3.book.kubebuilder.io/component-config-tutorial/tutorial.html) support was originally added, so does not currently work. The `--config` flag supports configuration of both binaries by file; this method of configuration only applies to the underlying [controller manager](https://pkg.go.dev/sigs.k8s.io/controller-runtime/pkg/manager#Manager), not the operator as a whole. To optionally configure the operator's Deployment with a config file, make the following update to config/default/kustomization.yaml:
9
+
```diff
10
+
# If you want your controller-manager to expose the /metrics # endpoint w/o any authn/z, please comment the following line.
11
+
- manager_auth_proxy_patch.yaml
12
+
+# Mount the controller config file for loading manager configurations
13
+
+# through a ComponentConfig type
14
+
+- manager_config_patch.yaml
15
15
```
16
16
This feature is opt-in: flags can be used as-is or to override config file values.
17
17
@@ -32,16 +32,16 @@ rules: \- apiGroups:
32
32
- - coordination.k8s.io
33
33
resources:
34
34
- configmaps
35
-
+ verbs:
36
-
+- get
37
-
+- list
38
-
+- watch
39
-
+- create
40
-
+- update
41
-
+- patch
42
-
+- delete
43
-
+- apiGroups:
44
-
+- coordination.k8s.io
35
+
+ verbs:
36
+
+- get
37
+
+- list
38
+
+- watch
39
+
+- create
40
+
+- update
41
+
+- patch
42
+
+- delete
43
+
+- apiGroups:
44
+
+- coordination.k8s.io
45
45
+ resources:
46
46
- leases
47
47
verbs:
@@ -56,11 +56,11 @@ Importing `setup-envtest.sh` needs bash, so your Makefile's `SHELL` variable sho
56
56
```diff
57
57
else GOBIN=$(shell go env GOBIN)
58
58
endif
59
-
+# Setting SHELL to bash allows bash commands to be executed by recipes.
60
-
+# This is a requirement for 'setup-envtest.sh' in the test target.
61
-
+# Options are set to exit when a recipe line exits non-zero or a piped command fails.
62
-
+SHELL = /usr/bin/env bash -o pipefail
63
-
+.SHELLFLAGS = -ec
64
-
+ all: build
59
+
+# Setting SHELL to bash allows bash commands to be executed by recipes.
60
+
+# This is a requirement for 'setup-envtest.sh' in the test target.
61
+
+# Options are set to exit when a recipe line exits non-zero or a piped command fails.
62
+
+SHELL = /usr/bin/env bash -o pipefail
63
+
+.SHELLFLAGS = -ec
64
+
+ all: build
65
65
```
66
66
_See [#4835](https://github.com/operator-framework/operator-sdk/pull/4835) for more details._
Copy file name to clipboardExpand all lines: website/content/en/docs/upgrading-sdk-version/v1.7.1.md
+23-23
Original file line number
Diff line number
Diff line change
@@ -5,13 +5,13 @@ weight: 998992999
5
5
6
6
## Add the manager config patch to config/default/kustomization.yaml
7
7
8
-
The scaffolded `--config` flag was not added to either ansible-/helm-operator binary when [config file](https://master.book.kubebuilder.io/component-config-tutorial/tutorial.html) support was originally added, so does not currently work. The `--config` flag supports configuration of both binaries by file; this method of configuration only applies to the underlying [controller manager](https://pkg.go.dev/sigs.k8s.io/controller-runtime/pkg/manager#Manager), not the operator as a whole. To optionally configure the operator's Deployment with a config file, make the following update to config/default/kustomization.yaml:
9
-
```diff
10
-
# If you want your controller-manager to expose the /metrics # endpoint w/o any authn/z, please comment the following line.
11
-
\- manager_auth_proxy_patch.yaml
12
-
+# Mount the controller config file for loading manager configurations
13
-
+# through a ComponentConfig type
14
-
+- manager_config_patch.yaml
8
+
The scaffolded `--config` flag was not added to either ansible-/helm-operator binary when [config file](https://book-v3.book.kubebuilder.io/component-config-tutorial/tutorial.html) support was originally added, so does not currently work. The `--config` flag supports configuration of both binaries by file; this method of configuration only applies to the underlying [controller manager](https://pkg.go.dev/sigs.k8s.io/controller-runtime/pkg/manager#Manager), not the operator as a whole. To optionally configure the operator's Deployment with a config file, make the following update to config/default/kustomization.yaml:
9
+
```diff
10
+
# If you want your controller-manager to expose the /metrics # endpoint w/o any authn/z, please comment the following line.
11
+
\- manager_auth_proxy_patch.yaml
12
+
+# Mount the controller config file for loading manager configurations
13
+
+# through a ComponentConfig type
14
+
+- manager_config_patch.yaml
15
15
```
16
16
This feature is opt-in: flags can be used as-is or to override config file values.
17
17
@@ -33,16 +33,16 @@ rules:
33
33
- - coordination.k8s.io
34
34
resources:
35
35
- configmaps
36
-
+ verbs:
37
-
+- get
38
-
+- list
39
-
+- watch
40
-
+- create
41
-
+- update
42
-
+- patch
43
-
+- delete
44
-
+- apiGroups:
45
-
+- coordination.k8s.io
36
+
+ verbs:
37
+
+- get
38
+
+- list
39
+
+- watch
40
+
+- create
41
+
+- update
42
+
+- patch
43
+
+- delete
44
+
+- apiGroups:
45
+
+- coordination.k8s.io
46
46
+ resources:
47
47
- leases
48
48
verbs:
@@ -57,12 +57,12 @@ Importing `setup-envtest.sh` needs bash, so your Makefile's `SHELL` variable sho
57
57
```diff
58
58
else GOBIN=$(shell go env GOBIN)
59
59
endif
60
-
+# Setting SHELL to bash allows bash commands to be executed by recipes.
61
-
+# This is a requirement for 'setup-envtest.sh' in the test target.
62
-
+# Options are set to exit when a recipe line exits non-zero or a piped command fails.
63
-
+SHELL = /usr/bin/env bash -o pipefail
64
-
+.SHELLFLAGS = -ec
65
-
+ all: build
60
+
+# Setting SHELL to bash allows bash commands to be executed by recipes.
61
+
+# This is a requirement for 'setup-envtest.sh' in the test target.
62
+
+# Options are set to exit when a recipe line exits non-zero or a piped command fails.
63
+
+SHELL = /usr/bin/env bash -o pipefail
64
+
+.SHELLFLAGS = -ec
65
+
+ all: build
66
66
```
67
67
_See [#4835](https://github.com/operator-framework/operator-sdk/pull/4835) for more details._
0 commit comments