-
Notifications
You must be signed in to change notification settings - Fork 138
feat: Simulated Provider for running IT #1129
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
Merged
Merged
Changes from all commits
Commits
Show all changes
20 commits
Select commit
Hold shift + click to select a range
d88615a
feat(sim): Update framework to set variables as part of BeforeSuite
takoverflow e632571
Add simulated provider for IT testing without CSP
takoverflow 910f655
Update go mod, run tidy
takoverflow c0a5e99
Update CICD test script to also run IT
takoverflow ca03db8
fix: Poll for machineclass secret in IT fwk
takoverflow 53a2f0c
Fix linter failures (docstring and reduced file permissions on write)
takoverflow b3e29a4
Address Review Comments
takoverflow 97f7a81
Switch the managedNodes to have only required info as map value
takoverflow fc99aeb
Remove mutex from the simulated driver (not needed with sync.Map)
takoverflow 410efa6
On clusterEnv creation, update context with the cluster name
takoverflow e649eca
Check for nil nodetemplate before building a node
takoverflow 7d4a186
Fix the machine class name in managedNodes
takoverflow ce03c80
Add note on running IT with simulated provider
takoverflow 249cf2e
Address review comments
takoverflow 910e9f7
Appease the linter: docstrings for CRD objects
takoverflow 283727c
Specify kwok version when creating the cluster
takoverflow ffe4afd
Update IT VAP to block node ready updates
takoverflow 09368d8
Update kwok config to use kcm, explicit addition of stage
takoverflow 2b92d67
Update node on VAP removal to trigger recovery
takoverflow 3a36d58
Wait for all preserved machines to either be removed or recover
takoverflow File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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,44 @@ | ||
| // SPDX-FileCopyrightText: 2026 SAP SE or an SAP affiliate company and Gardener contributors | ||
| // | ||
| // SPDX-License-Identifier: Apache-2.0 | ||
|
|
||
| package kubernetes | ||
|
|
||
| import ( | ||
| _ "embed" | ||
|
|
||
| apiextensionsv1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1" | ||
| sigyaml "sigs.k8s.io/yaml" | ||
| ) | ||
|
|
||
| func mustUnmarshal(raw []byte) *apiextensionsv1.CustomResourceDefinition { | ||
| t := new(apiextensionsv1.CustomResourceDefinition) | ||
| err := sigyaml.Unmarshal(raw, &t) | ||
| if err != nil { | ||
| panic(err) | ||
| } | ||
| return t | ||
| } | ||
|
|
||
| var ( | ||
| //go:embed crds/machine.sapcloud.io_machineclasses.yaml | ||
| // MachineClassCRD represents the raw bytes for MachineClass resource. | ||
| MachineClassCRD []byte | ||
| //go:embed crds/machine.sapcloud.io_machinedeployments.yaml | ||
| // MachineDeploymentCRD represents the raw bytes for MachineDeployment resource. | ||
| MachineDeploymentCRD []byte | ||
| //go:embed crds/machine.sapcloud.io_machinesets.yaml | ||
| // MachineSetCRD represents the raw bytes for MachineSet resource. | ||
| MachineSetCRD []byte | ||
| //go:embed crds/machine.sapcloud.io_machines.yaml | ||
| // MachineCRD represents the raw bytes for Machine resource. | ||
| MachineCRD []byte | ||
|
|
||
| // CRDs is a list of all machine-controller-manager CRDs. | ||
| CRDs = []*apiextensionsv1.CustomResourceDefinition{ | ||
| mustUnmarshal(MachineClassCRD), | ||
| mustUnmarshal(MachineDeploymentCRD), | ||
| mustUnmarshal(MachineSetCRD), | ||
| mustUnmarshal(MachineCRD), | ||
| } | ||
| ) |
This file contains hidden or 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,49 @@ | ||
| # SPDX-FileCopyrightText: 2026 SAP SE or an SAP affiliate company and Gardener contributors | ||
| # | ||
| # SPDX-License-Identifier: Apache-2.0 | ||
|
|
||
| PKG_ROOT := $(shell dirname "$(realpath $(lastword $(MAKEFILE_LIST)))") | ||
| PKG_DIR := $(shell dirname "$(PKG_ROOT)") | ||
| REPO_ROOT := $(shell dirname "$(PKG_DIR)") | ||
| TOOLS_BIN_DIR := $(REPO_ROOT)/hack/tools/bin | ||
|
|
||
| KWOKCTL ?= $(TOOLS_BIN_DIR)/kwokctl | ||
| KWOK_VERSION ?= v0.8.0 | ||
|
|
||
| $(KWOKCTL): $(TOOLS_BIN_DIR) | ||
| GOBIN=$(abspath $(TOOLS_BIN_DIR)) go install sigs.k8s.io/kwok/cmd/{kwok,kwokctl}@$(KWOK_VERSION) | ||
|
|
||
|
|
||
| .PHONY: build | ||
| build: | ||
| @mkdir -p bin | ||
| go build -v -o bin/machine-controller cmd/machine-controller/main.go | ||
|
|
||
| .PHONY: start | ||
| start: | ||
| @GO111MODULE=on go run \ | ||
| cmd/machine-controller/main.go \ | ||
| --control-kubeconfig=$(CONTROL_KUBECONFIG) \ | ||
| --target-kubeconfig=$(TARGET_KUBECONFIG) \ | ||
| --namespace=$(CONTROL_NAMESPACE) \ | ||
| --machine-creation-timeout=20m \ | ||
| --machine-drain-timeout=5m \ | ||
| --machine-health-timeout=10m \ | ||
| --machine-pv-detach-timeout=2m \ | ||
| --machine-safety-apiserver-statuscheck-timeout=30s \ | ||
| --machine-safety-apiserver-statuscheck-period=1m \ | ||
| --machine-safety-orphan-vms-period=30m \ | ||
| --leader-elect=$(LEADER_ELECT) \ | ||
| --v=3 | ||
|
|
||
| .PHONY: start-simulated-cluster | ||
| start-simulated-cluster: $(KWOKCTL) | ||
| $(KWOKCTL) create cluster --name "test-cluster" --config ./cluster/kwok-config.yaml | ||
|
|
||
| .PHONY: stop-simulated-cluster | ||
| stop-simulated-cluster: $(KWOKCTL) | ||
| $(KWOKCTL) delete cluster --name "test-cluster" | ||
|
|
||
| .PHONY: test-integration | ||
| test-integration: | ||
| @(cd test/integration/controller; ginkgo -v --show-node-events --poll-progress-after=300s --poll-progress-interval=60s) |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.