Skip to content

Commit 5005f56

Browse files
craigvanamanCraig Vanaman
andauthored
Feat: controller - machine create, status, delete
* feat: tooling * chore: adding dependencies for local kind cluster * chore: improve just for local dev cluster * feat: e2e now working in isolated kind cluster * feat: basic compute requests. not yet working * fix: first vertical slice now working * feat: machine status implemented * feat: delete machine * chore: updating ginkgo * fix: machine create, delete, status. e2e tests --------- Co-authored-by: Craig Vanaman <craig.vanaman@aoe.com>
1 parent 3f3b90a commit 5005f56

File tree

1,264 files changed

+292126
-146008
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,264 files changed

+292126
-146008
lines changed

.gitignore

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
/args
2-
/bin
32
/.kube-secrets
43
/tmp/*
54
/dev
6-
/test
75
/logs
86

97
.vscode
@@ -15,3 +13,20 @@ main
1513

1614
# Output of the go coverage tool
1715
*coverprofile.out*
16+
*.out
17+
18+
# Build artifacts
19+
build/
20+
21+
# Hermit
22+
.hermit/
23+
24+
# Vendir
25+
.vendir-tmp*/
26+
vendir.lock.yml
27+
28+
# Localdev
29+
.craig
30+
CLAUDE.md
31+
.claude
32+
ROADMAP.md

CONTRIBUTING.md

Lines changed: 0 additions & 1 deletion
This file was deleted.

Dockerfile

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,25 @@
1+
# SPDX-FileCopyrightText: 2024 SAP SE or an SAP affiliate company and Gardener contributors
2+
# SPDX-License-Identifier: Apache-2.0
3+
14
############# builder #############
2-
FROM golang:1.13.5 AS builder
5+
FROM golang:1.25.3 AS builder
36

4-
WORKDIR /go/src/github.com/aoepeople/machine-controller-manager-provider-stackit
7+
WORKDIR /workspace
58
COPY . .
69

7-
RUN .ci/build
10+
# Build binary
11+
RUN ./scripts/build.sh
812

913
############# base #############
10-
FROM alpine:3.11.2 as base
14+
FROM alpine:3.20 AS base
1115

12-
RUN apk add --update bash curl tzdata
16+
RUN apk add --no-cache bash curl tzdata ca-certificates
1317
WORKDIR /
1418

15-
############# machine-controller #############
19+
############# machine-controller #############
1620
FROM base AS machine-controller
1721

18-
COPY --from=builder /go/src/github.com/aoepeople/machine-controller-manager-provider-stackit/bin/rel/machine-controller /machine-controller
22+
COPY --from=builder /workspace/build/machine-controller /machine-controller
23+
24+
USER 65532:65532
1925
ENTRYPOINT ["/machine-controller"]

Makefile

Lines changed: 23 additions & 77 deletions
Original file line numberDiff line numberDiff line change
@@ -1,103 +1,49 @@
11
# SPDX-FileCopyrightText: 2024 SAP SE or an SAP affiliate company and Gardener contributors
2-
#
32
# SPDX-License-Identifier: Apache-2.0
43

4+
# Minimal Makefile wrapper - all logic is in justfile
5+
# This provides backward compatibility for make users
56

6-
BINARY_PATH := bin/
7-
COVERPROFILE := test/output/coverprofile.out
8-
IMAGE_REPOSITORY := <link-to-image-repo>
9-
IMAGE_TAG := $(shell cat VERSION)
10-
PROVIDER_NAME := SampleProvider
11-
PROJECT_NAME := gardener
12-
CONTROL_NAMESPACE := default
13-
CONTROL_KUBECONFIG := dev/target-kubeconfig.yaml
14-
TARGET_KUBECONFIG := dev/target-kubeconfig.yaml
15-
16-
#########################################
17-
# Rules for running helper scripts
18-
#########################################
19-
20-
.PHONY: rename-project
21-
rename-project:
22-
@./hack/rename-project ${PROJECT_NAME} ${PROVIDER_NAME}
7+
.PHONY: build
8+
build:
9+
just build
2310

