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

[etcdbackup&restore] Implement RKE2Config webhook #542

Merged
merged 6 commits into from
Aug 2, 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
7 changes: 6 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ BIN_DIR := bin
TEST_DIR := test
TOOLS_DIR := hack/tools
TOOLS_BIN_DIR := $(abspath $(TOOLS_DIR)/$(BIN_DIR))
EXP_ETCDRESTORE_DIR := exp/etcdrestore

$(TOOLS_BIN_DIR):
mkdir -p $@
Expand Down Expand Up @@ -296,10 +297,14 @@ ARTIFACTS ?= ${ROOT_DIR}/_artifacts
KUBEBUILDER_ASSETS ?= $(shell $(SETUP_ENVTEST) use --use-env -p path $(KUBEBUILDER_ENVTEST_KUBERNETES_VERSION))

.PHONY: test
test: $(SETUP_ENVTEST) manifests ## Run tests.
test: $(SETUP_ENVTEST) manifests test-exp-etcdrestore ## Run all generators and exp tests.
go clean -testcache
KUBEBUILDER_ASSETS="$(KUBEBUILDER_ASSETS)" go test ./... $(TEST_ARGS)

.PHONY: test-exp-etcdrestore
furkatgofurov7 marked this conversation as resolved.
Show resolved Hide resolved
test-exp-etcdrestore: $(SETUP_ENVTEST) ## Run tests for experimental etcdrestore API.
cd $(EXP_ETCDRESTORE_DIR); KUBEBUILDER_ASSETS="$(KUBEBUILDER_ASSETS)" go test ./... $(TEST_ARGS)

##@ Build

.PHONY: build
Expand Down
4 changes: 2 additions & 2 deletions charts/rancher-turtles/templates/clusterctl-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,15 +37,15 @@ data:
url: "https://github.com/kubernetes-sigs/cluster-api/releases/v1.4.6/bootstrap-components.yaml"
type: "BootstrapProvider"
- name: "rke2"
url: "https://github.com/rancher/cluster-api-provider-rke2/releases/v0.4.1/bootstrap-components.yaml"
url: "https://github.com/rancher/cluster-api-provider-rke2/releases/v0.5.0/bootstrap-components.yaml"
type: "BootstrapProvider"

# ControlPlane providers
- name: "kubeadm"
url: "https://github.com/kubernetes-sigs/cluster-api/releases/v1.4.6/control-plane-components.yaml"
type: "ControlPlaneProvider"
- name: "rke2"
url: "https://github.com/rancher/cluster-api-provider-rke2/releases/v0.4.1/control-plane-components.yaml"
url: "https://github.com/rancher/cluster-api-provider-rke2/releases/v0.5.0/control-plane-components.yaml"
type: "ControlPlaneProvider"

