|
@@ -26,6 +26,7 @@ import (
|
|
|
|
|
|
|
|
"github.com/google/go-cmp/cmp"
|
|
"github.com/google/go-cmp/cmp"
|
|
|
"github.com/google/go-cmp/cmp/cmpopts"
|
|
"github.com/google/go-cmp/cmp/cmpopts"
|
|
|
|
|
+ "github.com/onsi/gomega/format"
|
|
|
"github.com/prometheus/client_golang/prometheus"
|
|
"github.com/prometheus/client_golang/prometheus"
|
|
|
dto "github.com/prometheus/client_model/go"
|
|
dto "github.com/prometheus/client_model/go"
|
|
|
v1 "k8s.io/api/core/v1"
|
|
v1 "k8s.io/api/core/v1"
|
|
@@ -89,30 +90,23 @@ var _ = Describe("Kind=secret existence logic", func() {
|
|
|
}
|
|
}
|
|
|
type testCase struct {
|
|
type testCase struct {
|
|
|
Name string
|
|
Name string
|
|
|
- Input v1.Secret
|
|
|
|
|
|
|
+ Input *v1.Secret
|
|
|
ExpectedOutput bool
|
|
ExpectedOutput bool
|
|
|
}
|
|
}
|
|
|
tests := []testCase{
|
|
tests := []testCase{
|
|
|
{
|
|
{
|
|
|
Name: "Should not be valid in case of missing uid",
|
|
Name: "Should not be valid in case of missing uid",
|
|
|
- Input: v1.Secret{},
|
|
|
|
|
|
|
+ Input: &v1.Secret{},
|
|
|
ExpectedOutput: false,
|
|
ExpectedOutput: false,
|
|
|
},
|
|
},
|
|
|
{
|
|
{
|
|
|
Name: "A nil annotation should not be valid",
|
|
Name: "A nil annotation should not be valid",
|
|
|
- Input: v1.Secret{
|
|
|
|
|
|
|
+ Input: &v1.Secret{
|
|
|
ObjectMeta: metav1.ObjectMeta{
|
|
ObjectMeta: metav1.ObjectMeta{
|
|
|
- UID: "xxx",
|
|
|
|
|
- Annotations: map[string]string{},
|
|
|
|
|
- },
|
|
|
|
|
- },
|
|
|
|
|
- ExpectedOutput: false,
|
|
|
|
|
- },
|
|
|
|
|
- {
|
|
|
|
|
- Name: "A nil annotation should not be valid",
|
|
|
|
|
- Input: v1.Secret{
|
|
|
|
|
- ObjectMeta: metav1.ObjectMeta{
|
|
|
|
|
- UID: "xxx",
|
|
|
|
|
|
|
+ UID: "xxx",
|
|
|
|
|
+ Labels: map[string]string{
|
|
|
|
|
+ esv1beta1.LabelManaged: esv1beta1.LabelManagedValue,
|
|
|
|
|
+ },
|
|
|
Annotations: map[string]string{},
|
|
Annotations: map[string]string{},
|
|
|
},
|
|
},
|
|
|
},
|
|
},
|
|
@@ -120,9 +114,12 @@ var _ = Describe("Kind=secret existence logic", func() {
|
|
|
},
|
|
},
|
|
|
{
|
|
{
|
|
|
Name: "An invalid annotation hash should not be valid",
|
|
Name: "An invalid annotation hash should not be valid",
|
|
|
- Input: v1.Secret{
|
|
|
|
|
|
|
+ Input: &v1.Secret{
|
|
|
ObjectMeta: metav1.ObjectMeta{
|
|
ObjectMeta: metav1.ObjectMeta{
|
|
|
UID: "xxx",
|
|
UID: "xxx",
|
|
|
|
|
+ Labels: map[string]string{
|
|
|
|
|
+ esv1beta1.LabelManaged: esv1beta1.LabelManagedValue,
|
|
|
|
|
+ },
|
|
|
Annotations: map[string]string{
|
|
Annotations: map[string]string{
|
|
|
esv1beta1.AnnotationDataHash: "xxxxxx",
|
|
esv1beta1.AnnotationDataHash: "xxxxxx",
|
|
|
},
|
|
},
|
|
@@ -131,10 +128,13 @@ var _ = Describe("Kind=secret existence logic", func() {
|
|
|
ExpectedOutput: false,
|
|
ExpectedOutput: false,
|
|
|
},
|
|
},
|
|
|
{
|
|
{
|
|
|
- Name: "A valid config map should return true",
|
|
|
|
|
- Input: v1.Secret{
|
|
|
|
|
|
|
+ Name: "A valid secret should return true",
|
|
|
|
|
+ Input: &v1.Secret{
|
|
|
ObjectMeta: metav1.ObjectMeta{
|
|
ObjectMeta: metav1.ObjectMeta{
|
|
|
UID: "xxx",
|
|
UID: "xxx",
|
|
|
|
|
+ Labels: map[string]string{
|
|
|
|
|
+ esv1beta1.LabelManaged: esv1beta1.LabelManagedValue,
|
|
|
|
|
+ },
|
|
|
Annotations: map[string]string{
|
|
Annotations: map[string]string{
|
|
|
esv1beta1.AnnotationDataHash: utils.ObjectHash(validData),
|
|
esv1beta1.AnnotationDataHash: utils.ObjectHash(validData),
|
|
|
},
|
|
},
|
|
@@ -449,9 +449,10 @@ var _ = Describe("ExternalSecret controller", Serial, func() {
|
|
|
Expect(string(secret.Data[existingKey])).To(Equal(existingVal))
|
|
Expect(string(secret.Data[existingKey])).To(Equal(existingVal))
|
|
|
Expect(string(secret.Data[targetProp])).To(Equal(secretVal))
|
|
Expect(string(secret.Data[targetProp])).To(Equal(secretVal))
|
|
|
|
|
|
|
|
- Expect(secret.ObjectMeta.Labels).To(HaveLen(2))
|
|
|
|
|
|
|
+ Expect(secret.ObjectMeta.Labels).To(HaveLen(3))
|
|
|
Expect(secret.ObjectMeta.Labels).To(HaveKeyWithValue("existing-label-key", "existing-label-value"))
|
|
Expect(secret.ObjectMeta.Labels).To(HaveKeyWithValue("existing-label-key", "existing-label-value"))
|
|
|
Expect(secret.ObjectMeta.Labels).To(HaveKeyWithValue("es-label-key", "es-label-value"))
|
|
Expect(secret.ObjectMeta.Labels).To(HaveKeyWithValue("es-label-key", "es-label-value"))
|
|
|
|
|
+ Expect(secret.ObjectMeta.Labels).To(HaveKeyWithValue(esv1beta1.LabelManaged, esv1beta1.LabelManagedValue))
|
|
|
|
|
|
|
|
Expect(secret.ObjectMeta.Annotations).To(HaveLen(3))
|
|
Expect(secret.ObjectMeta.Annotations).To(HaveLen(3))
|
|
|
Expect(secret.ObjectMeta.Annotations).To(HaveKeyWithValue("existing-annotation-key", "existing-annotation-value"))
|
|
Expect(secret.ObjectMeta.Annotations).To(HaveKeyWithValue("existing-annotation-key", "existing-annotation-value"))
|
|
@@ -460,12 +461,15 @@ var _ = Describe("ExternalSecret controller", Serial, func() {
|
|
|
|
|
|
|
|
Expect(ctest.HasOwnerRef(secret.ObjectMeta, "ExternalSecret", ExternalSecretFQDN)).To(BeFalse())
|
|
Expect(ctest.HasOwnerRef(secret.ObjectMeta, "ExternalSecret", ExternalSecretFQDN)).To(BeFalse())
|
|
|
Expect(secret.ObjectMeta.ManagedFields).To(HaveLen(2))
|
|
Expect(secret.ObjectMeta.ManagedFields).To(HaveLen(2))
|
|
|
- Expect(ctest.HasFieldOwnership(
|
|
|
|
|
- secret.ObjectMeta,
|
|
|
|
|
- ExternalSecretFQDN,
|
|
|
|
|
- fmt.Sprintf(`{"f:data":{"f:targetProperty":{}},"f:immutable":{},"f:metadata":{"f:annotations":{"f:es-annotation-key":{},"f:%s":{}},"f:labels":{"f:es-label-key":{}}}}`, esv1beta1.AnnotationDataHash)),
|
|
|
|
|
- ).To(BeEmpty())
|
|
|
|
|
- Expect(ctest.HasFieldOwnership(secret.ObjectMeta, FakeManager, `{"f:data":{".":{},"f:pre-existing-key":{}},"f:metadata":{"f:annotations":{".":{},"f:existing-annotation-key":{}},"f:labels":{".":{},"f:existing-label-key":{}}},"f:type":{}}`)).To(BeEmpty())
|
|
|
|
|
|
|
+ oldCharactersAroundMismatchToInclude := format.CharactersAroundMismatchToInclude
|
|
|
|
|
+ format.CharactersAroundMismatchToInclude = 10
|
|
|
|
|
+ Expect(ctest.FirstManagedFieldForManager(secret.ObjectMeta, ExternalSecretFQDN)).To(
|
|
|
|
|
+ Equal(fmt.Sprintf(`{"f:data":{"f:targetProperty":{}},"f:metadata":{"f:annotations":{"f:es-annotation-key":{},"f:%s":{}},"f:labels":{"f:es-label-key":{},"f:%s":{}}}}`, esv1beta1.AnnotationDataHash, esv1beta1.LabelManaged)),
|
|
|
|
|
+ )
|
|
|
|
|
+ Expect(ctest.FirstManagedFieldForManager(secret.ObjectMeta, FakeManager)).To(
|
|
|
|
|
+ Equal(`{"f:data":{".":{},"f:pre-existing-key":{}},"f:metadata":{"f:annotations":{".":{},"f:existing-annotation-key":{}},"f:labels":{".":{},"f:existing-label-key":{}}},"f:type":{}}`),
|
|
|
|
|
+ )
|
|
|
|
|
+ format.CharactersAroundMismatchToInclude = oldCharactersAroundMismatchToInclude
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -548,8 +552,18 @@ var _ = Describe("ExternalSecret controller", Serial, func() {
|
|
|
|
|
|
|
|
fakeProvider.WithGetSecret([]byte(secretVal), nil)
|
|
fakeProvider.WithGetSecret([]byte(secretVal), nil)
|
|
|
tc.checkCondition = func(es *esv1beta1.ExternalSecret) bool {
|
|
tc.checkCondition = func(es *esv1beta1.ExternalSecret) bool {
|
|
|
- cond := GetExternalSecretCondition(es.Status, esv1beta1.ExternalSecretReady)
|
|
|
|
|
- if cond == nil || cond.Status != v1.ConditionFalse || cond.Reason != esv1beta1.ConditionReasonSecretSyncedError {
|
|
|
|
|
|
|
+ expected := []esv1beta1.ExternalSecretStatusCondition{
|
|
|
|
|
+ {
|
|
|
|
|
+ Type: esv1beta1.ExternalSecretReady,
|
|
|
|
|
+ Status: v1.ConditionTrue,
|
|
|
|
|
+ Reason: esv1beta1.ConditionReasonSecretMissing,
|
|
|
|
|
+ Message: msgMissing,
|
|
|
|
|
+ },
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ opts := cmpopts.IgnoreFields(esv1beta1.ExternalSecretStatusCondition{}, "LastTransitionTime")
|
|
|
|
|
+ if diff := cmp.Diff(expected, es.Status.Conditions, opts); diff != "" {
|
|
|
|
|
+ GinkgoLogr.Info("(-got, +want)\n%s", "diff", diff)
|
|
|
return false
|
|
return false
|
|
|
}
|
|
}
|
|
|
return true
|
|
return true
|
|
@@ -558,10 +572,10 @@ var _ = Describe("ExternalSecret controller", Serial, func() {
|
|
|
Eventually(func() bool {
|
|
Eventually(func() bool {
|
|
|
Expect(testSyncCallsError.WithLabelValues(ExternalSecretName, ExternalSecretNamespace).Write(&metric)).To(Succeed())
|
|
Expect(testSyncCallsError.WithLabelValues(ExternalSecretName, ExternalSecretNamespace).Write(&metric)).To(Succeed())
|
|
|
Expect(testExternalSecretReconcileDuration.WithLabelValues(ExternalSecretName, ExternalSecretNamespace).Write(&metricDuration)).To(Succeed())
|
|
Expect(testExternalSecretReconcileDuration.WithLabelValues(ExternalSecretName, ExternalSecretNamespace).Write(&metricDuration)).To(Succeed())
|
|
|
- return metric.GetCounter().GetValue() >= 2.0 && metricDuration.GetGauge().GetValue() > 0.0
|
|
|
|
|
|
|
+ return metric.GetCounter().GetValue() == 0 && metricDuration.GetGauge().GetValue() > 0.0
|
|
|
}, timeout, interval).Should(BeTrue())
|
|
}, timeout, interval).Should(BeTrue())
|
|
|
- Expect(externalSecretConditionShouldBe(ExternalSecretName, ExternalSecretNamespace, esv1beta1.ExternalSecretReady, v1.ConditionFalse, 1.0)).To(BeTrue())
|
|
|
|
|
- Expect(externalSecretConditionShouldBe(ExternalSecretName, ExternalSecretNamespace, esv1beta1.ExternalSecretReady, v1.ConditionTrue, 0.0)).To(BeTrue())
|
|
|
|
|
|
|
+ Expect(externalSecretConditionShouldBe(ExternalSecretName, ExternalSecretNamespace, esv1beta1.ExternalSecretReady, v1.ConditionFalse, 0.0)).To(BeTrue())
|
|
|
|
|
+ Expect(externalSecretConditionShouldBe(ExternalSecretName, ExternalSecretNamespace, esv1beta1.ExternalSecretReady, v1.ConditionTrue, 1.0)).To(BeTrue())
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -591,11 +605,12 @@ var _ = Describe("ExternalSecret controller", Serial, func() {
|
|
|
// check owner/managedFields
|
|
// check owner/managedFields
|
|
|
Expect(ctest.HasOwnerRef(secret.ObjectMeta, "ExternalSecret", ExternalSecretFQDN)).To(BeFalse())
|
|
Expect(ctest.HasOwnerRef(secret.ObjectMeta, "ExternalSecret", ExternalSecretFQDN)).To(BeFalse())
|
|
|
Expect(secret.ObjectMeta.ManagedFields).To(HaveLen(2))
|
|
Expect(secret.ObjectMeta.ManagedFields).To(HaveLen(2))
|
|
|
- Expect(ctest.HasFieldOwnership(
|
|
|
|
|
- secret.ObjectMeta,
|
|
|
|
|
- ExternalSecretFQDN,
|
|
|
|
|
- fmt.Sprintf("{\"f:data\":{\"f:targetProperty\":{}},\"f:immutable\":{},\"f:metadata\":{\"f:annotations\":{\"f:%s\":{}}}}", esv1beta1.AnnotationDataHash)),
|
|
|
|
|
- ).To(BeEmpty())
|
|
|
|
|
|
|
+ oldCharactersAroundMismatchToInclude := format.CharactersAroundMismatchToInclude
|
|
|
|
|
+ format.CharactersAroundMismatchToInclude = 10
|
|
|
|
|
+ Expect(ctest.FirstManagedFieldForManager(secret.ObjectMeta, ExternalSecretFQDN)).To(
|
|
|
|
|
+ Equal(fmt.Sprintf(`{"f:data":{"f:targetProperty":{}},"f:metadata":{"f:annotations":{".":{},"f:%s":{}},"f:labels":{".":{},"f:%s":{}}}}`, esv1beta1.AnnotationDataHash, esv1beta1.LabelManaged)),
|
|
|
|
|
+ )
|
|
|
|
|
+ format.CharactersAroundMismatchToInclude = oldCharactersAroundMismatchToInclude
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -1394,7 +1409,7 @@ var _ = Describe("ExternalSecret controller", Serial, func() {
|
|
|
Type: esv1beta1.ExternalSecretReady,
|
|
Type: esv1beta1.ExternalSecretReady,
|
|
|
Status: v1.ConditionTrue,
|
|
Status: v1.ConditionTrue,
|
|
|
Reason: esv1beta1.ConditionReasonSecretSynced,
|
|
Reason: esv1beta1.ConditionReasonSecretSynced,
|
|
|
- Message: "Secret was synced",
|
|
|
|
|
|
|
+ Message: msgSyncedRetain,
|
|
|
},
|
|
},
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -1841,7 +1856,7 @@ var _ = Describe("ExternalSecret controller", Serial, func() {
|
|
|
&Reconciler{
|
|
&Reconciler{
|
|
|
ClusterSecretStoreEnabled: false,
|
|
ClusterSecretStoreEnabled: false,
|
|
|
},
|
|
},
|
|
|
- *tc.externalSecret,
|
|
|
|
|
|
|
+ tc.externalSecret,
|
|
|
)).To(BeTrue())
|
|
)).To(BeTrue())
|
|
|
|
|
|
|
|
tc.checkCondition = func(es *esv1beta1.ExternalSecret) bool {
|
|
tc.checkCondition = func(es *esv1beta1.ExternalSecret) bool {
|
|
@@ -2315,14 +2330,17 @@ var _ = Describe("ExternalSecret controller", Serial, func() {
|
|
|
var _ = Describe("ExternalSecret refresh logic", func() {
|
|
var _ = Describe("ExternalSecret refresh logic", func() {
|
|
|
Context("secret refresh", func() {
|
|
Context("secret refresh", func() {
|
|
|
It("should refresh when resource version does not match", func() {
|
|
It("should refresh when resource version does not match", func() {
|
|
|
- Expect(shouldRefresh(esv1beta1.ExternalSecret{
|
|
|
|
|
|
|
+ Expect(shouldRefresh(&esv1beta1.ExternalSecret{
|
|
|
|
|
+ Spec: esv1beta1.ExternalSecretSpec{
|
|
|
|
|
+ RefreshInterval: &metav1.Duration{Duration: time.Minute},
|
|
|
|
|
+ },
|
|
|
Status: esv1beta1.ExternalSecretStatus{
|
|
Status: esv1beta1.ExternalSecretStatus{
|
|
|
SyncedResourceVersion: "some resource version",
|
|
SyncedResourceVersion: "some resource version",
|
|
|
},
|
|
},
|
|
|
})).To(BeTrue())
|
|
})).To(BeTrue())
|
|
|
})
|
|
})
|
|
|
It("should refresh when labels change", func() {
|
|
It("should refresh when labels change", func() {
|
|
|
- es := esv1beta1.ExternalSecret{
|
|
|
|
|
|
|
+ es := &esv1beta1.ExternalSecret{
|
|
|
ObjectMeta: metav1.ObjectMeta{
|
|
ObjectMeta: metav1.ObjectMeta{
|
|
|
Generation: 1,
|
|
Generation: 1,
|
|
|
Labels: map[string]string{
|
|
Labels: map[string]string{
|
|
@@ -2346,7 +2364,7 @@ var _ = Describe("ExternalSecret refresh logic", func() {
|
|
|
})
|
|
})
|
|
|
|
|
|
|
|
It("should refresh when annotations change", func() {
|
|
It("should refresh when annotations change", func() {
|
|
|
- es := esv1beta1.ExternalSecret{
|
|
|
|
|
|
|
+ es := &esv1beta1.ExternalSecret{
|
|
|
ObjectMeta: metav1.ObjectMeta{
|
|
ObjectMeta: metav1.ObjectMeta{
|
|
|
Generation: 1,
|
|
Generation: 1,
|
|
|
Annotations: map[string]string{
|
|
Annotations: map[string]string{
|
|
@@ -2370,12 +2388,12 @@ var _ = Describe("ExternalSecret refresh logic", func() {
|
|
|
})
|
|
})
|
|
|
|
|
|
|
|
It("should refresh when generation has changed", func() {
|
|
It("should refresh when generation has changed", func() {
|
|
|
- es := esv1beta1.ExternalSecret{
|
|
|
|
|
|
|
+ es := &esv1beta1.ExternalSecret{
|
|
|
ObjectMeta: metav1.ObjectMeta{
|
|
ObjectMeta: metav1.ObjectMeta{
|
|
|
Generation: 1,
|
|
Generation: 1,
|
|
|
},
|
|
},
|
|
|
Spec: esv1beta1.ExternalSecretSpec{
|
|
Spec: esv1beta1.ExternalSecretSpec{
|
|
|
- RefreshInterval: &metav1.Duration{Duration: 0},
|
|
|
|
|
|
|
+ RefreshInterval: &metav1.Duration{Duration: time.Minute},
|
|
|
},
|
|
},
|
|
|
Status: esv1beta1.ExternalSecretStatus{
|
|
Status: esv1beta1.ExternalSecretStatus{
|
|
|
RefreshTime: metav1.Now(),
|
|
RefreshTime: metav1.Now(),
|
|
@@ -2390,7 +2408,7 @@ var _ = Describe("ExternalSecret refresh logic", func() {
|
|
|
})
|
|
})
|
|
|
|
|
|
|
|
It("should skip refresh when refreshInterval is 0", func() {
|
|
It("should skip refresh when refreshInterval is 0", func() {
|
|
|
- es := esv1beta1.ExternalSecret{
|
|
|
|
|
|
|
+ es := &esv1beta1.ExternalSecret{
|
|
|
ObjectMeta: metav1.ObjectMeta{
|
|
ObjectMeta: metav1.ObjectMeta{
|
|
|
Generation: 1,
|
|
Generation: 1,
|
|
|
},
|
|
},
|
|
@@ -2405,7 +2423,7 @@ var _ = Describe("ExternalSecret refresh logic", func() {
|
|
|
})
|
|
})
|
|
|
|
|
|
|
|
It("should refresh when refresh interval has passed", func() {
|
|
It("should refresh when refresh interval has passed", func() {
|
|
|
- es := esv1beta1.ExternalSecret{
|
|
|
|
|
|
|
+ es := &esv1beta1.ExternalSecret{
|
|
|
ObjectMeta: metav1.ObjectMeta{
|
|
ObjectMeta: metav1.ObjectMeta{
|
|
|
Generation: 1,
|
|
Generation: 1,
|
|
|
},
|
|
},
|
|
@@ -2422,7 +2440,7 @@ var _ = Describe("ExternalSecret refresh logic", func() {
|
|
|
})
|
|
})
|
|
|
|
|
|
|
|
It("should refresh when no refresh time was set", func() {
|
|
It("should refresh when no refresh time was set", func() {
|
|
|
- es := esv1beta1.ExternalSecret{
|
|
|
|
|
|
|
+ es := &esv1beta1.ExternalSecret{
|
|
|
ObjectMeta: metav1.ObjectMeta{
|
|
ObjectMeta: metav1.ObjectMeta{
|
|
|
Generation: 1,
|
|
Generation: 1,
|
|
|
},
|
|
},
|
|
@@ -2502,43 +2520,6 @@ var _ = Describe("ExternalSecret refresh logic", func() {
|
|
|
})
|
|
})
|
|
|
})
|
|
})
|
|
|
|
|
|
|
|
-var _ = Describe("Controller Reconcile logic", func() {
|
|
|
|
|
- Context("controller reconcile", func() {
|
|
|
|
|
- It("should reconcile when resource is not synced", func() {
|
|
|
|
|
- Expect(shouldReconcile(esv1beta1.ExternalSecret{
|
|
|
|
|
- Status: esv1beta1.ExternalSecretStatus{
|
|
|
|
|
- SyncedResourceVersion: "some resource version",
|
|
|
|
|
- Conditions: []esv1beta1.ExternalSecretStatusCondition{{Reason: "NotASecretSynced"}},
|
|
|
|
|
- },
|
|
|
|
|
- })).To(BeTrue())
|
|
|
|
|
- })
|
|
|
|
|
-
|
|
|
|
|
- It("should reconcile when secret isn't immutable", func() {
|
|
|
|
|
- Expect(shouldReconcile(esv1beta1.ExternalSecret{
|
|
|
|
|
- Spec: esv1beta1.ExternalSecretSpec{
|
|
|
|
|
- Target: esv1beta1.ExternalSecretTarget{
|
|
|
|
|
- Immutable: false,
|
|
|
|
|
- },
|
|
|
|
|
- },
|
|
|
|
|
- })).To(BeTrue())
|
|
|
|
|
- })
|
|
|
|
|
-
|
|
|
|
|
- It("should not reconcile if secret is immutable and has synced condition", func() {
|
|
|
|
|
- Expect(shouldReconcile(esv1beta1.ExternalSecret{
|
|
|
|
|
- Spec: esv1beta1.ExternalSecretSpec{
|
|
|
|
|
- Target: esv1beta1.ExternalSecretTarget{
|
|
|
|
|
- Immutable: true,
|
|
|
|
|
- },
|
|
|
|
|
- },
|
|
|
|
|
- Status: esv1beta1.ExternalSecretStatus{
|
|
|
|
|
- SyncedResourceVersion: "some resource version",
|
|
|
|
|
- Conditions: []esv1beta1.ExternalSecretStatusCondition{{Reason: "SecretSynced"}},
|
|
|
|
|
- },
|
|
|
|
|
- })).To(BeFalse())
|
|
|
|
|
- })
|
|
|
|
|
- })
|
|
|
|
|
-})
|
|
|
|
|
-
|
|
|
|
|
func externalSecretConditionShouldBe(name, ns string, ct esv1beta1.ExternalSecretConditionType, cs v1.ConditionStatus, v float64) bool {
|
|
func externalSecretConditionShouldBe(name, ns string, ct esv1beta1.ExternalSecretConditionType, cs v1.ConditionStatus, v float64) bool {
|
|
|
return Eventually(func() float64 {
|
|
return Eventually(func() float64 {
|
|
|
Expect(testExternalSecretCondition.WithLabelValues(name, ns, string(ct), string(cs)).Write(&metric)).To(Succeed())
|
|
Expect(testExternalSecretCondition.WithLabelValues(name, ns, string(ct), string(cs)).Write(&metric)).To(Succeed())
|