From 0360e4d1a1d779ad31ee47001c4592e9e39c3b2a Mon Sep 17 00:00:00 2001 From: wojtekt Date: Fri, 27 Mar 2020 11:15:53 +0100 Subject: [PATCH 1/2] Promote Immutable Secrets/ConfigMaps feature to Beta --- pkg/apis/core/types.go | 4 ++-- pkg/features/kube_features.go | 3 ++- staging/src/k8s.io/api/core/v1/types.go | 4 ++-- test/e2e/common/configmap_volume.go | 2 +- test/e2e/common/secrets_volume.go | 2 +- 5 files changed, 8 insertions(+), 7 deletions(-) diff --git a/pkg/apis/core/types.go b/pkg/apis/core/types.go index 34e8058395b..0f3b7a84800 100644 --- a/pkg/apis/core/types.go +++ b/pkg/apis/core/types.go @@ -4780,7 +4780,7 @@ type Secret struct { // Immutable field, if set, ensures that data stored in the Secret cannot // be updated (only object metadata can be modified). - // This is an alpha field enabled by ImmutableEphemeralVolumes feature gate. + // This is a beta field enabled by ImmutableEphemeralVolumes feature gate. // +optional Immutable *bool @@ -4908,7 +4908,7 @@ type ConfigMap struct { // Immutable field, if set, ensures that data stored in the ConfigMap cannot // be updated (only object metadata can be modified). - // This is an alpha field enabled by ImmutableEphemeralVolumes feature gate. + // This is a beta field enabled by ImmutableEphemeralVolumes feature gate. // +optional Immutable *bool diff --git a/pkg/features/kube_features.go b/pkg/features/kube_features.go index 458fe38ce9b..881b8c5d7e8 100644 --- a/pkg/features/kube_features.go +++ b/pkg/features/kube_features.go @@ -543,6 +543,7 @@ const ( // owner: @wojtek-t // alpha: v1.18 + // beta: v1.19 // // Enables a feature to make secrets and configmaps data immutable. ImmutableEphemeralVolumes featuregate.Feature = "ImmutableEphemeralVolumes" @@ -657,7 +658,7 @@ var defaultKubernetesFeatureGates = map[featuregate.Feature]featuregate.FeatureS PodDisruptionBudget: {Default: true, PreRelease: featuregate.Beta}, ServiceTopology: {Default: false, PreRelease: featuregate.Alpha}, ServiceAppProtocol: {Default: true, PreRelease: featuregate.Beta}, - ImmutableEphemeralVolumes: {Default: false, PreRelease: featuregate.Alpha}, + ImmutableEphemeralVolumes: {Default: true, PreRelease: featuregate.Beta}, DefaultIngressClass: {Default: true, PreRelease: featuregate.Beta}, HugePageStorageMediumSize: {Default: false, PreRelease: featuregate.Alpha}, ExternalPolicyForExternalIP: {Default: false, PreRelease: featuregate.GA}, // remove in 1.19 diff --git a/staging/src/k8s.io/api/core/v1/types.go b/staging/src/k8s.io/api/core/v1/types.go index 777a1285a3f..5b7f4b8f27e 100644 --- a/staging/src/k8s.io/api/core/v1/types.go +++ b/staging/src/k8s.io/api/core/v1/types.go @@ -5495,7 +5495,7 @@ type Secret struct { // be updated (only object metadata can be modified). // If not set to true, the field can be modified at any time. // Defaulted to nil. - // This is an alpha field enabled by ImmutableEphemeralVolumes feature gate. + // This is a beta field enabled by ImmutableEphemeralVolumes feature gate. // +optional Immutable *bool `json:"immutable,omitempty" protobuf:"varint,5,opt,name=immutable"` @@ -5636,7 +5636,7 @@ type ConfigMap struct { // be updated (only object metadata can be modified). // If not set to true, the field can be modified at any time. // Defaulted to nil. - // This is an alpha field enabled by ImmutableEphemeralVolumes feature gate. + // This is a beta field enabled by ImmutableEphemeralVolumes feature gate. // +optional Immutable *bool `json:"immutable,omitempty" protobuf:"varint,4,opt,name=immutable"` diff --git a/test/e2e/common/configmap_volume.go b/test/e2e/common/configmap_volume.go index f0032f3216e..cda866086e9 100644 --- a/test/e2e/common/configmap_volume.go +++ b/test/e2e/common/configmap_volume.go @@ -554,7 +554,7 @@ var _ = ginkgo.Describe("[sig-storage] ConfigMap", func() { // It should be forbidden to change data for configmaps marked as immutable, but // allowed to modify its metadata independently of its state. - ginkgo.It("should be immutable if `immutable` field is set [Feature:ImmutableEphemeralVolume]", func() { + ginkgo.It("should be immutable if `immutable` field is set", func() { name := "immutable" configMap := newConfigMap(f, name) diff --git a/test/e2e/common/secrets_volume.go b/test/e2e/common/secrets_volume.go index 288cd30bc54..03abed7fa8d 100644 --- a/test/e2e/common/secrets_volume.go +++ b/test/e2e/common/secrets_volume.go @@ -372,7 +372,7 @@ var _ = ginkgo.Describe("[sig-storage] Secrets", func() { // It should be forbidden to change data for secrets marked as immutable, but // allowed to modify its metadata independently of its state. - ginkgo.It("should be immutable if `immutable` field is set [Feature:ImmutableEphemeralVolume]", func() { + ginkgo.It("should be immutable if `immutable` field is set", func() { name := "immutable" secret := secretForTest(f.Namespace.Name, name) From ab7e65995375bf1c8dc579f7bd1658fecdca0f8a Mon Sep 17 00:00:00 2001 From: wojtekt Date: Fri, 27 Mar 2020 11:34:56 +0100 Subject: [PATCH 2/2] Autogenerated --- api/openapi-spec/swagger.json | 4 ++-- staging/src/k8s.io/api/core/v1/generated.proto | 4 ++-- staging/src/k8s.io/api/core/v1/types_swagger_doc_generated.go | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/api/openapi-spec/swagger.json b/api/openapi-spec/swagger.json index b9632dfc412..e9301fb53c8 100644 --- a/api/openapi-spec/swagger.json +++ b/api/openapi-spec/swagger.json @@ -5359,7 +5359,7 @@ "type": "object" }, "immutable": { - "description": "Immutable, if set to true, ensures that data stored in the ConfigMap cannot be updated (only object metadata can be modified). If not set to true, the field can be modified at any time. Defaulted to nil. This is an alpha field enabled by ImmutableEphemeralVolumes feature gate.", + "description": "Immutable, if set to true, ensures that data stored in the ConfigMap cannot be updated (only object metadata can be modified). If not set to true, the field can be modified at any time. Defaulted to nil. This is a beta field enabled by ImmutableEphemeralVolumes feature gate.", "type": "boolean" }, "kind": { @@ -9475,7 +9475,7 @@ "type": "object" }, "immutable": { - "description": "Immutable, if set to true, ensures that data stored in the Secret cannot be updated (only object metadata can be modified). If not set to true, the field can be modified at any time. Defaulted to nil. This is an alpha field enabled by ImmutableEphemeralVolumes feature gate.", + "description": "Immutable, if set to true, ensures that data stored in the Secret cannot be updated (only object metadata can be modified). If not set to true, the field can be modified at any time. Defaulted to nil. This is a beta field enabled by ImmutableEphemeralVolumes feature gate.", "type": "boolean" }, "kind": { diff --git a/staging/src/k8s.io/api/core/v1/generated.proto b/staging/src/k8s.io/api/core/v1/generated.proto index 2b98585192b..2f5c4742dc0 100644 --- a/staging/src/k8s.io/api/core/v1/generated.proto +++ b/staging/src/k8s.io/api/core/v1/generated.proto @@ -459,7 +459,7 @@ message ConfigMap { // be updated (only object metadata can be modified). // If not set to true, the field can be modified at any time. // Defaulted to nil. - // This is an alpha field enabled by ImmutableEphemeralVolumes feature gate. + // This is a beta field enabled by ImmutableEphemeralVolumes feature gate. // +optional optional bool immutable = 4; @@ -4310,7 +4310,7 @@ message Secret { // be updated (only object metadata can be modified). // If not set to true, the field can be modified at any time. // Defaulted to nil. - // This is an alpha field enabled by ImmutableEphemeralVolumes feature gate. + // This is a beta field enabled by ImmutableEphemeralVolumes feature gate. // +optional optional bool immutable = 5; diff --git a/staging/src/k8s.io/api/core/v1/types_swagger_doc_generated.go b/staging/src/k8s.io/api/core/v1/types_swagger_doc_generated.go index 6aaa349d7af..fd80fadf922 100644 --- a/staging/src/k8s.io/api/core/v1/types_swagger_doc_generated.go +++ b/staging/src/k8s.io/api/core/v1/types_swagger_doc_generated.go @@ -252,7 +252,7 @@ func (ComponentStatusList) SwaggerDoc() map[string]string { var map_ConfigMap = map[string]string{ "": "ConfigMap holds configuration data for pods to consume.", "metadata": "Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata", - "immutable": "Immutable, if set to true, ensures that data stored in the ConfigMap cannot be updated (only object metadata can be modified). If not set to true, the field can be modified at any time. Defaulted to nil. This is an alpha field enabled by ImmutableEphemeralVolumes feature gate.", + "immutable": "Immutable, if set to true, ensures that data stored in the ConfigMap cannot be updated (only object metadata can be modified). If not set to true, the field can be modified at any time. Defaulted to nil. This is a beta field enabled by ImmutableEphemeralVolumes feature gate.", "data": "Data contains the configuration data. Each key must consist of alphanumeric characters, '-', '_' or '.'. Values with non-UTF-8 byte sequences must use the BinaryData field. The keys stored in Data must not overlap with the keys in the BinaryData field, this is enforced during validation process.", "binaryData": "BinaryData contains the binary data. Each key must consist of alphanumeric characters, '-', '_' or '.'. BinaryData can contain byte sequences that are not in the UTF-8 range. The keys stored in BinaryData must not overlap with the ones in the Data field, this is enforced during validation process. Using this field will require 1.10+ apiserver and kubelet.", } @@ -2018,7 +2018,7 @@ func (ScopedResourceSelectorRequirement) SwaggerDoc() map[string]string { var map_Secret = map[string]string{ "": "Secret holds secret data of a certain type. The total bytes of the values in the Data field must be less than MaxSecretSize bytes.", "metadata": "Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata", - "immutable": "Immutable, if set to true, ensures that data stored in the Secret cannot be updated (only object metadata can be modified). If not set to true, the field can be modified at any time. Defaulted to nil. This is an alpha field enabled by ImmutableEphemeralVolumes feature gate.", + "immutable": "Immutable, if set to true, ensures that data stored in the Secret cannot be updated (only object metadata can be modified). If not set to true, the field can be modified at any time. Defaulted to nil. This is a beta field enabled by ImmutableEphemeralVolumes feature gate.", "data": "Data contains the secret data. Each key must consist of alphanumeric characters, '-', '_' or '.'. The serialized form of the secret data is a base64 encoded string, representing the arbitrary (possibly non-string) data value here. Described in https://tools.ietf.org/html/rfc4648#section-4", "stringData": "stringData allows specifying non-binary secret data in string form. It is provided as a write-only convenience method. All keys and values are merged into the data field on write, overwriting any existing values. It is never output when reading from the API.", "type": "Used to facilitate programmatic handling of secret data.",