Skip to content

Commit

Permalink
test: update chainsaw to v0.2.6
Browse files Browse the repository at this point in the history
  • Loading branch information
lwpk110 committed Aug 16, 2024
1 parent d62bada commit eb6ac9b
Show file tree
Hide file tree
Showing 14 changed files with 73 additions and 83 deletions.
2 changes: 1 addition & 1 deletion .chainsaw.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@ spec:
delete: 240s
error: 120s
exec: 45s
skipDelete: true
skipDelete: false
failFast: true
25 changes: 8 additions & 17 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -385,22 +385,14 @@ kind-delete: kind ## Delete a kind cluster.

# chainsaw

CHAINSAW_VERSION ?= v0.1.8
CHAINSAW_VERSION ?= v0.2.6
CHAINSAW = $(LOCALBIN)/chainsaw

.PHONY: chainsaw
CHAINSAW = $(LOCALBIN)/chainsaw
chainsaw: ## Download chainsaw locally if necessary.
ifeq (,$(shell which $(CHAINSAW)))
ifeq (,$(shell which chainsaw 2>/dev/null))
@{ \
set -e ;\
go install github.com/kyverno/chainsaw@$(CHAINSAW_VERSION) ;\
}
CHAINSAW = $(GOBIN)/chainsaw
else
CHAINSAW = $(shell which chainsaw)
endif
endif
chainsaw: $(CHAINSAW) ## Download chainsaw locally if necessary.
$(CHAINSAW): $(LOCALBIN)
test -s $(LOCALBIN)/chainsaw && $(LOCALBIN)/chainsaw version | grep -q $(CHAINSAW_VERSION) || \
GOBIN=$(LOCALBIN) go install github.com/kyverno/chainsaw@$(CHAINSAW_VERSION)

# chainsaw setup logical
# - Build the operator docker image
Expand All @@ -414,11 +406,10 @@ chainsaw-setup: manifests kustomize ## Run the chainsaw setup
make docker-build
$(KIND) --name $(KIND_CLUSTER_NAME) load docker-image $(IMG)
KUBECONFIG=$(KIND_KUBECONFIG) make deploy

.PHONY: chainsaw-test
chainsaw-test: chainsaw ## Run the chainsaw test
$(CHAINSAW) test --cluster cluster-1=$(KIND_KUBECONFIG) --test-dir ./test/e2e

KUBECONFIG=$(KIND_KUBECONFIG) $(CHAINSAW) test --cluster cluster-1=$(KIND_KUBECONFIG) --test-dir ./test/e2e/

.PHONY: chainsaw-cleanup
chainsaw-cleanup: manifests kustomize ## Run the chainsaw cleanup
Expand Down
22 changes: 0 additions & 22 deletions test/e2e/default/00-assert.yaml

This file was deleted.

36 changes: 36 additions & 0 deletions test/e2e/default/chainsaw-test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
apiVersion: chainsaw.kyverno.io/v1alpha1
kind: Test
metadata:
name: default
spec:
steps:
- try:
- apply:
file: ../setup/olm.yaml
- assert:
file: ../setup/olm-assert.yaml
- try:
- apply:
file: ../setup/subs.yaml
- assert:
file: ../setup/subs-assert.yaml
- apply:
file: ../setup/secret.yaml
- assert:
file: ../setup/secret-assert.yaml
- try:
- apply:
file: ../setup/zookeeper.yaml
- assert:
file: ../setup/zookeeper-assert.yaml
cleanup:
- sleep:
duration: 30s
- try:
- apply:
file: kafka.yaml
- assert:
file: kafka-assert.yaml
cleanup:
- sleep:
duration: 10s
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,10 @@ apiVersion: apps/v1
kind: StatefulSet
metadata:
name: kafkacluster-sample-default-broker
namespace: kubedatastack
status:
replicas: 3
---
apiVersion: v1
kind: ConfigMap
metadata:
name: kafkacluster-sample
namespace: kubedatastack
name: kafkacluster-sample
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ metadata:
app.kubernetes.io/managed-by: kustomize
app.kubernetes.io/created-by: kafka-operator
name: kafkacluster-sample
namespace: kubedatastack
spec:
clusterConfig:
tls:
Expand Down
14 changes: 14 additions & 0 deletions test/e2e/setup/olm-assert.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
apiVersion: operators.coreos.com/v1
kind: OperatorGroup
metadata:
name: kubedoop-system
---
apiVersion: operators.coreos.com/v1alpha1
kind: CatalogSource
metadata:
name: kubedoop-catalog
status:
connectionState:
lastObservedState: READY