# Addon providers
Expand Down
5 changes: 3 additions & 2 deletions exp/etcdrestore/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@ replace github.com/rancher/turtles => ../..
require (
github.com/onsi/ginkgo/v2 v2.17.2
github.com/onsi/gomega v1.33.1
github.com/rancher-sandbox/cluster-api-provider-rke2 v0.3.0
github.com/rancher/cluster-api-provider-rke2 v0.5.0
github.com/rancher/turtles v0.0.0-00010101000000-000000000000
github.com/spf13/pflag v1.0.6-0.20210604193023-d5e0c0615ace
k8s.io/api v0.29.4
k8s.io/apimachinery v0.29.4
k8s.io/client-go v0.29.4
k8s.io/component-base v0.29.4
k8s.io/klog/v2 v2.110.1
sigs.k8s.io/cluster-api v1.7.1
sigs.k8s.io/cluster-api v1.7.2
sigs.k8s.io/cluster-api-operator v0.12.0
sigs.k8s.io/controller-runtime v0.17.3
)
Expand All @@ -33,6 +33,7 @@ require (
github.com/coreos/vcontext v0.0.0-20230201181013-d72178a18687 // indirect
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect
github.com/emicklei/go-restful/v3 v3.12.0 // indirect
github.com/evanphx/json-patch v5.7.0+incompatible // indirect
github.com/evanphx/json-patch/v5 v5.9.0 // indirect
github.com/fsnotify/fsnotify v1.7.0 // indirect
github.com/go-logr/logr v1.4.1 // indirect
Expand Down
8 changes: 4 additions & 4 deletions exp/etcdrestore/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -141,8 +141,8 @@ github.com/prometheus/common v0.45.0 h1:2BGz0eBc2hdMDLnO/8n0jeB3oPrt2D08CekT0lne
github.com/prometheus/common v0.45.0/go.mod h1:YJmSTw9BoKxJplESWWxlbyttQR4uaEcGyv9MZjVOJsY=
github.com/prometheus/procfs v0.12.0 h1:jluTpSng7V9hY0O2R9DzzJHYb2xULk9VTR1V1R/k6Bo=
github.com/prometheus/procfs v0.12.0/go.mod h1:pcuDEFsWDnvcgNzo4EEweacyhjeA9Zk3cnaOZAZEfOo=
github.com/rancher-sandbox/cluster-api-provider-rke2 v0.3.0 h1:HhdHPhleqypIjib7oDCOFO69QrzufhrulBGupvLg2qA=
github.com/rancher-sandbox/cluster-api-provider-rke2 v0.3.0/go.mod h1:UAGaFOkIoCyZBhDkdeEMPjLxuLJRDefKnAdsgQoOmOU=
github.com/rancher/cluster-api-provider-rke2 v0.5.0 h1:l+E3GqgLPlo9WIE6yamBiYGG3aPk4qbx6XhfqJ8WQKs=
github.com/rancher/cluster-api-provider-rke2 v0.5.0/go.mod h1:V4jxqD4v1xQFSbgk57IECmXS4Y2DPyhrUDAsg/p75+k=
github.com/rogpeppe/go-internal v1.10.0 h1:TMyTOH3F/DB16zRVcYyreMH6GnZZrwQVAoYjRBZyWFQ=
github.com/rogpeppe/go-internal v1.10.0/go.mod h1:UQnix2H7Ngw/k4C5ijL5+65zddjncjaFoBhdsK/akog=
github.com/shopspring/decimal v1.3.1 h1:2Usl1nmF/WZucqkFZhnfFYxxxu8LG21F6nPQBE5gKV8=
Expand Down Expand Up @@ -277,8 +277,8 @@ k8s.io/kube-openapi v0.0.0-20231010175941-2dd684a91f00 h1:aVUu9fTY98ivBPKR9Y5w/A
k8s.io/kube-openapi v0.0.0-20231010175941-2dd684a91f00/go.mod h1:AsvuZPBlUDVuCdzJ87iajxtXuR9oktsTctW/R9wwouA=
k8s.io/utils v0.0.0-20231127182322-b307cd553661 h1:FepOBzJ0GXm8t0su67ln2wAZjbQ6RxQGZDnzuLcrUTI=
k8s.io/utils v0.0.0-20231127182322-b307cd553661/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0=
sigs.k8s.io/cluster-api v1.7.1 h1:JkMAbAMzBM+WBHxXLTJXTiCisv1PAaHRzld/3qrmLYY=
sigs.k8s.io/cluster-api v1.7.1/go.mod h1:V9ZhKLvQtsDODwjXOKgbitjyCmC71yMBwDcMyNNIov0=
sigs.k8s.io/cluster-api v1.7.2 h1:bRE8zoao7ajuLC0HijqfZVcubKQCPlZ04HMgcA53FGE=
sigs.k8s.io/cluster-api v1.7.2/go.mod h1:V9ZhKLvQtsDODwjXOKgbitjyCmC71yMBwDcMyNNIov0=
sigs.k8s.io/cluster-api-operator v0.12.0 h1:7EBStWwkvWg+yZW8Uq8XihmQdFXcEXZOEYfjqdJEN18=
sigs.k8s.io/cluster-api-operator v0.12.0/go.mod h1:GcWnGrKz74LS/E0IuFcT6YHBtL7zR9DNqjyVezf72mk=
sigs.k8s.io/controller-runtime v0.17.3 h1:65QmN7r3FWgTxDMz9fvGnO1kbf2nu+acg9p2R9oYYYk=
Expand Down
2 changes: 1 addition & 1 deletion exp/etcdrestore/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import (
"os"
"time"

bootstrapv1 "github.com/rancher-sandbox/cluster-api-provider-rke2/bootstrap/api/v1beta1"
bootstrapv1 "github.com/rancher/cluster-api-provider-rke2/bootstrap/api/v1beta1"
snapshotrestorev1 "github.com/rancher/turtles/exp/etcdrestore/api/v1alpha1"
expcontrollers "github.com/rancher/turtles/exp/etcdrestore/controllers"
expwebhooks "github.com/rancher/turtles/exp/etcdrestore/webhooks"
Expand Down
6 changes: 6 additions & 0 deletions exp/etcdrestore/webhooks/installsh.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
package webhooks

var installsh = `
furkatgofurov7 marked this conversation as resolved.
Show resolved Hide resolved
#!/bin/sh
echo "Starting the install script"
`
Loading