Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix controller-gen and operator-sdk versions #234

Merged
merged 1 commit into from
Sep 21, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 13 additions & 11 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,6 @@ BUNDLE_IMG ?= $(IMAGE_TAG_BASE)-bundle:v$(VERSION)

# Image URL to use all building/pushing image targets
IMG ?= quay.io/openshift/origin-ptp-operator:$(VERSION)
# Produce CRDs that work back to Kubernetes 1.11 (no version conversion)
CRD_OPTIONS ?= "crd:trivialVersions=true,preserveUnknownFields=false"

# Get the currently used golang install path (in GOPATH/bin, unless GOBIN is set)
ifeq (,$(shell go env GOBIN))
Expand Down Expand Up @@ -74,7 +72,7 @@ help: ## Display this help.
##@ Development

manifests: controller-gen ## Generate WebhookConfiguration, ClusterRole and CustomResourceDefinition objects.
$(CONTROLLER_GEN) $(CRD_OPTIONS) rbac:roleName=manager-role webhook paths="./..." output:crd:artifacts:config=config/crd/bases
$(CONTROLLER_GEN) crd rbac:roleName=manager-role webhook paths="./..." output:crd:artifacts:config=config/crd/bases

generate: controller-gen ## Generate code containing DeepCopy, DeepCopyInto, and DeepCopyObject method implementations.
$(CONTROLLER_GEN) object:headerFile="hack/boilerplate.go.txt" paths="./..."
Expand Down Expand Up @@ -130,6 +128,14 @@ CONTROLLER_GEN = $(shell pwd)/bin/controller-gen
controller-gen: ## Download controller-gen locally if necessary.
$(call go-install-tool,$(CONTROLLER_GEN),sigs.k8s.io/controller-tools/cmd/[email protected])

OPERATOR_SDK = $(shell pwd)/bin/operator-sdk
OPERATOR_SDK_VERSION = $(shell $(OPERATOR_SDK) version 2>/dev/null | sed 's/^operator-sdk version: "\([^"]*\).*/\1/')
OPERATOR_SDK_VERSION_REQ = v1.22.0-ocp
operator-sdk: ## Download operator-sdk locally if necessary.
ifneq ($(OPERATOR_SDK_VERSION_REQ),$(OPERATOR_SDK_VERSION))
curl https://mirror.openshift.com/pub/openshift-v4/x86_64/clients/operator-sdk/4.11.0/operator-sdk-linux-x86_64.tar.gz? | tar -xz -C bin/
endif

KUSTOMIZE = $(shell pwd)/bin/kustomize
kustomize: ## Download kustomize locally if necessary.
$(call go-install-tool,$(KUSTOMIZE),sigs.k8s.io/kustomize/kustomize/[email protected])
Expand All @@ -149,11 +155,11 @@ rm -rf $$TMP_DIR ;\
endef

.PHONY: bundle ## Generate bundle manifests and metadata, then validate generated files.
bundle: manifests kustomize
operator-sdk generate kustomize manifests --interactive=false -q
bundle: operator-sdk manifests kustomize
$(OPERATOR_SDK) generate kustomize manifests --interactive=false -q
cd config/manager && $(KUSTOMIZE) edit set image controller=$(IMG)
$(KUSTOMIZE) build config/manifests | operator-sdk generate bundle -q --overwrite --version $(VERSION).0 $(BUNDLE_METADATA_OPTS) --extra-service-accounts "linuxptp-daemon"
operator-sdk bundle validate ./bundle
$(KUSTOMIZE) build config/manifests | $(OPERATOR_SDK) generate bundle -q --overwrite --version $(VERSION).0 $(BUNDLE_METADATA_OPTS) --extra-service-accounts "linuxptp-daemon"
$(OPERATOR_SDK) bundle validate ./bundle

.PHONY: bundle-build ## Build the bundle image.
bundle-build:
Expand Down Expand Up @@ -225,10 +231,6 @@ functests:
test-validation-only:
SUITE=./test/validation hack/run-functests.sh

# find or download controller-gen
# download controller-gen if necessary
operator-sdk:
go install ./vendor/github.com/operator-framework/operator-sdk/cmd/operator-sdk
buildtest:
PATH=${PATH}:${GOBIN} ginkgo build ./test/conformance
cp ./test/conformance/conformance.test ./bin/testptp
Expand Down
2 changes: 1 addition & 1 deletion bundle.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ LABEL operators.operatorframework.io.bundle.manifests.v1=manifests/
LABEL operators.operatorframework.io.bundle.metadata.v1=metadata/
LABEL operators.operatorframework.io.bundle.package.v1=ptp-operator
LABEL operators.operatorframework.io.bundle.channels.v1=alpha
LABEL operators.operatorframework.io.metrics.builder=operator-sdk-v1.14.0+git
LABEL operators.operatorframework.io.metrics.builder=operator-sdk-v1.22.0-ocp
LABEL operators.operatorframework.io.metrics.mediatype.v1=metrics+v1
LABEL operators.operatorframework.io.metrics.project_layout=go.kubebuilder.io/v3

