Skip to content

Commit

Permalink
Merge pull request #2008 from chrischdi/pr-go-install-controller-gen-1-5
Browse files Browse the repository at this point in the history
[release-1.5] 🌱 hack/tools: use go-install.sh for installing controller-gen for 1.5
  • Loading branch information
k8s-ci-robot authored Jul 13, 2023
2 parents 205dfd9 + 3d000f8 commit 6454515
Show file tree
Hide file tree
Showing 32 changed files with 113 additions and 249 deletions.
16 changes: 14 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,13 @@ MANAGER := $(BIN_DIR)/manager
CLUSTERCTL := $(BIN_DIR)/clusterctl

# Tooling binaries
CONTROLLER_GEN := $(abspath $(TOOLS_BIN_DIR)/controller-gen)
GO_INSTALL := ./hack/go-install.sh

CONTROLLER_GEN_VER := v0.12.1
CONTROLLER_GEN_BIN := controller-gen
CONTROLLER_GEN := $(abspath $(TOOLS_BIN_DIR)/$(CONTROLLER_GEN_BIN)-$(CONTROLLER_GEN_VER))
CONTROLLER_GEN_PKG := sigs.k8s.io/controller-tools/cmd/controller-gen

CONVERSION_GEN := $(TOOLS_BIN_DIR)/conversion-gen
GINKGO := $(TOOLS_BIN_DIR)/ginkgo
GOLANGCI_LINT := $(TOOLS_BIN_DIR)/golangci-lint
Expand All @@ -66,7 +72,7 @@ SETUP_ENVTEST := $(abspath $(TOOLS_BIN_DIR)/setup-envtest)
CONVERSION_VERIFIER := $(abspath $(TOOLS_BIN_DIR)/conversion-verifier)
GO_APIDIFF := $(TOOLS_BIN_DIR)/go-apidiff
RELEASE_NOTES := $(TOOLS_BIN_DIR)/release-notes
TOOLING_BINARIES := $(CONTROLLER_GEN) $(CONVERSION_GEN) $(GINKGO) $(GOLANGCI_LINT) $(GOVC) $(KIND) $(KUSTOMIZE) $(CONVERSION_VERIFIER) $(GO_APIDIFF) $(RELEASE_NOTES)
TOOLING_BINARIES := $(CONVERSION_GEN) $(GINKGO) $(GOLANGCI_LINT) $(GOVC) $(KIND) $(KUSTOMIZE) $(CONVERSION_VERIFIER) $(GO_APIDIFF) $(RELEASE_NOTES)
ARTIFACTS_PATH := $(ROOT_DIR)/_artifacts

# Set --output-base for conversion-gen if we are not within GOPATH
Expand Down Expand Up @@ -218,6 +224,12 @@ tools: $(TOOLING_BINARIES) ## Build tooling binaries
$(TOOLING_BINARIES):
make -C $(TOOLS_DIR) $(@F)

$(CONTROLLER_GEN): # Build CONTROLLER_GEN from tools folder.
CGO_ENABLED=0 GOBIN=$(TOOLS_BIN_DIR) $(GO_INSTALL) $(CONTROLLER_GEN_PKG) $(CONTROLLER_GEN_BIN) $(CONTROLLER_GEN_VER)

.PHONY: $(CONTROLLER_GEN_BIN)
$(CONTROLLER_GEN_BIN): $(CONTROLLER_GEN) ## Build a local copy of controller-gen.

## --------------------------------------
## Linting and fixing linter errors
## --------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion apis/v1beta1/vspherevm_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ type VSphereVMStatus struct {
}

// +kubebuilder:object:root=true
// +kubebuilder:resource:path=vspherevms,scope=Namespaced
// +kubebuilder:resource:path=vspherevms,scope=Namespaced,categories=cluster-api
// +kubebuilder:storageversion
// +kubebuilder:subresource:status

Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@

