Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into add-preparation-of-cl…
Browse files Browse the repository at this point in the history
…usterclass
  • Loading branch information
farodin91 committed Jun 14, 2024
2 parents 60c1762 + 0cfa945 commit 24d8123
Show file tree
Hide file tree
Showing 29 changed files with 6,829 additions and 38 deletions.
7 changes: 5 additions & 2 deletions .github/ISSUE_TEMPLATE/release.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,10 @@ Release vX.X.X
## Checklist

- [ ] Update metadata & clusterctl-settings.
- [ ] Update version in e2e config.
- [ ] Update docs (compatibility table; usage etc).
- [ ] Create tag.
- [ ] Create release branch `release-X.Y`
- [ ] Create tag `vX.Y.Z`.
- [ ] Update the created draft release to include things like breaking changes or important notes.
- [ ] Publish the release.
- [ ] Update the draft release notes with generated release notes from `sigs.k8s.io/kubebuilder-release-tools/notes`
- [ ] Publish the release.
31 changes: 31 additions & 0 deletions .github/workflows/conformance-e2e.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Conformance end-to-end tests
on:
schedule:
- cron: "0 5 * * 1"
workflow_dispatch: {}
jobs:
conformance-e2e:
runs-on: ubuntu-latest
environment: e2e
env:
IONOS_TOKEN: ${{ secrets.IONOS_TOKEN }}
IONOSCLOUD_MACHINE_IMAGE_ID: ${{ vars.IONOSCLOUD_MACHINE_IMAGE_ID }}
CONTROL_PLANE_ENDPOINT_LOCATION: ${{ vars.CONTROL_PLANE_ENDPOINT_LOCATION }}
steps:
- uses: actions/checkout@v4

- name: Setup Go environment
uses: actions/setup-go@v5
with:
go-version-file: "go.mod"

- name: Run e2e tests
run: make GINKGO_LABEL="Conformance" test-e2e

- name : Upload artifacts
uses: actions/upload-artifact@v4
if: success() || failure()
with:
name: logs
path: _artifacts
retention-days: 7
64 changes: 64 additions & 0 deletions .github/workflows/e2e.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
name: End-to-end tests
on:
pull_request_target:
types: ["opened", "synchronize", "reopened", "labeled", "unlabeled" ]
branches: [ "main" ]
paths:
- "**.go"
- "**.ya?ml"
- "**.sh"
- "Dockerfile"
- "Makefile"
push:
branches:
- main
paths:
- "**.go"
- "**.ya?ml"
- "**.sh"
- "Dockerfile"
- "Makefile"
jobs:
e2e:
if: ${{ ! contains( github.event.pull_request.labels.*.name, 'skip e2e') }}
runs-on: ubuntu-latest
environment: e2e
env:
IONOS_TOKEN: ${{ secrets.IONOS_TOKEN }}
IONOSCLOUD_MACHINE_IMAGE_ID: ${{ vars.IONOSCLOUD_MACHINE_IMAGE_ID }}
CONTROL_PLANE_ENDPOINT_LOCATION: ${{ vars.CONTROL_PLANE_ENDPOINT_LOCATION }}
steps:
- name: Check out branch ${{ github.ref }}
if: ${{ github.event_name == 'push' }}
uses: actions/checkout@v4

- name: Check out PR ${{ github.event.pull_request.number }}
if: ${{ github.event_name == 'pull_request_target' }}
uses: actions/checkout@v4
with:
repository: ${{ github.event.pull_request.head.repo.full_name }}
ref: ${{ github.event.pull_request.head.ref }}

- name: Setup Go environment
uses: actions/setup-go@v5
with:
go-version-file: "go.mod"

- name: Run e2e tests
id: tests
run: make test-e2e

- name: Upload artifacts
uses: actions/upload-artifact@v4
if: success() || failure()
with:
name: logs
path: _artifacts
retention-days: 7

- name: Remove cancelled run leftovers
if: cancelled()
env:
DATACENTER_ID: ${{ steps.tests.outputs.DATACENTER_ID }}
IP_BLOCK_ID: ${{ steps.tests.outputs.IP_BLOCK_ID }}
run: make remove-cancelled-e2e-leftovers
7 changes: 1 addition & 6 deletions .github/workflows/verify.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,6 @@ on:
- main
pull_request:

# don't waste resources and time on outdated commits
concurrency:
group: ${{ github.ref }}
cancel-in-progress: true