18 changes: 3 additions & 15 deletions test/e2e/default/00-olm.yaml → test/e2e/setup/olm.yaml
Original file line number Diff line number Diff line change
@@ -1,29 +1,17 @@
apiVersion: v1
kind: Namespace
metadata:
name: kubedatastack-operators
---
apiVersion: v1
kind: Namespace
metadata:
name: kubedatastack
---
apiVersion: operators.coreos.com/v1
kind: OperatorGroup
metadata:
name: zncdata-stack
namespace: kubedatastack-operators
name: kubedoop-system
spec:
# if not specified, the operator group will target all namespaces
# so the operator will be able to watch and manage resources in all namespaces
targetNamespaces:
- kubedatastack
- ($namespace)
---
apiVersion: operators.coreos.com/v1alpha1
kind: CatalogSource
metadata:
name: kubedata-catalog
namespace: olm
name: kubedoop-catalog
spec:
sourceType: grpc
grpcPodConfig:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ apiVersion: apps/v1
kind: DaemonSet
metadata:
name: secretcsi-sample-csi
namespace: kubedatastack
status:
currentNumberScheduled: 1
desiredNumberScheduled: 1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ apiVersion: secrets.zncdata.dev/v1alpha1
kind: SecretClass
metadata:
name: tls
namespace: kubedatastack
spec:
backend:
autoTls:
Expand All @@ -11,14 +10,13 @@ spec:
caCertificateLifeTime: 730h
secret:
name: tls-hdfs-ca
namespace: kubedatastack
nameSpace: ($namespace)
maxCertificateLifeTime: 360h
---
apiVersion: secrets.zncdata.dev/v1alpha1
kind: SecretClass
metadata:
name: kafka-internal-tls
namespace: kubedatastack
spec:
backend:
autoTls:
Expand All @@ -27,7 +25,7 @@ spec:
caCertificateLifeTime: 730h
secret:
name: tls-hdfs-ca
namespace: kubedatastack
nameSpace: ($namespace)
maxCertificateLifeTime: 360h
---
apiVersion: secrets.zncdata.dev/v1alpha1
Expand All @@ -40,7 +38,6 @@ metadata:
app.kubernetes.io/managed-by: kustomize
app.kubernetes.io/created-by: secret-operator
name: secretcsi-sample
namespace: kubedatastack
spec:
csiDriver:
repository: quay.io/zncdatadev/secret-csi-driver
Expand All @@ -65,4 +62,4 @@ spec:
tag: v2.11.0
pullPolicy: IfNotPresent
logging:
level: "10"
level: "10"
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,19 @@ apiVersion: apps/v1
kind: Deployment
metadata:
name: zookeeper-operator-controller-manager
namespace: kubedatastack-operators
status:
availableReplicas: 1
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: listener-operator-controller-manager
namespace: kubedatastack-operators
status:
availableReplicas: 1
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: secret-operator-controller-manager
namespace: kubedatastack-operators
status:
availableReplicas: 1
16 changes: 7 additions & 9 deletions test/e2e/default/01-subs.yaml → test/e2e/setup/subs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,34 +2,32 @@ apiVersion: operators.coreos.com/v1alpha1
kind: Subscription
metadata:
name: listener-sub
namespace: kubedatastack-operators
spec:
channel: stable
name: listener-operator
source: kubedata-catalog
sourceNamespace: olm
source: kubedoop-catalog
sourceNamespace: ($namespace)
installPlanApproval: Automated
---
apiVersion: operators.coreos.com/v1alpha1
kind: Subscription
metadata:
name: secret-sub
namespace: kubedatastack-operators
spec:
channel: stable
name: secret-operator
source: kubedata-catalog
sourceNamespace: olm
source: kubedoop-catalog
sourceNamespace: ($namespace)
installPlanApproval: Automated
---
apiVersion: operators.coreos.com/v1alpha1
kind: Subscription
metadata:
name: zookeeper-sub
namespace: kubedatastack-operators
spec:
channel: stable
name: zookeeper-operator
source: kubedata-catalog
sourceNamespace: olm
source: kubedoop-catalog
sourceNamespace: ($namespace)
installPlanApproval: Automated

Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,10 @@ apiVersion: apps/v1
kind: StatefulSet
metadata:
name: zookeepercluster-sample-default
namespace: kubedatastack
status:
replicas: 1
---
apiVersion: v1
kind: ConfigMap
metadata:
name: kafka-znode
namespace: kubedatastack
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ metadata:
app.kubernetes.io/managed-by: kustomize
app.kubernetes.io/created-by: zookeeper-operator
name: zookeepercluster-sample
namespace: kubedatastack
spec:
image:
repository: docker.io/bitnami/zookeeper
Expand Down Expand Up @@ -47,9 +46,7 @@ metadata:
app.kubernetes.io/managed-by: kustomize
app.kubernetes.io/created-by: zookeeper-operator
name: kafka-znode
namespace: kubedatastack
spec:
clusterRef:
name: zookeepercluster-sample
namespace: kubedatastack

0 comments on commit eb6ac9b

Please sign in to comment.