---
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.7.0
creationTimestamp: null
controller-gen.kubebuilder.io/version: v0.12.1
name: haproxyloadbalancers.infrastructure.cluster.x-k8s.io
spec:
group: infrastructure.cluster.x-k8s.io
Expand Down Expand Up @@ -104,7 +102,7 @@ spec:
devices:
description: Devices is the list of network devices used by
the virtual machine. TODO(akutz) Make sure at least one
network matches the ClusterSpec.CloudProviderConfiguration.Network.Name
network matches the ClusterSpec.CloudProviderConfiguration.Network.Name
items:
description: NetworkDeviceSpec defines the network configuration
for a virtual machine's network device.
Expand Down Expand Up @@ -294,9 +292,3 @@ spec:
storage: true
subresources:
status: {}
status:
acceptedNames:
kind: ""
plural: ""
conditions: []
storedVersions: []
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@

---
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.7.0
creationTimestamp: null
controller-gen.kubebuilder.io/version: v0.12.1
name: vsphereclusteridentities.infrastructure.cluster.x-k8s.io
spec:
group: infrastructure.cluster.x-k8s.io
Expand Down Expand Up @@ -88,6 +86,7 @@ spec:
"value". The requirements are ANDed.
type: object
type: object
x-kubernetes-map-type: atomic
type: object
secretName:
description: SecretName references a Secret inside the controller
Expand Down Expand Up @@ -219,6 +218,7 @@ spec:
"value". The requirements are ANDed.
type: object
type: object
x-kubernetes-map-type: atomic
type: object
secretName:
description: SecretName references a Secret inside the controller
Expand Down Expand Up @@ -350,6 +350,7 @@ spec:
"value". The requirements are ANDed.
type: object
type: object
x-kubernetes-map-type: atomic
type: object
secretName:
description: SecretName references a Secret inside the controller
Expand Down Expand Up @@ -412,9 +413,3 @@ spec:
storage: true
subresources:
status: {}
status:
acceptedNames:
kind: ""
plural: ""
conditions: []
storedVersions: []
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@

---
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.7.0
creationTimestamp: null
controller-gen.kubebuilder.io/version: v0.12.1
name: vsphereclusters.infrastructure.cluster.x-k8s.io
spec:
group: infrastructure.cluster.x-k8s.io
Expand Down Expand Up @@ -116,9 +114,9 @@ spec:
may be found. This may used in the event that: 1. It is
not desirable to use the K8s API to watch changes to secrets
2. The cloud controller manager is not running in a K8s
environment, such as DC/OS. For example, the container
storage interface (CSI) is container orcehstrator (CO)
agnostic, and should support non-K8s COs. Defaults to /etc/cloud/credentials.'
environment, such as DC/OS. For example, the container storage
interface (CSI) is container orcehstrator (CO) agnostic,
and should support non-K8s COs. Defaults to /etc/cloud/credentials.'
type: string
serviceAccount:
description: ServiceAccount is the Kubernetes service account
Expand Down Expand Up @@ -323,6 +321,7 @@ spec:
description: 'UID of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids'
type: string
type: object
x-kubernetes-map-type: atomic
server:
description: Server is the address of the vSphere endpoint.
type: string
Expand Down Expand Up @@ -752,9 +751,3 @@ spec:
storage: true
subresources:
status: {}
status:
acceptedNames:
kind: ""
plural: ""
conditions: []
storedVersions: []
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@

---
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.7.0
creationTimestamp: null
controller-gen.kubebuilder.io/version: v0.12.1
name: vsphereclustertemplates.infrastructure.cluster.x-k8s.io
spec:
group: infrastructure.cluster.x-k8s.io
Expand Down Expand Up @@ -206,9 +204,3 @@ spec:
type: object
served: true
storage: true
status:
acceptedNames:
kind: ""
plural: ""
conditions: []
storedVersions: []
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@

---
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.7.0
creationTimestamp: null
controller-gen.kubebuilder.io/version: v0.12.1
name: vspheredeploymentzones.infrastructure.cluster.x-k8s.io
spec:
group: infrastructure.cluster.x-k8s.io
Expand Down Expand Up @@ -331,9 +329,3 @@ spec:
storage: true
subresources:
status: {}
status:
acceptedNames:
kind: ""
plural: ""
conditions: []
storedVersions: []
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@

---
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.7.0
creationTimestamp: null
controller-gen.kubebuilder.io/version: v0.12.1
name: vspherefailuredomains.infrastructure.cluster.x-k8s.io
spec:
group: infrastructure.cluster.x-k8s.io
Expand Down Expand Up @@ -380,9 +378,3 @@ spec:
type: object
served: true
storage: true
status:
acceptedNames:
kind: ""
plural: ""
conditions: []
storedVersions: []
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@