jobs:
verify:
runs-on: ubuntu-latest
Expand All @@ -21,4 +16,4 @@ jobs:
with:
go-version-file: go.mod
- name: Run verifications
run: make verify
run: make verify
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,9 @@ cluster.yaml
# release
out/

# e2e tests
_artifacts/

# crs
templates/crs/cni/calico.yaml

Expand Down
3 changes: 3 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,11 @@ linters-settings:
# Controller Runtime
- pkg: sigs.k8s.io/controller-runtime
alias: ctrl
# Cluster API
- pkg: sigs.k8s.io/cluster-api/api/v1beta1
alias: clusterv1
- pkg: "sigs.k8s.io/cluster-api/test/e2e"
alias: capie2e
# Own module
- pkg: github.com/ionos-cloud/cluster-api-provider-ionoscloud/api/v1alpha1
alias: infrav1
Expand Down
58 changes: 56 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@

# Image URL to use all building/pushing image targets
IMG ?= controller:latest
IMG ?= controller:dev
# ENVTEST_K8S_VERSION refers to the version of kubebuilder assets to be downloaded by envtest binary.
ENVTEST_K8S_VERSION = 1.28.0
ENVTEST_K8S_VERSION = 1.29.5

# Get the currently used golang install path (in GOPATH/bin, unless GOBIN is set)
ifeq (,$(shell go env GOBIN))
Expand Down Expand Up @@ -261,3 +261,57 @@ CALICO_VERSION ?= v3.26.3
.PHONY: crs-calico
crs-calico: ## Generates crs manifests for Calico.
curl -o templates/crs/cni/calico.yaml https://raw.githubusercontent.com/projectcalico/calico/$(CALICO_VERSION)/manifests/calico.yaml

##@ End-to-End Tests

# Directories.
#
# Full directory of where the Makefile resides
ROOT_DIR:=$(shell dirname $(realpath $(firstword $(MAKEFILE_LIST))))
TEST_DIR := test
ARTIFACTS ?= ${ROOT_DIR}/_artifacts


E2E_CONF_FILE ?= $(ROOT_DIR)/$(TEST_DIR)/e2e/config/ionoscloud.yaml
SKIP_RESOURCE_CLEANUP ?= false
USE_EXISTING_CLUSTER ?= false

GINKGO_POLL_PROGRESS_AFTER ?= 10m
GINKGO_POLL_PROGRESS_INTERVAL ?= 1m
GINKGO_NODES ?= 1
GINKGO_FOCUS ?=
GINKGO_TIMEOUT ?= 2h
GINKGO_NOCOLOR ?= false
GINKGO_LABEL ?= "!Conformance"

GINKGO_SKIP ?=
# To set multiple ginkgo skip flags, if any
ifneq ($(strip $(GINKGO_SKIP)),)
_SKIP_ARGS := $(foreach arg,$(strip $(GINKGO_SKIP)),-skip="$(arg)")
endif

.PHONY: docker-build-e2e
docker-build-e2e: ## Build docker image with the manager.
$(CONTAINER_TOOL) build -t ghcr.io/ionos-cloud/cluster-api-provider-ionoscloud:e2e .

.PHONY: test-e2e
test-e2e: docker-build-e2e ## Run the end-to-end tests
CGO_ENABLED=1 go run github.com/onsi/ginkgo/v2/ginkgo -v --trace \
-poll-progress-after=$(GINKGO_POLL_PROGRESS_AFTER) \
-poll-progress-interval=$(GINKGO_POLL_PROGRESS_INTERVAL) --tags=e2e --focus="$(GINKGO_FOCUS)" --fail-fast \
$(_SKIP_ARGS) --nodes=$(GINKGO_NODES) --label-filter=$(GINKGO_LABEL) --timeout=$(GINKGO_TIMEOUT) --no-color=$(GINKGO_NOCOLOR) \
--output-dir="$(ARTIFACTS)" --junit-report="junit.e2e_suite.1.xml" $(GINKGO_ARGS) $(ROOT_DIR)/$(TEST_DIR)/e2e -- \
-e2e.artifacts-folder="$(ARTIFACTS)" -e2e.config="$(E2E_CONF_FILE)" \
-e2e.skip-resource-cleanup=$(SKIP_RESOURCE_CLEANUP) -e2e.use-existing-cluster=$(USE_EXISTING_CLUSTER)

