-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
97 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
"on": | ||
workflow_dispatch: | ||
inputs: | ||
kne_ref: | ||
description: "openconfig/kne reference (tag, commit, branch)" | ||
type: string | ||
default: v0.24.4 | ||
kind_version: | ||
description: "KinD version" | ||
type: string | ||
required: true | ||
default: v0.17.0 | ||
|
||
jobs: | ||
e2e: | ||
name: End-to-end test | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Set env vars | ||
run: | | ||
echo "KNE_REF=${{ inputs.kne_ref }}" >> $GITHUB_ENV | ||
- name: Set up Go | ||
uses: actions/setup-go@v3 | ||
with: | ||
go-version: ${{ env.GOVER }} | ||
|
||
- name: set up kind cluster | ||
uses: engineerd/setup-kind@v0.5.0 | ||
with: | ||
version: ${{ inputs.kind_version }} | ||
|
||
- uses: actions/checkout@v3 | ||
# - uses: fregante/setup-git-user@v1 | ||
|
||
- name: Publish structs | ||
run: make install-srl-controller |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
# KNE_REF is a git reference to use for KNE. It can be a branch, tag, or commit hash. | ||
KNE_REF ?= dee1995a7ec0f446b159a35fad201df9185ee75d | ||
KNE_REPO := https://github.com/openconfig/kne.git | ||
KNE_TEMP_DIR := /tmp/.srlcontroller-tests/kne | ||
KNE_TEST_DEPLOYMENT_FILE := ${KNE_TEMP_DIR}/deploy/kne/kind-bridge-no-controllers.yaml | ||
KIND_CLUSTER_NAME ?= srl-test | ||
|
||
.PHONY: install-kne | ||
install-kne: ## Install KNE | ||
rm -rf ${KNE_TEMP_DIR} && \ | ||
mkdir -p ${KNE_TEMP_DIR} && \ | ||
git clone ${KNE_REPO} ${KNE_TEMP_DIR} && \ | ||
cd ${KNE_TEMP_DIR} && git checkout ${KNE_REF} && \ | ||
make install | ||
|
||
.PHONY: kne-test-deployment-cfg-file | ||
kne-test-deployment-cfg-file: ## Create a KNE test deployment config file without controllers section | ||
sed -n '/controllers:/q;p' < ${KNE_TEMP_DIR}/deploy/kne/kind-bridge.yaml > ${KNE_TEST_DEPLOYMENT_FILE} | ||
sed -i 's/name: kne/name: ${KIND_CLUSTER_NAME}/g' ${KNE_TEST_DEPLOYMENT_FILE} | ||
|
||
.PHONY: deploy-kne | ||
deploy-kne: ## Deploy KNE kind cluster | ||
kind delete cluster --name=${KIND_CLUSTER_NAME} && \ | ||
cd ${KNE_TEMP_DIR} && kne deploy ${KNE_TEST_DEPLOYMENT_FILE} | ||
|
||
.PHONY: temp-docker-build | ||
temp-docker-build: ## Built controller container using the image and tag specified in the manager's manifest | ||
image="$(shell docker run -i --rm mikefarah/yq '.images[0].newName' < config/manager/kustomization.yaml)" tag="$(shell docker run -i --rm mikefarah/yq '.images[0].newTag' < config/manager/kustomization.yaml)" && \ | ||
docker build -t $$image:$$tag . && \ | ||
kind load docker-image $$image:$$tag --name ${KIND_CLUSTER_NAME} | ||
|
||
.PHONY: install-srl-controller | ||
install-srl-controller: install-kne kne-test-deployment-cfg-file deploy-kne temp-docker-build ## Install srl-controller from current working dir | ||
kubectl apply -k config/default | ||
@echo "wait for controller manager to be ready" | ||
kubectl -n srlinux-controller wait --for=condition=Available deployment.apps/srlinux-controller-controller-manager |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# copied from https://github.com/openconfig/kne/blob/main/deploy/kne/kind-bridge.yaml | ||
# with controllers removed | ||
cluster: | ||
kind: Kind | ||
spec: | ||
name: kne | ||
recycle: True | ||
version: v0.17.0 | ||
image: kindest/node:v1.26.0 | ||
config: ../../kind/kind-no-cni.yaml | ||
additionalManifests: | ||
- ../../manifests/kind/kind-bridge.yaml | ||
ingress: | ||
kind: MetalLB | ||
spec: | ||
manifest: ../../manifests/metallb/manifest.yaml | ||
ip_count: 100 | ||
cni: | ||
kind: Meshnet | ||
spec: | ||
manifest: ../../manifests/meshnet/grpc/manifest.yaml |