24-
#########################################
25-
# Rules for starting machine-controller locally
26-
#########################################
11+
.PHONY: build-local
12+
build-local:
13+
just build
2714

2815
.PHONY: start
2916
start:
30-
@GO111MODULE=on go run \
31-
-mod=vendor \
32-
cmd/machine-controller/main.go \
33-
--control-kubeconfig=$(CONTROL_KUBECONFIG) \
34-
--target-kubeconfig=$(TARGET_KUBECONFIG) \
35-
--namespace=$(CONTROL_NAMESPACE) \
36-
--machine-creation-timeout=20m \
37-
--machine-drain-timeout=5m \
38-
--machine-health-timeout=10m \
39-
--machine-pv-detach-timeout=2m \
40-
--machine-safety-apiserver-statuscheck-timeout=30s \
41-
--machine-safety-apiserver-statuscheck-period=1m \
42-
--machine-safety-orphan-vms-period=30m \
43-
--v=3
17+
just start
4418

45-
#########################################
46-
# Rules for re-vendoring
47-
#########################################
19+
.PHONY: clean
20+
clean:
21+
just clean
4822

4923
.PHONY: revendor
5024
revendor:
51-
@env GO111MODULE=on go mod vendor -v
52-
@env GO111MODULE=on go mod tidy -v
25+
just revendor
5326

5427
.PHONY: update-dependencies
5528
update-dependencies:
56-
@env GO111MODULE=on go get -u
57-
58-
#########################################
59-
# Rules for testing
60-
#########################################
29+
just update-deps
6130

6231
.PHONY: test-unit
6332
test-unit:
64-
.ci/test
65-
66-
#########################################
67-
# Rules for build/release
68-
#########################################
69-
70-
.PHONY: release
71-
release: build-local build docker-image docker-login docker-push rename-binaries
72-
73-
.PHONY: build-local
74-
build-local:
75-
@env LOCAL_BUILD=1 .ci/build
76-
77-
.PHONY: build
78-
build:
79-
@.ci/build
33+
just golang::test
8034

8135
.PHONY: docker-image
8236
docker-image:
83-
@docker build -t $(IMAGE_REPOSITORY):$(IMAGE_TAG) .
84-
85-
.PHONY: docker-login
86-
docker-login:
87-
@gcloud auth login
37+
just docker-build
8838

8939
.PHONY: docker-push
9040
docker-push:
91-
@if ! docker images $(IMAGE_REPOSITORY) | awk '{ print $$2 }' | grep -q -F $(IMAGE_TAG); then echo "$(IMAGE_REPOSITORY) version $(IMAGE_TAG) is not yet built. Please run 'make docker-images'"; false; fi
92-
@gcloud docker -- push $(IMAGE_REPOSITORY):$(IMAGE_TAG)
41+
just docker-push
9342

94-
.PHONY: rename-binaries
95-
rename-binaries:
96-
@if [[ -f bin/machine-controller ]]; then cp bin/machine-controller machine-controller-darwin-amd64; fi
97-
@if [[ -f bin/rel/machine-controller ]]; then cp bin/rel/machine-controller machine-controller-linux-amd64; fi
43+
.PHONY: lint
44+
lint:
45+
just lint
9846

99-
.PHONY: clean
100-
clean:
101-
@rm -rf bin/
102-
@rm -f *linux-amd64
103-
@rm -f *darwin-amd64
47+
.PHONY: fmt
48+
fmt:
49+
just fmt

bin/.docker-buildx-0.29.1.pkg

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
hermit

bin/.gcloud-544.0.0.pkg

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
hermit

bin/.go-1.25.3.pkg

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
hermit

bin/.golangci-lint-2.5.0.pkg

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
hermit

bin/.just-1.43.0.pkg

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
hermit

bin/.kind-0.30.0.pkg

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
hermit

0 commit comments

Comments
 (0)