.PHONY: ionosctl
ionosctl: $(LOCALBIN) ## Download the latest release of ionosctl and add to the bin folder
@if [ ! -f $(LOCALBIN)/ionosctl ]; then \
LATEST_RELEASE_TAG=$$(curl -sI https://github.com/ionos-cloud/ionosctl/releases/latest | grep -Fi Location | sed -E 's/.*\/tag\/v(.*)/\1/' | tr -d '\r'); \
IONOSCTL_DOWNLOAD_URL="https://github.com/ionos-cloud/ionosctl/releases/download/v$${LATEST_RELEASE_TAG}/ionosctl-$${LATEST_RELEASE_TAG}-linux-amd64.tar.gz"; \
curl -sL $$IONOSCTL_DOWNLOAD_URL | tar xz -C $(LOCALBIN) ionosctl; \
fi

.PHONY: remove-cancelled-e2e-leftovers
remove-cancelled-e2e-leftovers: $(ionosctl) ## Remove any leftover resources from cancelled e2e tests
$(ROOT_DIR)/hack/scripts/cancelled-workflow.sh
10 changes: 8 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,15 @@ If you need help with CAPIC, please visit the [#cluster-api-ionoscloud][slack] c

## Compatibility

### Cluster API Versions (TODO)
### Cluster API Versions

### Kubernetes Versions (TODO)
This provider's versions are compatible with the following versions of Cluster API:

| | Cluster API v1beta1 (v1.7) |
|------------------------|:--------------------------:|
| CAPIC v1alpha1 (v0.2) ||

### Kubernetes Versions

The IONOS Cloud provider is able to install and manage the [versions of Kubernetes supported by the Cluster API (CAPI) project](https://cluster-api.sigs.k8s.io/reference/versions.html#supported-kubernetes-versions).

Expand Down
7 changes: 7 additions & 0 deletions clusterctl-settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"name": "infrastructure-ionoscloud",
"config": {
"componentsFile": "infrastructure-components.yaml",
"nextVersion": "v0.2.0"
}
}
62 changes: 53 additions & 9 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -17,18 +17,35 @@ require (
k8s.io/client-go v0.29.4
k8s.io/klog/v2 v2.120.1
sigs.k8s.io/cluster-api v1.7.2
sigs.k8s.io/cluster-api/test v1.7.2
sigs.k8s.io/controller-runtime v0.17.3
)

require (
github.com/BurntSushi/toml v1.0.0 // indirect
github.com/MakeNowJust/heredoc v1.0.0 // indirect
github.com/Masterminds/goutils v1.1.1 // indirect
github.com/Masterminds/semver/v3 v3.2.0 // indirect
github.com/Masterminds/sprig/v3 v3.2.3 // indirect
github.com/Microsoft/go-winio v0.5.0 // indirect
github.com/NYTimes/gziphandler v1.1.1 // indirect
github.com/ProtonMail/go-crypto v0.0.0-20230217124315-7d5c6f04bbb8 // indirect
github.com/adrg/xdg v0.4.0 // indirect
github.com/alessio/shellescape v1.4.1 // indirect
github.com/antlr/antlr4/runtime/Go/antlr/v4 v4.0.0-20230305170008-8188dc5388df // indirect
github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a // indirect
github.com/beorn7/perks v1.0.1 // indirect
github.com/blang/semver/v4 v4.0.0 // indirect
github.com/cenkalti/backoff/v4 v4.2.1 // indirect
github.com/cespare/xxhash/v2 v2.2.0 // indirect
github.com/cloudflare/circl v1.3.7 // indirect
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect
github.com/emicklei/go-restful/v3 v3.11.0 // indirect
github.com/distribution/reference v0.5.0 // indirect
github.com/docker/docker v25.0.5+incompatible // indirect
github.com/docker/go-connections v0.5.0 // indirect
github.com/docker/go-units v0.4.0 // indirect
github.com/drone/envsubst/v2 v2.0.0-20210730161058-179042472c46 // 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/felixge/httpsnoop v1.0.4 // indirect
Expand All @@ -45,37 +62,61 @@ require (
github.com/golang/protobuf v1.5.4 // indirect
github.com/google/cel-go v0.17.7 // indirect
github.com/google/gnostic-models v0.6.8 // indirect
github.com/google/go-github/v53 v53.2.0 // indirect
github.com/google/go-querystring v1.1.0 // indirect
github.com/google/gofuzz v1.2.0 // indirect
github.com/google/pprof v0.0.0-20240424215950-a892ee059fd6 // indirect
github.com/google/safetext v0.0.0-20220905092116-b49f7bc46da2 // indirect
github.com/grpc-ecosystem/grpc-gateway/v2 v2.16.0 // indirect
github.com/hashicorp/hcl v1.0.0 // indirect
github.com/huandu/xstrings v1.3.3 // indirect
github.com/imdario/mergo v0.3.13 // indirect
github.com/inconshreveable/mousetrap v1.1.0 // indirect
github.com/josharian/intern v1.0.0 // indirect
github.com/json-iterator/go v1.1.12 // indirect
github.com/magiconair/properties v1.8.7 // indirect
github.com/mailru/easyjson v0.7.7 // indirect
github.com/mattn/go-isatty v0.0.20 // indirect
github.com/matttproud/golang_protobuf_extensions/v2 v2.0.0 // indirect
github.com/mitchellh/copystructure v1.2.0 // indirect
github.com/mitchellh/mapstructure v1.5.0 // indirect
github.com/mitchellh/reflectwalk v1.0.2 // indirect
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/modern-go/reflect2 v1.0.2 // indirect
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
github.com/opencontainers/go-digest v1.0.0 // indirect
github.com/opencontainers/image-spec v1.0.2 // indirect
github.com/pelletier/go-toml v1.9.5 // indirect
github.com/pelletier/go-toml/v2 v2.1.0 // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect
github.com/prometheus/client_golang v1.18.0 // indirect
github.com/prometheus/client_model v0.5.0 // indirect
github.com/prometheus/common v0.45.0 // indirect
github.com/prometheus/procfs v0.12.0 // indirect
github.com/sagikazarmark/locafero v0.4.0 // indirect
github.com/sagikazarmark/slog-shim v0.1.0 // indirect
github.com/shopspring/decimal v1.3.1 // indirect
github.com/sourcegraph/conc v0.3.0 // indirect
github.com/spf13/afero v1.11.0 // indirect
github.com/spf13/cast v1.6.0 // indirect
github.com/spf13/cobra v1.8.0 // indirect
github.com/spf13/viper v1.18.2 // indirect
github.com/stoewer/go-strcase v1.2.0 // indirect
github.com/stretchr/objx v0.5.2 // indirect
github.com/subosito/gotenv v1.6.0 // indirect
github.com/valyala/fastjson v1.6.4 // indirect
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.46.0 // indirect
go.opentelemetry.io/otel v1.20.0 // indirect
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.20.0 // indirect
go.opentelemetry.io/otel v1.22.0 // indirect
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.22.0 // indirect
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.20.0 // indirect
go.opentelemetry.io/otel/metric v1.20.0 // indirect
go.opentelemetry.io/otel/sdk v1.20.0 // indirect
go.opentelemetry.io/otel/trace v1.20.0 // indirect
go.opentelemetry.io/otel/metric v1.22.0 // indirect
go.opentelemetry.io/otel/sdk v1.22.0 // indirect
go.opentelemetry.io/otel/trace v1.22.0 // indirect
go.opentelemetry.io/proto/otlp v1.0.0 // indirect
go.uber.org/multierr v1.11.0 // indirect
go.uber.org/zap v1.26.0 // indirect
golang.org/x/crypto v0.23.0 // indirect
golang.org/x/exp v0.0.0-20230905200255-921286631fa9 // indirect
golang.org/x/net v0.25.0 // indirect
golang.org/x/oauth2 v0.18.0 // indirect
Expand All @@ -89,18 +130,21 @@ require (
google.golang.org/appengine v1.6.8 // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20231106174013-bbf56f31fb17 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20231120223509-83a465c0220f // indirect
google.golang.org/grpc v1.59.0 // indirect
google.golang.org/grpc v1.60.1 // indirect
google.golang.org/protobuf v1.33.0 // indirect
gopkg.in/inf.v0 v0.9.1 // indirect
gopkg.in/ini.v1 v1.67.0 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
k8s.io/apiextensions-apiserver v0.29.3 // indirect
k8s.io/apiserver v0.29.3 // indirect
k8s.io/cluster-bootstrap v0.29.3 // indirect
k8s.io/component-base v0.29.3 // indirect
k8s.io/kube-openapi v0.0.0-20231010175941-2dd684a91f00 // indirect
k8s.io/utils v0.0.0-20240102154912-e7106e64919e // indirect
k8s.io/utils v0.0.0-20231127182322-b307cd553661 // indirect
sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.28.0 // indirect
sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect
sigs.k8s.io/kind v0.22.0 // indirect
sigs.k8s.io/structured-merge-diff/v4 v4.4.1 // indirect
sigs.k8s.io/yaml v1.4.0 // indirect
)
Loading

0 comments on commit 24d8123

Please sign in to comment.