|
|
@@ -39,58 +39,44 @@ var _ = Describe("[vault] ", func() {
|
|
|
framework.TableFunc(f,
|
|
|
newVaultProvider(f)),
|
|
|
// uses token auth
|
|
|
- compose(withTokenAuth, f, common.JSONDataFromSync, useTokenAuth),
|
|
|
- compose(withTokenAuth, f, common.JSONDataWithProperty, useTokenAuth),
|
|
|
- compose(withTokenAuth, f, common.JSONDataWithTemplate, useTokenAuth),
|
|
|
- compose(withTokenAuth, f, common.DataPropertyDockerconfigJSON, useTokenAuth),
|
|
|
- compose(withTokenAuth, f, common.JSONDataWithoutTargetName, useTokenAuth),
|
|
|
+ framework.Compose(withTokenAuth, f, common.JSONDataFromSync, useTokenAuth),
|
|
|
+ framework.Compose(withTokenAuth, f, common.JSONDataWithProperty, useTokenAuth),
|
|
|
+ framework.Compose(withTokenAuth, f, common.JSONDataWithTemplate, useTokenAuth),
|
|
|
+ framework.Compose(withTokenAuth, f, common.DataPropertyDockerconfigJSON, useTokenAuth),
|
|
|
+ framework.Compose(withTokenAuth, f, common.JSONDataWithoutTargetName, useTokenAuth),
|
|
|
// use cert auth
|
|
|
- compose(withCertAuth, f, common.JSONDataFromSync, useCertAuth),
|
|
|
- compose(withCertAuth, f, common.JSONDataWithProperty, useCertAuth),
|
|
|
- compose(withCertAuth, f, common.JSONDataWithTemplate, useCertAuth),
|
|
|
- compose(withCertAuth, f, common.DataPropertyDockerconfigJSON, useCertAuth),
|
|
|
- compose(withCertAuth, f, common.JSONDataWithoutTargetName, useTokenAuth),
|
|
|
+ framework.Compose(withCertAuth, f, common.JSONDataFromSync, useCertAuth),
|
|
|
+ framework.Compose(withCertAuth, f, common.JSONDataWithProperty, useCertAuth),
|
|
|
+ framework.Compose(withCertAuth, f, common.JSONDataWithTemplate, useCertAuth),
|
|
|
+ framework.Compose(withCertAuth, f, common.DataPropertyDockerconfigJSON, useCertAuth),
|
|
|
+ framework.Compose(withCertAuth, f, common.JSONDataWithoutTargetName, useTokenAuth),
|
|
|
// use approle auth
|
|
|
- compose(withApprole, f, common.JSONDataFromSync, useApproleAuth),
|
|
|
- compose(withApprole, f, common.JSONDataWithProperty, useApproleAuth),
|
|
|
- compose(withApprole, f, common.JSONDataWithTemplate, useApproleAuth),
|
|
|
- compose(withApprole, f, common.DataPropertyDockerconfigJSON, useApproleAuth),
|
|
|
- compose(withApprole, f, common.JSONDataWithoutTargetName, useTokenAuth),
|
|
|
+ framework.Compose(withApprole, f, common.JSONDataFromSync, useApproleAuth),
|
|
|
+ framework.Compose(withApprole, f, common.JSONDataWithProperty, useApproleAuth),
|
|
|
+ framework.Compose(withApprole, f, common.JSONDataWithTemplate, useApproleAuth),
|
|
|
+ framework.Compose(withApprole, f, common.DataPropertyDockerconfigJSON, useApproleAuth),
|
|
|
+ framework.Compose(withApprole, f, common.JSONDataWithoutTargetName, useTokenAuth),
|
|
|
// use v1 provider
|
|
|
- compose(withV1, f, common.JSONDataFromSync, useV1Provider),
|
|
|
- compose(withV1, f, common.JSONDataWithProperty, useV1Provider),
|
|
|
- compose(withV1, f, common.JSONDataWithTemplate, useV1Provider),
|
|
|
- compose(withV1, f, common.DataPropertyDockerconfigJSON, useV1Provider),
|
|
|
- compose(withV1, f, common.JSONDataWithoutTargetName, useTokenAuth),
|
|
|
+ framework.Compose(withV1, f, common.JSONDataFromSync, useV1Provider),
|
|
|
+ framework.Compose(withV1, f, common.JSONDataWithProperty, useV1Provider),
|
|
|
+ framework.Compose(withV1, f, common.JSONDataWithTemplate, useV1Provider),
|
|
|
+ framework.Compose(withV1, f, common.DataPropertyDockerconfigJSON, useV1Provider),
|
|
|
+ framework.Compose(withV1, f, common.JSONDataWithoutTargetName, useTokenAuth),
|
|
|
// use jwt provider
|
|
|
- compose(withJWT, f, common.JSONDataFromSync, useJWTProvider),
|
|
|
- compose(withJWT, f, common.JSONDataWithProperty, useJWTProvider),
|
|
|
- compose(withJWT, f, common.JSONDataWithTemplate, useJWTProvider),
|
|
|
- compose(withJWT, f, common.DataPropertyDockerconfigJSON, useJWTProvider),
|
|
|
- compose(withJWT, f, common.JSONDataWithoutTargetName, useTokenAuth),
|
|
|
+ framework.Compose(withJWT, f, common.JSONDataFromSync, useJWTProvider),
|
|
|
+ framework.Compose(withJWT, f, common.JSONDataWithProperty, useJWTProvider),
|
|
|
+ framework.Compose(withJWT, f, common.JSONDataWithTemplate, useJWTProvider),
|
|
|
+ framework.Compose(withJWT, f, common.DataPropertyDockerconfigJSON, useJWTProvider),
|
|
|
+ framework.Compose(withJWT, f, common.JSONDataWithoutTargetName, useTokenAuth),
|
|
|
// use kubernetes provider
|
|
|
- compose(withK8s, f, common.JSONDataFromSync, useKubernetesProvider),
|
|
|
- compose(withK8s, f, common.JSONDataWithProperty, useKubernetesProvider),
|
|
|
- compose(withK8s, f, common.JSONDataWithTemplate, useKubernetesProvider),
|
|
|
- compose(withK8s, f, common.DataPropertyDockerconfigJSON, useKubernetesProvider),
|
|
|
- compose(withK8s, f, common.JSONDataWithoutTargetName, useTokenAuth),
|
|
|
+ framework.Compose(withK8s, f, common.JSONDataFromSync, useKubernetesProvider),
|
|
|
+ framework.Compose(withK8s, f, common.JSONDataWithProperty, useKubernetesProvider),
|
|
|
+ framework.Compose(withK8s, f, common.JSONDataWithTemplate, useKubernetesProvider),
|
|
|
+ framework.Compose(withK8s, f, common.DataPropertyDockerconfigJSON, useKubernetesProvider),
|
|
|
+ framework.Compose(withK8s, f, common.JSONDataWithoutTargetName, useTokenAuth),
|
|
|
)
|
|
|
})
|
|
|
|
|
|
-func compose(descAppend string, f *framework.Framework, fn func(f *framework.Framework) (string, func(*framework.TestCase)), tweaks ...func(*framework.TestCase)) TableEntry {
|
|
|
- desc, tfn := fn(f)
|
|
|
- tweaks = append(tweaks, tfn)
|
|
|
- te := Entry(desc + " " + descAppend)
|
|
|
-
|
|
|
- // need to convert []func to []interface{}
|
|
|
- ifs := make([]interface{}, len(tweaks))
|
|
|
- for i := 0; i < len(tweaks); i++ {
|
|
|
- ifs[i] = tweaks[i]
|
|
|
- }
|
|
|
- te.Parameters = ifs
|
|
|
- return te
|
|
|
-}
|
|
|
-
|
|
|
func useTokenAuth(tc *framework.TestCase) {
|
|
|
tc.ExternalSecret.Spec.SecretStoreRef.Name = tc.Framework.Namespace.Name
|
|
|
}
|