Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(Makefile): update chainsaw setup and Helm targets in Makefile #103

Merged
merged 1 commit into from
Nov 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 12 additions & 9 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -369,13 +369,14 @@ ifneq ($(strip $(HELM_DEPENDS)),)
done
endif

.PHONY: helm-install
helm-install: helm-install-depends ## Install the helm chart.
$(HELM) upgrade --install --create-namespace --namespace $(TEST_NAMESPACE) --wait $(PROJECT_NAME) kubedoop/$(PROJECT_NAME) --version $(VERSION)

.PHONY: helm-uninstall
helm-uninstall: ## Uninstall the helm chart.
$(HELM) uninstall --namespace $(TEST_NAMESPACE) $(PROJECT_NAME)
## helm uninstall depends
.PHONY: helm-uninstall-depends
helm-uninstall-depends: ## Uninstall the helm chart depends.
ifneq ($(strip $(HELM_DEPENDS)),)
for dep in $(HELM_DEPENDS); do \
$(HELM) uninstall --namespace $(TEST_NAMESPACE) $$dep; \
done
endif

# kind
KIND_VERSION ?= v0.24.0
Expand Down Expand Up @@ -448,12 +449,14 @@ $(CHAINSAW): $(LOCALBIN)
chainsaw-setup: ## Run the chainsaw setup
make docker-build
$(KIND) --name $(KIND_CLUSTER_NAME) load docker-image $(IMG)
KUBECONFIG=$(KIND_KUBECONFIG) make helm-install
KUBECONFIG=$(KIND_KUBECONFIG) make helm-install-depends
KUBECONFIG=$(KIND_KUBECONFIG) make deploy

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

.PHONY: chainsaw-cleanup
chainsaw-cleanup: ## Run the chainsaw cleanup
KUBECONFIG=$(KIND_KUBECONFIG) make helm-uninstall
KUBECONFIG=$(KIND_KUBECONFIG) make helm-uninstall-depends
KUBECONFIG=$(KIND_KUBECONFIG) make undeploy
17 changes: 17 additions & 0 deletions test/e2e/kerberos/chainsaw-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,23 @@ spec:
cleanup:
- sleep:
duration: 10s
catch:
- sleep:
duration: 5s
- script:
env:
- name: NAMESPACE
value: ($namespace)
content: |
set -ex
kubectl -n $NAMESPACE get pods
- describe:
apiVersion: v1
kind: Pod
selector: app.kubernetes.io/managed-by=hdfs-operator
- podLogs:
selector: app.kubernetes.io/managed-by=hdfs-operator
tail: -1
- try:
- apply:
file: hbase.yaml
Expand Down
4 changes: 2 additions & 2 deletions test/e2e/setup/hdfs-assert.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,5 @@ kind: StatefulSet
metadata:
name: hdfs-default-datanode
status:
availableReplicas: 2
replicas: 2
availableReplicas: 1
replicas: 1
2 changes: 1 addition & 1 deletion test/e2e/setup/hdfs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ spec:
dataNode:
roleGroups:
default:
replicas: 2
replicas: 1
config:
logging:
datanode:
Expand Down
8 changes: 4 additions & 4 deletions test/e2e/setup/zookeeper-assert.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ kind: StatefulSet
metadata:
name: zk-server-default
status:
availableReplicas: 3
readyReplicas: 3
currentReplicas: 3
replicas: 3
availableReplicas: 1
readyReplicas: 1
currentReplicas: 1
replicas: 1
2 changes: 1 addition & 1 deletion test/e2e/setup/zookeeper.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ spec:
server:
roleGroups:
default:
replicas: 3
replicas: 1
config:
logging:
zookeeperCluster:
Expand Down
Loading