---
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.7.0
creationTimestamp: null
controller-gen.kubebuilder.io/version: v0.12.1
name: vspheremachines.infrastructure.cluster.x-k8s.io
spec:
group: infrastructure.cluster.x-k8s.io
Expand Down Expand Up @@ -112,7 +110,7 @@ spec:
devices:
description: Devices is the list of network devices used by the
virtual machine. TODO(akutz) Make sure at least one network
matches the ClusterSpec.CloudProviderConfiguration.Network.Name
matches the ClusterSpec.CloudProviderConfiguration.Network.Name
items:
description: NetworkDeviceSpec defines the network configuration
for a virtual machine's network device.
Expand Down Expand Up @@ -507,7 +505,7 @@ spec:
devices:
description: Devices is the list of network devices used by the
virtual machine. TODO(akutz) Make sure at least one network
matches the ClusterSpec.CloudProviderConfiguration.Network.Name
matches the ClusterSpec.CloudProviderConfiguration.Network.Name
items:
description: NetworkDeviceSpec defines the network configuration
for a virtual machine's network device.
Expand Down Expand Up @@ -917,7 +915,7 @@ spec:
devices:
description: Devices is the list of network devices used by the
virtual machine. TODO(akutz) Make sure at least one network
matches the ClusterSpec.CloudProviderConfiguration.Network.Name
matches the ClusterSpec.CloudProviderConfiguration.Network.Name
items:
description: NetworkDeviceSpec defines the network configuration
for a virtual machine's network device.
Expand Down Expand Up @@ -948,6 +946,7 @@ spec:
- kind
- name
type: object
x-kubernetes-map-type: atomic
type: array
deviceName:
description: DeviceName may be used to explicitly assign
Expand Down Expand Up @@ -1382,9 +1381,3 @@ spec:
storage: true
subresources:
status: {}
status:
acceptedNames:
kind: ""
plural: ""
conditions: []
storedVersions: []
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@

---
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.7.0
creationTimestamp: null
controller-gen.kubebuilder.io/version: v0.12.1
name: vspheremachinetemplates.infrastructure.cluster.x-k8s.io
spec:
group: infrastructure.cluster.x-k8s.io
Expand Down Expand Up @@ -150,6 +148,7 @@ spec:
- name
- uid
type: object
x-kubernetes-map-type: atomic
type: array
type: object
spec:
Expand Down Expand Up @@ -209,7 +208,7 @@ spec:
devices:
description: Devices is the list of network devices used
by the virtual machine. TODO(akutz) Make sure at least
one network matches the ClusterSpec.CloudProviderConfiguration.Network.Name
one network matches the ClusterSpec.CloudProviderConfiguration.Network.Name
items:
description: NetworkDeviceSpec defines the network configuration
for a virtual machine's network device.
Expand Down Expand Up @@ -497,7 +496,7 @@ spec:
devices:
description: Devices is the list of network devices used
by the virtual machine. TODO(akutz) Make sure at least
one network matches the ClusterSpec.CloudProviderConfiguration.Network.Name
one network matches the ClusterSpec.CloudProviderConfiguration.Network.Name
items:
description: NetworkDeviceSpec defines the network configuration
for a virtual machine's network device.
Expand Down Expand Up @@ -802,7 +801,7 @@ spec:
devices:
description: Devices is the list of network devices used
by the virtual machine. TODO(akutz) Make sure at least
one network matches the ClusterSpec.CloudProviderConfiguration.Network.Name
one network matches the ClusterSpec.CloudProviderConfiguration.Network.Name
items:
description: NetworkDeviceSpec defines the network configuration
for a virtual machine's network device.
Expand Down Expand Up @@ -836,6 +835,7 @@ spec:
- kind
- name
type: object
x-kubernetes-map-type: atomic
type: array
deviceName:
description: DeviceName may be used to explicitly
Expand Down Expand Up @@ -1167,9 +1167,3 @@ spec:
type: object
served: true
storage: true
status:
acceptedNames:
kind: ""
plural: ""
conditions: []
storedVersions: []
Loading

0 comments on commit 6454515

Please sign in to comment.