Browse Source

Marking v1alpha1 as deprecated.

Improving docs and menu order.
Signed-off-by: Gustavo Carvalho <gustavo.carvalho@container-solutions.com>
Gustavo Carvalho 4 years ago
parent
commit
c779ef59e7

+ 1 - 0
apis/externalsecrets/v1alpha1/externalsecret_types.go

@@ -228,6 +228,7 @@ type ExternalSecretStatus struct {
 
 // ExternalSecret is the Schema for the external-secrets API.
 // +kubebuilder:subresource:status
+// +kubebuilder:deprecatedversion
 // +kubebuilder:resource:scope=Namespaced,categories={externalsecrets},shortName=es
 // +kubebuilder:printcolumn:name="Store",type=string,JSONPath=`.spec.secretStoreRef.name`
 // +kubebuilder:printcolumn:name="Refresh Interval",type=string,JSONPath=`.spec.refreshInterval`

+ 2 - 0
apis/externalsecrets/v1alpha1/secretstore_types.go

@@ -133,6 +133,7 @@ type SecretStoreStatus struct {
 // +kubebuilder:printcolumn:name="AGE",type="date",JSONPath=".metadata.creationTimestamp"
 // +kubebuilder:printcolumn:name="Status",type=string,JSONPath=`.status.conditions[?(@.type=="Ready")].reason`
 // +kubebuilder:subresource:status
+// +kubebuilder:deprecatedversion
 // +kubebuilder:resource:scope=Namespaced,categories={externalsecrets},shortName=ss
 type SecretStore struct {
 	metav1.TypeMeta   `json:",inline"`
@@ -156,6 +157,7 @@ type SecretStoreList struct {
 // ClusterSecretStore represents a secure external location for storing secrets, which can be referenced as part of `storeRef` fields.
 // +kubebuilder:printcolumn:name="AGE",type="date",JSONPath=".metadata.creationTimestamp"
 // +kubebuilder:printcolumn:name="Status",type=string,JSONPath=`.status.conditions[?(@.type=="Ready")].reason`
+// +kubebuilder:deprecatedversion
 // +kubebuilder:subresource:status
 // +kubebuilder:resource:scope=Cluster,categories={externalsecrets},shortName=css
 type ClusterSecretStore struct {

+ 1 - 0
config/crds/bases/external-secrets.io_clustersecretstores.yaml

@@ -25,6 +25,7 @@ spec:
     - jsonPath: .status.conditions[?(@.type=="Ready")].reason
       name: Status
       type: string
+    deprecated: true
     name: v1alpha1
     schema:
       openAPIV3Schema:

+ 1 - 0
config/crds/bases/external-secrets.io_externalsecrets.yaml

@@ -28,6 +28,7 @@ spec:
     - jsonPath: .status.conditions[?(@.type=="Ready")].reason
       name: Status
       type: string
+    deprecated: true
     name: v1alpha1
     schema:
       openAPIV3Schema:

+ 1 - 0
config/crds/bases/external-secrets.io_secretstores.yaml

@@ -25,6 +25,7 @@ spec:
     - jsonPath: .status.conditions[?(@.type=="Ready")].reason
       name: Status
       type: string
+    deprecated: true
     name: v1alpha1
     schema:
       openAPIV3Schema:

+ 3 - 0
deploy/crds/bundle.yaml

@@ -350,6 +350,7 @@ spec:
         - jsonPath: .status.conditions[?(@.type=="Ready")].reason
           name: Status
           type: string
+      deprecated: true
       name: v1alpha1
       schema:
         openAPIV3Schema:
@@ -2340,6 +2341,7 @@ spec:
         - jsonPath: .status.conditions[?(@.type=="Ready")].reason
           name: Status
           type: string
+      deprecated: true
       name: v1alpha1
       schema:
         openAPIV3Schema:
@@ -2836,6 +2838,7 @@ spec:
         - jsonPath: .status.conditions[?(@.type=="Ready")].reason
           name: Status
           type: string
+      deprecated: true
       name: v1alpha1
       schema:
         openAPIV3Schema:

+ 4 - 6
docs/guides-v1beta1.md

@@ -28,12 +28,10 @@ spec:
             app: web
 ```
 
-## Upgrading between versions
+## Upgrading
 
-If you already have an installation of ESO using `v1alpha1`, we recommend you to upgrade to `v1beta1`. If you do not use `dataFrom` in your ExternalSecrets, or if you deploy the CRDs using official the official Helm charts, the upgrade can be done with no risk of losing data. 
+If you already have an installation of ESO using `v1alpha1`, we recommend you to upgrade to `v1beta1`. If you do not use `dataFrom` in your ExternalSecrets, or if you deploy the CRDs using the official Helm charts, the upgrade can be done with no risk of losing data. 
 
-If you are installing CRDs manually, you will need to deploy the bundle CRD file available at `deploys/crds/bundle.yaml`. This bundle file contains `v1beta1` definition and a conversion webhook configuration. This configuration will ensure that new requests to handle any CRD object will only be valid after the upgrade is successfully complete - so there are no risks of losing data due to an incomplete upgrade.
+If you are installing CRDs manually, you will need to deploy the bundle CRD file available at `deploys/crds/bundle.yaml`. This bundle file contains `v1beta1` definition and a conversion webhook configuration. This configuration will ensure that new requests to handle any CRD object will only be valid after the upgrade is successfully complete - so there are no risks of losing data due to an incomplete upgrade. Once the new CRDs are applied, you can proceed to upgrade the controller version.
 
-Once the configuration is finished, at each reconcile, any `ExternalSecret`, `SecretStore`,  and `ClusterSecretStore` stored in etcd in `v1alpha1` will be automatically converted to `v1beta1`. 
-
-Since `v1alpha1` is now deprecated, be sure to upgrade any resources you have to `v1beta1`.
+Once the upgrade is finished, at each reconcile, any `ExternalSecret`, `SecretStore`,  and `ClusterSecretStore` stored in `v1alpha1` will be automatically converted to `v1beta1`. 

+ 0 - 1
e2e/framework/testcase.go

@@ -78,7 +78,6 @@ func TableFunc(f *Framework, prov SecretStoreProvider) func(...func(*TestCase))
 			// create v1beta1 external secret otherwise
 			err = tc.Framework.CRClient.Create(context.Background(), tc.ExternalSecret)
 			Expect(err).ToNot(HaveOccurred())
-
 		}
 
 		// in case target name is empty

+ 6 - 6
e2e/suite/common/common.go

@@ -38,13 +38,13 @@ const (
 func SyncV1Alpha1(f *framework.Framework) (string, func(*framework.TestCase)) {
 	return "[common] should sync secrets from v1alpha1 spec", func(tc *framework.TestCase) {
 		secretKey1 := fmt.Sprintf("%s-%s", f.Namespace.Name, "one")
-		targetSecretKey1 := "name"
-		targetSecretValue1 := "great-name"
-		targetSecretKey2 := "surname"
-		targetSecretValue2 := "great-surname"
+		targetSecretKey1 := "alpha-name"
+		targetSecretValue1 := "alpha-great-name"
+		targetSecretKey2 := "alpha-surname"
+		targetSecretValue2 := "alpha-great-surname"
 		secretValue := fmt.Sprintf("{ %q: %q, %q: %q }", targetSecretKey1, targetSecretValue1, targetSecretKey2, targetSecretValue2)
-		tc.Secrets = map[string]string{
-			secretKey1: secretValue,
+		tc.Secrets = map[string]framework.SecretEntry{
+			secretKey1: {Value: secretValue},
 		}
 		tc.ExpectedSecret = &v1.Secret{
 			Type: v1.SecretTypeOpaque,

+ 5 - 5
e2e/suite/import.go

@@ -16,10 +16,10 @@ package suite
 import (
 
 	// import different e2e test suites.
-	// _ "github.com/external-secrets/external-secrets/e2e/suite/aws/parameterstore"
-	// _ "github.com/external-secrets/external-secrets/e2e/suite/aws/secretsmanager"
-	// _ "github.com/external-secrets/external-secrets/e2e/suite/azure"
-	// _ "github.com/external-secrets/external-secrets/e2e/suite/gcp"
-	// _ "github.com/external-secrets/external-secrets/e2e/suite/template"
+	_ "github.com/external-secrets/external-secrets/e2e/suite/aws/parameterstore"
+	_ "github.com/external-secrets/external-secrets/e2e/suite/aws/secretsmanager"
+	_ "github.com/external-secrets/external-secrets/e2e/suite/azure"
+	_ "github.com/external-secrets/external-secrets/e2e/suite/gcp"
+	_ "github.com/external-secrets/external-secrets/e2e/suite/template"
 	_ "github.com/external-secrets/external-secrets/e2e/suite/vault"
 )

+ 2 - 2
hack/api-docs/mkdocs.yml

@@ -35,15 +35,15 @@ nav:
   - Guides:
     - Introduction: guides-introduction.md
     - Getting started: guides-getting-started.md
-    - Upgrading to v1beta1: guides-v1beta1.md
     - Advanced Templating:
         v2: guides-templating.md
         v1: guides-templating-v1.md
-    - Controller Classes: guides-controller-class.md
     - All keys, One secret: guides-all-keys-one-secret.md
     - Common K8S Secret Types: guides-common-k8s-secret-types.md
+    - Controller Classes: guides-controller-class.md
     - Multi Tenancy: guides-multi-tenancy.md
     - Metrics: guides-metrics.md
+    - Upgrading to v1beta1: guides-v1beta1.md
     - Using Latest Image: guides-using-latest-image.md
   - Provider:
     - AWS: