Add e2e test for CRDs+CRs reconciliation using cert-manager
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
This commit is contained in:
parent
97bbc59eb6
commit
8baead9b2e
|
|
@ -58,6 +58,7 @@ jobs:
|
|||
echo -e "${RESULT}\n\ndoes not equal\n\n${EXPECTED}"
|
||||
exit 1
|
||||
fi
|
||||
kubectl delete -f config/testdata/status-defaults
|
||||
- name: Deploy controllers
|
||||
run: |
|
||||
make dev-deploy IMG=test/kustomize-controller:latest
|
||||
|
|
@ -80,6 +81,11 @@ jobs:
|
|||
kubectl -n impersonation wait kustomizations/podinfo --for=condition=ready --timeout=4m
|
||||
kubectl -n impersonation delete kustomizations/podinfo
|
||||
until kubectl -n impersonation get deploy/podinfo 2>&1 | grep NotFound ; do sleep 2; done
|
||||
- name: Run CRDs + CRs tests
|
||||
run: |
|
||||
kubectl -n kustomize-system apply -f ./config/testdata/crds-crs
|
||||
kubectl -n kustomize-system wait kustomizations/certs --for=condition=ready --timeout=4m
|
||||
kubectl -n kustomizer-cert-test wait issuers/my-ca-issuer --for=condition=ready --timeout=1m
|
||||
- name: Logs
|
||||
run: |
|
||||
kubectl -n kustomize-system logs deploy/source-controller
|
||||
|
|
|
|||
|
|
@ -0,0 +1,31 @@
|
|||
apiVersion: source.toolkit.fluxcd.io/v1beta1
|
||||
kind: GitRepository
|
||||
metadata:
|
||||
name: certs
|
||||
spec:
|
||||
interval: 15m
|
||||
url: https://github.com/stefanprodan/kustomizer
|
||||
ref:
|
||||
tag: "v1.1.0"
|
||||
---
|
||||
apiVersion: kustomize.toolkit.fluxcd.io/v1beta2
|
||||
kind: Kustomization
|
||||
metadata:
|
||||
name: certs
|
||||
spec:
|
||||
interval: 10m
|
||||
path: "./testdata/certs"
|
||||
prune: true
|
||||
sourceRef:
|
||||
kind: GitRepository
|
||||
name: certs
|
||||
healthChecks:
|
||||
- apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
name: cert-manager
|
||||
namespace: cert-manager
|
||||
- apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
name: cert-manager-webhook
|
||||
namespace: cert-manager
|
||||
timeout: 2m
|
||||
|
|
@ -647,7 +647,7 @@ func (r *KustomizationReconciler) apply(ctx context.Context, manager *ssa.Resour
|
|||
if len(stageTwo) > 0 {
|
||||
changeSet, err := manager.ApplyAll(ctx, stageTwo, kustomization.Spec.Force)
|
||||
if err != nil {
|
||||
return false, err
|
||||
return false, fmt.Errorf("%w\n%s", err, changeSetLog.String())
|
||||
}
|
||||
|
||||
if changeSet != nil && len(changeSet.Entries) > 0 {
|
||||
|
|
|
|||
|
|
@ -174,6 +174,7 @@ func (m *ResourceManager) apply(ctx context.Context, object *unstructured.Unstru
|
|||
func (m *ResourceManager) IsClusterDefinition(kind string) bool {
|
||||
switch strings.ToLower(kind) {
|
||||
case "customresourcedefinition":
|
||||
return true
|
||||
case "namespace":
|
||||
return true
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue