Skip to content

Commit

Permalink
Merge pull request #82 from damdo/rebase-atop-v0.8.0
Browse files Browse the repository at this point in the history
  • Loading branch information
openshift-merge-bot[bot] authored May 27, 2024
2 parents 60b7ca9 + 472b888 commit d2119dd
Show file tree
Hide file tree
Showing 5,513 changed files with 481,947 additions and 479,693 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
2 changes: 1 addition & 1 deletion .ci-operator.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
build_root_image:
name: release
namespace: openshift
tag: rhel-9-release-golang-1.21-openshift-4.16
tag: rhel-9-release-golang-1.21-openshift-4.17
2 changes: 1 addition & 1 deletion .github/workflows/weekly-security-scan.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
strategy:
fail-fast: false
matrix:
branch: [ main, release-0.6, release-0.5 ]
branch: [ main, release-0.7, release-0.6 ]
name: Trivy
runs-on: ubuntu-latest
steps:
Expand Down
6 changes: 3 additions & 3 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -101,9 +101,9 @@ linters-settings:
allow-leading-space: false
require-specific: true
staticcheck:
go: "1.20"
go: "1.21"
stylecheck:
go: "1.20"
go: "1.21"
gosec:
excludes:
- G307 # Deferring unsafe method "Close" on type "\*os.File"
Expand All @@ -126,7 +126,7 @@ linters-settings:
- whyNoLint
- wrapperFunc
unused:
go: "1.20"
go: "1.21"
issues:
max-same-issues: 0
max-issues-per-linter: 0
Expand Down
3 changes: 2 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@
# limitations under the License.

# Build the manager binary
FROM --platform=${BUILDPLATFORM} golang:1.20.12 as toolchain
ARG golang_image
FROM --platform=${BUILDPLATFORM} ${golang_image} as toolchain

# Run this with docker build --build_arg $(go env GOPROXY) to override the goproxy
ARG goproxy=https://proxy.golang.org,direct
Expand Down
51 changes: 43 additions & 8 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@ ROOT_DIR_RELATIVE := .

include $(ROOT_DIR_RELATIVE)/common.mk

GO_VERSION ?= 1.20.12

# Image URL to use all building/pushing image targets
IMG ?= controller:latest
# Produce CRDs that work back to Kubernetes 1.11 (no version conversion)
CRD_OPTIONS ?= "crd:crdVersions=v1"

SHELL=/bin/bash

# Directories.
REPO_ROOT := $(shell git rev-parse --show-toplevel)
ARTIFACTS ?= $(REPO_ROOT)/_artifacts
Expand Down Expand Up @@ -62,6 +62,10 @@ RELEASE_ALIAS_TAG ?= $(PULL_BASE_REF)
RELEASE_DIR := out
OUTPUT_TYPE ?= type=registry

# Go
GO_VERSION ?=1.21.10
GO_CONTAINER_IMAGE ?= golang:$(GO_VERSION)

# kind
CAPI_KIND_CLUSTER_NAME ?= capi-test

Expand Down Expand Up @@ -281,7 +285,7 @@ $(ARTIFACTS):

.PHONY: build-toolchain
build-toolchain: ## Build the toolchain
docker build --target toolchain -t $(TOOLCHAIN_IMAGE) .
docker build --target toolchain --build-arg golang_image=$(GO_CONTAINER_IMAGE) -t $(TOOLCHAIN_IMAGE) .

.PHONY: list-staging-releases
list-staging-releases: ## List staging images for image promotion
Expand Down Expand Up @@ -416,7 +420,7 @@ ensure-buildx:

.PHONY: docker-build
docker-build: docker-pull-prerequisites ensure-buildx ## Build the docker image for controller-manager
docker buildx build --platform linux/$(ARCH) --output=$(OUTPUT_TYPE) --pull --build-arg LDFLAGS="$(LDFLAGS)" -t $(CORE_CONTROLLER_IMG)-$(ARCH):$(TAG) .
docker buildx build --platform linux/$(ARCH) --output=$(OUTPUT_TYPE) --pull --build-arg golang_image=$(GO_CONTAINER_IMAGE) --build-arg LDFLAGS="$(LDFLAGS)" -t $(CORE_CONTROLLER_IMG)-$(ARCH):$(TAG) .

.PHONY: docker-pull-prerequisites
docker-pull-prerequisites:
Expand All @@ -425,7 +429,7 @@ docker-pull-prerequisites:

.PHONY: e2e-image
e2e-image: docker-pull-prerequisites ensure-buildx
docker buildx build --platform linux/$(ARCH) --load --tag=$(CORE_CONTROLLER_ORIGINAL_IMG):e2e .
docker buildx build --platform linux/$(ARCH) --load --build-arg golang_image=$(GO_CONTAINER_IMAGE) --tag=$(CORE_CONTROLLER_ORIGINAL_IMG):e2e .
$(MAKE) set-manifest-image MANIFEST_IMG=$(CORE_CONTROLLER_ORIGINAL_IMG):e2e TARGET_RESOURCE="./config/default/manager_image_patch.yaml"
$(MAKE) set-manifest-pull-policy PULL_POLICY=Never TARGET_RESOURCE="./config/default/manager_pull_policy.yaml"

Expand All @@ -451,8 +455,8 @@ docker-build-%:

.PHONY: docker-build-core-image
docker-build-core-image: ensure-buildx ## Build the multiarch core docker image
docker buildx build --builder capibm --platform $(BUILDX_PLATFORMS) --output=$(OUTPUT_TYPE) \
--pull --build-arg ldflags="$(LDFLAGS)" \
docker buildx build --builder capibm --platform $(BUILDX_PLATFORMS) --output=$(OUTPUT_TYPE) \
--pull --build-arg golang_image=$(GO_CONTAINER_IMAGE) --build-arg ldflags="$(LDFLAGS)" \
-t $(CORE_CONTROLLER_IMG):$(TAG) .

## --------------------------------------
Expand Down Expand Up @@ -483,7 +487,7 @@ define checkdiff
git --no-pager diff --name-only FETCH_HEAD
endef

ALL_VERIFY_CHECKS = boilerplate shellcheck modules gen conversions
ALL_VERIFY_CHECKS = boilerplate shellcheck modules gen conversions go-version

.PHONY: verify
verify: $(addprefix verify-,$(ALL_VERIFY_CHECKS)) ## Run all verify-* targets
Expand Down Expand Up @@ -539,6 +543,17 @@ verify-security: ## Verify code and images for vulnerabilities
exit 1; \
fi


SUBMAKEFILE_GO_VERSION=$(shell grep "GO_VERSION" -m1 hack/ccm/Makefile | cut -d '=' -f2 )
.SILENT:
.PHONY: verify-go-version
verify-go-version: ## Confirms the version of go used in Makefiles are uniform
ifeq ($(strip $(SUBMAKEFILE_GO_VERSION)), $(strip $(GO_VERSION)))
echo "Versions are uniform across Makefile, the go-version used is $(GO_VERSION)"
else
echo "Versions are different across Makefiles. Please ensure to keep them uniform."
endif

## --------------------------------------
## Cleanup / Verification
## --------------------------------------
Expand Down Expand Up @@ -600,3 +615,23 @@ kind-cluster: ## Create a new kind cluster designed for development with Tilt

go-version: ## Print the go version we use to compile our binaries and images
@echo $(GO_VERSION)

## --------------------------------------
## Documentation and Publishing
## --------------------------------------

.PHONY: serve
serve: ## Build the CAPIBM book and serve it locally to validate changes in documentation.
$(MAKE) -C docs/book/ serve

