Skip to content

Commit 1c73b9a

Browse files
pedjakclaude
andcommitted
fix(api): align deprecated field godoc with OpenShift conventions
Restructure serviceAccount and Name field godoc to start with the JSON field name (lowercase) per OpenShift API conventions, with DEPRECATED marker in the body. Suppress optionalfields lint for deprecated fields where making them pointers would be a breaking API change. Co-Authored-By: Claude <noreply@anthropic.com>
1 parent e21b8cb commit 1c73b9a

7 files changed

Lines changed: 54 additions & 31 deletions

File tree

api/v1/clusterextension_types.go

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -66,13 +66,15 @@ type ClusterExtensionSpec struct {
6666
// +required
6767
Namespace string `json:"namespace"`
6868

69-
// Deprecated: serviceAccount is no longer used and will be removed in a future release.
69+
// serviceAccount was previously used to specify the service account for
70+
// extension management.
71+
// DEPRECATED: serviceAccount is no longer used and will be removed in a future release.
7072
// OLMv1 is a single-tenant system where users with ClusterExtension write access are
7173
// effectively delegated cluster-admin trust. The operator-controller runs with
7274
// cluster-admin privileges and uses its own service account for all cluster interactions.
7375
//
7476
// +optional
75-
ServiceAccount ServiceAccountReference `json:"serviceAccount,omitzero"`
77+
ServiceAccount ServiceAccountReference `json:"serviceAccount,omitzero"` //nolint:kubeapilinter // deprecated field uses omitzero per OpenShift convention; pointer would be a breaking API change
7678

7779
// source is required and selects the installation source of content for this ClusterExtension.
7880
// Set the sourceType field to perform the selection.
@@ -376,11 +378,14 @@ type CatalogFilter struct {
376378
UpgradeConstraintPolicy UpgradeConstraintPolicy `json:"upgradeConstraintPolicy,omitempty"`
377379
}
378380

379-
// Deprecated: ServiceAccountReference is no longer used and will be removed in a future release.
381+
// ServiceAccountReference was previously used to reference a service account for
382+
// extension management.
383+
// DEPRECATED: ServiceAccountReference is no longer used and will be removed in a future release.
380384
type ServiceAccountReference struct {
381-
// Deprecated: name is no longer used, but preserved for compatibility.
382-
// It was a required, immutable reference to the name of the ServiceAccount used for installation
383-
// and management of the content for the package specified in the packageName field.
385+
// name was previously a required, immutable reference to the name of the
386+
// ServiceAccount used for installation and management of the content for
387+
// the package specified in the packageName field.
388+
// DEPRECATED: name is no longer used and will be removed in a future release.
384389
//
385390
// The name field follows the DNS subdomain standard as defined in [RFC 1123].
386391
// It must contain only lowercase alphanumeric characters, hyphens (-) or periods (.),
@@ -403,7 +408,7 @@ type ServiceAccountReference struct {
403408
// +kubebuilder:validation:XValidation:rule="self == oldSelf || size(self) == 0",message="name is immutable once set, but may be cleared"
404409
// +kubebuilder:validation:XValidation:rule="size(self) == 0 || self.matches(\"^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\\\\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$\")",message="name must be a valid DNS1123 subdomain. It must contain only lowercase alphanumeric characters, hyphens (-) or periods (.), start and end with an alphanumeric character, and be no longer than 253 characters"
405410
// +optional
406-
Name string `json:"name"`
411+
Name string `json:"name"` //nolint:kubeapilinter // deprecated field; empty string means unset, pointer would be a breaking API change
407412
}
408413

409414
// PreflightConfig holds the configuration for the preflight checks. If used, at least one preflight check must be non-nil.

helm/olmv1/base/operator-controller/crd/experimental/olm.operatorframework.io_clusterextensions.yaml

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -176,16 +176,19 @@ spec:
176176
type: integer
177177
serviceAccount:
178178
description: |-
179-
Deprecated: serviceAccount is no longer used and will be removed in a future release.
179+
serviceAccount was previously used to specify the service account for
180+
extension management.
181+
DEPRECATED: serviceAccount is no longer used and will be removed in a future release.
180182
OLMv1 is a single-tenant system where users with ClusterExtension write access are
181183
effectively delegated cluster-admin trust. The operator-controller runs with
182184
cluster-admin privileges and uses its own service account for all cluster interactions.
183185
properties:
184186
name:
185187
description: |-
186-
Deprecated: name is no longer used, but preserved for compatibility.
187-
It was a required, immutable reference to the name of the ServiceAccount used for installation
188-
and management of the content for the package specified in the packageName field.
188+
name was previously a required, immutable reference to the name of the
189+
ServiceAccount used for installation and management of the content for
190+
the package specified in the packageName field.
191+
DEPRECATED: name is no longer used and will be removed in a future release.
189192
190193
The name field follows the DNS subdomain standard as defined in [RFC 1123].
191194
It must contain only lowercase alphanumeric characters, hyphens (-) or periods (.),

helm/olmv1/base/operator-controller/crd/standard/olm.operatorframework.io_clusterextensions.yaml

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -128,16 +128,19 @@ spec:
128128
rule: self.matches("^[a-z0-9]([-a-z0-9]*[a-z0-9])?$")
129129
serviceAccount:
130130
description: |-
131-
Deprecated: serviceAccount is no longer used and will be removed in a future release.
131+
serviceAccount was previously used to specify the service account for
132+
extension management.
133+
DEPRECATED: serviceAccount is no longer used and will be removed in a future release.
132134
OLMv1 is a single-tenant system where users with ClusterExtension write access are
133135
effectively delegated cluster-admin trust. The operator-controller runs with
134136
cluster-admin privileges and uses its own service account for all cluster interactions.
135137
properties:
136138
name:
137139
description: |-
138-
Deprecated: name is no longer used, but preserved for compatibility.
139-
It was a required, immutable reference to the name of the ServiceAccount used for installation
140-
and management of the content for the package specified in the packageName field.
140+
name was previously a required, immutable reference to the name of the
141+
ServiceAccount used for installation and management of the content for
142+
the package specified in the packageName field.
143+
DEPRECATED: name is no longer used and will be removed in a future release.
141144
142145
The name field follows the DNS subdomain standard as defined in [RFC 1123].
143146
It must contain only lowercase alphanumeric characters, hyphens (-) or periods (.),

manifests/experimental-e2e.yaml

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -790,16 +790,19 @@ spec:
790790
type: integer
791791
serviceAccount:
792792
description: |-
793-
Deprecated: serviceAccount is no longer used and will be removed in a future release.
793+
serviceAccount was previously used to specify the service account for
794+
extension management.
795+
DEPRECATED: serviceAccount is no longer used and will be removed in a future release.
794796
OLMv1 is a single-tenant system where users with ClusterExtension write access are
795797
effectively delegated cluster-admin trust. The operator-controller runs with
796798
cluster-admin privileges and uses its own service account for all cluster interactions.
797799
properties:
798800
name:
799801
description: |-
800-
Deprecated: name is no longer used, but preserved for compatibility.
801-
It was a required, immutable reference to the name of the ServiceAccount used for installation
802-
and management of the content for the package specified in the packageName field.
802+
name was previously a required, immutable reference to the name of the
803+
ServiceAccount used for installation and management of the content for
804+
the package specified in the packageName field.
805+
DEPRECATED: name is no longer used and will be removed in a future release.
803806
804807
The name field follows the DNS subdomain standard as defined in [RFC 1123].
805808
It must contain only lowercase alphanumeric characters, hyphens (-) or periods (.),

manifests/experimental.yaml

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -751,16 +751,19 @@ spec:
751751
type: integer
752752
serviceAccount:
753753
description: |-
754-
Deprecated: serviceAccount is no longer used and will be removed in a future release.
754+
serviceAccount was previously used to specify the service account for
755+
extension management.
756+
DEPRECATED: serviceAccount is no longer used and will be removed in a future release.
755757
OLMv1 is a single-tenant system where users with ClusterExtension write access are
756758
effectively delegated cluster-admin trust. The operator-controller runs with
757759
cluster-admin privileges and uses its own service account for all cluster interactions.
758760
properties:
759761
name:
760762
description: |-
761-
Deprecated: name is no longer used, but preserved for compatibility.
762-
It was a required, immutable reference to the name of the ServiceAccount used for installation
763-
and management of the content for the package specified in the packageName field.
763+
name was previously a required, immutable reference to the name of the
764+
ServiceAccount used for installation and management of the content for
765+
the package specified in the packageName field.
766+
DEPRECATED: name is no longer used and will be removed in a future release.
764767
765768
The name field follows the DNS subdomain standard as defined in [RFC 1123].
766769
It must contain only lowercase alphanumeric characters, hyphens (-) or periods (.),

manifests/standard-e2e.yaml

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -742,16 +742,19 @@ spec:
742742
rule: self.matches("^[a-z0-9]([-a-z0-9]*[a-z0-9])?$")
743743
serviceAccount:
744744
description: |-
745-
Deprecated: serviceAccount is no longer used and will be removed in a future release.
745+
serviceAccount was previously used to specify the service account for
746+
extension management.
747+
DEPRECATED: serviceAccount is no longer used and will be removed in a future release.
746748
OLMv1 is a single-tenant system where users with ClusterExtension write access are
747749
effectively delegated cluster-admin trust. The operator-controller runs with
748750
cluster-admin privileges and uses its own service account for all cluster interactions.
749751
properties:
750752
name:
751753
description: |-
752-
Deprecated: name is no longer used, but preserved for compatibility.
753-
It was a required, immutable reference to the name of the ServiceAccount used for installation
754-
and management of the content for the package specified in the packageName field.
754+
name was previously a required, immutable reference to the name of the
755+
ServiceAccount used for installation and management of the content for
756+
the package specified in the packageName field.
757+
DEPRECATED: name is no longer used and will be removed in a future release.
755758
756759
The name field follows the DNS subdomain standard as defined in [RFC 1123].
757760
It must contain only lowercase alphanumeric characters, hyphens (-) or periods (.),

manifests/standard.yaml

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -703,16 +703,19 @@ spec:
703703
rule: self.matches("^[a-z0-9]([-a-z0-9]*[a-z0-9])?$")
704704
serviceAccount:
705705
description: |-
706-
Deprecated: serviceAccount is no longer used and will be removed in a future release.
706+
serviceAccount was previously used to specify the service account for
707+
extension management.
708+
DEPRECATED: serviceAccount is no longer used and will be removed in a future release.
707709
OLMv1 is a single-tenant system where users with ClusterExtension write access are
708710
effectively delegated cluster-admin trust. The operator-controller runs with
709711
cluster-admin privileges and uses its own service account for all cluster interactions.
710712
properties:
711713
name:
712714
description: |-
713-
Deprecated: name is no longer used, but preserved for compatibility.
714-
It was a required, immutable reference to the name of the ServiceAccount used for installation
715-
and management of the content for the package specified in the packageName field.
715+
name was previously a required, immutable reference to the name of the
716+
ServiceAccount used for installation and management of the content for
717+
the package specified in the packageName field.
718+
DEPRECATED: name is no longer used and will be removed in a future release.
716719
717720
The name field follows the DNS subdomain standard as defined in [RFC 1123].
718721
It must contain only lowercase alphanumeric characters, hyphens (-) or periods (.),

0 commit comments

Comments
 (0)