Skip to content

Commit

Permalink
feat: support CAPI v1alpha4
Browse files Browse the repository at this point in the history
This PR will add all of the changes necessary for supporting CAPI v1alpha4 resources.

Signed-off-by: Gerard de Leeuw <[email protected]>
Signed-off-by: Artem Chernyshev <[email protected]>
  • Loading branch information
lion7 authored and Unix4ever committed Oct 8, 2021
1 parent d923bb0 commit bb52e71
Show file tree
Hide file tree
Showing 51 changed files with 1,488 additions and 881 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ ARG CGO_ENABLED
ENV CGO_ENABLED ${CGO_ENABLED}
ENV GOCACHE /.cache/go-build
ENV GOMODCACHE /.cache/mod
RUN --mount=type=cache,target=/.cache go install sigs.k8s.io/controller-tools/cmd/controller-gen@v0.5.0
RUN --mount=type=cache,target=/.cache go install sigs.k8s.io/controller-tools/cmd/controller-gen@v0.6.2
RUN --mount=type=cache,target=/.cache go install k8s.io/code-generator/cmd/[email protected]
RUN --mount=type=cache,target=/.cache go install mvdan.cc/gofumpt/[email protected]
RUN curl -sfL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | bash -s -- -b /toolchain/bin v1.38.0
Expand Down
11 changes: 8 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,11 @@ MODULE := $(shell head -1 go.mod | cut -d' ' -f2)

ARTIFACTS := _out
TEST_PKGS ?= ./...
TALOS_RELEASE ?= v0.11.5
DEFAULT_K8S_VERSION ?= v1.21.3
TALOS_RELEASE ?= v0.12.3
DEFAULT_K8S_VERSION ?= v1.22.2

CONTROLLER_GEN_VERSION ?= v0.6.2
CONVERSION_GEN_VERSION ?= v0.21.3

TOOLS ?= ghcr.io/talos-systems/tools:v0.6.0
PKGS ?= v0.6.0
Expand Down Expand Up @@ -49,6 +52,8 @@ COMMON_ARGS += --build-arg=MODULE=$(MODULE)
COMMON_ARGS += --build-arg=TEST_PKGS=$(TEST_PKGS)
COMMON_ARGS += --build-arg=PKGS=$(PKGS)
COMMON_ARGS += --build-arg=TOOLS=$(TOOLS)
COMMON_ARGS += --build-arg=CONTROLLER_GEN_VERSION=$(CONTROLLER_GEN_VERSION)
COMMON_ARGS += --build-arg=CONVERSION_GEN_VERSION=$(CONVERSION_GEN_VERSION)
COMMON_ARGS += --build-arg=TALOS_RELEASE=$(TALOS_RELEASE)
COMMON_ARGS += --build-arg=DEFAULT_K8S_VERSION=$(DEFAULT_K8S_VERSION)
COMMON_ARGS += --build-arg=CGO_ENABLED=$(CGO_ENABLED)
Expand Down Expand Up @@ -127,7 +132,7 @@ check-dirty: ## Verifies that source tree is not dirty
# Artifacts

.PHONY: release
release: manifests ## Create the release YAML. The build result will be ouput to the specified local destination.
release: manifests ## Create the release YAML. The build result will be output to the specified local destination.
@$(MAKE) local-$@ DEST=./$(ARTIFACTS)

.PHONY: caps-controller-manager
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ package v1alpha3

import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
capiv1 "sigs.k8s.io/cluster-api/api/v1alpha3"
capiv1 "sigs.k8s.io/cluster-api/api/v1alpha4"
)

const (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.5.0
controller-gen.kubebuilder.io/version: v0.6.2
creationTimestamp: null
name: metalclusters.infrastructure.cluster.x-k8s.io
spec:
Expand All @@ -24,10 +24,14 @@ spec:
description: MetalCluster is the Schema for the metalclusters API.
properties:
apiVersion:
description: 'APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
description: 'APIVersion defines the versioned schema of this representation
of an object. Servers should convert recognized schemas to the latest
internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
type: string
kind:
description: 'Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
description: 'Kind is a string value representing the REST resource this
object represents. Servers may infer this from the endpoint the client
submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
type: string
metadata:
type: object
Expand All @@ -53,7 +57,8 @@ spec:
description: MetalClusterStatus defines the observed state of MetalCluster.
properties:
apiEndpoints:
description: APIEndpoints represents the endpoints to communicate with the control plane.
description: APIEndpoints represents the endpoints to communicate
with the control plane.
items:
properties:
host:
Expand Down Expand Up @@ -96,18 +101,23 @@ spec:
description: MetalCluster is the Schema for the metalclusters API.
properties:
apiVersion:
description: 'APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
description: 'APIVersion defines the versioned schema of this representation
of an object. Servers should convert recognized schemas to the latest
internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
type: string
kind:
description: 'Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
description: 'Kind is a string value representing the REST resource this
object represents. Servers may infer this from the endpoint the client
submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
type: string
metadata:
type: object
spec:
description: MetalClusterSpec defines the desired state of MetalCluster.
properties:
controlPlaneEndpoint:
description: ControlPlaneEndpoint represents the endpoint used to communicate with the control plane.
description: ControlPlaneEndpoint represents the endpoint used to
communicate with the control plane.
properties:
host:
description: The hostname on which the API server is serving.
Expand Down
Loading

0 comments on commit bb52e71

Please sign in to comment.