Skip to content

Commit bc04e3d

Browse files
committed
Deprecate spec.ServiceAccount and remove synthetic permissions feature
Make spec.ServiceAccount an optional field and note that it's now deprecated and does not perform any function. Make OLM use cluster-admin by default for managing ClusterExtensions. Remove the permissions preflight experimental feature flag. Remove the synthetic permissions experimental feature flag.
1 parent dcf2963 commit bc04e3d

File tree

27 files changed

+52
-1892
lines changed

27 files changed

+52
-1892
lines changed

api/v1/clusterextension_types.go

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,7 @@ const (
4949
// ClusterExtensionSpec defines the desired state of ClusterExtension
5050
type ClusterExtensionSpec struct {
5151
// namespace is a reference to a Kubernetes namespace.
52-
// This is the namespace in which the provided ServiceAccount must exist.
53-
// It also designates the default namespace where namespace-scoped resources
52+
// It designates the default namespace where namespace-scoped resources
5453
// for the extension are applied to the cluster.
5554
// Some extensions may contain namespace-scoped resources to be applied in other namespaces.
5655
// This namespace must exist.
@@ -67,14 +66,13 @@ type ClusterExtensionSpec struct {
6766
// +kubebuilder:validation:Required
6867
Namespace string `json:"namespace"`
6968

70-
// serviceAccount is a reference to a ServiceAccount used to perform all interactions
69+
// serviceAccount is deprecated and ignored by OLM.
70+
// serviceAccount was a reference to the ServiceAccount used to perform all interactions
7171
// with the cluster that are required to manage the extension.
72-
// The ServiceAccount must be configured with the necessary permissions to perform these interactions.
73-
// The ServiceAccount must exist in the namespace referenced in the spec.
74-
// serviceAccount is required.
72+
// serviceAccount is optional.
7573
//
76-
// +kubebuilder:validation:Required
77-
ServiceAccount ServiceAccountReference `json:"serviceAccount"`
74+
// +kubebuilder:validation:Optional
75+
ServiceAccount ServiceAccountReference `json:"serviceAccount,omitzero"`
7876

7977
// source is a required field which selects the installation source of content
8078
// for this ClusterExtension. Selection is performed by setting the sourceType.
@@ -369,7 +367,8 @@ type CatalogFilter struct {
369367
UpgradeConstraintPolicy UpgradeConstraintPolicy `json:"upgradeConstraintPolicy,omitempty"`
370368
}
371369

372-
// ServiceAccountReference identifies the serviceAccount used fo install a ClusterExtension.
370+
// ServiceAccountReference identifies the serviceAccount used to install a ClusterExtension.
371+
// Note: The serviceAccount field is deprecated and ignored by OLM.
373372
type ServiceAccountReference struct {
374373
// name is a required, immutable reference to the name of the ServiceAccount
375374
// to be used for installation and management of the content for the package

cmd/operator-controller/main.go

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,6 @@ import (
6262
ocv1 "github.com/operator-framework/operator-controller/api/v1"
6363
"github.com/operator-framework/operator-controller/internal/operator-controller/action"
6464
"github.com/operator-framework/operator-controller/internal/operator-controller/applier"
65-
"github.com/operator-framework/operator-controller/internal/operator-controller/authentication"
66-
"github.com/operator-framework/operator-controller/internal/operator-controller/authorization"
6765
"github.com/operator-framework/operator-controller/internal/operator-controller/catalogmetadata/cache"
6866
catalogclient "github.com/operator-framework/operator-controller/internal/operator-controller/catalogmetadata/client"
6967
"github.com/operator-framework/operator-controller/internal/operator-controller/contentmanager"
@@ -606,11 +604,8 @@ func setupHelm(
606604
if err != nil {
607605
return fmt.Errorf("unable to create core client: %w", err)
608606
}
609-
tokenGetter := authentication.NewTokenGetter(coreClient, authentication.WithExpirationDuration(1*time.Hour))
610-
clientRestConfigMapper := action.ServiceAccountRestConfigMapper(tokenGetter)
611-
if features.OperatorControllerFeatureGate.Enabled(features.SyntheticPermissions) {
612-
clientRestConfigMapper = action.SyntheticUserRestConfigMapper(clientRestConfigMapper)
613-
}
607+
608+
clientRestConfigMapper := action.ClusterAdminRestConfigMapper(mgr.GetConfig())
614609

615610
cfgGetter, err := helmclient.NewActionConfigGetter(mgr.GetConfig(), mgr.GetRESTMapper(),
616611
helmclient.StorageDriverMapper(action.ChunkedStorageDriverMapper(coreClient, mgr.GetAPIReader(), cfg.systemNamespace)),
@@ -631,12 +626,6 @@ func setupHelm(
631626
return fmt.Errorf("unable to create helm action client getter: %w", err)
632627
}
633628

634-
// determine if PreAuthorizer should be enabled based on feature gate
635-
var preAuth authorization.PreAuthorizer
636-
if features.OperatorControllerFeatureGate.Enabled(features.PreflightPermissions) {
637-
preAuth = authorization.NewRBACPreAuthorizer(mgr.GetClient())
638-
}
639-
640629
cm := contentmanager.NewManager(clientRestConfigMapper, mgr.GetConfig(), mgr.GetRESTMapper())
641630
err = clusterExtensionFinalizers.Register(controllers.ClusterExtensionCleanupContentManagerCacheFinalizer, finalizers.FinalizerFunc(func(ctx context.Context, obj client.Object) (crfinalizer.Result, error) {
642631
ext := obj.(*ocv1.ClusterExtension)
@@ -660,7 +649,6 @@ func setupHelm(
660649
IsWebhookSupportEnabled: certProvider != nil,
661650
},
662651
HelmReleaseToObjectsConverter: &applier.HelmReleaseToObjectsConverter{},
663-
PreAuthorizer: preAuth,
664652
Watcher: ceController,
665653
Manager: cm,
666654
}

docs/api-reference/olmv1-api-reference.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -339,8 +339,8 @@ _Appears in:_
339339

340340
| Field | Description | Default | Validation |
341341
| --- | --- | --- | --- |
342-
| `namespace` _string_ | namespace is a reference to a Kubernetes namespace.<br />This is the namespace in which the provided ServiceAccount must exist.<br />It also designates the default namespace where namespace-scoped resources<br />for the extension are applied to the cluster.<br />Some extensions may contain namespace-scoped resources to be applied in other namespaces.<br />This namespace must exist.<br /><br />namespace is required, immutable, and follows the DNS label standard<br />as defined in [RFC 1123]. It must contain only lowercase alphanumeric characters or hyphens (-),<br />start and end with an alphanumeric character, and be no longer than 63 characters<br /><br />[RFC 1123]: https://tools.ietf.org/html/rfc1123 | | MaxLength: 63 <br />Required: \{\} <br /> |
343-
| `serviceAccount` _[ServiceAccountReference](#serviceaccountreference)_ | serviceAccount is a reference to a ServiceAccount used to perform all interactions<br />with the cluster that are required to manage the extension.<br />The ServiceAccount must be configured with the necessary permissions to perform these interactions.<br />The ServiceAccount must exist in the namespace referenced in the spec.<br />serviceAccount is required. | | Required: \{\} <br /> |
342+
| `namespace` _string_ | namespace is a reference to a Kubernetes namespace.<br />It designates the default namespace where namespace-scoped resources<br />for the extension are applied to the cluster.<br />Some extensions may contain namespace-scoped resources to be applied in other namespaces.<br />This namespace must exist.<br /><br />namespace is required, immutable, and follows the DNS label standard<br />as defined in [RFC 1123]. It must contain only lowercase alphanumeric characters or hyphens (-),<br />start and end with an alphanumeric character, and be no longer than 63 characters<br /><br />[RFC 1123]: https://tools.ietf.org/html/rfc1123 | | MaxLength: 63 <br />Required: \{\} <br /> |
343+
| `serviceAccount` _[ServiceAccountReference](#serviceaccountreference)_ | serviceAccount is deprecated and ignored by OLM.<br />serviceAccount was a reference to the ServiceAccount used to perform all interactions<br />with the cluster that are required to manage the extension.<br />serviceAccount is optional. | | Optional: \{\} <br /> |
344344
| `source` _[SourceConfig](#sourceconfig)_ | source is a required field which selects the installation source of content<br />for this ClusterExtension. Selection is performed by setting the sourceType.<br /><br />Catalog is currently the only implemented sourceType, and setting the<br />sourcetype to "Catalog" requires the catalog field to also be defined.<br /><br />Below is a minimal example of a source definition (in yaml):<br /><br />source:<br /> sourceType: Catalog<br /> catalog:<br /> packageName: example-package | | Required: \{\} <br /> |
345345
| `install` _[ClusterExtensionInstallConfig](#clusterextensioninstallconfig)_ | install is an optional field used to configure the installation options<br />for the ClusterExtension such as the pre-flight check configuration. | | |
346346
| `config` _[ClusterExtensionConfig](#clusterextensionconfig)_ | config contains optional configuration values applied during rendering of the<br />ClusterExtension's manifests. Values can be specified inline.<br /><br />config is optional. When not specified, the default configuration of the resolved bundle will be used.<br /><br /><opcon:experimental> | | |
@@ -440,7 +440,8 @@ _Appears in:_
440440

441441

442442

443-
ServiceAccountReference identifies the serviceAccount used fo install a ClusterExtension.
443+
ServiceAccountReference identifies the serviceAccount used to install a ClusterExtension.
444+
Note: The serviceAccount field is deprecated and ignored by OLM.
444445

445446

446447

go.mod

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@ require (
3939
k8s.io/client-go v0.34.0
4040
k8s.io/component-base v0.34.0
4141
k8s.io/klog/v2 v2.130.1
42-
k8s.io/kubernetes v1.34.0
4342
k8s.io/utils v0.0.0-20250604170112-4c0f3b243397
4443
pkg.package-operator.run/boxcutter v0.7.1
4544
sigs.k8s.io/controller-runtime v0.22.1
@@ -48,10 +47,7 @@ require (
4847
sigs.k8s.io/yaml v1.6.0
4948
)
5049

51-
require (
52-
k8s.io/component-helpers v0.34.0 // indirect
53-
k8s.io/kube-openapi v0.0.0-20250710124328-f3f2b991d03b // indirect
54-
)
50+
require k8s.io/kube-openapi v0.0.0-20250710124328-f3f2b991d03b // indirect
5551

5652
require (
5753
cel.dev/expr v0.24.0 // indirect
@@ -242,7 +238,6 @@ require (
242238
gopkg.in/warnings.v0 v0.1.2 // indirect
243239
gopkg.in/yaml.v2 v2.4.0 // indirect
244240
gopkg.in/yaml.v3 v3.0.1 // indirect
245-
k8s.io/controller-manager v0.33.2 // indirect
246241
k8s.io/kubectl v0.34.0 // indirect
247242
oras.land/oras-go/v2 v2.6.0 // indirect
248243
sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.33.0 // indirect

go.sum

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -765,18 +765,12 @@ k8s.io/client-go v0.34.0 h1:YoWv5r7bsBfb0Hs2jh8SOvFbKzzxyNo0nSb0zC19KZo=
765765
k8s.io/client-go v0.34.0/go.mod h1:ozgMnEKXkRjeMvBZdV1AijMHLTh3pbACPvK7zFR+QQY=
766766
k8s.io/component-base v0.34.0 h1:bS8Ua3zlJzapklsB1dZgjEJuJEeHjj8yTu1gxE2zQX8=
767767
k8s.io/component-base v0.34.0/go.mod h1:RSCqUdvIjjrEm81epPcjQ/DS+49fADvGSCkIP3IC6vg=
768-
k8s.io/component-helpers v0.34.0 h1:5T7P9XGMoUy1JDNKzHf0p/upYbeUf8ZaSf9jbx0QlIo=
769-
k8s.io/component-helpers v0.34.0/go.mod h1:kaOyl5tdtnymriYcVZg4uwDBe2d1wlIpXyDkt6sVnt4=
770-
k8s.io/controller-manager v0.34.0 h1:oCHoqS8dcFp7zDSu7HUvTpakq3isSxil3GprGGlJMsE=
771-
k8s.io/controller-manager v0.34.0/go.mod h1:XFto21U+Mm9BT8r/Jd5E4tHCGtwjKAUFOuDcqaj2VK0=
772768
k8s.io/klog/v2 v2.130.1 h1:n9Xl7H1Xvksem4KFG4PYbdQCQxqc/tTUyrgXaOhHSzk=
773769
k8s.io/klog/v2 v2.130.1/go.mod h1:3Jpz1GvMt720eyJH1ckRHK1EDfpxISzJ7I9OYgaDtPE=
774770
k8s.io/kube-openapi v0.0.0-20250710124328-f3f2b991d03b h1:MloQ9/bdJyIu9lb1PzujOPolHyvO06MXG5TUIj2mNAA=
775771
k8s.io/kube-openapi v0.0.0-20250710124328-f3f2b991d03b/go.mod h1:UZ2yyWbFTpuhSbFhv24aGNOdoRdJZgsIObGBUaYVsts=
776772
k8s.io/kubectl v0.34.0 h1:NcXz4TPTaUwhiX4LU+6r6udrlm0NsVnSkP3R9t0dmxs=
777773
k8s.io/kubectl v0.34.0/go.mod h1:bmd0W5i+HuG7/p5sqicr0Li0rR2iIhXL0oUyLF3OjR4=
778-
k8s.io/kubernetes v1.34.0 h1:NvUrwPAVB4W3mSOpJ/RtNGHWWYyUP/xPaX5rUSpzA0w=
779-
k8s.io/kubernetes v1.34.0/go.mod h1:iu+FhII+Oc/1gGWLJcer6wpyih441aNFHl7Pvm8yPto=
780774
k8s.io/utils v0.0.0-20250604170112-4c0f3b243397 h1:hwvWFiBzdWw1FhfY1FooPn3kzWuJ8tmbZBHi4zVsl1Y=
781775
k8s.io/utils v0.0.0-20250604170112-4c0f3b243397/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0=
782776
oras.land/oras-go/v2 v2.6.0 h1:X4ELRsiGkrbeox69+9tzTu492FMUu7zJQW6eJU+I2oc=

hack/demo/resources/synthetic-user-perms/argocd-clusterextension.yaml

Lines changed: 0 additions & 13 deletions
This file was deleted.

hack/demo/resources/synthetic-user-perms/cegroup-admin-binding.yaml

Lines changed: 0 additions & 11 deletions
This file was deleted.

hack/demo/synthetic-user-cluster-admin-demo-script.sh

Lines changed: 0 additions & 30 deletions
This file was deleted.

hack/tools/crd-generator/testdata/api/v1/clusterextension_types.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,13 +63,13 @@ type ClusterExtensionSpec struct {
6363
// +kubebuilder:validation:Required
6464
Namespace string `json:"namespace"`
6565

66-
// serviceAccount is a reference to a ServiceAccount used to perform all interactions
66+
// serviceAccount is deprecated and ignored by OLM.
6767
// with the cluster that are required to manage the extension.
6868
// The ServiceAccount must be configured with the necessary permissions to perform these interactions.
6969
// The ServiceAccount must exist in the namespace referenced in the spec.
70-
// serviceAccount is required.
70+
// serviceAccount is deprecated and optional.
7171
//
72-
// +kubebuilder:validation:Required
72+
// +kubebuilder:validation:Optional
7373
ServiceAccount ServiceAccountReference `json:"serviceAccount"`
7474

7575
// source is a required field which selects the installation source of content

helm/experimental.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
operatorControllerFeatures:
99
- WebhookProviderCertManager
1010
- SingleOwnNamespaceInstallSupport
11-
- PreflightPermissions
1211
- HelmChartSupport
1312
- BoxcutterRuntime
1413

0 commit comments

Comments
 (0)