|
@@ -228,3 +228,48 @@ func NestedJSONWithGJSON(f *framework.Framework) (string, func(*framework.TestCa
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+// This case creates a secret with a Docker json configuration value.
|
|
|
|
|
+// The values from the nested data are extracted using gjson.
|
|
|
|
|
+// not supported by: vault.
|
|
|
|
|
+func DockerJSONConfig(f *framework.Framework) (string, func(*framework.TestCase)) {
|
|
|
|
|
+ return "[specific] should do something I guess but not sure what!", func(tc *framework.TestCase) {
|
|
|
|
|
+ cloudSecretName := fmt.Sprintf("%s-%s", f.Namespace.Name, "docker-config-example")
|
|
|
|
|
+ cloudSecretValue := `{"auths":{"https://index.docker.io/v1/": {"auth": "c3R...zE2"}}}`
|
|
|
|
|
+
|
|
|
|
|
+ tc.Secrets = map[string]string{
|
|
|
|
|
+ cloudSecretName: cloudSecretValue,
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ tc.ExpectedSecret = &v1.Secret{
|
|
|
|
|
+ Type: v1.SecretTypeOpaque,
|
|
|
|
|
+ Data: map[string][]byte{
|
|
|
|
|
+ ".dockerconfigjson": []byte(cloudSecretValue),
|
|
|
|
|
+ },
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ tc.ExternalSecret.Spec.Data = []esv1alpha1.ExternalSecretData{
|
|
|
|
|
+ {
|
|
|
|
|
+ SecretKey: "mysecret",
|
|
|
|
|
+ RemoteRef: esv1alpha1.ExternalSecretDataRemoteRef{
|
|
|
|
|
+ Key: cloudSecretName,
|
|
|
|
|
+ },
|
|
|
|
|
+ },
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ tc.ExternalSecret.Spec.Target.Template = &esv1alpha1.ExternalSecretTemplate{
|
|
|
|
|
+ Metadata: esv1alpha1.ExternalSecretTemplateMetadata{
|
|
|
|
|
+ Annotations: map[string]string{
|
|
|
|
|
+ "example": "annotation",
|
|
|
|
|
+ },
|
|
|
|
|
+ Labels: map[string]string{
|
|
|
|
|
+ "example": "label",
|
|
|
|
|
+ },
|
|
|
|
|
+ },
|
|
|
|
|
+ Data: map[string]string{
|
|
|
|
|
+ ".dockerconfigjson": "{{ .mysecret | toString }}",
|
|
|
|
|
+ },
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ }
|
|
|
|
|
+}
|