16 |
17 | {{ end }}
18 |
--------------------------------------------------------------------------------
/testdata/go/v4/memcached-operator/config/prometheus/monitor_tls_patch.yaml:
--------------------------------------------------------------------------------
1 | # Patch for Prometheus ServiceMonitor to enable secure TLS configuration
2 | # using certificates managed by cert-manager
3 | - op: replace
4 | path: /spec/endpoints/0/tlsConfig
5 | value:
6 | # SERVICE_NAME and SERVICE_NAMESPACE will be substituted by kustomize
7 | serverName: SERVICE_NAME.SERVICE_NAMESPACE.svc
8 | insecureSkipVerify: false
9 | ca:
10 | secret:
11 | name: metrics-server-cert
12 | key: ca.crt
13 | cert:
14 | secret:
15 | name: metrics-server-cert
16 | key: tls.crt
17 | keySecret:
18 | name: metrics-server-cert
19 | key: tls.key
20 |
--------------------------------------------------------------------------------
/website/content/en/build/images/arrow.svg:
--------------------------------------------------------------------------------
1 |
2 |
13 |
--------------------------------------------------------------------------------
/website/content/en/docs/cli/operator-sdk_completion_powershell.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: "operator-sdk completion powershell"
3 | ---
4 | ## operator-sdk completion powershell
5 |
6 | Load powershell completions
7 |
8 | ```
9 | operator-sdk completion powershell [flags]
10 | ```
11 |
12 | ### Options
13 |
14 | ```
15 | -h, --help help for powershell
16 | ```
17 |
18 | ### Options inherited from parent commands
19 |
20 | ```
21 | --plugins strings plugin keys to be used for this subcommand execution
22 | --verbose Enable verbose logging
23 | ```
24 |
25 | ### SEE ALSO
26 |
27 | * [operator-sdk completion](../operator-sdk_completion) - Load completions for the specified shell
28 |
29 |
--------------------------------------------------------------------------------
/testdata/go/v4/memcached-operator/config/webhook/manifests.yaml:
--------------------------------------------------------------------------------
1 | ---
2 | apiVersion: admissionregistration.k8s.io/v1
3 | kind: MutatingWebhookConfiguration
4 | metadata:
5 | name: mutating-webhook-configuration
6 | webhooks:
7 | - admissionReviewVersions:
8 | - v1
9 | clientConfig:
10 | service:
11 | name: webhook-service
12 | namespace: system
13 | path: /mutate-cache-example-com-v1alpha1-memcached
14 | failurePolicy: Fail
15 | name: mmemcached-v1alpha1.kb.io
16 | rules:
17 | - apiGroups:
18 | - cache.example.com
19 | apiVersions:
20 | - v1alpha1
21 | operations:
22 | - CREATE
23 | - UPDATE
24 | resources:
25 | - memcacheds
26 | sideEffects: None
27 |
--------------------------------------------------------------------------------
/testdata/go/v4/monitoring/memcached-operator/config/prometheus/monitor_tls_patch.yaml:
--------------------------------------------------------------------------------
1 | # Patch for Prometheus ServiceMonitor to enable secure TLS configuration
2 | # using certificates managed by cert-manager
3 | - op: replace
4 | path: /spec/endpoints/0/tlsConfig
5 | value:
6 | # SERVICE_NAME and SERVICE_NAMESPACE will be substituted by kustomize
7 | serverName: SERVICE_NAME.SERVICE_NAMESPACE.svc
8 | insecureSkipVerify: false
9 | ca:
10 | secret:
11 | name: metrics-server-cert
12 | key: ca.crt
13 | cert:
14 | secret:
15 | name: metrics-server-cert
16 | key: tls.crt
17 | keySecret:
18 | name: metrics-server-cert
19 | key: tls.key
20 |
--------------------------------------------------------------------------------
/internal/generate/testdata/go/api/shared/doc.go:
--------------------------------------------------------------------------------
1 | // Copyright 2021 The Operator-SDK Authors
2 | //
3 | // Licensed under the Apache License, Version 2.0 (the "License");
4 | // you may not use this file except in compliance with the License.
5 | // You may obtain a copy of the License at
6 | //
7 | // http://www.apache.org/licenses/LICENSE-2.0
8 | //
9 | // Unless required by applicable law or agreed to in writing, software
10 | // distributed under the License is distributed on an "AS IS" BASIS,
11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | // See the License for the specific language governing permissions and
13 | // limitations under the License.
14 |
15 | package shared
16 |
--------------------------------------------------------------------------------
/testdata/go/v4/memcached-operator/.devcontainer/devcontainer.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "Kubebuilder DevContainer",
3 | "image": "golang:1.24",
4 | "features": {
5 | "ghcr.io/devcontainers/features/docker-in-docker:2": {},
6 | "ghcr.io/devcontainers/features/git:1": {}
7 | },
8 |
9 | "runArgs": ["--network=host"],
10 |
11 | "customizations": {
12 | "vscode": {
13 | "settings": {
14 | "terminal.integrated.shell.linux": "/bin/bash"
15 | },
16 | "extensions": [
17 | "ms-kubernetes-tools.vscode-kubernetes-tools",
18 | "ms-azuretools.vscode-docker"
19 | ]
20 | }
21 | },
22 |
23 | "onCreateCommand": "bash .devcontainer/post-install.sh"
24 | }
25 |
26 |
--------------------------------------------------------------------------------
/testdata/go/v4/monitoring/memcached-operator/.devcontainer/devcontainer.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "Kubebuilder DevContainer",
3 | "image": "golang:1.24",
4 | "features": {
5 | "ghcr.io/devcontainers/features/docker-in-docker:2": {},
6 | "ghcr.io/devcontainers/features/git:1": {}
7 | },
8 |
9 | "runArgs": ["--network=host"],
10 |
11 | "customizations": {
12 | "vscode": {
13 | "settings": {
14 | "terminal.integrated.shell.linux": "/bin/bash"
15 | },
16 | "extensions": [
17 | "ms-kubernetes-tools.vscode-kubernetes-tools",
18 | "ms-azuretools.vscode-docker"
19 | ]
20 | }
21 | },
22 |
23 | "onCreateCommand": "bash .devcontainer/post-install.sh"
24 | }
25 |
26 |
--------------------------------------------------------------------------------
/testdata/go/v4/monitoring/memcached-operator/config/webhook/manifests.yaml:
--------------------------------------------------------------------------------
1 | ---
2 | apiVersion: admissionregistration.k8s.io/v1
3 | kind: MutatingWebhookConfiguration
4 | metadata:
5 | name: mutating-webhook-configuration
6 | webhooks:
7 | - admissionReviewVersions:
8 | - v1
9 | clientConfig:
10 | service:
11 | name: webhook-service
12 | namespace: system
13 | path: /mutate-cache-example-com-v1alpha1-memcached
14 | failurePolicy: Fail
15 | name: mmemcached-v1alpha1.kb.io
16 | rules:
17 | - apiGroups:
18 | - cache.example.com
19 | apiVersions:
20 | - v1alpha1
21 | operations:
22 | - CREATE
23 | - UPDATE
24 | resources:
25 | - memcacheds
26 | sideEffects: None
27 |
--------------------------------------------------------------------------------
/testdata/helm/memcached-operator/bundle/manifests/memcached-operator-memcached-editor-role_rbac.authorization.k8s.io_v1_clusterrole.yaml:
--------------------------------------------------------------------------------
1 | apiVersion: rbac.authorization.k8s.io/v1
2 | kind: ClusterRole
3 | metadata:
4 | creationTimestamp: null
5 | labels:
6 | app.kubernetes.io/managed-by: kustomize
7 | app.kubernetes.io/name: memcached-operator
8 | name: memcached-operator-memcached-editor-role
9 | rules:
10 | - apiGroups:
11 | - cache.example.com
12 | resources:
13 | - memcacheds
14 | verbs:
15 | - create
16 | - delete
17 | - get
18 | - list
19 | - patch
20 | - update
21 | - watch
22 | - apiGroups:
23 | - cache.example.com
24 | resources:
25 | - memcacheds/status
26 | verbs:
27 | - get
28 |
--------------------------------------------------------------------------------
/website/content/en/docs/cli/operator-sdk_version.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: "operator-sdk version"
3 | ---
4 | ## operator-sdk version
5 |
6 | Print the operator-sdk version
7 |
8 | ### Synopsis
9 |
10 | Print the operator-sdk version
11 |
12 | ```
13 | operator-sdk version [flags]
14 | ```
15 |
16 | ### Examples
17 |
18 | ```
19 | operator-sdk version
20 | ```
21 |
22 | ### Options
23 |
24 | ```
25 | -h, --help help for version
26 | ```
27 |
28 | ### Options inherited from parent commands
29 |
30 | ```
31 | --plugins strings plugin keys to be used for this subcommand execution
32 | --verbose Enable verbose logging
33 | ```
34 |
35 | ### SEE ALSO
36 |
37 | * [operator-sdk](../operator-sdk) -
38 |
39 |
--------------------------------------------------------------------------------
/website/content/en/docs/upgrading-sdk-version/_index.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: Upgrade SDK Version
3 | weight: 4
4 | description: Guide to upgrading sdk version for your operator
5 | ---
6 |
7 | ## Backwards Compatibility when Upgrading Operator-sdk version
8 |
9 | When upgrading your version of Operator-sdk, it is intended that post-1.0.0 minor versions (i.e. 1.y) are backwards compatible and strictly additive. Therefore, you
10 | only need to re-scaffold your operator with a newer version of Operator-SDK if you wish to take advantage of new features. If you do not wish to use new features,
11 | all that should be required is bumping the operator image dependency (if a Helm or Ansible operator) and rebuilding your operator image.
12 |
--------------------------------------------------------------------------------
/website/content/en/docs/upgrading-sdk-version/v1.9.0.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: v1.9.0
3 | weight: 998991000
4 | ---
5 |
6 | ## The ansible-operator binary will reject the kubeconfig if the server URL contains a path.
7 |
8 | There is currently no workaround other than running the operator as a pod in the cluster (where it will use the internal endpoint). The fix for this issue is currently blocked waiting on a fix to the apimachinery package. Once the upstream issue is merged then a proper fix will be done for ansible-operator. Work on this issue is being tracked here: https://github.com/operator-framework/operator-sdk/issues/4925
9 |
10 | _See [#4987](https://github.com/operator-framework/operator-sdk/pull/4987) for more details._
11 |
--------------------------------------------------------------------------------
/testdata/go/v4/memcached-operator/bundle/manifests/memcached-operator-memcached-editor-role_rbac.authorization.k8s.io_v1_clusterrole.yaml:
--------------------------------------------------------------------------------
1 | apiVersion: rbac.authorization.k8s.io/v1
2 | kind: ClusterRole
3 | metadata:
4 | creationTimestamp: null
5 | labels:
6 | app.kubernetes.io/managed-by: kustomize
7 | app.kubernetes.io/name: memcached-operator
8 | name: memcached-operator-memcached-editor-role
9 | rules:
10 | - apiGroups:
11 | - cache.example.com
12 | resources:
13 | - memcacheds
14 | verbs:
15 | - create
16 | - delete
17 | - get
18 | - list
19 | - patch
20 | - update
21 | - watch
22 | - apiGroups:
23 | - cache.example.com
24 | resources:
25 | - memcacheds/status
26 | verbs:
27 | - get
28 |
--------------------------------------------------------------------------------
/testdata/helm/memcached-operator/helm-charts/memcached/templates/svc.yaml:
--------------------------------------------------------------------------------
1 | apiVersion: v1
2 | kind: Service
3 | metadata:
4 | name: {{ template "memcached.fullname" . }}
5 | namespace: {{ .Release.Namespace }}
6 | labels:
7 | {{ include "memcached.labels" . | indent 4 }}
8 | annotations:
9 | {{ toYaml .Values.serviceAnnotations | indent 4 }}
10 | spec:
11 | clusterIP: None
12 | ports:
13 | - name: memcache
14 | port: 11211
15 | targetPort: memcache
16 | {{- if .Values.metrics.enabled }}
17 | - name: metrics
18 | port: 9150
19 | targetPort: metrics
20 | {{- end }}
21 | selector:
22 | app.kubernetes.io/name: {{ include "memcached.name" . }}
23 | app.kubernetes.io/instance: {{ .Release.Name }}
24 |
--------------------------------------------------------------------------------
/testdata/go/v4/monitoring/memcached-operator/bundle/manifests/memcached-operator-memcached-editor-role_rbac.authorization.k8s.io_v1_clusterrole.yaml:
--------------------------------------------------------------------------------
1 | apiVersion: rbac.authorization.k8s.io/v1
2 | kind: ClusterRole
3 | metadata:
4 | creationTimestamp: null
5 | labels:
6 | app.kubernetes.io/managed-by: kustomize
7 | app.kubernetes.io/name: memcached-operator
8 | name: memcached-operator-memcached-editor-role
9 | rules:
10 | - apiGroups:
11 | - cache.example.com
12 | resources:
13 | - memcacheds
14 | verbs:
15 | - create
16 | - delete
17 | - get
18 | - list
19 | - patch
20 | - update
21 | - watch
22 | - apiGroups:
23 | - cache.example.com
24 | resources:
25 | - memcacheds/status
26 | verbs:
27 | - get
28 |
--------------------------------------------------------------------------------
/website/content/en/docs/upgrading-sdk-version/v1.34.0.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: v1.34.0
3 | weight: 998966000
4 | ---
5 |
6 | ## To fix multi-arch build, replace docker-buildx target in project Makefile
7 |
8 | In the project `Makefile`, replace existing `docker-buildx` target with following definition.
9 |
10 | ```make
11 | docker-buildx: ## Build and push docker image for the manager for cross-platform support
12 | - docker buildx create --name project-v3-builder
13 | docker buildx use project-v3-builder
14 | - docker buildx build --push --platform=$(PLATFORMS) --tag ${IMG} -f Dockerfile .
15 | - docker buildx rm project-v3-builder
16 | ```
17 |
18 | _See [#6661](https://github.com/operator-framework/operator-sdk/pull/6661) for more details._
19 |
--------------------------------------------------------------------------------
/website/content/en/docs/upgrading-sdk-version/v1.37.0.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: v1.37.0
3 | weight: 998963000
4 | ---
5 |
6 | ## Migrate to the Quarkus extension provided bootstrap
7 |
8 | From now on, you can bootstrap your Quarkus-based operator
9 | with the provided Quarkus tools as described in the bootstrapping
10 | instructions - https://github.com/quarkiverse/quarkus-operator-sdk?tab=readme-ov-file#bootstrapping-a-project.
11 |
12 | _See [#6824](https://github.com/operator-framework/operator-sdk/pull/6824) for more details._
13 |
14 | ## Remove hybrid-helm v1-alpha support
15 |
16 | As an operator author you can switch to a go-based operator.
17 |
18 | _See [#6833](https://github.com/operator-framework/operator-sdk/pull/6833) for more details._
19 |
--------------------------------------------------------------------------------
/internal/markers/markers.go:
--------------------------------------------------------------------------------
1 | // Copyright 2019 The Operator-SDK Authors
2 | //
3 | // Licensed under the Apache License, Version 2.0 (the "License");
4 | // you may not use this file except in compliance with the License.
5 | // You may obtain a copy of the License at
6 | //
7 | // http://www.apache.org/licenses/LICENSE-2.0
8 | //
9 | // Unless required by applicable law or agreed to in writing, software
10 | // distributed under the License is distributed on an "AS IS" BASIS,
11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | // See the License for the specific language governing permissions and
13 | // limitations under the License.
14 |
15 | package markers
16 |
17 | const (
18 | Prefix = "operator-sdk"
19 | )
20 |
--------------------------------------------------------------------------------
/website/content/en/docs/building-operators/helm/installation.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: Installation Guide
3 | linkTitle: Installation
4 | weight: 1
5 | ---
6 |
7 | ## Install `operator-sdk`
8 |
9 | Follow the steps in the [installation guide][install-guide] to learn how to install the `operator-sdk` CLI tool.
10 |
11 | ### Additional Prerequisites
12 |
13 | - [docker][docker_tool] version 17.03+.
14 | - [kubectl][kubectl_tool] and access to a Kubernetes cluster of a [compatible version][k8s-version-compat].
15 |
16 |
17 | [install-guide]:/docs/installation/
18 | [docker_tool]:https://docs.docker.com/install/
19 | [kubectl_tool]:https://kubernetes.io/docs/tasks/tools/install-kubectl/
20 | [k8s-version-compat]:/docs/overview#kubernetes-version-compatibility
21 |
--------------------------------------------------------------------------------
/testdata/go/v4/memcached-operator/.devcontainer/post-install.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | set -x
3 |
4 | curl -Lo ./kind https://kind.sigs.k8s.io/dl/latest/kind-linux-amd64
5 | chmod +x ./kind
6 | mv ./kind /usr/local/bin/kind
7 |
8 | curl -L -o kubebuilder https://go.kubebuilder.io/dl/latest/linux/amd64
9 | chmod +x kubebuilder
10 | mv kubebuilder /usr/local/bin/
11 |
12 | KUBECTL_VERSION=$(curl -L -s https://dl.k8s.io/release/stable.txt)
13 | curl -LO "https://dl.k8s.io/release/$KUBECTL_VERSION/bin/linux/amd64/kubectl"
14 | chmod +x kubectl
15 | mv kubectl /usr/local/bin/kubectl
16 |
17 | docker network create -d=bridge --subnet=172.19.0.0/24 kind
18 |
19 | kind version
20 | kubebuilder version
21 | docker --version
22 | go version
23 | kubectl version --client
24 |
--------------------------------------------------------------------------------
/testdata/helm/memcached-operator/helm-charts/memcached/templates/NOTES.txt:
--------------------------------------------------------------------------------
1 | Memcached can be accessed via port 11211 on the following DNS name from within your cluster:
2 | {{ template "memcached.fullname" . }}.{{ .Release.Namespace }}.svc.cluster.local
3 |
4 | If you'd like to test your instance, forward the port locally:
5 |
6 | export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app.kubernetes.io/name={{ include "memcached.name" . }},app.kubernetes.io/instance={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}")
7 | kubectl port-forward $POD_NAME 11211
8 |
9 | In another tab, attempt to set a key:
10 |
11 | $ echo -e 'set mykey 0 60 5\r\nhello\r' | nc localhost 11211
12 |
13 | You should see:
14 |
15 | STORED
16 |
--------------------------------------------------------------------------------
/testdata/go/v4/monitoring/memcached-operator/.devcontainer/post-install.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | set -x
3 |
4 | curl -Lo ./kind https://kind.sigs.k8s.io/dl/latest/kind-linux-amd64
5 | chmod +x ./kind
6 | mv ./kind /usr/local/bin/kind
7 |
8 | curl -L -o kubebuilder https://go.kubebuilder.io/dl/latest/linux/amd64
9 | chmod +x kubebuilder
10 | mv kubebuilder /usr/local/bin/
11 |
12 | KUBECTL_VERSION=$(curl -L -s https://dl.k8s.io/release/stable.txt)
13 | curl -LO "https://dl.k8s.io/release/$KUBECTL_VERSION/bin/linux/amd64/kubectl"
14 | chmod +x kubectl
15 | mv kubectl /usr/local/bin/kubectl
16 |
17 | docker network create -d=bridge --subnet=172.19.0.0/24 kind
18 |
19 | kind version
20 | kubebuilder version
21 | docker --version
22 | go version
23 | kubectl version --client
24 |
--------------------------------------------------------------------------------
/website/scripts/set_menu_version.sh:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 |
3 | # This script updates the hugo config's "version_menu" param
4 | # to the current ${MAJOR}.${MINOR} string.
5 |
6 | DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null 2>&1 && pwd)"
7 | CONFIG_PATH="${DIR}/../config.toml"
8 |
9 | BRANCH_NAME="$(git rev-parse --abbrev-ref HEAD)"
10 | if [[ "$BRANCH_NAME" =~ v[0-9]+\.[0-9]+\.x ]]; then
11 | VERSION_MENU="$(echo $BRANCH_NAME | awk -F. '{ print v$1"."$2 }')"
12 | sed -i -E 's/version_menu = ".+"/version_menu = "'${VERSION_MENU}'"/g' "$CONFIG_PATH"
13 |
14 | # Ensure config.toml was updated.
15 | if ! grep -q "version_menu = \"${VERSION_MENU}\"" "$CONFIG_PATH"; then
16 | echo "$0 failed to update config.toml"
17 | exit 1
18 | fi
19 | fi
20 |
--------------------------------------------------------------------------------
/website/scripts/update_download_url.sh:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 |
3 | # This script updates the operator-sdk download link with the current release version.
4 | # This change should be committed in the prerelease commit.
5 |
6 | set -e
7 |
8 | DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null 2>&1 && pwd)"
9 | DOC_PATH="${DIR}/../content/en/docs/installation/_index.md"
10 |
11 | VERSION="${1?"A Version is required"}"
12 |
13 | TARGET="export OPERATOR_SDK_DL_URL=https://github.com/operator-framework/operator-sdk/releases/download/"
14 |
15 | sed -i -E 's@('"${TARGET}"').+@\1'"${VERSION}"'@g' "$DOC_PATH"
16 |
17 | # Ensure the file was updated.
18 | if ! grep -q "${TARGET}${VERSION}" "$DOC_PATH"; then
19 | echo "$0 failed to update ${DOC_PATH}"
20 | exit 1
21 | fi
22 |
--------------------------------------------------------------------------------
/internal/flags/flags.go:
--------------------------------------------------------------------------------
1 | // Copyright 2019 The Operator-SDK Authors
2 | //
3 | // Licensed under the Apache License, Version 2.0 (the "License");
4 | // you may not use this file except in compliance with the License.
5 | // You may obtain a copy of the License at
6 | //
7 | // http://www.apache.org/licenses/LICENSE-2.0
8 | //
9 | // Unless required by applicable law or agreed to in writing, software
10 | // distributed under the License is distributed on an "AS IS" BASIS,
11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | // See the License for the specific language governing permissions and
13 | // limitations under the License.
14 |
15 | package flags
16 |
17 | // global command-line flags
18 | const (
19 | VerboseOpt = "verbose"
20 | )
21 |
--------------------------------------------------------------------------------
/internal/plugins/helm/v1/scaffolds/doc.go:
--------------------------------------------------------------------------------
1 | /*
2 | Copyright 2018 The Kubernetes Authors.
3 |
4 | Licensed under the Apache License, Version 2.0 (the "License");
5 | you may not use this file except in compliance with the License.
6 | You may obtain a copy of the License at
7 |
8 | http://www.apache.org/licenses/LICENSE-2.0
9 |
10 | Unless required by applicable law or agreed to in writing, software
11 | distributed under the License is distributed on an "AS IS" BASIS,
12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | See the License for the specific language governing permissions and
14 | limitations under the License.
15 | */
16 |
17 | // Package scaffolds contains libraries for scaffolding code to use with helm-operator
18 | package scaffolds
19 |
--------------------------------------------------------------------------------
/.github/dependabot.yml:
--------------------------------------------------------------------------------
1 | version: 2
2 | updates:
3 | - package-ecosystem: docker
4 | directory: "/images/custom-scorecard-tests"
5 | schedule:
6 | interval: daily
7 | - package-ecosystem: docker
8 | directory: "/images/helm-operator"
9 | schedule:
10 | interval: daily
11 | - package-ecosystem: docker
12 | directory: "/images/operator-sdk"
13 | schedule:
14 | interval: daily
15 | - package-ecosystem: docker
16 | directory: "/images/scorecard-test"
17 | schedule:
18 | interval: daily
19 | - package-ecosystem: docker
20 | directory: "/images/scorecard-test-kuttl"
21 | schedule:
22 | interval: daily
23 | - package-ecosystem: "github-actions"
24 | directory: "/"
25 | schedule:
26 | interval: daily
27 |
28 |
--------------------------------------------------------------------------------
/internal/helm/client/doc.go:
--------------------------------------------------------------------------------
1 | // Copyright 2018 The Operator-SDK Authors
2 | //
3 | // Licensed under the Apache License, Version 2.0 (the "License");
4 | // you may not use this file except in compliance with the License.
5 | // You may obtain a copy of the License at
6 | //
7 | // http://www.apache.org/licenses/LICENSE-2.0
8 | //
9 | // Unless required by applicable law or agreed to in writing, software
10 | // distributed under the License is distributed on an "AS IS" BASIS,
11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | // See the License for the specific language governing permissions and
13 | // limitations under the License.
14 |
15 | // Package client provides helper functions for API clients used by the helm
16 | // operator.
17 | package client
18 |
--------------------------------------------------------------------------------
/internal/helm/internal/types/doc.go:
--------------------------------------------------------------------------------
1 | // Copyright 2018 The Operator-SDK Authors
2 | //
3 | // Licensed under the Apache License, Version 2.0 (the "License");
4 | // you may not use this file except in compliance with the License.
5 | // You may obtain a copy of the License at
6 | //
7 | // http://www.apache.org/licenses/LICENSE-2.0
8 | //
9 | // Unless required by applicable law or agreed to in writing, software
10 | // distributed under the License is distributed on an "AS IS" BASIS,
11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | // See the License for the specific language governing permissions and
13 | // limitations under the License.
14 |
15 | // Package types contains types used by various components of the Helm
16 | // operator
17 | package types
18 |
--------------------------------------------------------------------------------
/testdata/go/v4/monitoring/memcached-operator/docs/monitoring/metrics.md:
--------------------------------------------------------------------------------
1 | # Operator Metrics
2 | This document aims to help users that are not familiar with metrics exposed by this operator.
3 | The metrics documentation is auto-generated by the utility tool "monitoring/metricsdocs" and reflects all of the metrics that are exposed by the operator.
4 |
5 | ## Operator Metrics List
6 | ### memcached_deployment_size_undesired_count_total
7 | Total number of times the deployment size was not as desired. Type: Counter.
8 | ## Developing new metrics
9 | After developing new metrics or changing old ones, please run "make generate-metricsdocs" to regenerate this document.
10 |
11 | If you feel that the new metric doesn't follow these rules, please change "monitoring/metricsdocs" according to your needs.
12 |
--------------------------------------------------------------------------------
/testdata/go/v4/memcached-operator/config/crd/kustomization.yaml:
--------------------------------------------------------------------------------
1 | # This kustomization.yaml is not intended to be run by itself,
2 | # since it depends on service name and namespace that are out of this kustomize package.
3 | # It should be run by config/default
4 | resources:
5 | - bases/cache.example.com_memcacheds.yaml
6 | # +kubebuilder:scaffold:crdkustomizeresource
7 |
8 | patches:
9 | # [WEBHOOK] To enable webhook, uncomment all the sections with [WEBHOOK] prefix.
10 | # patches here are for enabling the conversion webhook for each CRD
11 | # +kubebuilder:scaffold:crdkustomizewebhookpatch
12 |
13 | # [WEBHOOK] To enable webhook, uncomment the following section
14 | # the following config is for teaching kustomize how to do kustomization for CRDs.
15 | #configurations:
16 | #- kustomizeconfig.yaml
17 |
--------------------------------------------------------------------------------
/testdata/helm/memcached-operator/bundle/manifests/memcached-operator-controller-manager-metrics-monitor_monitoring.coreos.com_v1_servicemonitor.yaml:
--------------------------------------------------------------------------------
1 | apiVersion: monitoring.coreos.com/v1
2 | kind: ServiceMonitor
3 | metadata:
4 | labels:
5 | app.kubernetes.io/managed-by: kustomize
6 | app.kubernetes.io/name: memcached-operator
7 | control-plane: controller-manager
8 | name: memcached-operator-controller-manager-metrics-monitor
9 | spec:
10 | endpoints:
11 | - bearerTokenFile: /var/run/secrets/kubernetes.io/serviceaccount/token
12 | path: /metrics
13 | port: https
14 | scheme: https
15 | tlsConfig:
16 | insecureSkipVerify: true
17 | selector:
18 | matchLabels:
19 | app.kubernetes.io/name: memcached-operator
20 | control-plane: controller-manager
21 |
--------------------------------------------------------------------------------
/testdata/go/v4/memcached-operator/bundle.Dockerfile:
--------------------------------------------------------------------------------
1 | FROM scratch
2 |
3 | # Core bundle labels.
4 | LABEL operators.operatorframework.io.bundle.mediatype.v1=registry+v1
5 | LABEL operators.operatorframework.io.bundle.manifests.v1=manifests/
6 | LABEL operators.operatorframework.io.bundle.metadata.v1=metadata/
7 | LABEL operators.operatorframework.io.bundle.package.v1=memcached-operator
8 | LABEL operators.operatorframework.io.bundle.channels.v1=alpha
9 |
10 | # Labels for testing.
11 | LABEL operators.operatorframework.io.test.mediatype.v1=scorecard+v1
12 | LABEL operators.operatorframework.io.test.config.v1=tests/scorecard/
13 |
14 | # Copy files to locations specified by labels.
15 | COPY bundle/manifests /manifests/
16 | COPY bundle/metadata /metadata/
17 | COPY bundle/tests/scorecard /tests/scorecard/
18 |
--------------------------------------------------------------------------------
/testdata/helm/memcached-operator/bundle.Dockerfile:
--------------------------------------------------------------------------------
1 | FROM scratch
2 |
3 | # Core bundle labels.
4 | LABEL operators.operatorframework.io.bundle.mediatype.v1=registry+v1
5 | LABEL operators.operatorframework.io.bundle.manifests.v1=manifests/
6 | LABEL operators.operatorframework.io.bundle.metadata.v1=metadata/
7 | LABEL operators.operatorframework.io.bundle.package.v1=memcached-operator
8 | LABEL operators.operatorframework.io.bundle.channels.v1=alpha
9 |
10 | # Labels for testing.
11 | LABEL operators.operatorframework.io.test.mediatype.v1=scorecard+v1
12 | LABEL operators.operatorframework.io.test.config.v1=tests/scorecard/
13 |
14 | # Copy files to locations specified by labels.
15 | COPY bundle/manifests /manifests/
16 | COPY bundle/metadata /metadata/
17 | COPY bundle/tests/scorecard /tests/scorecard/
18 |
--------------------------------------------------------------------------------
/website/content/en/docs/cli/operator-sdk_create.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: "operator-sdk create"
3 | ---
4 | ## operator-sdk create
5 |
6 | Scaffold a Kubernetes API or webhook
7 |
8 | ### Synopsis
9 |
10 | Scaffold a Kubernetes API or webhook.
11 |
12 | ### Options
13 |
14 | ```
15 | -h, --help help for create
16 | ```
17 |
18 | ### Options inherited from parent commands
19 |
20 | ```
21 | --plugins strings plugin keys to be used for this subcommand execution
22 | --verbose Enable verbose logging
23 | ```
24 |
25 | ### SEE ALSO
26 |
27 | * [operator-sdk](../operator-sdk) -
28 | * [operator-sdk create api](../operator-sdk_create_api) - Scaffold a Kubernetes API
29 | * [operator-sdk create webhook](../operator-sdk_create_webhook) - Scaffold a webhook for an API resource
30 |
31 |
--------------------------------------------------------------------------------
/testdata/go/v4/monitoring/memcached-operator/config/crd/kustomization.yaml:
--------------------------------------------------------------------------------
1 | # This kustomization.yaml is not intended to be run by itself,
2 | # since it depends on service name and namespace that are out of this kustomize package.
3 | # It should be run by config/default
4 | resources:
5 | - bases/cache.example.com_memcacheds.yaml
6 | # +kubebuilder:scaffold:crdkustomizeresource
7 |
8 | patches:
9 | # [WEBHOOK] To enable webhook, uncomment all the sections with [WEBHOOK] prefix.
10 | # patches here are for enabling the conversion webhook for each CRD
11 | # +kubebuilder:scaffold:crdkustomizewebhookpatch
12 |
13 | # [WEBHOOK] To enable webhook, uncomment the following section
14 | # the following config is for teaching kustomize how to do kustomization for CRDs.
15 | #configurations:
16 | #- kustomizeconfig.yaml
17 |
--------------------------------------------------------------------------------
/testdata/go/v4/monitoring/memcached-operator/bundle.Dockerfile:
--------------------------------------------------------------------------------
1 | FROM scratch
2 |
3 | # Core bundle labels.
4 | LABEL operators.operatorframework.io.bundle.mediatype.v1=registry+v1
5 | LABEL operators.operatorframework.io.bundle.manifests.v1=manifests/
6 | LABEL operators.operatorframework.io.bundle.metadata.v1=metadata/
7 | LABEL operators.operatorframework.io.bundle.package.v1=memcached-operator
8 | LABEL operators.operatorframework.io.bundle.channels.v1=alpha
9 |
10 | # Labels for testing.
11 | LABEL operators.operatorframework.io.test.mediatype.v1=scorecard+v1
12 | LABEL operators.operatorframework.io.test.config.v1=tests/scorecard/
13 |
14 | # Copy files to locations specified by labels.
15 | COPY bundle/manifests /manifests/
16 | COPY bundle/metadata /metadata/
17 | COPY bundle/tests/scorecard /tests/scorecard/
18 |
--------------------------------------------------------------------------------
/release/changelog/internal/testdata/valid/fragment2.yml:
--------------------------------------------------------------------------------
1 | entries:
2 | - description: Addition description 1
3 | kind: addition
4 | breaking: false
5 | pull_request_override: 999999
6 | - description: Change description 1
7 | kind: change
8 | breaking: false
9 | pull_request_override: 999999
10 | - description: Removal description 1
11 | kind: removal
12 | breaking: true
13 | pull_request_override: 999999
14 | migration:
15 | header: Header for removal migration 1
16 | body: Body for removal migration 1
17 | - description: Deprecation description 1
18 | kind: deprecation
19 | breaking: false
20 | pull_request_override: 999999
21 | - description: Bugfix description 1
22 | kind: bugfix
23 | breaking: false
24 | pull_request_override: 999999
25 |
--------------------------------------------------------------------------------
/testdata/helm/memcached-operator/config/rbac/leader_election_role.yaml:
--------------------------------------------------------------------------------
1 | # permissions to do leader election.
2 | apiVersion: rbac.authorization.k8s.io/v1
3 | kind: Role
4 | metadata:
5 | labels:
6 | app.kubernetes.io/name: memcached-operator
7 | app.kubernetes.io/managed-by: kustomize
8 | name: leader-election-role
9 | rules:
10 | - apiGroups:
11 | - ""
12 | resources:
13 | - configmaps
14 | verbs:
15 | - get
16 | - list
17 | - watch
18 | - create
19 | - update
20 | - patch
21 | - delete
22 | - apiGroups:
23 | - coordination.k8s.io
24 | resources:
25 | - leases
26 | verbs:
27 | - get
28 | - list
29 | - watch
30 | - create
31 | - update
32 | - patch
33 | - delete
34 | - apiGroups:
35 | - ""
36 | resources:
37 | - events
38 | verbs:
39 | - create
40 | - patch
41 |
--------------------------------------------------------------------------------
/testdata/go/v4/memcached-operator/config/rbac/leader_election_role.yaml:
--------------------------------------------------------------------------------
1 | # permissions to do leader election.
2 | apiVersion: rbac.authorization.k8s.io/v1
3 | kind: Role
4 | metadata:
5 | labels:
6 | app.kubernetes.io/name: memcached-operator
7 | app.kubernetes.io/managed-by: kustomize
8 | name: leader-election-role
9 | rules:
10 | - apiGroups:
11 | - ""
12 | resources:
13 | - configmaps
14 | verbs:
15 | - get
16 | - list
17 | - watch
18 | - create
19 | - update
20 | - patch
21 | - delete
22 | - apiGroups:
23 | - coordination.k8s.io
24 | resources:
25 | - leases
26 | verbs:
27 | - get
28 | - list
29 | - watch
30 | - create
31 | - update
32 | - patch
33 | - delete
34 | - apiGroups:
35 | - ""
36 | resources:
37 | - events
38 | verbs:
39 | - create
40 | - patch
41 |
--------------------------------------------------------------------------------
/testdata/go/v4/monitoring/memcached-operator/config/rbac/leader_election_role.yaml:
--------------------------------------------------------------------------------
1 | # permissions to do leader election.
2 | apiVersion: rbac.authorization.k8s.io/v1
3 | kind: Role
4 | metadata:
5 | labels:
6 | app.kubernetes.io/name: memcached-operator
7 | app.kubernetes.io/managed-by: kustomize
8 | name: leader-election-role
9 | rules:
10 | - apiGroups:
11 | - ""
12 | resources:
13 | - configmaps
14 | verbs:
15 | - get
16 | - list
17 | - watch
18 | - create
19 | - update
20 | - patch
21 | - delete
22 | - apiGroups:
23 | - coordination.k8s.io
24 | resources:
25 | - leases
26 | verbs:
27 | - get
28 | - list
29 | - watch
30 | - create
31 | - update
32 | - patch
33 | - delete
34 | - apiGroups:
35 | - ""
36 | resources:
37 | - events
38 | verbs:
39 | - create
40 | - patch
41 |
--------------------------------------------------------------------------------
/website/content/en/docs/upgrading-sdk-version/v1.1.0.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: v1.1.0
3 | weight: 998999000
4 | ---
5 |
6 | ## Ansible Operator fact gathering causes performance regression
7 |
8 | To disable fact gathering by default for your operator, you will need to
9 | add the following entry to the manager container in`config/manager/manager.yaml`:
10 |
11 | ```yaml
12 | env:
13 | - name: ANSIBLE_GATHERING
14 | value: explicit
15 | ```
16 |
17 | _See [#3933](https://github.com/operator-framework/operator-sdk/pull/3933) for more details._
18 |
19 | ## Update scorecard-test-kuttl image to use latest kuttl
20 |
21 | The scorecard-test-kuttl image is updated to use kuttl:v0.5.2
22 | as the base image.
23 |
24 | _See [#3711](https://github.com/operator-framework/operator-sdk/pull/3711) for more details._
25 |
--------------------------------------------------------------------------------
/website/content/en/docs/cli/operator-sdk_generate_kustomize.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: "operator-sdk generate kustomize"
3 | ---
4 | ## operator-sdk generate kustomize
5 |
6 | Contains subcommands that generate operator-framework kustomize data for the operator
7 |
8 | ### Options
9 |
10 | ```
11 | -h, --help help for kustomize
12 | ```
13 |
14 | ### Options inherited from parent commands
15 |
16 | ```
17 | --plugins strings plugin keys to be used for this subcommand execution
18 | --verbose Enable verbose logging
19 | ```
20 |
21 | ### SEE ALSO
22 |
23 | * [operator-sdk generate](../operator-sdk_generate) - Invokes a specific generator
24 | * [operator-sdk generate kustomize manifests](../operator-sdk_generate_kustomize_manifests) - Generates kustomize bases and a kustomization.yaml for operator-framework manifests
25 |
26 |
--------------------------------------------------------------------------------
/testdata/go/v4/memcached-operator/.github/workflows/test-e2e.yml:
--------------------------------------------------------------------------------
1 | name: E2E Tests
2 |
3 | on:
4 | push:
5 | pull_request:
6 |
7 | jobs:
8 | test-e2e:
9 | name: Run on Ubuntu
10 | runs-on: ubuntu-latest
11 | steps:
12 | - name: Clone the code
13 | uses: actions/checkout@v4
14 |
15 | - name: Setup Go
16 | uses: actions/setup-go@v5
17 | with:
18 | go-version-file: go.mod
19 |
20 | - name: Install the latest version of kind
21 | run: |
22 | curl -Lo ./kind https://kind.sigs.k8s.io/dl/latest/kind-linux-amd64
23 | chmod +x ./kind
24 | sudo mv ./kind /usr/local/bin/kind
25 |
26 | - name: Verify kind installation
27 | run: kind version
28 |
29 | - name: Running Test e2e
30 | run: |
31 | go mod tidy
32 | make test-e2e
33 |
--------------------------------------------------------------------------------
/website/content/en/docs/upgrading-sdk-version/v1.10.0.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: v1.10.0
3 | weight: 998990000
4 | ---
5 |
6 | ## (ansible/v1) Bump Kustomize version in helm project scaffolding to 3.8.7
7 |
8 | Ansible projects are now scaffolded with `Kustomize` version `3.8.7`. This version of kustomize requires that the path to patch file be provided with the `--path` flag in `add patch` command. In `molecule/default/prepare.yml` file, update the command under `Set pull policy`, to be:
9 | ```diff
10 | - name: Set pull policy
11 | - command: '{{ "{{ kustomize }}" }} edit add patch pull_policy/{{ "{{ operator_pull_policy }}" }}.yaml'
12 | + command: '{{ "{{ kustomize }}" }} edit add patch --path pull_policy/{{ "{{ operator_pull_policy }}" }}.yaml'
13 | ```
14 |
15 | _See [#5057](https://github.com/operator-framework/operator-sdk/pull/5057) for more details._
16 |
--------------------------------------------------------------------------------
/changelog/generated/v1.32.0.md:
--------------------------------------------------------------------------------
1 | ## v1.32.0
2 |
3 | ### Additions
4 |
5 | - For Helm-based operators, whenever the operator encounters an error during reconcilliation, it would attempt to rollback the changes with the `--force` option. This behavior could have undesired side effects in some scenario.
6 | This change allows the users to change this behavior by adding the annotation, `helm.sdk.operatorframework.io/rollback-force: false`
7 | to the custom resource. ([#6546](https://github.com/operator-framework/operator-sdk/pull/6546))
8 |
9 | ### Bug Fixes
10 |
11 | - (helm): Use informer cache label selectors to reduce memory consumption. ([#6377](https://github.com/operator-framework/operator-sdk/pull/6377))
12 | - (helm): Fix bug with detection of owner reference support when setting up dynamic watches. ([#6377](https://github.com/operator-framework/operator-sdk/pull/6377))
13 |
--------------------------------------------------------------------------------
/testdata/go/v4/monitoring/memcached-operator/.github/workflows/test-e2e.yml:
--------------------------------------------------------------------------------
1 | name: E2E Tests
2 |
3 | on:
4 | push:
5 | pull_request:
6 |
7 | jobs:
8 | test-e2e:
9 | name: Run on Ubuntu
10 | runs-on: ubuntu-latest
11 | steps:
12 | - name: Clone the code
13 | uses: actions/checkout@v4
14 |
15 | - name: Setup Go
16 | uses: actions/setup-go@v5
17 | with:
18 | go-version-file: go.mod
19 |
20 | - name: Install the latest version of kind
21 | run: |
22 | curl -Lo ./kind https://kind.sigs.k8s.io/dl/latest/kind-linux-amd64
23 | chmod +x ./kind
24 | sudo mv ./kind /usr/local/bin/kind
25 |
26 | - name: Verify kind installation
27 | run: kind version
28 |
29 | - name: Running Test e2e
30 | run: |
31 | go mod tidy
32 | make test-e2e
33 |
--------------------------------------------------------------------------------
/internal/generate/testdata/go/api/v1alpha1/doc.go:
--------------------------------------------------------------------------------
1 | // Copyright 2020 The Operator-SDK Authors
2 | //
3 | // Licensed under the Apache License, Version 2.0 (the "License");
4 | // you may not use this file except in compliance with the License.
5 | // You may obtain a copy of the License at
6 | //
7 | // http://www.apache.org/licenses/LICENSE-2.0
8 | //
9 | // Unless required by applicable law or agreed to in writing, software
10 | // distributed under the License is distributed on an "AS IS" BASIS,
11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | // See the License for the specific language governing permissions and
13 | // limitations under the License.
14 |
15 | // Package v1alpha1 contains API Schema definitions for the cache v1alpha1 API group
16 | // +k8s:deepcopy-gen=package,register
17 | // +groupName=cache.example.com
18 | package v1alpha1
19 |
--------------------------------------------------------------------------------
/internal/generate/testdata/go/api/v1alpha2/doc.go:
--------------------------------------------------------------------------------
1 | // Copyright 2020 The Operator-SDK Authors
2 | //
3 | // Licensed under the Apache License, Version 2.0 (the "License");
4 | // you may not use this file except in compliance with the License.
5 | // You may obtain a copy of the License at
6 | //
7 | // http://www.apache.org/licenses/LICENSE-2.0
8 | //
9 | // Unless required by applicable law or agreed to in writing, software
10 | // distributed under the License is distributed on an "AS IS" BASIS,
11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | // See the License for the specific language governing permissions and
13 | // limitations under the License.
14 |
15 | // Package v1alpha2 contains API Schema definitions for the cache v1alpha2 API group
16 | // +k8s:deepcopy-gen=package,register
17 | // +groupName=cache.example.com
18 | package v1alpha2
19 |
--------------------------------------------------------------------------------
/website/content/en/docs/contribution-guidelines/changelog.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: Changelog
3 | weight: 25
4 | ---
5 |
6 | The Operator SDK project tracks changes across releases by maintaining a live changelog. This changelog is compiled via fragments located in `changelog/fragments`
7 |
8 | Contributors are asked to add these changelog fragments when creating pull requests by following this [template][changelog-template].
9 |
10 | The changlog fragments document the following information:
11 |
12 | * Description of Changes
13 | * Types of Changes
14 | * One of: addition, change, deprecation, removal, bugfix
15 | * Migration Guide for Changes
16 | * These are required for breaking changes, and essential (but not required) for scaffolding-related changes.
17 |
18 | [changelog-template]: https://github.com/operator-framework/operator-sdk/blob/master/changelog/fragments/00-template.yaml
19 |
--------------------------------------------------------------------------------
/website/content/en/docs/building-operators/golang/installation.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: Installation Guide
3 | linkTitle: Installation
4 | weight: 1
5 | ---
6 |
7 | ## Install `operator-sdk`
8 |
9 | Follow the steps in the [installation guide][install-guide] to learn how to install the `operator-sdk` CLI tool.
10 |
11 | ## Additional Prerequisites
12 |
13 | - [git][git_tool]
14 | - [go][go_tool] version 1.22
15 | - [docker][docker_tool] version 17.03+.
16 | - [kubectl][kubectl_tool] and access to a Kubernetes cluster of a [compatible version][k8s-version-compat].
17 |
18 |
19 | [install-guide]:/docs/installation/
20 | [git_tool]:https://git-scm.com/downloads
21 | [go_tool]:https://golang.org/dl/
22 | [docker_tool]:https://docs.docker.com/install/
23 | [kubectl_tool]:https://kubernetes.io/docs/tasks/tools/install-kubectl/
24 | [k8s-version-compat]:/docs/overview#kubernetes-version-compatibility
25 |
--------------------------------------------------------------------------------
/website/content/en/docs/cli/operator-sdk_run.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: "operator-sdk run"
3 | ---
4 | ## operator-sdk run
5 |
6 | Run an Operator in a variety of environments
7 |
8 | ### Synopsis
9 |
10 | This command has subcommands that will deploy your Operator with OLM.
11 |
12 | ### Options
13 |
14 | ```
15 | -h, --help help for run
16 | ```
17 |
18 | ### Options inherited from parent commands
19 |
20 | ```
21 | --plugins strings plugin keys to be used for this subcommand execution
22 | --verbose Enable verbose logging
23 | ```
24 |
25 | ### SEE ALSO
26 |
27 | * [operator-sdk](../operator-sdk) -
28 | * [operator-sdk run bundle](../operator-sdk_run_bundle) - Deploy an Operator in the bundle format with OLM
29 | * [operator-sdk run bundle-upgrade](../operator-sdk_run_bundle-upgrade) - Upgrade an Operator previously installed in the bundle format with OLM
30 |
31 |
--------------------------------------------------------------------------------
/testdata/go/v4/memcached-operator/config/certmanager/certificate-webhook.yaml:
--------------------------------------------------------------------------------
1 | # The following manifests contain a self-signed issuer CR and a certificate CR.
2 | # More document can be found at https://docs.cert-manager.io
3 | apiVersion: cert-manager.io/v1
4 | kind: Certificate
5 | metadata:
6 | labels:
7 | app.kubernetes.io/name: memcached-operator
8 | app.kubernetes.io/managed-by: kustomize
9 | name: serving-cert # this name should match the one appeared in kustomizeconfig.yaml
10 | namespace: system
11 | spec:
12 | # SERVICE_NAME and SERVICE_NAMESPACE will be substituted by kustomize
13 | # replacements in the config/default/kustomization.yaml file.
14 | dnsNames:
15 | - SERVICE_NAME.SERVICE_NAMESPACE.svc
16 | - SERVICE_NAME.SERVICE_NAMESPACE.svc.cluster.local
17 | issuerRef:
18 | kind: Issuer
19 | name: selfsigned-issuer
20 | secretName: webhook-server-cert
21 |
--------------------------------------------------------------------------------
/website/content/en/docs/cli/operator-sdk_olm_install.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: "operator-sdk olm install"
3 | ---
4 | ## operator-sdk olm install
5 |
6 | Install Operator Lifecycle Manager in your cluster
7 |
8 | ```
9 | operator-sdk olm install [flags]
10 | ```
11 |
12 | ### Options
13 |
14 | ```
15 | -h, --help help for install
16 | --timeout duration time to wait for the command to complete before failing (default 2m0s)
17 | --version string version of OLM resources to install (default "0.28.0")
18 | ```
19 |
20 | ### Options inherited from parent commands
21 |
22 | ```
23 | --plugins strings plugin keys to be used for this subcommand execution
24 | --verbose Enable verbose logging
25 | ```
26 |
27 | ### SEE ALSO
28 |
29 | * [operator-sdk olm](../operator-sdk_olm) - Manage the Operator Lifecycle Manager installation in your cluster
30 |
31 |
--------------------------------------------------------------------------------
/test/e2e/go/scorecard_test.go:
--------------------------------------------------------------------------------
1 | // Copyright 2020 The Operator-SDK Authors
2 | //
3 | // Licensed under the Apache License, Version 2.0 (the "License");
4 | // you may not use this file except in compliance with the License.
5 | // You may obtain a copy of the License at
6 | //
7 | // http://www.apache.org/licenses/LICENSE-2.0
8 | //
9 | // Unless required by applicable law or agreed to in writing, software
10 | // distributed under the License is distributed on an "AS IS" BASIS,
11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | // See the License for the specific language governing permissions and
13 | // limitations under the License.
14 |
15 | package e2e_go_test
16 |
17 | import (
18 | . "github.com/onsi/ginkgo/v2"
19 |
20 | "github.com/operator-framework/operator-sdk/test/common"
21 | )
22 |
23 | var _ = Describe("scorecard", common.ScorecardSpec(&tc, "go"))
24 |
--------------------------------------------------------------------------------
/testdata/go/v4/memcached-operator/bundle/manifests/memcached-operator-controller-manager-metrics-monitor_monitoring.coreos.com_v1_servicemonitor.yaml:
--------------------------------------------------------------------------------
1 | apiVersion: monitoring.coreos.com/v1
2 | kind: ServiceMonitor
3 | metadata:
4 | labels:
5 | app.kubernetes.io/managed-by: kustomize
6 | app.kubernetes.io/name: memcached-operator
7 | control-plane: controller-manager
8 | name: memcached-operator-controller-manager-metrics-monitor
9 | spec:
10 | endpoints:
11 | - bearerTokenFile: /var/run/secrets/kubernetes.io/serviceaccount/token
12 | path: /metrics
13 | port: https
14 | scheme: https
15 | tlsConfig:
16 | insecureSkipVerify: true
17 | serverName: memcached-operator-controller-manager-metrics-service.memcached-operator-system
18 | selector:
19 | matchLabels:
20 | app.kubernetes.io/name: memcached-operator
21 | control-plane: controller-manager
22 |
--------------------------------------------------------------------------------
/testdata/go/v4/memcached-operator/config/certmanager/certificate-metrics.yaml:
--------------------------------------------------------------------------------
1 | # The following manifests contain a self-signed issuer CR and a metrics certificate CR.
2 | # More document can be found at https://docs.cert-manager.io
3 | apiVersion: cert-manager.io/v1
4 | kind: Certificate
5 | metadata:
6 | labels:
7 | app.kubernetes.io/name: memcached-operator
8 | app.kubernetes.io/managed-by: kustomize
9 | name: metrics-certs # this name should match the one appeared in kustomizeconfig.yaml
10 | namespace: system
11 | spec:
12 | dnsNames:
13 | # SERVICE_NAME and SERVICE_NAMESPACE will be substituted by kustomize
14 | # replacements in the config/default/kustomization.yaml file.
15 | - SERVICE_NAME.SERVICE_NAMESPACE.svc
16 | - SERVICE_NAME.SERVICE_NAMESPACE.svc.cluster.local
17 | issuerRef:
18 | kind: Issuer
19 | name: selfsigned-issuer
20 | secretName: metrics-server-cert
21 |
--------------------------------------------------------------------------------
/testdata/go/v4/memcached-operator/config/webhook/kustomizeconfig.yaml:
--------------------------------------------------------------------------------
1 | # the following config is for teaching kustomize where to look at when substituting nameReference.
2 | # It requires kustomize v2.1.0 or newer to work properly.
3 | nameReference:
4 | - kind: Service
5 | version: v1
6 | fieldSpecs:
7 | - kind: MutatingWebhookConfiguration
8 | group: admissionregistration.k8s.io
9 | path: webhooks/clientConfig/service/name
10 | - kind: ValidatingWebhookConfiguration
11 | group: admissionregistration.k8s.io
12 | path: webhooks/clientConfig/service/name
13 |
14 | namespace:
15 | - kind: MutatingWebhookConfiguration
16 | group: admissionregistration.k8s.io
17 | path: webhooks/clientConfig/service/namespace
18 | create: true
19 | - kind: ValidatingWebhookConfiguration
20 | group: admissionregistration.k8s.io
21 | path: webhooks/clientConfig/service/namespace
22 | create: true
23 |
--------------------------------------------------------------------------------
/testdata/go/v4/monitoring/memcached-operator/config/certmanager/certificate-webhook.yaml:
--------------------------------------------------------------------------------
1 | # The following manifests contain a self-signed issuer CR and a certificate CR.
2 | # More document can be found at https://docs.cert-manager.io
3 | apiVersion: cert-manager.io/v1
4 | kind: Certificate
5 | metadata:
6 | labels:
7 | app.kubernetes.io/name: memcached-operator
8 | app.kubernetes.io/managed-by: kustomize
9 | name: serving-cert # this name should match the one appeared in kustomizeconfig.yaml
10 | namespace: system
11 | spec:
12 | # SERVICE_NAME and SERVICE_NAMESPACE will be substituted by kustomize
13 | # replacements in the config/default/kustomization.yaml file.
14 | dnsNames:
15 | - SERVICE_NAME.SERVICE_NAMESPACE.svc
16 | - SERVICE_NAME.SERVICE_NAMESPACE.svc.cluster.local
17 | issuerRef:
18 | kind: Issuer
19 | name: selfsigned-issuer
20 | secretName: webhook-server-cert
21 |
--------------------------------------------------------------------------------
/hack/generate/samples/internal/helm/generate.go:
--------------------------------------------------------------------------------
1 | // Copyright 2021 The Operator-SDK Authors
2 | //
3 | // Licensed under the Apache License, Version 2.0 (the "License");
4 | // you may not use this file except in compliance with the License.
5 | // You may obtain a copy of the License at
6 | //
7 | // http://www.apache.org/licenses/LICENSE-2.0
8 | //
9 | // Unless required by applicable law or agreed to in writing, software
10 | // distributed under the License is distributed on an "AS IS" BASIS,
11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | // See the License for the specific language governing permissions and
13 | // limitations under the License.
14 |
15 | package helm
16 |
17 | import (
18 | "path/filepath"
19 | )
20 |
21 | func GenerateMemcachedSamples(binaryPath, rootPath string) {
22 | GenerateMemcachedSample(binaryPath, filepath.Join(rootPath, "helm"))
23 | }
24 |
--------------------------------------------------------------------------------
/internal/plugins/plugins.go:
--------------------------------------------------------------------------------
1 | // Copyright 2020 The Operator-SDK Authors
2 | //
3 | // Licensed under the Apache License, Version 2.0 (the "License");
4 | // you may not use this file except in compliance with the License.
5 | // You may obtain a copy of the License at
6 | //
7 | // http://www.apache.org/licenses/LICENSE-2.0
8 | //
9 | // Unless required by applicable law or agreed to in writing, software
10 | // distributed under the License is distributed on an "AS IS" BASIS,
11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | // See the License for the specific language governing permissions and
13 | // limitations under the License.
14 |
15 | package plugins
16 |
17 | // DefaultNameQualifier is the Operator SDK plugin name suffix. Appending
18 | // this suffix to a short name, ex. "go", makes it fully qualified.
19 | const DefaultNameQualifier = ".sdk.operatorframework.io"
20 |
--------------------------------------------------------------------------------
/internal/scorecard/testdata/pod.yaml:
--------------------------------------------------------------------------------
1 | apiVersion: v1
2 | kind: Pod
3 | metadata:
4 | name: scorecard-test
5 | namespace: default
6 | spec:
7 | containers:
8 | - env:
9 | - name: NAMESPACE
10 | valueFrom:
11 | fieldRef:
12 | apiVersion: v1
13 | fieldPath: metadata.namespace
14 | image: quay.io/operator-framework/scorecard-test:dev
15 | imagePullPolicy: Always
16 | name: scorecard-test
17 | command: ["/usr/local/bin/scorecard-test"]
18 | args: ["basic-check-spec"]
19 | resources: {}
20 | volumeMounts:
21 | - mountPath: /scorecard
22 | name: scorecard-bundle
23 | readOnly: true
24 | dnsPolicy: ClusterFirst
25 | restartPolicy: Never
26 | securityContext: {}
27 | serviceAccount: default
28 | serviceAccountName: default
29 | volumes:
30 | - name: scorecard-bundle
31 | configMap:
32 | name: scorecard-bundle
33 |
--------------------------------------------------------------------------------
/test/e2e/helm/scorecard_test.go:
--------------------------------------------------------------------------------
1 | // Copyright 2020 The Operator-SDK Authors
2 | //
3 | // Licensed under the Apache License, Version 2.0 (the "License");
4 | // you may not use this file except in compliance with the License.
5 | // You may obtain a copy of the License at
6 | //
7 | // http://www.apache.org/licenses/LICENSE-2.0
8 | //
9 | // Unless required by applicable law or agreed to in writing, software
10 | // distributed under the License is distributed on an "AS IS" BASIS,
11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | // See the License for the specific language governing permissions and
13 | // limitations under the License.
14 |
15 | package e2e_helm_test
16 |
17 | import (
18 | . "github.com/onsi/ginkgo/v2"
19 |
20 | "github.com/operator-framework/operator-sdk/test/common"
21 | )
22 |
23 | var _ = Describe("scorecard", common.ScorecardSpec(&tc, "helm"))
24 |
--------------------------------------------------------------------------------
/testdata/go/v4/monitoring/memcached-operator/bundle/manifests/memcached-operator-controller-manager-metrics-monitor_monitoring.coreos.com_v1_servicemonitor.yaml:
--------------------------------------------------------------------------------
1 | apiVersion: monitoring.coreos.com/v1
2 | kind: ServiceMonitor
3 | metadata:
4 | labels:
5 | app.kubernetes.io/managed-by: kustomize
6 | app.kubernetes.io/name: memcached-operator
7 | control-plane: controller-manager
8 | name: memcached-operator-controller-manager-metrics-monitor
9 | spec:
10 | endpoints:
11 | - bearerTokenFile: /var/run/secrets/kubernetes.io/serviceaccount/token
12 | path: /metrics
13 | port: https
14 | scheme: https
15 | tlsConfig:
16 | insecureSkipVerify: true
17 | serverName: memcached-operator-controller-manager-metrics-service.memcached-operator-system
18 | selector:
19 | matchLabels:
20 | app.kubernetes.io/name: memcached-operator
21 | control-plane: controller-manager
22 |
--------------------------------------------------------------------------------
/testdata/go/v4/monitoring/memcached-operator/config/certmanager/certificate-metrics.yaml:
--------------------------------------------------------------------------------
1 | # The following manifests contain a self-signed issuer CR and a metrics certificate CR.
2 | # More document can be found at https://docs.cert-manager.io
3 | apiVersion: cert-manager.io/v1
4 | kind: Certificate
5 | metadata:
6 | labels:
7 | app.kubernetes.io/name: memcached-operator
8 | app.kubernetes.io/managed-by: kustomize
9 | name: metrics-certs # this name should match the one appeared in kustomizeconfig.yaml
10 | namespace: system
11 | spec:
12 | dnsNames:
13 | # SERVICE_NAME and SERVICE_NAMESPACE will be substituted by kustomize
14 | # replacements in the config/default/kustomization.yaml file.
15 | - SERVICE_NAME.SERVICE_NAMESPACE.svc
16 | - SERVICE_NAME.SERVICE_NAMESPACE.svc.cluster.local
17 | issuerRef:
18 | kind: Issuer
19 | name: selfsigned-issuer
20 | secretName: metrics-server-cert
21 |
--------------------------------------------------------------------------------
/testdata/go/v4/monitoring/memcached-operator/config/webhook/kustomizeconfig.yaml:
--------------------------------------------------------------------------------
1 | # the following config is for teaching kustomize where to look at when substituting nameReference.
2 | # It requires kustomize v2.1.0 or newer to work properly.
3 | nameReference:
4 | - kind: Service
5 | version: v1
6 | fieldSpecs:
7 | - kind: MutatingWebhookConfiguration
8 | group: admissionregistration.k8s.io
9 | path: webhooks/clientConfig/service/name
10 | - kind: ValidatingWebhookConfiguration
11 | group: admissionregistration.k8s.io
12 | path: webhooks/clientConfig/service/name
13 |
14 | namespace:
15 | - kind: MutatingWebhookConfiguration
16 | group: admissionregistration.k8s.io
17 | path: webhooks/clientConfig/service/namespace
18 | create: true
19 | - kind: ValidatingWebhookConfiguration
20 | group: admissionregistration.k8s.io
21 | path: webhooks/clientConfig/service/namespace
22 | create: true
23 |
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE/feature-request.md:
--------------------------------------------------------------------------------
1 | ---
2 | name: Feature Request
3 | about: Suggest a feature
4 | title: ''
5 | labels: ''
6 | assignees: ''
7 |
8 | ---
9 |
10 | ## Feature Request
11 |
12 | #### Describe the problem you need a feature to resolve.
13 |
14 |
19 |
20 | #### Describe the solution you'd like.
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
--------------------------------------------------------------------------------
/internal/helm/flags/suite_test.go:
--------------------------------------------------------------------------------
1 | // Copyright 2021 The Operator-SDK Authors
2 | //
3 | // Licensed under the Apache License, Version 2.0 (the "License");
4 | // you may not use this file except in compliance with the License.
5 | // You may obtain a copy of the License at
6 | //
7 | // http://www.apache.org/licenses/LICENSE-2.0
8 | //
9 | // Unless required by applicable law or agreed to in writing, software
10 | // distributed under the License is distributed on an "AS IS" BASIS,
11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | // See the License for the specific language governing permissions and
13 | // limitations under the License.
14 |
15 | package flags_test
16 |
17 | import (
18 | "testing"
19 |
20 | . "github.com/onsi/ginkgo/v2"
21 | . "github.com/onsi/gomega"
22 | )
23 |
24 | func TestFlags(t *testing.T) {
25 | RegisterFailHandler(Fail)
26 | RunSpecs(t, "Flags Suite")
27 | }
28 |
--------------------------------------------------------------------------------
/internal/helm/release/doc.go:
--------------------------------------------------------------------------------
1 | // Copyright 2018 The Operator-SDK Authors
2 | //
3 | // Licensed under the Apache License, Version 2.0 (the "License");
4 | // you may not use this file except in compliance with the License.
5 | // You may obtain a copy of the License at
6 | //
7 | // http://www.apache.org/licenses/LICENSE-2.0
8 | //
9 | // Unless required by applicable law or agreed to in writing, software
10 | // distributed under the License is distributed on an "AS IS" BASIS,
11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | // See the License for the specific language governing permissions and
13 | // limitations under the License.
14 |
15 | // Package release provides interfaces and default implementations for a Helm
16 | // release manager, which is used by the Helm controller and reconciler to
17 | // manage Helm releases in a cluster based on watched custom resources.
18 | package release
19 |
--------------------------------------------------------------------------------
/website/content/en/docs/cli/operator-sdk_olm.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: "operator-sdk olm"
3 | ---
4 | ## operator-sdk olm
5 |
6 | Manage the Operator Lifecycle Manager installation in your cluster
7 |
8 | ### Options
9 |
10 | ```
11 | -h, --help help for olm
12 | ```
13 |
14 | ### Options inherited from parent commands
15 |
16 | ```
17 | --plugins strings plugin keys to be used for this subcommand execution
18 | --verbose Enable verbose logging
19 | ```
20 |
21 | ### SEE ALSO
22 |
23 | * [operator-sdk](../operator-sdk) -
24 | * [operator-sdk olm install](../operator-sdk_olm_install) - Install Operator Lifecycle Manager in your cluster
25 | * [operator-sdk olm status](../operator-sdk_olm_status) - Get the status of the Operator Lifecycle Manager installation in your cluster
26 | * [operator-sdk olm uninstall](../operator-sdk_olm_uninstall) - Uninstall Operator Lifecycle Manager from your cluster
27 |
28 |
--------------------------------------------------------------------------------
/internal/validate/suite_test.go:
--------------------------------------------------------------------------------
1 | // Copyright 2021 The Operator-SDK Authors
2 | //
3 | // Licensed under the Apache License, Version 2.0 (the "License");
4 | // you may not use this file except in compliance with the License.
5 | // You may obtain a copy of the License at
6 | //
7 | // http://www.apache.org/licenses/LICENSE-2.0
8 | //
9 | // Unless required by applicable law or agreed to in writing, software
10 | // distributed under the License is distributed on an "AS IS" BASIS,
11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | // See the License for the specific language governing permissions and
13 | // limitations under the License.
14 |
15 | package validate
16 |
17 | import (
18 | "testing"
19 |
20 | . "github.com/onsi/ginkgo/v2"
21 | . "github.com/onsi/gomega"
22 | )
23 |
24 | func TestResult(t *testing.T) {
25 | RegisterFailHandler(Fail)
26 | RunSpecs(t, "Output Result Tests")
27 | }
28 |
--------------------------------------------------------------------------------
/testdata/go/v4/memcached-operator/config/rbac/memcached_admin_role.yaml:
--------------------------------------------------------------------------------
1 | # This rule is not used by the project memcached-operator itself.
2 | # It is provided to allow the cluster admin to help manage permissions for users.
3 | #
4 | # Grants full permissions ('*') over cache.example.com.
5 | # This role is intended for users authorized to modify roles and bindings within the cluster,
6 | # enabling them to delegate specific permissions to other users or groups as needed.
7 |
8 | apiVersion: rbac.authorization.k8s.io/v1
9 | kind: ClusterRole
10 | metadata:
11 | labels:
12 | app.kubernetes.io/name: memcached-operator
13 | app.kubernetes.io/managed-by: kustomize
14 | name: memcached-admin-role
15 | rules:
16 | - apiGroups:
17 | - cache.example.com
18 | resources:
19 | - memcacheds
20 | verbs:
21 | - '*'
22 | - apiGroups:
23 | - cache.example.com
24 | resources:
25 | - memcacheds/status
26 | verbs:
27 | - get
28 |
--------------------------------------------------------------------------------
/testdata/helm/memcached-operator/config/rbac/memcached_admin_role.yaml:
--------------------------------------------------------------------------------
1 | # This rule is not used by the project memcached-operator itself.
2 | # It is provided to allow the cluster admin to help manage permissions for users.
3 | #
4 | # Grants full permissions ('*') over cache.example.com.
5 | # This role is intended for users authorized to modify roles and bindings within the cluster,
6 | # enabling them to delegate specific permissions to other users or groups as needed.
7 |
8 | apiVersion: rbac.authorization.k8s.io/v1
9 | kind: ClusterRole
10 | metadata:
11 | labels:
12 | app.kubernetes.io/name: memcached-operator
13 | app.kubernetes.io/managed-by: kustomize
14 | name: memcached-admin-role
15 | rules:
16 | - apiGroups:
17 | - cache.example.com
18 | resources:
19 | - memcacheds
20 | verbs:
21 | - '*'
22 | - apiGroups:
23 | - cache.example.com
24 | resources:
25 | - memcacheds/status
26 | verbs:
27 | - get
28 |
--------------------------------------------------------------------------------
/internal/cmd/operator-sdk/cli/cli_suite_test.go:
--------------------------------------------------------------------------------
1 | // Copyright 2020 The Operator-SDK Authors
2 | //
3 | // Licensed under the Apache License, Version 2.0 (the "License");
4 | // you may not use this file except in compliance with the License.
5 | // You may obtain a copy of the License at
6 | //
7 | // http://www.apache.org/licenses/LICENSE-2.0
8 | //
9 | // Unless required by applicable law or agreed to in writing, software
10 | // distributed under the License is distributed on an "AS IS" BASIS,
11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | // See the License for the specific language governing permissions and
13 | // limitations under the License.
14 |
15 | package cli
16 |
17 | import (
18 | "testing"
19 |
20 | . "github.com/onsi/ginkgo/v2"
21 | . "github.com/onsi/gomega"
22 | )
23 |
24 | func TestVersion(t *testing.T) {
25 | RegisterFailHandler(Fail)
26 | RunSpecs(t, "CLI Suite")
27 | }
28 |
--------------------------------------------------------------------------------
/internal/olm/client/client_suite_test.go:
--------------------------------------------------------------------------------
1 | // Copyright 2020 The Operator-SDK Authors
2 | //
3 | // Licensed under the Apache License, Version 2.0 (the "License");
4 | // you may not use this file except in compliance with the License.
5 | // You may obtain a copy of the License at
6 | //
7 | // http://www.apache.org/licenses/LICENSE-2.0
8 | //
9 | // Unless required by applicable law or agreed to in writing, software
10 | // distributed under the License is distributed on an "AS IS" BASIS,
11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | // See the License for the specific language governing permissions and
13 | // limitations under the License.
14 |
15 | package client
16 |
17 | import (
18 | "testing"
19 |
20 | . "github.com/onsi/ginkgo/v2"
21 | . "github.com/onsi/gomega"
22 | )
23 |
24 | func TestClient(t *testing.T) {
25 | RegisterFailHandler(Fail)
26 | RunSpecs(t, "check depErrors")
27 | }
28 |
--------------------------------------------------------------------------------
/internal/registry/registry_suite_test.go:
--------------------------------------------------------------------------------
1 | // Copyright 2020 The Operator-SDK Authors
2 | //
3 | // Licensed under the Apache License, Version 2.0 (the "License");
4 | // you may not use this file except in compliance with the License.
5 | // You may obtain a copy of the License at
6 | //
7 | // http://www.apache.org/licenses/LICENSE-2.0
8 | //
9 | // Unless required by applicable law or agreed to in writing, software
10 | // distributed under the License is distributed on an "AS IS" BASIS,
11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | // See the License for the specific language governing permissions and
13 | // limitations under the License.
14 |
15 | package registry
16 |
17 | import (
18 | "testing"
19 |
20 | . "github.com/onsi/ginkgo/v2"
21 | . "github.com/onsi/gomega"
22 | )
23 |
24 | func TestRegistry(t *testing.T) {
25 | RegisterFailHandler(Fail)
26 | RunSpecs(t, "Registry Suite")
27 | }
28 |
--------------------------------------------------------------------------------
/website/content/en/docs/cli/operator-sdk_generate.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: "operator-sdk generate"
3 | ---
4 | ## operator-sdk generate
5 |
6 | Invokes a specific generator
7 |
8 | ### Synopsis
9 |
10 | The 'operator-sdk generate' command invokes a specific generator to generate
11 | code or manifests.
12 |
13 | ### Options
14 |
15 | ```
16 | -h, --help help for generate
17 | ```
18 |
19 | ### Options inherited from parent commands
20 |
21 | ```
22 | --plugins strings plugin keys to be used for this subcommand execution
23 | --verbose Enable verbose logging
24 | ```
25 |
26 | ### SEE ALSO
27 |
28 | * [operator-sdk](../operator-sdk) -
29 | * [operator-sdk generate bundle](../operator-sdk_generate_bundle) - Generates bundle data for the operator
30 | * [operator-sdk generate kustomize](../operator-sdk_generate_kustomize) - Contains subcommands that generate operator-framework kustomize data for the operator
31 |
32 |
--------------------------------------------------------------------------------
/internal/cmd/operator-sdk/olm/olm_suite_test.go:
--------------------------------------------------------------------------------
1 | // Copyright 2020 The Operator-SDK Authors
2 | //
3 | // Licensed under the Apache License, Version 2.0 (the "License");
4 | // you may not use this file except in compliance with the License.
5 | // You may obtain a copy of the License at
6 | //
7 | // http://www.apache.org/licenses/LICENSE-2.0
8 | //
9 | // Unless required by applicable law or agreed to in writing, software
10 | // distributed under the License is distributed on an "AS IS" BASIS,
11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | // See the License for the specific language governing permissions and
13 | // limitations under the License.
14 |
15 | package olm_test
16 |
17 | import (
18 | "testing"
19 |
20 | . "github.com/onsi/ginkgo/v2"
21 | . "github.com/onsi/gomega"
22 | )
23 |
24 | func TestOlm(t *testing.T) {
25 | RegisterFailHandler(Fail)
26 | RunSpecs(t, "Olm Cmd Suite")
27 | }
28 |
--------------------------------------------------------------------------------
/internal/cmd/operator-sdk/run/run_suite_test.go:
--------------------------------------------------------------------------------
1 | // Copyright 2020 The Operator-SDK Authors
2 | //
3 | // Licensed under the Apache License, Version 2.0 (the "License");
4 | // you may not use this file except in compliance with the License.
5 | // You may obtain a copy of the License at
6 | //
7 | // http://www.apache.org/licenses/LICENSE-2.0
8 | //
9 | // Unless required by applicable law or agreed to in writing, software
10 | // distributed under the License is distributed on an "AS IS" BASIS,
11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | // See the License for the specific language governing permissions and
13 | // limitations under the License.
14 |
15 | package run_test
16 |
17 | import (
18 | "testing"
19 |
20 | . "github.com/onsi/ginkgo/v2"
21 | . "github.com/onsi/gomega"
22 | )
23 |
24 | func TestRun(t *testing.T) {
25 | RegisterFailHandler(Fail)
26 | RunSpecs(t, "Run Cmd Suite")
27 | }
28 |
--------------------------------------------------------------------------------
/internal/helm/controller/doc.go:
--------------------------------------------------------------------------------
1 | // Copyright 2018 The Operator-SDK Authors
2 | //
3 | // Licensed under the Apache License, Version 2.0 (the "License");
4 | // you may not use this file except in compliance with the License.
5 | // You may obtain a copy of the License at
6 | //
7 | // http://www.apache.org/licenses/LICENSE-2.0
8 | //
9 | // Unless required by applicable law or agreed to in writing, software
10 | // distributed under the License is distributed on an "AS IS" BASIS,
11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | // See the License for the specific language governing permissions and
13 | // limitations under the License.
14 |
15 | // Package controller provides functions for creating and registering a Helm
16 | // controller with a `controller-runtime` manager. It also provides a Helm
17 | // reconciler implementation that can be used to create a Helm-based operator.
18 | package controller
19 |
--------------------------------------------------------------------------------
/internal/olm/operator/operator_suite_test.go:
--------------------------------------------------------------------------------
1 | // Copyright 2020 The Operator-SDK Authors
2 | //
3 | // Licensed under the Apache License, Version 2.0 (the "License");
4 | // you may not use this file except in compliance with the License.
5 | // You may obtain a copy of the License at
6 | //
7 | // http://www.apache.org/licenses/LICENSE-2.0
8 | //
9 | // Unless required by applicable law or agreed to in writing, software
10 | // distributed under the License is distributed on an "AS IS" BASIS,
11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | // See the License for the specific language governing permissions and
13 | // limitations under the License.
14 |
15 | package operator
16 |
17 | import (
18 | "testing"
19 |
20 | . "github.com/onsi/ginkgo/v2"
21 | . "github.com/onsi/gomega"
22 | )
23 |
24 | func TestOperator(t *testing.T) {
25 | RegisterFailHandler(Fail)
26 | RunSpecs(t, "Operator Suite")
27 | }
28 |
--------------------------------------------------------------------------------
/testdata/go/v4/monitoring/memcached-operator/config/rbac/memcached_admin_role.yaml:
--------------------------------------------------------------------------------
1 | # This rule is not used by the project memcached-operator itself.
2 | # It is provided to allow the cluster admin to help manage permissions for users.
3 | #
4 | # Grants full permissions ('*') over cache.example.com.
5 | # This role is intended for users authorized to modify roles and bindings within the cluster,
6 | # enabling them to delegate specific permissions to other users or groups as needed.
7 |
8 | apiVersion: rbac.authorization.k8s.io/v1
9 | kind: ClusterRole
10 | metadata:
11 | labels:
12 | app.kubernetes.io/name: memcached-operator
13 | app.kubernetes.io/managed-by: kustomize
14 | name: memcached-admin-role
15 | rules:
16 | - apiGroups:
17 | - cache.example.com
18 | resources:
19 | - memcacheds
20 | verbs:
21 | - '*'
22 | - apiGroups:
23 | - cache.example.com
24 | resources:
25 | - memcacheds/status
26 | verbs:
27 | - get
28 |
--------------------------------------------------------------------------------
/internal/annotations/metrics/metrics_suite_test.go:
--------------------------------------------------------------------------------
1 | // Copyright 2021 The Operator-SDK Authors
2 | //
3 | // Licensed under the Apache License, Version 2.0 (the "License");
4 | // you may not use this file except in compliance with the License.
5 | // You may obtain a copy of the License at
6 | //
7 | // http://www.apache.org/licenses/LICENSE-2.0
8 | //
9 | // Unless required by applicable law or agreed to in writing, software
10 | // distributed under the License is distributed on an "AS IS" BASIS,
11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | // See the License for the specific language governing permissions and
13 | // limitations under the License.
14 |
15 | package metrics
16 |
17 | import (
18 | "testing"
19 |
20 | . "github.com/onsi/ginkgo/v2"
21 | . "github.com/onsi/gomega"
22 | )
23 |
24 | func TestMetrics(t *testing.T) {
25 | RegisterFailHandler(Fail)
26 | RunSpecs(t, "Metrics Suite")
27 | }
28 |
--------------------------------------------------------------------------------
/internal/olm/installer/installer_suite_test.go:
--------------------------------------------------------------------------------
1 | // Copyright 2020 The Operator-SDK Authors
2 | //
3 | // Licensed under the Apache License, Version 2.0 (the "License");
4 | // you may not use this file except in compliance with the License.
5 | // You may obtain a copy of the License at
6 | //
7 | // http://www.apache.org/licenses/LICENSE-2.0
8 | //
9 | // Unless required by applicable law or agreed to in writing, software
10 | // distributed under the License is distributed on an "AS IS" BASIS,
11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | // See the License for the specific language governing permissions and
13 | // limitations under the License.
14 |
15 | package installer
16 |
17 | import (
18 | "testing"
19 |
20 | . "github.com/onsi/ginkgo/v2"
21 | . "github.com/onsi/gomega"
22 | )
23 |
24 | func TestRegistry(t *testing.T) {
25 | RegisterFailHandler(Fail)
26 | RunSpecs(t, "Installer Suite")
27 | }
28 |
--------------------------------------------------------------------------------
/internal/scorecard/scorecard_suite_test.go:
--------------------------------------------------------------------------------
1 | // Copyright 2020 The Operator-SDK Authors
2 | //
3 | // Licensed under the Apache License, Version 2.0 (the "License");
4 | // you may not use this file except in compliance with the License.
5 | // You may obtain a copy of the License at
6 | //
7 | // http://www.apache.org/licenses/LICENSE-2.0
8 | //
9 | // Unless required by applicable law or agreed to in writing, software
10 | // distributed under the License is distributed on an "AS IS" BASIS,
11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | // See the License for the specific language governing permissions and
13 | // limitations under the License.
14 |
15 | package scorecard_test
16 |
17 | import (
18 | "testing"
19 |
20 | . "github.com/onsi/ginkgo/v2"
21 | . "github.com/onsi/gomega"
22 | )
23 |
24 | func TestScorecard(t *testing.T) {
25 | RegisterFailHandler(Fail)
26 | RunSpecs(t, "Scorecard Suite")
27 | }
28 |
--------------------------------------------------------------------------------
/internal/generate/collector/collector_suite_test.go:
--------------------------------------------------------------------------------
1 | // Copyright 2020 The Operator-SDK Authors
2 | //
3 | // Licensed under the Apache License, Version 2.0 (the "License");
4 | // you may not use this file except in compliance with the License.
5 | // You may obtain a copy of the License at
6 | //
7 | // http://www.apache.org/licenses/LICENSE-2.0
8 | //
9 | // Unless required by applicable law or agreed to in writing, software
10 | // distributed under the License is distributed on an "AS IS" BASIS,
11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | // See the License for the specific language governing permissions and
13 | // limitations under the License.
14 |
15 | package collector
16 |
17 | import (
18 | "testing"
19 |
20 | . "github.com/onsi/ginkgo/v2"
21 | . "github.com/onsi/gomega"
22 | )
23 |
24 | func TestCollector(t *testing.T) {
25 | RegisterFailHandler(Fail)
26 | RunSpecs(t, "Collector Suite")
27 | }
28 |
--------------------------------------------------------------------------------
/internal/olm/operator/registry/registry_suite_test.go:
--------------------------------------------------------------------------------
1 | // Copyright 2020 The Operator-SDK Authors
2 | //
3 | // Licensed under the Apache License, Version 2.0 (the "License");
4 | // you may not use this file except in compliance with the License.
5 | // You may obtain a copy of the License at
6 | //
7 | // http://www.apache.org/licenses/LICENSE-2.0
8 | //
9 | // Unless required by applicable law or agreed to in writing, software
10 | // distributed under the License is distributed on an "AS IS" BASIS,
11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | // See the License for the specific language governing permissions and
13 | // limitations under the License.
14 |
15 | package registry
16 |
17 | import (
18 | "testing"
19 |
20 | . "github.com/onsi/ginkgo/v2"
21 | . "github.com/onsi/gomega"
22 | )
23 |
24 | func TestRegistry(t *testing.T) {
25 | RegisterFailHandler(Fail)
26 | RunSpecs(t, "Registry Suite")
27 | }
28 |
--------------------------------------------------------------------------------
/internal/cmd/operator-sdk/bundle/bundle_suite_test.go:
--------------------------------------------------------------------------------
1 | // Copyright 2020 The Operator-SDK Authors
2 | //
3 | // Licensed under the Apache License, Version 2.0 (the "License");
4 | // you may not use this file except in compliance with the License.
5 | // You may obtain a copy of the License at
6 | //
7 | // http://www.apache.org/licenses/LICENSE-2.0
8 | //
9 | // Unless required by applicable law or agreed to in writing, software
10 | // distributed under the License is distributed on an "AS IS" BASIS,
11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | // See the License for the specific language governing permissions and
13 | // limitations under the License.
14 |
15 | package bundle_test
16 |
17 | import (
18 | "testing"
19 |
20 | . "github.com/onsi/ginkgo/v2"
21 | . "github.com/onsi/gomega"
22 | )
23 |
24 | func TestBundle(t *testing.T) {
25 | RegisterFailHandler(Fail)
26 | RunSpecs(t, "Bundle Cmd Suite")
27 | }
28 |
--------------------------------------------------------------------------------
/internal/cmd/operator-sdk/bundle/validate/cmd_suite_test.go:
--------------------------------------------------------------------------------
1 | // Copyright 2020 The Operator-SDK Authors
2 | //
3 | // Licensed under the Apache License, Version 2.0 (the "License");
4 | // you may not use this file except in compliance with the License.
5 | // You may obtain a copy of the License at
6 | //
7 | // http://www.apache.org/licenses/LICENSE-2.0
8 | //
9 | // Unless required by applicable law or agreed to in writing, software
10 | // distributed under the License is distributed on an "AS IS" BASIS,
11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | // See the License for the specific language governing permissions and
13 | // limitations under the License.
14 |
15 | package validate
16 |
17 | import (
18 | "testing"
19 |
20 | . "github.com/onsi/ginkgo/v2"
21 | . "github.com/onsi/gomega"
22 | )
23 |
24 | func TestValidate(t *testing.T) {
25 | RegisterFailHandler(Fail)
26 | RunSpecs(t, "Validate Suite")
27 | }
28 |
--------------------------------------------------------------------------------
/internal/cmd/helm-operator/version/version_suite_test.go:
--------------------------------------------------------------------------------
1 | // Copyright 2020 The Operator-SDK Authors
2 | //
3 | // Licensed under the Apache License, Version 2.0 (the "License");
4 | // you may not use this file except in compliance with the License.
5 | // You may obtain a copy of the License at
6 | //
7 | // http://www.apache.org/licenses/LICENSE-2.0
8 | //
9 | // Unless required by applicable law or agreed to in writing, software
10 | // distributed under the License is distributed on an "AS IS" BASIS,
11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | // See the License for the specific language governing permissions and
13 | // limitations under the License.
14 |
15 | package version_test
16 |
17 | import (
18 | "testing"
19 |
20 | . "github.com/onsi/ginkgo/v2"
21 | . "github.com/onsi/gomega"
22 | )
23 |
24 | func TestVersion(t *testing.T) {
25 | RegisterFailHandler(Fail)
26 | RunSpecs(t, "Version Cmd Suite")
27 | }
28 |
--------------------------------------------------------------------------------
/internal/cmd/operator-sdk/generate/internal/genutil_suite_test.go:
--------------------------------------------------------------------------------
1 | // Copyright 2020 The Operator-SDK Authors
2 | //
3 | // Licensed under the Apache License, Version 2.0 (the "License");
4 | // you may not use this file except in compliance with the License.
5 | // You may obtain a copy of the License at
6 | //
7 | // http://www.apache.org/licenses/LICENSE-2.0
8 | //
9 | // Unless required by applicable law or agreed to in writing, software
10 | // distributed under the License is distributed on an "AS IS" BASIS,
11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | // See the License for the specific language governing permissions and
13 | // limitations under the License.
14 |
15 | package genutil
16 |
17 | import (
18 | "testing"
19 |
20 | . "github.com/onsi/ginkgo/v2"
21 | . "github.com/onsi/gomega"
22 | )
23 |
24 | func TestGenutil(t *testing.T) {
25 | RegisterFailHandler(Fail)
26 | RunSpecs(t, "Collector Suite")
27 | }
28 |
--------------------------------------------------------------------------------
/testdata/go/v4/memcached-operator/config/rbac/memcached_viewer_role.yaml:
--------------------------------------------------------------------------------
1 | # This rule is not used by the project memcached-operator itself.
2 | # It is provided to allow the cluster admin to help manage permissions for users.
3 | #
4 | # Grants read-only access to cache.example.com resources.
5 | # This role is intended for users who need visibility into these resources
6 | # without permissions to modify them. It is ideal for monitoring purposes and limited-access viewing.
7 |
8 | apiVersion: rbac.authorization.k8s.io/v1
9 | kind: ClusterRole
10 | metadata:
11 | labels:
12 | app.kubernetes.io/name: memcached-operator
13 | app.kubernetes.io/managed-by: kustomize
14 | name: memcached-viewer-role
15 | rules:
16 | - apiGroups:
17 | - cache.example.com
18 | resources:
19 | - memcacheds
20 | verbs:
21 | - get
22 | - list
23 | - watch
24 | - apiGroups:
25 | - cache.example.com
26 | resources:
27 | - memcacheds/status
28 | verbs:
29 | - get
30 |
--------------------------------------------------------------------------------
/testdata/helm/memcached-operator/config/rbac/memcached_viewer_role.yaml:
--------------------------------------------------------------------------------
1 | # This rule is not used by the project memcached-operator itself.
2 | # It is provided to allow the cluster admin to help manage permissions for users.
3 | #
4 | # Grants read-only access to cache.example.com resources.
5 | # This role is intended for users who need visibility into these resources
6 | # without permissions to modify them. It is ideal for monitoring purposes and limited-access viewing.
7 |
8 | apiVersion: rbac.authorization.k8s.io/v1
9 | kind: ClusterRole
10 | metadata:
11 | labels:
12 | app.kubernetes.io/name: memcached-operator
13 | app.kubernetes.io/managed-by: kustomize
14 | name: memcached-viewer-role
15 | rules:
16 | - apiGroups:
17 | - cache.example.com
18 | resources:
19 | - memcacheds
20 | verbs:
21 | - get
22 | - list
23 | - watch
24 | - apiGroups:
25 | - cache.example.com
26 | resources:
27 | - memcacheds/status
28 | verbs:
29 | - get
30 |
--------------------------------------------------------------------------------
/website/content/en/docs/cli/operator-sdk_completion_fish.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: "operator-sdk completion fish"
3 | ---
4 | ## operator-sdk completion fish
5 |
6 | Load fish completions
7 |
8 | ```
9 | operator-sdk completion fish [flags]
10 | ```
11 |
12 | ### Examples
13 |
14 | ```
15 | # To load completion for this session, execute:
16 | $ operator-sdk completion fish | source
17 |
18 | # To load completions for each session, execute once:
19 | $ operator-sdk completion fish > ~/.config/fish/completions/operator-sdk.fish
20 |
21 | ```
22 |
23 | ### Options
24 |
25 | ```
26 | -h, --help help for fish
27 | ```
28 |
29 | ### Options inherited from parent commands
30 |
31 | ```
32 | --plugins strings plugin keys to be used for this subcommand execution
33 | --verbose Enable verbose logging
34 | ```
35 |
36 | ### SEE ALSO
37 |
38 | * [operator-sdk completion](../operator-sdk_completion) - Load completions for the specified shell
39 |
40 |
--------------------------------------------------------------------------------
/internal/cmd/operator-sdk/alpha/config3alphato3/suite_test.go:
--------------------------------------------------------------------------------
1 | // Copyright 2021 The Operator-SDK Authors
2 | //
3 | // Licensed under the Apache License, Version 2.0 (the "License");
4 | // you may not use this file except in compliance with the License.
5 | // You may obtain a copy of the License at
6 | //
7 | // http://www.apache.org/licenses/LICENSE-2.0
8 | //
9 | // Unless required by applicable law or agreed to in writing, software
10 | // distributed under the License is distributed on an "AS IS" BASIS,
11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | // See the License for the specific language governing permissions and
13 | // limitations under the License.
14 |
15 | package config3alphato3
16 |
17 | import (
18 | "testing"
19 |
20 | . "github.com/onsi/ginkgo/v2"
21 | . "github.com/onsi/gomega"
22 | )
23 |
24 | func TestInternal(t *testing.T) {
25 | RegisterFailHandler(Fail)
26 | RunSpecs(t, "Internal Suite")
27 | }
28 |
--------------------------------------------------------------------------------
/internal/cmd/operator-sdk/scorecard/scorecard_suite_test.go:
--------------------------------------------------------------------------------
1 | // Copyright 2020 The Operator-SDK Authors
2 | //
3 | // Licensed under the Apache License, Version 2.0 (the "License");
4 | // you may not use this file except in compliance with the License.
5 | // You may obtain a copy of the License at
6 | //
7 | // http://www.apache.org/licenses/LICENSE-2.0
8 | //
9 | // Unless required by applicable law or agreed to in writing, software
10 | // distributed under the License is distributed on an "AS IS" BASIS,
11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | // See the License for the specific language governing permissions and
13 | // limitations under the License.
14 |
15 | package scorecard_test
16 |
17 | import (
18 | "testing"
19 |
20 | . "github.com/onsi/ginkgo/v2"
21 | . "github.com/onsi/gomega"
22 | )
23 |
24 | func TestScorecard(t *testing.T) {
25 | RegisterFailHandler(Fail)
26 | RunSpecs(t, "Scorecard Cmd Suite")
27 | }
28 |
--------------------------------------------------------------------------------
/internal/generate/packagemanifest/packagemanifest_suite_test.go:
--------------------------------------------------------------------------------
1 | // Copyright 2021 The Operator-SDK Authors
2 | //
3 | // Licensed under the Apache License, Version 2.0 (the "License");
4 | // you may not use this file except in compliance with the License.
5 | // You may obtain a copy of the License at
6 | //
7 | // http://www.apache.org/licenses/LICENSE-2.0
8 | //
9 | // Unless required by applicable law or agreed to in writing, software
10 | // distributed under the License is distributed on an "AS IS" BASIS,
11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | // See the License for the specific language governing permissions and
13 | // limitations under the License.
14 |
15 | package packagemanifest_test
16 |
17 | import (
18 | "testing"
19 |
20 | . "github.com/onsi/ginkgo/v2"
21 | . "github.com/onsi/gomega"
22 | )
23 |
24 | func TestGenerate(t *testing.T) {
25 | RegisterFailHandler(Fail)
26 | RunSpecs(t, "Generate Suite")
27 | }
28 |
--------------------------------------------------------------------------------
/internal/olm/operator/registry/configmap/configmap_suite_test.go:
--------------------------------------------------------------------------------
1 | // Copyright 2019 The Operator-SDK Authors
2 | //
3 | // Licensed under the Apache License, Version 2.0 (the "License");
4 | // you may not use this file except in compliance with the License.
5 | // You may obtain a copy of the License at
6 | //
7 | // http://www.apache.org/licenses/LICENSE-2.0
8 | //
9 | // Unless required by applicable law or agreed to in writing, software
10 | // distributed under the License is distributed on an "AS IS" BASIS,
11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | // See the License for the specific language governing permissions and
13 | // limitations under the License.
14 |
15 | package configmap_test
16 |
17 | import (
18 | "testing"
19 |
20 | . "github.com/onsi/ginkgo/v2"
21 | . "github.com/onsi/gomega"
22 | )
23 |
24 | func TestConfigmap(t *testing.T) {
25 | RegisterFailHandler(Fail)
26 | RunSpecs(t, "Configmap Suite")
27 | }
28 |
--------------------------------------------------------------------------------
/testdata/go/v4/monitoring/memcached-operator/config/rbac/memcached_viewer_role.yaml:
--------------------------------------------------------------------------------
1 | # This rule is not used by the project memcached-operator itself.
2 | # It is provided to allow the cluster admin to help manage permissions for users.
3 | #
4 | # Grants read-only access to cache.example.com resources.
5 | # This role is intended for users who need visibility into these resources
6 | # without permissions to modify them. It is ideal for monitoring purposes and limited-access viewing.
7 |
8 | apiVersion: rbac.authorization.k8s.io/v1
9 | kind: ClusterRole
10 | metadata:
11 | labels:
12 | app.kubernetes.io/name: memcached-operator
13 | app.kubernetes.io/managed-by: kustomize
14 | name: memcached-viewer-role
15 | rules:
16 | - apiGroups:
17 | - cache.example.com
18 | resources:
19 | - memcacheds
20 | verbs:
21 | - get
22 | - list
23 | - watch
24 | - apiGroups:
25 | - cache.example.com
26 | resources:
27 | - memcacheds/status
28 | verbs:
29 | - get
30 |
--------------------------------------------------------------------------------
/internal/generate/testdata/go/api/shared/memcached_types.go:
--------------------------------------------------------------------------------
1 | // Copyright 2021 The Operator-SDK Authors
2 | //
3 | // Licensed under the Apache License, Version 2.0 (the "License");
4 | // you may not use this file except in compliance with the License.
5 | // You may obtain a copy of the License at
6 | //
7 | // http://www.apache.org/licenses/LICENSE-2.0
8 | //
9 | // Unless required by applicable law or agreed to in writing, software
10 | // distributed under the License is distributed on an "AS IS" BASIS,
11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | // See the License for the specific language governing permissions and
13 | // limitations under the License.
14 |
15 | package shared
16 |
17 | import (
18 | v1 "k8s.io/api/core/v1"
19 | )
20 |
21 | // UsefulType is a type shared between APIs.
22 | type UsefulType struct {
23 | // +operator-sdk:csv:customresourcedefinitions:type=spec
24 | Containers []v1.Container `json:"containers"`
25 | }
26 |
--------------------------------------------------------------------------------
/internal/registry/logger.go:
--------------------------------------------------------------------------------
1 | // Copyright 2020 The Operator-SDK Authors
2 | //
3 | // Licensed under the Apache License, Version 2.0 (the "License");
4 | // you may not use this file except in compliance with the License.
5 | // You may obtain a copy of the License at
6 | //
7 | // http://www.apache.org/licenses/LICENSE-2.0
8 | //
9 | // Unless required by applicable law or agreed to in writing, software
10 | // distributed under the License is distributed on an "AS IS" BASIS,
11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | // See the License for the specific language governing permissions and
13 | // limitations under the License.
14 |
15 | package registry
16 |
17 | import (
18 | "io"
19 |
20 | log "github.com/sirupsen/logrus"
21 | )
22 |
23 | // DiscardLogger returns a logger that throws away input.
24 | func DiscardLogger() *log.Entry {
25 | logger := log.New()
26 | logger.SetOutput(io.Discard)
27 | return log.NewEntry(logger)
28 | }
29 |
--------------------------------------------------------------------------------
/website/scripts/update_latest_release_compat.sh:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 |
3 | # This script updates the latest release version's `kube_version` and `client_go_version`
4 | # variable to be up to date. This change should be committed in the prerelease commit.
5 |
6 | DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null 2>&1 && pwd)"
7 | CONFIG_PATH="${DIR}/../config.toml"
8 |
9 | KUBE_VERSION="$(cat Makefile | grep "export K8S_VERSION" | awk -F= '{ gsub(/ /,""); print $2 }')"
10 | CLIENT_GO_VERSION="$(cat go.mod | grep "k8s.io/client-go" | awk -F" " '{ print $2 }')"
11 |
12 | KUBE_MARKER="##LATEST_RELEASE_KUBE_VERSION##"
13 | CLIENT_GO_MARKER="##LATEST_RELEASE_CLIENT_GO_VERSION##"
14 |
15 | perl -0777 -pi -e $'s@'"${KUBE_MARKER}\\n kube_version = ".+'@'"${KUBE_MARKER}\\n kube_version = \"${KUBE_VERSION}\""'@g' ${CONFIG_PATH}
16 | perl -0777 -pi -e $'s@'"${CLIENT_GO_MARKER}\\n client_go_version = ".+'@'"${CLIENT_GO_MARKER}\\n client_go_version = \"${CLIENT_GO_VERSION}\""'@g' ${CONFIG_PATH}
--------------------------------------------------------------------------------
/internal/generate/clusterserviceversion/bases/definitions/definitions_suite_test.go:
--------------------------------------------------------------------------------
1 | // Copyright 2020 The Operator-SDK Authors
2 | //
3 | // Licensed under the Apache License, Version 2.0 (the "License");
4 | // you may not use this file except in compliance with the License.
5 | // You may obtain a copy of the License at
6 | //
7 | // http://www.apache.org/licenses/LICENSE-2.0
8 | //
9 | // Unless required by applicable law or agreed to in writing, software
10 | // distributed under the License is distributed on an "AS IS" BASIS,
11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | // See the License for the specific language governing permissions and
13 | // limitations under the License.
14 |
15 | package definitions
16 |
17 | import (
18 | "testing"
19 |
20 | . "github.com/onsi/ginkgo/v2"
21 | . "github.com/onsi/gomega"
22 | )
23 |
24 | func TestGenerator(t *testing.T) {
25 | RegisterFailHandler(Fail)
26 | RunSpecs(t, "Definitions Suite")
27 | }
28 |
--------------------------------------------------------------------------------
/internal/generate/clusterserviceversion/clusterserviceversion_suite_test.go:
--------------------------------------------------------------------------------
1 | // Copyright 2020 The Operator-SDK Authors
2 | //
3 | // Licensed under the Apache License, Version 2.0 (the "License");
4 | // you may not use this file except in compliance with the License.
5 | // You may obtain a copy of the License at
6 | //
7 | // http://www.apache.org/licenses/LICENSE-2.0
8 | //
9 | // Unless required by applicable law or agreed to in writing, software
10 | // distributed under the License is distributed on an "AS IS" BASIS,
11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | // See the License for the specific language governing permissions and
13 | // limitations under the License.
14 |
15 | package clusterserviceversion
16 |
17 | import (
18 | "testing"
19 |
20 | . "github.com/onsi/ginkgo/v2"
21 | . "github.com/onsi/gomega"
22 | )
23 |
24 | func TestGenerator(t *testing.T) {
25 | RegisterFailHandler(Fail)
26 | RunSpecs(t, "Generator Suite")
27 | }
28 |
--------------------------------------------------------------------------------
/hack/check-links.sh:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 |
3 | set -e
4 |
5 | source ./hack/lib/common.sh
6 |
7 | header_text "Building the website"
8 | docker volume create sdk-html
9 | trap_add "docker volume rm sdk-html" EXIT
10 | docker run --rm -v "$(pwd):/src" -v sdk-html:/src/website/public klakegg/hugo:0.73.0-ext-ubuntu -s website
11 |
12 | header_text "Checking links"
13 | # For config explanation: https://github.com/gjtorikian/html-proofer#special-cases-for-the-command-line
14 | docker run --rm -v sdk-html:/target klakegg/html-proofer:3.19.2 /target \
15 | --empty-alt-ignore \
16 | --http-status-ignore 429 \
17 | --allow_hash_href \
18 | --typhoeus-config='{"ssl_verifypeer":false,"followlocation":true,"connecttimeout":600,"timeout":600}' \
19 | --hydra-config='{"max_concurrency":5}' \
20 | --url-ignore "/github.com\/operator-framework\/operator-sdk\/edit\/master\//,https://docs.github.com/en/get-started/quickstart/fork-a-repo,https://github.com/operator-framework/operator-sdk/settings/access"
21 |
--------------------------------------------------------------------------------
/internal/cmd/operator-sdk/bundle/validate/internal/logger.go:
--------------------------------------------------------------------------------
1 | // Copyright 2020 The Operator-SDK Authors
2 | //
3 | // Licensed under the Apache License, Version 2.0 (the "License");
4 | // you may not use this file except in compliance with the License.
5 | // You may obtain a copy of the License at
6 | //
7 | // http://www.apache.org/licenses/LICENSE-2.0
8 | //
9 | // Unless required by applicable law or agreed to in writing, software
10 | // distributed under the License is distributed on an "AS IS" BASIS,
11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | // See the License for the specific language governing permissions and
13 | // limitations under the License.
14 |
15 | package internal
16 |
17 | import (
18 | "io"
19 |
20 | log "github.com/sirupsen/logrus"
21 | )
22 |
23 | // NewLoggerTo returns a logger that writes logs to w.
24 | func NewLoggerTo(w io.Writer) *log.Logger {
25 | logger := log.New()
26 | logger.SetOutput(w)
27 | return logger
28 | }
29 |
--------------------------------------------------------------------------------
/internal/cmd/operator-sdk/pkgmantobundle/pkgmantobundle_suite_test.go:
--------------------------------------------------------------------------------
1 | // Copyright 2021 The Operator-SDK Authors
2 | //
3 | // Licensed under the Apache License, Version 2.0 (the "License");
4 | // you may not use this file except in compliance with the License.
5 | // You may obtain a copy of the License at
6 | //
7 | // http://www.apache.org/licenses/LICENSE-2.0
8 | //
9 | // Unless required by applicable law or agreed to in writing, software
10 | // distributed under the License is distributed on an "AS IS" BASIS,
11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | // See the License for the specific language governing permissions and
13 | // limitations under the License.
14 |
15 | package pkgmantobundle
16 |
17 | import (
18 | "testing"
19 |
20 | . "github.com/onsi/ginkgo/v2"
21 | . "github.com/onsi/gomega"
22 | )
23 |
24 | func TestPackagemanifestsToBundle(t *testing.T) {
25 | RegisterFailHandler(Fail)
26 | RunSpecs(t, "pkgman-To-Bundle Suite")
27 | }
28 |
--------------------------------------------------------------------------------
/internal/cmd/operator-sdk/run/packagemanifests/packagemanifests_suite_test.go:
--------------------------------------------------------------------------------
1 | // Copyright 2020 The Operator-SDK Authors
2 | //
3 | // Licensed under the Apache License, Version 2.0 (the "License");
4 | // you may not use this file except in compliance with the License.
5 | // You may obtain a copy of the License at
6 | //
7 | // http://www.apache.org/licenses/LICENSE-2.0
8 | //
9 | // Unless required by applicable law or agreed to in writing, software
10 | // distributed under the License is distributed on an "AS IS" BASIS,
11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | // See the License for the specific language governing permissions and
13 | // limitations under the License.
14 |
15 | package packagemanifests_test
16 |
17 | import (
18 | "testing"
19 |
20 | . "github.com/onsi/ginkgo/v2"
21 | . "github.com/onsi/gomega"
22 | )
23 |
24 | func TestRun(t *testing.T) {
25 | RegisterFailHandler(Fail)
26 | RunSpecs(t, "Packagemanifests Cmd Suite")
27 | }
28 |
--------------------------------------------------------------------------------
/changelog/generated/v1.29.0.md:
--------------------------------------------------------------------------------
1 | ## v1.29.0
2 |
3 | ### Changes
4 |
5 | - (scorecard): Update kuttl to v0.15.0 in the scorecard-test-kuttl image. ([#6401](https://github.com/operator-framework/operator-sdk/pull/6401))
6 | - (ansible/v1): Bump the golang base image version in the ansible-operator Dockerfiles from 1.18 to 1.19. ([#6398](https://github.com/operator-framework/operator-sdk/pull/6398))
7 | - (operator-sdk run bundle): Compress the bundle content, to avoid the configMap exceed max length error. The error will look like this:
8 | `... ConfigMap ... is invalid: []: Too long: must have at most 1048576 bytes`.
9 | Fixes issue [#6323](https://github.com/operator-framework/operator-sdk/issues/6323). ([#6408](https://github.com/operator-framework/operator-sdk/pull/6408))
10 |
11 | ### Bug Fixes
12 |
13 | - (docs): Update the go version in the developer guide. The documentation wasn't updated when the go version was bumped to v1.19. ([#6101](https://github.com/operator-framework/operator-sdk/pull/6101))
14 |
--------------------------------------------------------------------------------
/website/content/en/docs/cli/operator-sdk_olm_uninstall.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: "operator-sdk olm uninstall"
3 | ---
4 | ## operator-sdk olm uninstall
5 |
6 | Uninstall Operator Lifecycle Manager from your cluster
7 |
8 | ```
9 | operator-sdk olm uninstall [flags]
10 | ```
11 |
12 | ### Options
13 |
14 | ```
15 | -h, --help help for uninstall
16 | --olm-namespace string namespace from where OLM is to be uninstalled. (default "olm")
17 | --timeout duration time to wait for the command to complete before failing (default 2m0s)
18 | --version string version of OLM resources to uninstall.
19 | ```
20 |
21 | ### Options inherited from parent commands
22 |
23 | ```
24 | --plugins strings plugin keys to be used for this subcommand execution
25 | --verbose Enable verbose logging
26 | ```
27 |
28 | ### SEE ALSO
29 |
30 | * [operator-sdk olm](../operator-sdk_olm) - Manage the Operator Lifecycle Manager installation in your cluster
31 |
32 |
--------------------------------------------------------------------------------
/internal/cmd/operator-sdk/generate/packagemanifests/packagemanifests_suite_test.go:
--------------------------------------------------------------------------------
1 | // Copyright 2021 The Operator-SDK Authors
2 | //
3 | // Licensed under the Apache License, Version 2.0 (the "License");
4 | // you may not use this file except in compliance with the License.
5 | // You may obtain a copy of the License at
6 | //
7 | // http://www.apache.org/licenses/LICENSE-2.0
8 | //
9 | // Unless required by applicable law or agreed to in writing, software
10 | // distributed under the License is distributed on an "AS IS" BASIS,
11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | // See the License for the specific language governing permissions and
13 | // limitations under the License.
14 |
15 | package packagemanifests
16 |
17 | import (
18 | "testing"
19 |
20 | . "github.com/onsi/ginkgo/v2"
21 | . "github.com/onsi/gomega"
22 | )
23 |
24 | func TestPackagemanifests(t *testing.T) {
25 | RegisterFailHandler(Fail)
26 | RunSpecs(t, "Packagemanifests Suite")
27 | }
28 |
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE/doc-report.md:
--------------------------------------------------------------------------------
1 | ---
2 | name: Doc Report
3 | about: Raise an issue with the documentation.
4 | title: ''
5 | labels: kind/documentation
6 | assignees: ''
7 |
8 | ---
9 |
10 |
13 |
14 | ### What is the URL of the document?
15 |
16 |
17 |
18 | ### Which section(s) is the issue in?
19 |
20 |
21 |
22 | ### What needs fixing?
23 |
24 |
25 |
26 | #### Additional context
27 |
28 |
29 |
--------------------------------------------------------------------------------
/internal/bindata/olm/versions.go:
--------------------------------------------------------------------------------
1 | // Copyright 2020 The Operator-SDK Authors
2 | //
3 | // Licensed under the Apache License, Version 2.0 (the "License");
4 | // you may not use this file except in compliance with the License.
5 | // You may obtain a copy of the License at
6 | //
7 | // http://www.apache.org/licenses/LICENSE-2.0
8 | //
9 | // Unless required by applicable law or agreed to in writing, software
10 | // distributed under the License is distributed on an "AS IS" BASIS,
11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | // See the License for the specific language governing permissions and
13 | // limitations under the License.
14 |
15 | package olm
16 |
17 | var availableVersions = map[string]struct{}{
18 | "0.25.0": {},
19 | "0.26.0": {},
20 | "0.27.0": {},
21 | }
22 |
23 | // HasVersion returns whether version maps to released OLM manifests as bindata.
24 | func HasVersion(version string) bool {
25 | _, ok := availableVersions[version]
26 | return ok
27 | }
28 |
--------------------------------------------------------------------------------