Skip to content

Commit

Permalink
Merge branch 'main' into feat/use-specified-go-version-for-docker-build
Browse files Browse the repository at this point in the history
  • Loading branch information
simonostendorf authored Jan 14, 2025
2 parents 59d9240 + 88f5c66 commit fbfd310
Show file tree
Hide file tree
Showing 179 changed files with 1,462 additions and 31,005 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ jobs:
env:
GH_TOKEN: ${{ github.token }}
- name: Release
uses: softprops/action-gh-release@7b4da11513bf3f43f9999e90eabced41ab8bb048 # tag=v2.2.0
uses: softprops/action-gh-release@c95fe1489396fe8a9eb87c0abf8aa5b2ef267fda # tag=v2.2.1
with:
draft: true
files: out/*
Expand Down
3 changes: 0 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,8 @@ ARG goproxy=https://proxy.golang.org
ENV GOPROXY=$goproxy

# Copy the Go Modules manifests
RUN mkdir orc
COPY go.mod go.mod
COPY go.sum go.sum
COPY orc/go.mod orc/go.mod
COPY orc/go.sum orc/go.sum

# Cache deps before building and copying source so that we don't need to re-download as much
# and so that source changes don't invalidate our downloaded layer
Expand Down
28 changes: 6 additions & 22 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -150,17 +150,13 @@ kubebuilder_assets: $(SETUP_ENVTEST)

.PHONY: test
TEST_PATHS ?= ./...
test: test-capo test-orc
test: test-capo

.PHONY: test-capo
test-capo: $(ARTIFACTS) $(GOTESTSUM) kubebuilder_assets
KUBEBUILDER_ASSETS="$(KUBEBUILDER_ASSETS)" $(GOTESTSUM) --junitfile $(ARTIFACTS)/junit.test.xml --junitfile-hide-empty-pkg --jsonfile $(ARTIFACTS)/test-output.log -- \
-v $(TEST_PATHS) $(TEST_ARGS)

.PHONY: test-orc
test-orc:
$(MAKE) -C $(REPO_ROOT)/orc test

E2E_TEMPLATES_DIR=test/e2e/data/infrastructure-openstack
E2E_KUSTOMIZE_DIR=test/e2e/data/kustomize
# This directory holds the templates that do not require ci-artifacts script injection.
Expand Down Expand Up @@ -209,9 +205,9 @@ e2e-image: docker-build

# Pull all the images references in test/e2e/data/e2e_conf.yaml
test-e2e-image-prerequisites:
docker pull registry.k8s.io/cluster-api/cluster-api-controller:v1.8.5
docker pull registry.k8s.io/cluster-api/kubeadm-bootstrap-controller:v1.8.5
docker pull registry.k8s.io/cluster-api/kubeadm-control-plane-controller:v1.8.5
docker pull registry.k8s.io/cluster-api/cluster-api-controller:v1.9.3
docker pull registry.k8s.io/cluster-api/kubeadm-bootstrap-controller:v1.9.3
docker pull registry.k8s.io/cluster-api/kubeadm-control-plane-controller:v1.9.3

CONFORMANCE_E2E_ARGS ?= -kubetest.config-file=$(KUBETEST_CONF_PATH)
CONFORMANCE_E2E_ARGS += $(E2E_ARGS)
Expand Down Expand Up @@ -259,12 +255,10 @@ $(GO_APIDIFF): # Build go-apidiff.
.PHONY: lint
lint: $(GOLANGCI_LINT) ## Lint codebase
$(GOLANGCI_LINT) run -v --fast=false
$(MAKE) -C $(REPO_ROOT)/orc lint

.PHONY: lint-update
lint-update: $(GOLANGCI_LINT) ## Lint codebase
$(GOLANGCI_LINT) run -v --fast=false --fix
$(MAKE) -C $(REPO_ROOT)/orc lint-fix

lint-fast: $(GOLANGCI_LINT) ## Run only faster linters to detect possible issues
$(GOLANGCI_LINT) run -v --fast=true
Expand All @@ -275,12 +269,11 @@ lint-fast: $(GOLANGCI_LINT) ## Run only faster linters to detect possible issues

.PHONY: modules
modules: ## Runs go mod to ensure proper vendoring.
$(MAKE) -C $(REPO_ROOT)/orc modules
go mod tidy
cd $(TOOLS_DIR); go mod tidy

.PHONY: generate
generate: templates generate-orc generate-controller-gen generate-codegen generate-conversion-gen generate-go generate-manifests generate-api-docs ## Generate all generated code
generate: templates generate-controller-gen generate-codegen generate-conversion-gen generate-go generate-manifests generate-api-docs ## Generate all generated code

.PHONY: generate-go
generate-go: $(MOCKGEN)
Expand All @@ -296,10 +289,6 @@ generate-controller-gen: $(CONTROLLER_GEN)
generate-codegen: generate-controller-gen
./hack/update-codegen.sh

.PHONY: generate-orc
generate-orc:
$(MAKE) -C $(REPO_ROOT)/orc generate

.PHONY: generate-conversion-gen
generate-conversion-gen: $(CONVERSION_GEN)
$(CONVERSION_GEN) \
Expand All @@ -323,7 +312,6 @@ generate-manifests: $(CONTROLLER_GEN) ## Generate manifests e.g. CRD, RBAC etc.
$(CONTROLLER_GEN) \
paths=./ \
paths=./controllers/... \
paths=./orc/internal/controllers/... \
output:rbac:dir=$(RBAC_ROOT) \
rbac:roleName=manager-role

Expand Down Expand Up @@ -564,7 +552,7 @@ clean-release: ## Remove the release folder
rm -rf $(RELEASE_DIR)

.PHONY: verify
verify: verify-boilerplate verify-modules verify-gen verify-orc
verify: verify-boilerplate verify-modules verify-gen

.PHONY: verify-boilerplate
verify-boilerplate:
Expand All @@ -584,10 +572,6 @@ verify-gen: generate
echo "generated files are out of date, run make generate"; exit 1; \
fi

.PHONY: verify-orc
verify-orc:
$(MAKE) -C $(REPO_ROOT)/orc verify-generated

.PHONY: compile-e2e
compile-e2e: ## Test e2e compilation
go test -c -o /dev/null -tags=e2e ./test/e2e/suites/conformance
Expand Down
5 changes: 3 additions & 2 deletions api/v1alpha6/openstackcluster_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ package v1alpha6
import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1"
capierrors "sigs.k8s.io/cluster-api/errors"

capoerrors "sigs.k8s.io/cluster-api-provider-openstack/pkg/utils/errors"
)

const (
Expand Down Expand Up @@ -190,7 +191,7 @@ type OpenStackClusterStatus struct {
// OpenStackClusters can be added as events to the OpenStackCluster object
// and/or logged in the controller's output.
// +optional
FailureReason *capierrors.ClusterStatusError `json:"failureReason,omitempty"`
FailureReason *capoerrors.DeprecatedCAPIClusterStatusError `json:"failureReason,omitempty"`

// FailureMessage will be set in the event that there is a terminal problem
// reconciling the OpenStackCluster and will contain a more verbose string suitable
Expand Down
7 changes: 4 additions & 3 deletions api/v1alpha6/openstackmachine_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/utils/ptr"
clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1"
"sigs.k8s.io/cluster-api/errors"

capoerrors "sigs.k8s.io/cluster-api-provider-openstack/pkg/utils/errors"
)

const (
Expand Down Expand Up @@ -118,7 +119,7 @@ type OpenStackMachineStatus struct {
// +optional
InstanceState *InstanceState `json:"instanceState,omitempty"`

FailureReason *errors.MachineStatusError `json:"failureReason,omitempty"`
FailureReason *capoerrors.DeprecatedCAPIMachineStatusError `json:"failureReason,omitempty"`

// FailureMessage will be set in the event that there is a terminal problem
// reconciling the Machine and will contain a more verbose string suitable
Expand Down Expand Up @@ -189,7 +190,7 @@ func (r *OpenStackMachine) SetConditions(conditions clusterv1.Conditions) {
}

// SetFailure sets the OpenStackMachine status failure reason and failure message.
func (r *OpenStackMachine) SetFailure(failureReason errors.MachineStatusError, failureMessage error) {
func (r *OpenStackMachine) SetFailure(failureReason capoerrors.DeprecatedCAPIMachineStatusError, failureMessage error) {
r.Status.FailureReason = &failureReason
r.Status.FailureMessage = ptr.To(failureMessage.Error())
}
Expand Down
10 changes: 5 additions & 5 deletions api/v1alpha6/zz_generated.conversion.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions api/v1alpha6/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions api/v1alpha7/openstackcluster_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ package v1alpha7
import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1"
capierrors "sigs.k8s.io/cluster-api/errors"

capoerrors "sigs.k8s.io/cluster-api-provider-openstack/pkg/utils/errors"
)

const (
Expand Down Expand Up @@ -207,7 +208,7 @@ type OpenStackClusterStatus struct {
// OpenStackClusters can be added as events to the OpenStackCluster object
// and/or logged in the controller's output.
// +optional
FailureReason *capierrors.ClusterStatusError `json:"failureReason,omitempty"`
FailureReason *capoerrors.DeprecatedCAPIClusterStatusError `json:"failureReason,omitempty"`

// FailureMessage will be set in the event that there is a terminal problem
// reconciling the OpenStackCluster and will contain a more verbose string suitable
Expand Down
7 changes: 4 additions & 3 deletions api/v1alpha7/openstackmachine_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/utils/ptr"
clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1"
"sigs.k8s.io/cluster-api/errors"

capoerrors "sigs.k8s.io/cluster-api-provider-openstack/pkg/utils/errors"
)

const (
Expand Down Expand Up @@ -118,7 +119,7 @@ type OpenStackMachineStatus struct {
// +optional
InstanceState *InstanceState `json:"instanceState,omitempty"`

FailureReason *errors.MachineStatusError `json:"failureReason,omitempty"`
FailureReason *capoerrors.DeprecatedCAPIMachineStatusError `json:"failureReason,omitempty"`

// FailureMessage will be set in the event that there is a terminal problem
// reconciling the Machine and will contain a more verbose string suitable
Expand Down Expand Up @@ -187,7 +188,7 @@ func (r *OpenStackMachine) SetConditions(conditions clusterv1.Conditions) {
}

// SetFailure sets the OpenStackMachine status failure reason and failure message.
func (r *OpenStackMachine) SetFailure(failureReason errors.MachineStatusError, failureMessage error) {
func (r *OpenStackMachine) SetFailure(failureReason capoerrors.DeprecatedCAPIMachineStatusError, failureMessage error) {
r.Status.FailureReason = &failureReason
r.Status.FailureMessage = ptr.To(failureMessage.Error())
}
Expand Down
10 changes: 5 additions & 5 deletions api/v1alpha7/zz_generated.conversion.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions api/v1alpha7/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions api/v1beta1/openstackcluster_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ package v1beta1
import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1"
capierrors "sigs.k8s.io/cluster-api/errors"

capoerrors "sigs.k8s.io/cluster-api-provider-openstack/pkg/utils/errors"
"sigs.k8s.io/cluster-api-provider-openstack/pkg/utils/optional"
)

Expand Down Expand Up @@ -258,7 +258,7 @@ type OpenStackClusterStatus struct {
// OpenStackClusters can be added as events to the OpenStackCluster object
// and/or logged in the controller's output.
// +optional
FailureReason *capierrors.ClusterStatusError `json:"failureReason,omitempty"`
FailureReason *capoerrors.DeprecatedCAPIClusterStatusError `json:"failureReason,omitempty"`

// FailureMessage will be set in the event that there is a terminal problem
// reconciling the OpenStackCluster and will contain a more verbose string suitable
Expand Down
Loading

0 comments on commit fbfd310

Please sign in to comment.