Skip to content

Commit afd2706

Browse files
author
Per Goncalves da Silva
committed
Prune v1.0.0 test-operator
Signed-off-by: Per Goncalves da Silva <pegoncal@redhat.com>
1 parent c0a5c2c commit afd2706

File tree

146 files changed

+93
-6590
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

146 files changed

+93
-6590
lines changed

test/test-operator/v2/api/v1/groupversion_info.go renamed to test/test-operator/v1.0.0/api/v1/groupversion_info.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ limitations under the License.
1515
*/
1616

1717
// Package v1 contains API Schema definitions for the testolm v1 API group.
18-
// +kubebuilder:object:generate=true
19-
// +groupName=testolm.operator-framework.io
18+
// +kubebuilder:object:generate=false
19+
// +groupName=testolm.operatorframework.io
2020
package v1
2121

2222
import (
@@ -26,7 +26,7 @@ import (
2626

2727
var (
2828
// GroupVersion is group version used to register these objects.
29-
GroupVersion = schema.GroupVersion{Group: "testolm.operator-framework.io", Version: "v1"}
29+
GroupVersion = schema.GroupVersion{Group: "testolm.operatorframework.io", Version: "v1"}
3030

3131
// SchemeBuilder is used to add go types to the GroupVersionKind scheme.
3232
SchemeBuilder = &scheme.Builder{GroupVersion: GroupVersion}

test/test-operator/v1.0.0/bin/manager

50.9 MB
Binary file not shown.

test/test-operator/v2/bundle/manifests/v1.clusterserviceversion.yaml renamed to test/test-operator/v1.0.0/bundle/manifests/test-operator.v1.0.0.clusterserviceversion.yaml

Lines changed: 19 additions & 122 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@ metadata:
44
annotations:
55
alm-examples: '[]'
66
capabilities: Basic Install
7-
createdAt: "2025-07-03T15:21:41Z"
7+
createdAt: "2025-07-03T15:15:31Z"
88
operators.operatorframework.io/builder: operator-sdk-v1.40.0+git
99
operators.operatorframework.io/project_layout: go.kubebuilder.io/v4
10-
name: v1.v0.0.1
10+
name: test-operator.v1.0.0
1111
namespace: placeholder
1212
spec:
1313
apiservicedefinitions: {}
@@ -16,14 +16,9 @@ spec:
1616
- description: TestOperator is the Schema for the testoperators API.
1717
displayName: Test Operator
1818
kind: TestOperator
19-
name: testoperators.testolm.operator-framework.io
19+
name: testoperators.testolm.operatorframework.io
2020
version: v1
21-
- description: TestOperator is the Schema for the testoperators API.
22-
displayName: Test Operator
23-
kind: TestOperator
24-
name: testoperators.testolm.operator-framework.io
25-
version: v2
26-
description: OLM Test Operator
21+
description: Test OLM Operator
2722
displayName: OLM Test Operator
2823
icon:
2924
- base64data: ""
@@ -33,7 +28,7 @@ spec:
3328
clusterPermissions:
3429
- rules:
3530
- apiGroups:
36-
- testolm.operator-framework.io
31+
- testolm.operatorframework.io
3732
resources:
3833
- testoperators
3934
verbs:
@@ -45,13 +40,13 @@ spec:
4540
- update
4641
- watch
4742
- apiGroups:
48-
- testolm.operator-framework.io
43+
- testolm.operatorframework.io
4944
resources:
5045
- testoperators/finalizers
5146
verbs:
5247
- update
5348
- apiGroups:
54-
- testolm.operator-framework.io
49+
- testolm.operatorframework.io
5550
resources:
5651
- testoperators/status
5752
verbs:
@@ -70,53 +65,47 @@ spec:
7065
- subjectaccessreviews
7166
verbs:
7267
- create
73-
serviceAccountName: v1-controller-manager
68+
serviceAccountName: test-operator-controller-manager
7469
deployments:
7570
- label:
7671
app.kubernetes.io/managed-by: kustomize
77-
app.kubernetes.io/name: v1
72+
app.kubernetes.io/name: test-operator
7873
control-plane: controller-manager
79-
name: v1-controller-manager
74+
name: test-operator-controller-manager
8075
spec:
8176
replicas: 1
8277
selector:
8378
matchLabels:
84-
app.kubernetes.io/name: v1
79+
app.kubernetes.io/name: test-operator
8580
control-plane: controller-manager
8681
strategy: {}
8782
template:
8883
metadata:
8984
annotations:
9085
kubectl.kubernetes.io/default-container: manager
9186
labels:
92-
app.kubernetes.io/name: v1
87+
app.kubernetes.io/name: test-operator
9388
control-plane: controller-manager
9489
spec:
9590
containers:
9691
- args:
97-
- --metrics-bind-address=:8443
9892
- --leader-elect
9993
- --health-probe-bind-address=:8081
100-
- --webhook-cert-path=/tmp/k8s-webhook-server/serving-certs
10194
command:
10295
- /manager
10396
env:
10497
- name: WATCH_NAMESPACE
10598
valueFrom:
10699
fieldRef:
107100
fieldPath: metadata.annotations['olm.targetNamespaces']
108-
image: controller:latest
101+
image: docker.io/perdasilva/test-operator:v1.0.0
109102
livenessProbe:
110103
httpGet:
111104
path: /healthz
112105
port: 8081
113106
initialDelaySeconds: 15
114107
periodSeconds: 20
115108
name: manager
116-
ports:
117-
- containerPort: 9443
118-
name: webhook-server
119-
protocol: TCP
120109
readinessProbe:
121110
httpGet:
122111
path: /readyz
@@ -139,7 +128,7 @@ spec:
139128
runAsNonRoot: true
140129
seccompProfile:
141130
type: RuntimeDefault
142-
serviceAccountName: v1-controller-manager
131+
serviceAccountName: test-operator-controller-manager
143132
terminationGracePeriodSeconds: 10
144133
permissions:
145134
- rules:
@@ -174,12 +163,12 @@ spec:
174163
verbs:
175164
- create
176165
- patch
177-
serviceAccountName: v1-controller-manager
166+
serviceAccountName: test-operator-controller-manager
178167
strategy: deployment
179168
installModes:
180-
- supported: false
169+
- supported: true
181170
type: OwnNamespace
182-
- supported: false
171+
- supported: true
183172
type: SingleNamespace
184173
- supported: false
185174
type: MultiNamespace
@@ -190,104 +179,12 @@ spec:
190179
- operator
191180
links:
192181
- name: V1
193-
url: https://v1.domain
182+
url: https://github.com/operator-framework/operator-controller
194183
maintainers:
195184
- email: operator-framework-olm-dev@googlegroups.com
196185
name: community
197186
maturity: alpha
198187
provider:
199188
name: operator-framework
200189
url: https://github.com/operator-framework/operator-controller
201-
version: 0.0.1
202-
webhookdefinitions:
203-
- admissionReviewVersions:
204-
- v1
205-
containerPort: 443
206-
conversionCRDs:
207-
- testoperators.testolm.operator-framework.io
208-
deploymentName: v1-controller-manager
209-
generateName: ctestoperators.kb.io
210-
sideEffects: None
211-
targetPort: 9443
212-
type: ConversionWebhook
213-
webhookPath: /convert
214-
- admissionReviewVersions:
215-
- v1
216-
containerPort: 443
217-
deploymentName: v1-controller-manager
218-
failurePolicy: Fail
219-
generateName: mtestoperator-v1.kb.io
220-
rules:
221-
- apiGroups:
222-
- testolm.operator-framework.io
223-
apiVersions:
224-
- v1
225-
operations:
226-
- CREATE
227-
- UPDATE
228-
resources:
229-
- testoperators
230-
sideEffects: None
231-
targetPort: 9443
232-
type: MutatingAdmissionWebhook
233-
webhookPath: /mutate-testolm-operator-framework-io-v1-testoperator
234-
- admissionReviewVersions:
235-
- v1
236-
containerPort: 443
237-
deploymentName: v1-controller-manager
238-
failurePolicy: Fail
239-
generateName: mtestoperator-v2.kb.io
240-
rules:
241-
- apiGroups:
242-
- testolm.operator-framework.io
243-
apiVersions:
244-
- v2
245-
operations:
246-
- CREATE
247-
- UPDATE
248-
resources:
249-
- testoperators
250-
sideEffects: None
251-
targetPort: 9443
252-
type: MutatingAdmissionWebhook
253-
webhookPath: /mutate-testolm-operator-framework-io-v2-testoperator
254-
- admissionReviewVersions:
255-
- v1
256-
containerPort: 443
257-
deploymentName: v1-controller-manager
258-
failurePolicy: Fail
259-
generateName: vtestoperator-v1.kb.io
260-
rules:
261-
- apiGroups:
262-
- testolm.operator-framework.io
263-
apiVersions:
264-
- v1
265-
operations:
266-
- CREATE
267-
- UPDATE
268-
resources:
269-
- testoperators
270-
sideEffects: None
271-
targetPort: 9443
272-
type: ValidatingAdmissionWebhook
273-
webhookPath: /validate-testolm-operator-framework-io-v1-testoperator
274-
- admissionReviewVersions:
275-
- v1
276-
containerPort: 443
277-
deploymentName: v1-controller-manager
278-
failurePolicy: Fail
279-
generateName: vtestoperator-v2.kb.io
280-
rules:
281-
- apiGroups:
282-
- testolm.operator-framework.io
283-
apiVersions:
284-
- v2
285-
operations:
286-
- CREATE
287-
- UPDATE
288-
resources:
289-
- testoperators
290-
sideEffects: None
291-
targetPort: 9443
292-
type: ValidatingAdmissionWebhook
293-
webhookPath: /validate-testolm-operator-framework-io-v2-testoperator
190+
version: 1.0.0

test/test-operator/v1/bundle/manifests/testolm.operator-framework.io_testoperators.yaml renamed to test/test-operator/v1.0.0/bundle/manifests/testolm.operatorframework.io_testoperators.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ metadata:
44
annotations:
55
controller-gen.kubebuilder.io/version: v0.18.0
66
creationTimestamp: null
7-
name: testoperators.testolm.operator-framework.io
7+
name: testoperators.testolm.operatorframework.io
88
spec:
9-
group: testolm.operator-framework.io
9+
group: testolm.operatorframework.io
1010
names:
1111
kind: TestOperator
1212
listKind: TestOperatorList
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
annotations:
2+
operators.operatorframework.io.bundle.mediatype.v1: registry+v1
3+
operators.operatorframework.io.bundle.manifests.v1: manifests/
4+
operators.operatorframework.io.bundle.metadata.v1: metadata/
5+
operators.operatorframework.io.bundle.package.v1: test-operator
6+
operators.operatorframework.io.bundle.channels.v1: alpha

test/test-operator/v1/cmd/main.go renamed to test/test-operator/v1.0.0/cmd/main.go

Lines changed: 7 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ package main
1919
import (
2020
"crypto/tls"
2121
"flag"
22-
"fmt"
2322
"os"
2423
"path/filepath"
2524
"sigs.k8s.io/controller-runtime/pkg/cache"
@@ -39,9 +38,8 @@ import (
3938
metricsserver "sigs.k8s.io/controller-runtime/pkg/metrics/server"
4039
"sigs.k8s.io/controller-runtime/pkg/webhook"
4140

42-
testolmv1 "github.com/operator-framework/operator-controller/test/test-operator/v1/api/v1"
43-
"github.com/operator-framework/operator-controller/test/test-operator/v1/internal/controller"
44-
webhookv1 "github.com/operator-framework/operator-controller/test/test-operator/v1/internal/webhook/v1"
41+
testolmv1 "github.com/operator-framework/operator-controller/test/test-operator/v1.0.0/api/v1"
42+
"github.com/operator-framework/operator-controller/test/test-operator/v1.0.0/internal/controller"
4543
// +kubebuilder:scaffold:imports
4644
)
4745

@@ -181,19 +179,15 @@ func main() {
181179
})
182180
}
183181

184-
watchNamespace, err := getWatchNamespace()
185-
if err != nil {
186-
setupLog.Error(err, "unable to get WatchNamespace, "+
187-
"the manager will watch and manage resources in all namespaces")
188-
}
182+
watchNamespace := getWatchNamespace()
189183

190184
mgr, err := ctrl.NewManager(ctrl.GetConfigOrDie(), ctrl.Options{
191185
Scheme: scheme,
192186
Metrics: metricsServerOptions,
193187
WebhookServer: webhookServer,
194188
HealthProbeBindAddress: probeAddr,
195189
LeaderElection: enableLeaderElection,
196-
LeaderElectionID: "e10ca34c.operator-framework.io",
190+
LeaderElectionID: "e10ca34c.operatorframework.io",
197191
Cache: cache.Options{
198192
DefaultNamespaces: map[string]cache.Config{watchNamespace: {}},
199193
},
@@ -221,13 +215,6 @@ func main() {
221215
setupLog.Error(err, "unable to create controller", "controller", "TestOperator")
222216
os.Exit(1)
223217
}
224-
// nolint:goconst
225-
if os.Getenv("ENABLE_WEBHOOKS") != "false" {
226-
if err := webhookv1.SetupTestOperatorWebhookWithManager(mgr); err != nil {
227-
setupLog.Error(err, "unable to create webhook", "webhook", "TestOperator")
228-
os.Exit(1)
229-
}
230-
}
231218
// +kubebuilder:scaffold:builder
232219

233220
if metricsCertWatcher != nil {
@@ -263,15 +250,12 @@ func main() {
263250
}
264251

265252
// getWatchNamespace returns the Namespace the operator should be watching for changes
266-
func getWatchNamespace() (string, error) {
253+
func getWatchNamespace() string {
267254
// WatchNamespaceEnvVar is the constant for env variable WATCH_NAMESPACE
268255
// which specifies the Namespace to watch.
269256
// An empty value means the operator is running with cluster scope.
270257
var watchNamespaceEnvVar = "WATCH_NAMESPACE"
271258

272-
ns, found := os.LookupEnv(watchNamespaceEnvVar)
273-
if !found {
274-
return "", fmt.Errorf("%s must be set", watchNamespaceEnvVar)
275-
}
276-
return ns, nil
259+
ns, _ := os.LookupEnv(watchNamespaceEnvVar)
260+
return ns
277261
}

0 commit comments

Comments
 (0)