Browse Source

chore: update crd-spec

see https://github.com/external-secrets/crd-spec/pull/3

Signed-off-by: Moritz Johner <beller.moritz@googlemail.com>
Moritz Johner 5 years ago
parent
commit
b460153452

+ 6 - 27
apis/externalsecrets/v1alpha1/externalsecret_types.go

@@ -121,35 +121,15 @@ type ExternalSecretSpec struct {
 	DataFrom []ExternalSecretDataRemoteRef `json:"dataFrom,omitempty"`
 }
 
-// ExternalSecretStatusPhase represents the current phase of the Secret sync.
-type ExternalSecretStatusPhase string
-
-const (
-	// ExternalSecret created, controller did not yet sync the ExternalSecret or other dependencies are missing (e.g. secret store or configmap template).
-	ExternalSecretPending ExternalSecretStatusPhase = "Pending"
-
-	// ExternalSecret is being actively synced according to spec.
-	ExternalSecretSyncing ExternalSecretStatusPhase = "Syncing"
-
-	// ExternalSecret can not be synced, this might require user intervention.
-	ExternalSecretFailing ExternalSecretStatusPhase = "Failing"
-
-	// ExternalSecret can not be synced right now and will not able to.
-	ExternalSecretFailed ExternalSecretStatusPhase = "Failed"
-
-	// ExternalSecret was synced successfully (one-time use only).
-	ExternalSecretCompleted ExternalSecretStatusPhase = "Completed"
-)
-
 type ExternalSecretConditionType string
 
 const (
-	InSync ExternalSecretConditionType = "InSync"
+	ExternalSecretReady ExternalSecretConditionType = "Ready"
 )
 
 type ExternalSecretStatusCondition struct {
-	Type   SecretStoreConditionType `json:"type"`
-	Status corev1.ConditionStatus   `json:"status"`
+	Type   ExternalSecretConditionType `json:"type"`
+	Status corev1.ConditionStatus      `json:"status"`
 
 	// +optional
 	Reason string `json:"reason,omitempty"`
@@ -159,14 +139,13 @@ type ExternalSecretStatusCondition struct {
 
 	// +optional
 	LastTransitionTime metav1.Time `json:"lastTransitionTime,omitempty"`
-
-	// +optional
-	LastSyncTime metav1.Time `json:"lastSyncTime,omitempty"`
 }
 
 type ExternalSecretStatus struct {
 	// +optional
-	Phase ExternalSecretStatusPhase `json:"phase"`
+	// refreshTime is the time and date the external secret was fetched and
+	// the target secret updated
+	RefreshTime metav1.Time `json:"refreshTime"`
 
 	// +optional
 	Conditions []ExternalSecretStatusCondition `json:"conditions"`

+ 1 - 14
apis/externalsecrets/v1alpha1/secretstore_types.go

@@ -47,20 +47,10 @@ type SecretStoreProvider struct {
 	AWSSM *AWSSMProvider `json:"awssm,omitempty"`
 }
 
-type SecretStoreStatusPhase string
-
-const (
-	// E.g. referenced Secret containing credentials is missing.
-	SecretStorePending SecretStoreStatusPhase = "Pending"
-
-	// All dependencies are met, sync.
-	SecretStoreRunning SecretStoreStatusPhase = "Running"
-)
-
 type SecretStoreConditionType string
 
 const (
-	Ready SecretStoreConditionType = "Ready"
+	SecretStoreReady SecretStoreConditionType = "Ready"
 )
 
 type SecretStoreStatusCondition struct {
@@ -80,9 +70,6 @@ type SecretStoreStatusCondition struct {
 // SecretStoreStatus defines the observed state of the SecretStore.
 type SecretStoreStatus struct {
 	// +optional
-	Phase SecretStoreStatusPhase `json:"phase"`
-
-	// +optional
 	Conditions []SecretStoreStatusCondition `json:"conditions"`
 }
 

+ 1 - 1
apis/externalsecrets/v1alpha1/zz_generated.deepcopy.go

@@ -249,6 +249,7 @@ func (in *ExternalSecretSpec) DeepCopy() *ExternalSecretSpec {
 // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
 func (in *ExternalSecretStatus) DeepCopyInto(out *ExternalSecretStatus) {
 	*out = *in
+	in.RefreshTime.DeepCopyInto(&out.RefreshTime)
 	if in.Conditions != nil {
 		in, out := &in.Conditions, &out.Conditions
 		*out = make([]ExternalSecretStatusCondition, len(*in))
@@ -272,7 +273,6 @@ func (in *ExternalSecretStatus) DeepCopy() *ExternalSecretStatus {
 func (in *ExternalSecretStatusCondition) DeepCopyInto(out *ExternalSecretStatusCondition) {
 	*out = *in
 	in.LastTransitionTime.DeepCopyInto(&out.LastTransitionTime)
-	in.LastSyncTime.DeepCopyInto(&out.LastSyncTime)
 }
 
 // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ExternalSecretStatusCondition.

+ 4 - 6
config/crd/bases/external-secrets.io_externalsecrets.yaml

@@ -132,9 +132,6 @@ spec:
               conditions:
                 items:
                   properties:
-                    lastSyncTime:
-                      format: date-time
-                      type: string
                     lastTransitionTime:
                       format: date-time
                       type: string
@@ -151,9 +148,10 @@ spec:
                   - type
                   type: object
                 type: array
-              phase:
-                description: ExternalSecretStatusPhase represents the current phase
-                  of the Secret sync.
+              refreshTime:
+                description: refreshTime is the time and date the external secret
+                  was fetched and the target secret updated
+                format: date-time
                 type: string
             type: object
         type: object

+ 0 - 2
config/crd/bases/external-secrets.io_secretstores.yaml

@@ -149,8 +149,6 @@ spec:
                   - type
                   type: object
                 type: array
-              phase:
-                type: string
             type: object
         type: object
     served: true