## --------------------------------------
## Update Go Version
## --------------------------------------
.PHONY: update-go
update-go: ## Update Go version across files: Usage make update-go VERSION=X.YY.ZZ- Use only if you know what you're doing.
ifndef VERSION
echo "VERSION not set. Usage: make update-go VERSION=X.YY.ZZ"
else
sed -i '' "s/GO_VERSION ?=[[:digit:]].[[:digit:]]\{1,\}.[[:digit:]]\{1,\}/GO_VERSION ?=$(VERSION)/" hack/ccm/Makefile
echo "Updated go version to $(VERSION) in Makefile"
endif
26 changes: 22 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,28 @@
[![LICENSE](https://img.shields.io/badge/license-apache2.0-green.svg)](https://sigs.k8s.io/cluster-api-provider-ibmcloud/blob/master/LICENSE)
![GitHub release (latest by date)](https://img.shields.io/github/v/release/kubernetes-sigs/cluster-api-provider-ibmcloud?label=version)
[![Go Report Card](https://goreportcard.com/badge/sigs.k8s.io/cluster-api-provider-ibmcloud)](https://goreportcard.com/report/sigs.k8s.io/cluster-api-provider-ibmcloud)

# Kubernetes Cluster API Provider IBM Cloud (CAPIBM)

<p align="center">
<a href="https://github.com/kubernetes-sigs/cluster-api"><img src="https://github.com/kubernetes/kubernetes/raw/master/logo/logo.png" width="100"></a><a href="https://www.ibm.com/cloud/"><img hspace="90px" src="./docs/images/ibm-cloud.svg" alt="Powered by IBM Cloud" height="100"></a>
</p>

<p align="center">
<!-- Go Doc reference -->
<a href="https://godoc.org/sigs.k8s.io/cluster-api-provider-ibmcloud">
<img src="https://godoc.org/sigs.k8s.io/cluster-api-provider-ibmcloud?status.svg"></a>
<!-- CAPIBM Version -->
<a href="https://github.com/kubernetes-sigs/cluster-api-provider-ibmcloud/releases/latest">
<img src="https://img.shields.io/github/v/release/kubernetes-sigs/cluster-api-provider-ibmcloud?label=version"></a>
<!-- Go Reportcard -->
<a href="https://goreportcard.com/report/sigs.k8s.io/cluster-api-provider-ibmcloud">
<img src="https://goreportcard.com/badge/sigs.k8s.io/cluster-api-provider-ibmcloud"></a>
<!-- K8s - ClusterAPI Provider IBM Cloud slack channel -->
<a href="http://slack.k8s.io/">
<img src="https://img.shields.io/badge/join%20slack-%20%23cluster--api--ibmcloud-brightgreen"></a>
<!-- License information -->
<a href="https://github.com/kubernetes-sigs/cluster-api-provider-ibmcloud/blob/main/LICENSE">
<img src="https://img.shields.io/badge/license-apache2.0-green.svg"></a>
</p>


------

Expand All @@ -31,7 +49,7 @@ This provider's versions are compatible with the following versions of Cluster A
|:----------------------------------------|:---------------:|:--------------:|
| CAPIBM v1alpha4 (v0.1.x) || |
| CAPIBM v1beta1 (v0.2.x, v0.3.x) | ||
| CAPIBM v1beta2 (v0.[4-6].x, main) | ||
| CAPIBM v1beta2 (v0.[4-7].x, main) | ||


(See [Kubernetes support matrix][cluster-api-supported-v] of Cluster API versions).
Expand Down
15 changes: 15 additions & 0 deletions api/v1beta1/ibmpowervs_conversion.go
Original file line number Diff line number Diff line change
Expand Up @@ -193,3 +193,18 @@ func Convert_v1beta2_IBMPowerVSMachineSpec_To_v1beta1_IBMPowerVSMachineSpec(in *

return autoConvert_v1beta2_IBMPowerVSMachineSpec_To_v1beta1_IBMPowerVSMachineSpec(in, out, s)
}

func Convert_v1beta2_IBMPowerVSClusterSpec_To_v1beta1_IBMPowerVSClusterSpec(in *infrav1beta2.IBMPowerVSClusterSpec, out *IBMPowerVSClusterSpec, s apiconversion.Scope) error {
if in.ServiceInstance != nil && in.ServiceInstance.ID != nil {
out.ServiceInstanceID = *in.ServiceInstance.ID
}
return autoConvert_v1beta2_IBMPowerVSClusterSpec_To_v1beta1_IBMPowerVSClusterSpec(in, out, s)
}

func Convert_v1beta2_IBMPowerVSClusterStatus_To_v1beta1_IBMPowerVSClusterStatus(in *infrav1beta2.IBMPowerVSClusterStatus, out *IBMPowerVSClusterStatus, s apiconversion.Scope) error {
return autoConvert_v1beta2_IBMPowerVSClusterStatus_To_v1beta1_IBMPowerVSClusterStatus(in, out, s)
}

func Convert_v1beta2_IBMPowerVSImageSpec_To_v1beta1_IBMPowerVSImageSpec(in *infrav1beta2.IBMPowerVSImageSpec, out *IBMPowerVSImageSpec, s apiconversion.Scope) error {
return autoConvert_v1beta2_IBMPowerVSImageSpec_To_v1beta1_IBMPowerVSImageSpec(in, out, s)
}
8 changes: 8 additions & 0 deletions api/v1beta1/ibmvpc_conversion.go
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,10 @@ func Convert_v1beta2_IBMVPCMachineSpec_To_v1beta1_IBMVPCMachineSpec(in *infrav1b
return autoConvert_v1beta2_IBMVPCMachineSpec_To_v1beta1_IBMVPCMachineSpec(in, out, s)
}

func Convert_v1beta2_IBMVPCMachineTemplateStatus_To_v1beta1_IBMVPCMachineTemplateStatus(in *infrav1beta2.IBMVPCMachineTemplateStatus, out *IBMVPCMachineTemplateStatus, s apiconversion.Scope) error {
return autoConvert_v1beta2_IBMVPCMachineTemplateStatus_To_v1beta1_IBMVPCMachineTemplateStatus(in, out, s)
}

func Convert_Slice_Pointer_string_To_Slice_Pointer_v1beta2_IBMVPCResourceReference(in *[]*string, out *[]*infrav1beta2.IBMVPCResourceReference, _ apiconversion.Scope) error {
for _, sshKey := range *in {
*out = append(*out, &infrav1beta2.IBMVPCResourceReference{
Expand All @@ -215,3 +219,7 @@ func Convert_Slice_Pointer_v1beta2_IBMVPCResourceReference_To_Slice_Pointer_stri
}
return nil
}

func Convert_v1beta2_VPCLoadBalancerSpec_To_v1beta1_VPCLoadBalancerSpec(in *infrav1beta2.VPCLoadBalancerSpec, out *VPCLoadBalancerSpec, s apiconversion.Scope) error {
return autoConvert_v1beta2_VPCLoadBalancerSpec_To_v1beta1_VPCLoadBalancerSpec(in, out, s)
}
9 changes: 8 additions & 1 deletion api/v1beta1/ibmvpcmachinetemplate_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,12 @@ type IBMVPCMachineTemplateResource struct {
Spec IBMVPCMachineSpec `json:"spec"`
}

// IBMVPCMachineTemplateStatus defines the observed state of IBMVPCMachineTemplate.
type IBMVPCMachineTemplateStatus struct {
// INSERT ADDITIONAL STATUS FIELD - define observed state of cluster
// Important: Run "make" to regenerate code after modifying this file
}

// +kubebuilder:object:root=true
// +kubebuilder:resource:path=ibmvpcmachinetemplates,scope=Namespaced,categories=cluster-api

Expand All @@ -39,7 +45,8 @@ type IBMVPCMachineTemplate struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`

Spec IBMVPCMachineTemplateSpec `json:"spec,omitempty"`
Spec IBMVPCMachineTemplateSpec `json:"spec,omitempty"`
Status IBMVPCMachineTemplateStatus `json:"status,omitempty"`
}

//+kubebuilder:object:root=true
Expand Down
Loading

0 comments on commit d2119dd

Please sign in to comment.