Skip to content
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
19 changes: 2 additions & 17 deletions .github/workflows/agent-ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,22 +17,7 @@ jobs:
contents: write
steps:
- uses: actions/checkout@v4

- name: Install everything, run the tests, produce the .coverage file
- name: Install everything, run the tests, produce the .coverage file and coverage.xml report
run: |
cd agent
make test
- name: Coverage comment
id: coverage_comment
uses: py-cov-action/python-coverage-comment-action@v3
with:
COVERAGE_PATH: agent/
GITHUB_TOKEN: ${{ github.token }}
- name: Store Pull Request comment to be posted
uses: actions/upload-artifact@v4
if: steps.coverage_comment.outputs.COMMENT_FILE_WRITTEN == 'true'
with:
# If you use a different name, update COMMENT_ARTIFACT_NAME accordingly
name: python-coverage-comment-action
# If you use a different name, update COMMENT_FILENAME accordingly
path: python-coverage-comment-action.txt
make test
11 changes: 11 additions & 0 deletions agent/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,17 @@ build: ## Builds using hatch to `dist`
$(VENV)hatch -p skyhook-agent version $(build_version)
$(VENV)hatch -p skyhook-agent build -c

docker-setup:
test ! $($(DOCKER_CMD) context ls | grep builder) || $(DOCKER_CMD) context create builder;
$(DOCKER_CMD) buildx create --platform linux/amd64,linux/arm64 --use builder
$(DOCKER_CMD) run --privileged --rm tonistiigi/binfmt --install amd64,arm64

ACTUAL_TAGS=$(shell echo "-t $(REGISTRY)/$(AGENT_IMAGE):$(shell date +%y.%m.%d-%H%M%S)-$(COMMIT_SHORT_SHA) $(TAGS)" | tr A-Z a-z)
.PHONY: docker-build-only
docker-build-only:
@echo "Building skyhook-agent $(DOCKER_CMD) image with tags: $(ACTUAL_TAGS)"
$(DOCKER_CMD) buildx build $(BUILD_ARGS) --build-arg AGENT_VERSION=$(AGENT_VERSION) --platform linux/amd64,linux/arm64 $(ACTUAL_TAGS) --metadata-file=metadata.json -f ../containers/agent.Dockerfile .

##@ Vendor
.PHONY: vendor
vendor: ## Uses Unearth to vendor all dependencies locally.
Expand Down
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion e2e/readme.md → k8s-tests/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Due to some limitatations it can be hard to test circumstances where a node will
1. Run `make create-kind-cluster`, and wait for local cluster to be brought up.
2. Run `make install` to install the skyhook CRD into the cluster.
3. Use vscode's debugger in order to run the operator with your local cluster.
4. Use `kubectl apply -f e2e/chainsaw/simple-skyhook/skyhook.yaml` to define a skyhook.
4. Use `kubectl apply -f k8s-tests/chainsaw/simple-skyhook/skyhook.yaml` to define a skyhook.
5. You can then use `kubectl` or `k9s` in order to overview the state of the skyhook as well as it's resources. In this instance we are looking for the configmap named `{skyhook.Name}-{node.Name}-metadata`.
6. Now that we can see that the configmap exists we can remove the node to see if the configmap will be deleted accordingly. We'll do so with the command `kubectl delete node {node.Name}`.
7. Now check to see whether the configmap named `{skyhook.Name}-{node.Name}-metadata` still exists and if it doesn't then everything is working.
Expand Down