Expand Down
2 changes: 1 addition & 1 deletion bundle/manifests/ptp-operator.clusterserviceversion.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ metadata:
linuxptp processes such as ptp4l, phc2sys and timemaster.
olm.skipRange: '>=4.3.0-0 <4.12.0'
operators.openshift.io/infrastructure-features: '["disconnected"]'
operators.operatorframework.io/builder: operator-sdk-v1.14.0+git
operators.operatorframework.io/builder: operator-sdk-v1.22.0-ocp
operators.operatorframework.io/project_layout: go.kubebuilder.io/v3
provider: Red Hat
repository: https://github.com/openshift/ptp-operator
Expand Down
6 changes: 3 additions & 3 deletions bundle/manifests/ptp.openshift.io_nodeptpdevices.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.4.1
controller-gen.kubebuilder.io/version: v0.9.2
creationTimestamp: null
name: nodeptpdevices.ptp.openshift.io
spec:
Expand Down Expand Up @@ -59,5 +59,5 @@ status:
acceptedNames:
kind: ""
plural: ""
conditions: []
storedVersions: []
conditions: null
storedVersions: null
6 changes: 3 additions & 3 deletions bundle/manifests/ptp.openshift.io_ptpconfigs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.4.1
controller-gen.kubebuilder.io/version: v0.9.2
creationTimestamp: null
name: ptpconfigs.ptp.openshift.io
spec:
Expand Down Expand Up @@ -133,5 +133,5 @@ status:
acceptedNames:
kind: ""
plural: ""
conditions: []
storedVersions: []
conditions: null
storedVersions: null
6 changes: 3 additions & 3 deletions bundle/manifests/ptp.openshift.io_ptpoperatorconfigs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.4.1
controller-gen.kubebuilder.io/version: v0.9.2
creationTimestamp: null
name: ptpoperatorconfigs.ptp.openshift.io
spec:
Expand Down Expand Up @@ -71,5 +71,5 @@ status:
acceptedNames:
kind: ""
plural: ""
conditions: []
storedVersions: []
conditions: null
storedVersions: null
2 changes: 1 addition & 1 deletion bundle/metadata/annotations.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ annotations:
operators.operatorframework.io.bundle.metadata.v1: metadata/
operators.operatorframework.io.bundle.package.v1: ptp-operator
operators.operatorframework.io.bundle.channels.v1: alpha
operators.operatorframework.io.metrics.builder: operator-sdk-v1.14.0+git
operators.operatorframework.io.metrics.builder: operator-sdk-v1.22.0-ocp
operators.operatorframework.io.metrics.mediatype.v1: metrics+v1
operators.operatorframework.io.metrics.project_layout: go.kubebuilder.io/v3

Expand Down
9 changes: 1 addition & 8 deletions config/crd/bases/ptp.openshift.io_nodeptpdevices.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@

---
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.4.1
controller-gen.kubebuilder.io/version: v0.9.2
creationTimestamp: null
name: nodeptpdevices.ptp.openshift.io
spec:
Expand Down Expand Up @@ -57,9 +56,3 @@ spec:
storage: true
subresources:
status: {}
status:
acceptedNames:
kind: ""
plural: ""
conditions: []
storedVersions: []
9 changes: 1 addition & 8 deletions config/crd/bases/ptp.openshift.io_ptpconfigs.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@

---
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.4.1
controller-gen.kubebuilder.io/version: v0.9.2
creationTimestamp: null
name: ptpconfigs.ptp.openshift.io
spec:
Expand Down Expand Up @@ -131,9 +130,3 @@ spec:
storage: true
subresources:
status: {}
status:
acceptedNames:
kind: ""
plural: ""
conditions: []
storedVersions: []
9 changes: 1 addition & 8 deletions config/crd/bases/ptp.openshift.io_ptpoperatorconfigs.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@

---
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.4.1
controller-gen.kubebuilder.io/version: v0.9.2
creationTimestamp: null
name: ptpoperatorconfigs.ptp.openshift.io
spec:
Expand Down Expand Up @@ -69,9 +68,3 @@ spec:
storage: true
subresources:
status: {}
status:
acceptedNames:
kind: ""
plural: ""
conditions: []
storedVersions: []
1 change: 0 additions & 1 deletion config/rbac/role.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
Expand Down
2 changes: 1 addition & 1 deletion manifests/stable/ptp-operator.clusterserviceversion.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ metadata:
linuxptp processes such as ptp4l, phc2sys and timemaster.
olm.skipRange: '>=4.3.0-0 <4.12.0'
operators.openshift.io/infrastructure-features: '["disconnected"]'
operators.operatorframework.io/builder: operator-sdk-v1.14.0+git
operators.operatorframework.io/builder: operator-sdk-v1.22.0-ocp
operators.operatorframework.io/project_layout: go.kubebuilder.io/v3
provider: Red Hat
repository: https://github.com/openshift/ptp-operator
Expand Down
2 changes: 1 addition & 1 deletion manifests/stable/ptp.openshift.io_nodeptpdevices.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.4.1
controller-gen.kubebuilder.io/version: v0.9.2
creationTimestamp: null
name: nodeptpdevices.ptp.openshift.io
spec:
Expand Down
2 changes: 1 addition & 1 deletion manifests/stable/ptp.openshift.io_ptpconfigs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.4.1
controller-gen.kubebuilder.io/version: v0.9.2
creationTimestamp: null
name: ptpconfigs.ptp.openshift.io
spec:
Expand Down
2 changes: 1 addition & 1 deletion manifests/stable/ptp.openshift.io_ptpoperatorconfigs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.4.1
controller-gen.kubebuilder.io/version: v0.9.2
creationTimestamp: null
name: ptpoperatorconfigs.ptp.openshift.io
spec:
Expand Down