Skip to content

Commit b994023

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 95c5934 commit b994023

37 files changed

+219
-2622
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+
// Deprecated: ServiceAccount is ignored by OLM and will be removed in a future release.
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,8 +367,9 @@ type CatalogFilter struct {
369367
UpgradeConstraintPolicy UpgradeConstraintPolicy `json:"upgradeConstraintPolicy,omitempty"`
370368
}
371369

372-
// ServiceAccountReference identifies the serviceAccount used fo install a ClusterExtension.
370+
// Deprecated: ServiceAccount is ignored by OLM and will be removed in a future release.
373371
type ServiceAccountReference struct {
372+
// Deprecated: ServiceAccount.Name is ignored by OLM and will be removed in a future release.
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
376375
// specified in the packageName field.

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"
@@ -625,11 +623,8 @@ func setupHelm(
625623
if err != nil {
626624
return fmt.Errorf("unable to create core client: %w", err)
627625
}
628-
tokenGetter := authentication.NewTokenGetter(coreClient, authentication.WithExpirationDuration(1*time.Hour))
629-
clientRestConfigMapper := action.ServiceAccountRestConfigMapper(tokenGetter)
630-
if features.OperatorControllerFeatureGate.Enabled(features.SyntheticPermissions) {
631-
clientRestConfigMapper = action.SyntheticUserRestConfigMapper(clientRestConfigMapper)
632-
}
626+
627+
clientRestConfigMapper := action.ClusterAdminRestConfigMapper(mgr.GetConfig())
633628

634629
cfgGetter, err := helmclient.NewActionConfigGetter(mgr.GetConfig(), mgr.GetRESTMapper(),
635630
helmclient.StorageDriverMapper(action.ChunkedStorageDriverMapper(coreClient, mgr.GetAPIReader(), cfg.systemNamespace)),
@@ -650,12 +645,6 @@ func setupHelm(
650645
return fmt.Errorf("unable to create helm action client getter: %w", err)
651646
}
652647

653-
// determine if PreAuthorizer should be enabled based on feature gate
654-
var preAuth authorization.PreAuthorizer
655-
if features.OperatorControllerFeatureGate.Enabled(features.PreflightPermissions) {
656-
preAuth = authorization.NewRBACPreAuthorizer(mgr.GetClient())
657-
}
658-
659648
cm := contentmanager.NewManager(clientRestConfigMapper, mgr.GetConfig(), mgr.GetRESTMapper())
660649
err = clusterExtensionFinalizers.Register(controllers.ClusterExtensionCleanupContentManagerCacheFinalizer, finalizers.FinalizerFunc(func(ctx context.Context, obj client.Object) (crfinalizer.Result, error) {
661650
ext := obj.(*ocv1.ClusterExtension)
@@ -675,7 +664,6 @@ func setupHelm(
675664
ManifestProvider: regv1ManifestProvider,
676665
},
677666
HelmReleaseToObjectsConverter: &applier.HelmReleaseToObjectsConverter{},
678-
PreAuthorizer: preAuth,
679667
Watcher: ceController,
680668
Manager: cm,
681669
}

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

Lines changed: 4 additions & 4 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)_ | Deprecated: ServiceAccount is ignored by OLM and will be removed in a future release.<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,7 @@ _Appears in:_
440440

441441

442442

443-
ServiceAccountReference identifies the serviceAccount used fo install a ClusterExtension.
443+
Deprecated: ServiceAccount is ignored by OLM and will be removed in a future release.
444444

445445

446446

@@ -449,7 +449,7 @@ _Appears in:_
449449

450450
| Field | Description | Default | Validation |
451451
| --- | --- | --- | --- |
452-
| `name` _string_ | name is a required, immutable reference to the name of the ServiceAccount<br />to be used for installation and management of the content for the package<br />specified in the packageName field.<br /><br />This ServiceAccount must exist in the installNamespace.<br /><br />name follows the DNS subdomain standard as defined in [RFC 1123].<br />It must contain only lowercase alphanumeric characters,<br />hyphens (-) or periods (.), start and end with an alphanumeric character,<br />and be no longer than 253 characters.<br /><br />Some examples of valid values are:<br /> - some-serviceaccount<br /> - 123-serviceaccount<br /> - 1-serviceaccount-2<br /> - someserviceaccount<br /> - some.serviceaccount<br /><br />Some examples of invalid values are:<br /> - -some-serviceaccount<br /> - some-serviceaccount-<br /><br />[RFC 1123]: https://tools.ietf.org/html/rfc1123 | | MaxLength: 253 <br />Required: \{\} <br /> |
452+
| `name` _string_ | Deprecated: ServiceAccount.Name is ignored by OLM and will be removed in a future release.<br />name is a required, immutable reference to the name of the ServiceAccount<br />to be used for installation and management of the content for the package<br />specified in the packageName field.<br /><br />This ServiceAccount must exist in the installNamespace.<br /><br />name follows the DNS subdomain standard as defined in [RFC 1123].<br />It must contain only lowercase alphanumeric characters,<br />hyphens (-) or periods (.), start and end with an alphanumeric character,<br />and be no longer than 253 characters.<br /><br />Some examples of valid values are:<br /> - some-serviceaccount<br /> - 123-serviceaccount<br /> - 1-serviceaccount-2<br /> - someserviceaccount<br /> - some.serviceaccount<br /><br />Some examples of invalid values are:<br /> - -some-serviceaccount<br /> - some-serviceaccount-<br /><br />[RFC 1123]: https://tools.ietf.org/html/rfc1123 | | MaxLength: 253 <br />Required: \{\} <br /> |
453453

454454

455455
#### SourceConfig

go.mod

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

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

5753
require (
5854
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.

0 commit comments

Comments
 (0)