Skip to content

Commit e29f502

Browse files
author
Per Goncalves da Silva
committed
Revert API changes
Signed-off-by: Per Goncalves da Silva <pegoncal@redhat.com>
1 parent e89394b commit e29f502

6 files changed

Lines changed: 9 additions & 30 deletions

File tree

api/v1/clusterextension_types.go

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -66,19 +66,10 @@ type ClusterExtensionSpec struct {
6666
// with the cluster that are required to manage the extension.
6767
// The ServiceAccount must be configured with the necessary permissions to perform these interactions.
6868
// The ServiceAccount must exist in the namespace referenced in the spec.
69+
// serviceAccount is required.
6970
//
70-
// serviceAccount is optional. If a service account is not defined, requests to the apiserver will instead use
71-
// username "olmv1:clusterextensions:<clusterExtension.metadata.name>:admin" and groups
72-
// "olmv1:clusterextensions:admin" and "system:authenticated"
73-
//
74-
// Deprecated: Use of serviceAccount is not recommended. Instead, administrators are encouraged
75-
// to use the synthetic user/groups described above. All of the same RBAC setup is still required with these
76-
// synthetic user/groups. However, this mode is preferred because it requires administrators to specifically
77-
// configure RBAC for extension management, rather than enabling piggybacking on existing highly privileged
78-
// service accounts that already exist on the cluster.
79-
//
80-
// +optional
81-
ServiceAccount *ServiceAccountReference `json:"serviceAccount"`
71+
// +kubebuilder:validation:Required
72+
ServiceAccount ServiceAccountReference `json:"serviceAccount"`
8273

8374
// source is a required field which selects the installation source of content
8475
// for this ClusterExtension. Selection is performed by setting the sourceType.

api/v1/zz_generated.deepcopy.go

Lines changed: 1 addition & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

config/base/operator-controller/crd/bases/olm.operatorframework.io_clusterextensions.yaml

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -135,16 +135,7 @@ spec:
135135
with the cluster that are required to manage the extension.
136136
The ServiceAccount must be configured with the necessary permissions to perform these interactions.
137137
The ServiceAccount must exist in the namespace referenced in the spec.
138-
139-
serviceAccount is optional. If a service account is not defined, requests to the apiserver will instead use
140-
username "olmv1:clusterextensions:<clusterExtension.metadata.name>:admin" and groups
141-
"olmv1:clusterextensions:admin" and "system:authenticated"
142-
143-
Deprecated: Use of serviceAccount is not recommended. Instead, administrators are encouraged
144-
to use the synthetic user/groups described above. All of the same RBAC setup is still required with these
145-
synthetic user/groups. However, this mode is preferred because it requires administrators to specifically
146-
configure RBAC for extension management, rather than enabling piggybacking on existing highly privileged
147-
service accounts that already exist on the cluster.
138+
serviceAccount is required.
148139
properties:
149140
name:
150141
description: |-
@@ -467,6 +458,7 @@ spec:
467458
has(self.catalog) : !has(self.catalog)'
468459
required:
469460
- namespace
461+
- serviceAccount
470462
- source
471463
type: object
472464
status:

internal/operator-controller/controllers/clusterextension_admission_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -356,7 +356,7 @@ func TestClusterExtensionAdmissionServiceAccount(t *testing.T) {
356356
},
357357
},
358358
Namespace: "default",
359-
ServiceAccount: &ocv1.ServiceAccountReference{
359+
ServiceAccount: ocv1.ServiceAccountReference{
360360
Name: tc.serviceAccount,
361361
},
362362
}))

internal/operator-controller/controllers/clusterextension_controller_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -284,7 +284,7 @@ func TestClusterExtensionServiceAccountNotFound(t *testing.T) {
284284
},
285285
},
286286
Namespace: "default",
287-
ServiceAccount: &ocv1.ServiceAccountReference{
287+
ServiceAccount: ocv1.ServiceAccountReference{
288288
Name: "missing-sa",
289289
},
290290
},

test/e2e/cluster_extension_install_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -395,7 +395,7 @@ func TestClusterExtensionInstallWithDeprecatedServiceAccount(t *testing.T) {
395395
},
396396
},
397397
Namespace: ns.Name,
398-
ServiceAccount: &ocv1.ServiceAccountReference{Name: sa.Name},
398+
ServiceAccount: ocv1.ServiceAccountReference{Name: sa.Name},
399399
}
400400
t.Log("It resolves the specified package with correct bundle path")
401401
t.Log("By creating the ClusterExtension resource")

0 commit comments

Comments
 (0)