-
Notifications
You must be signed in to change notification settings - Fork 116
Expand file tree
/
Copy pathMakefile.bundle
More file actions
57 lines (49 loc) · 1.88 KB
/
Makefile.bundle
File metadata and controls
57 lines (49 loc) · 1.88 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
include Makefile
# Current Operator version
VERSION ?= 4.22.0
# Default bundle image tag
BUNDLE_IMG ?= controller-bundle:$(VERSION)
# download-tool will download any package $2 and install it to $1.
define download-tool
@[ -f $(1) ] || { \
set -e ;\
echo "Downloading $(2)" ;\
curl -sL -o $1 $2 ;\
chmod +x $1 ;\
}
endef
OPERATORSDK = $(BIN_DIR)/operator-sdk
UNAME_S := $(shell uname -s)
UNAME_M := $(shell uname -m)
OPERATORSDK_OS := linux
OPERATORSDK_ARCH := amd64
ifeq ($(UNAME_S),Darwin)
OPERATORSDK_OS := darwin
endif
ifeq ($(UNAME_M),arm64)
OPERATORSDK_ARCH := arm64
endif
ifeq ($(UNAME_M),aarch64)
OPERATORSDK_ARCH := arm64
endif
operator-sdk: ## Download operator-sdk locally if necessary.
$(call download-tool,$(OPERATORSDK),https://github.com/operator-framework/operator-sdk/releases/download/v1.40.0/operator-sdk_$(OPERATORSDK_OS)_$(OPERATORSDK_ARCH))
# Generate bundle manifests and metadata, then validate generated files.
.PHONY: bundle
bundle: manifests kustomize operator-sdk
rm -f bundle/manifests/*
MANIFEST_YAML=$$(ls manifests/stable/*.yaml | grep -v supported-nic-ids_v1_configmap.yaml) ; \
rm -f $$MANIFEST_YAML
$(OPERATORSDK) generate kustomize manifests --interactive=false -q
cd config/manager && $(KUSTOMIZE) edit set image controller=$(IMG)
$(KUSTOMIZE) build config/manifests | $(OPERATORSDK) generate bundle -q --overwrite --version $(VERSION) $(BUNDLE_METADATA_OPTS) --extra-service-accounts sriov-network-config-daemon
$(OPERATORSDK) bundle validate ./bundle
BUNDLE_MANIFEST_YAML=$$(ls bundle/manifests/* | grep -v supported-nic-ids_v1_configmap.yaml); \
cp $$BUNDLE_MANIFEST_YAML manifests/stable
# Build the bundle image.
.PHONY: bundle-build
bundle-build:
docker build -f bundle.Dockerfile -t $(BUNDLE_IMG) .
KUSTOMIZE = $(BIN_DIR)/kustomize
kustomize: ## Download kustomize locally if necessary.
$(call go-install-tool,$(KUSTOMIZE),sigs.k8s.io/kustomize/kustomize/v4@v4.5.5)