This repository has been archived by the owner on Jan 28, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 35
/
Makefile
429 lines (354 loc) · 18.2 KB
/
Makefile
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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
# Copyright 2017 The Kubernetes Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
all: build test verify
# Some env vars that devs might find useful:
# GOFLAGS : extra "go build" flags to use - e.g. -v (for verbose)
# NO_DOCKER=1 : execute each step in the native environment instead of a Docker container
# UNIT_TEST_DIRS= : only run the unit tests from the specified dirs
# INT_TEST_DIRS= : only run the integration tests from the specified dirs
# TEST_FLAGS= : add flags to the go test command
# Define some constants
#######################
ROOT = $(dir $(abspath $(lastword $(MAKEFILE_LIST))))
BINDIR ?= bin
BUILD_DIR ?= build
COVERAGE ?= $(CURDIR)/coverage.html
CLUSTERAPI_BIN = $(BINDIR)/cluster-api
VERIFY_IMPORT_CONFIG = build/verify-imports/import-rules.yaml
CLUSTER_OPERATOR_PKG = github.com/openshift/cluster-operator
CLUSTER_OPERATOR_ANSIBLE_IMAGE_NAME = cluster-operator-ansible
TOP_SRC_DIRS = cmd pkg
SRC_DIRS = $(shell sh -c "find $(TOP_SRC_DIRS) -name \\*.go \
-exec dirname {} \\; | sort | uniq")
UNIT_TEST_DIRS ?= $(shell sh -c "find $(TOP_SRC_DIRS) -name \\*_test.go \
-exec dirname {} \\; | sort | uniq")
INT_TEST_DIRS ?= $(shell sh -c "find test/integration -name \\*_test.go \
-exec dirname {} \\; | sort | uniq")
VERSION ?= $(shell git describe --always --abbrev=7 --dirty)
BUILD_LDFLAGS = $(shell build/version.sh $(ROOT) $(CLUSTER_OPERATOR_PKG))
# Run stat against /dev/null and check if it has any stdout output.
# If stdout is blank, we are detecting bsd-stat because stat it has
# returned an error to stderr. If not bsd-stat, assume gnu-stat.
ifeq ($(shell stat -c"%U" /dev/null 2> /dev/null),)
STAT = stat -f '%c %N'
else
STAT = stat -c '%Y %n'
endif
TYPES_FILES = $(shell find pkg/apis -name types.go)
GO_VERSION = 1.9
ALL_ARCH=amd64 arm arm64 ppc64le s390x
PLATFORM?=linux
ARCH?=amd64
BASEIMAGE?=centos:7
GO_BUILD = env GOOS=$(PLATFORM) GOARCH=$(ARCH) go build -i $(GOFLAGS) \
-ldflags "-X $(CLUSTER_OPERATOR_PKG)/pkg.VERSION=$(VERSION) $(BUILD_LDFLAGS)"
BASE_PATH = $(ROOT:/src/github.com/openshift/cluster-operator/=)
export GOPATH = $(BASE_PATH):$(ROOT)/vendor
MUTABLE_TAG ?= canary
DEVELOPMENT_TAG ?= dev
CLUSTER_OPERATOR_IMAGE = $(REGISTRY)cluster-operator-$(ARCH):$(VERSION)
CLUSTER_OPERATOR_MUTABLE_IMAGE = $(REGISTRY)cluster-operator-$(ARCH):$(MUTABLE_TAG)
FAKE_OPENSHIFT_ANSIBLE_IMAGE = $(REGISTRY)fake-openshift-ansible:$(VERSION)
FAKE_OPENSHIFT_ANSIBLE_MUTABLE_IMAGE = $(REGISTRY)fake-openshift-ansible:$(MUTABLE_TAG)
PLAYBOOK_MOCK_IMAGE = $(REGISTRY)playbook-mock:$(VERSION)
PLAYBOOK_MOCK_MUTABLE_IMAGE = $(REGISTRY)playbook-mock:$(MUTABLE_TAG)
FAKE_MACHINE_CONTROLLER_IMAGE = $(REGISTRY)fake-machine-controller:$(VERSION)
FAKE_MACHINE_CONTROLLER_MUTABLE_IMAGE = $(REGISTRY)fake-machine-controller:$(MUTABLE_TAG)
CLUSTER_API_DEPLOYMENT_PLAYBOOK = deploy-cluster-api-production.yaml
CLUSTER_API_DEPLOYMENT_PLAYBOOK_DEV = deploy-cluster-api-development.yaml
$(if $(realpath vendor/k8s.io/apimachinery/vendor), \
$(error the vendor directory exists in the apimachinery \
vendored source and must be flattened. \
run 'glide i -v'))
ifdef TEST_LOG_LEVEL
TEST_FLAGS+=-v
TEST_LOG_FLAGS=-args --alsologtostderr --v=$(TEST_LOG_LEVEL)
endif
NO_DOCKER ?= 0
ifeq ($(NO_DOCKER), 1)
DOCKER_CMD =
clusterOperatorBuildImageTarget =
else
# Mount .pkg as pkg so that we save our cached "go build" output files
DOCKER_CMD = docker run --security-opt label:disable --rm -v $(PWD):/go/src/$(CLUSTER_OPERATOR_PKG) \
-v $(PWD)/.pkg:/go/pkg clusteroperatorbuildimage
clusterOperatorBuildImageTarget = .clusterOperatorBuildImage
endif
NON_VENDOR_DIRS = $(shell $(DOCKER_CMD) glide nv)
# This section builds the output binaries.
# Some will have dedicated targets to make it easier to type, for example
# "cluster-operator" instead of "bin/cluster-operator".
#########################################################################
build: .init .generate_files \
$(BINDIR)/cluster-operator \
$(BINDIR)/fake-openshift-ansible \
$(BINDIR)/fake-machine-controller \
$(BINDIR)/coutil
.PHONY: $(BINDIR)/cluster-operator
cluster-operator: $(BINDIR)/cluster-operator
$(BINDIR)/cluster-operator: .init .generate_files
$(DOCKER_CMD) $(GO_BUILD) -o $@ $(CLUSTER_OPERATOR_PKG)/cmd/cluster-operator
.PHONY: $(BINDIR)/fake-machine-controller
fake-machine-controller: $(BINDIR)/fake-machine-controller
$(BINDIR)/fake-machine-controller: .init
$(DOCKER_CMD) $(GO_BUILD) -o $@ $(CLUSTER_OPERATOR_PKG)/cmd/fake-machine-controller
.PHONY: $(BINDIR)/coutil
coutil: $(BINDIR)/coutil
$(BINDIR)/coutil: .init
$(DOCKER_CMD) $(GO_BUILD) -o $@ $(CLUSTER_OPERATOR_PKG)/contrib/cmd/coutil
fake-openshift-ansible: $(BINDIR)/fake-openshift-ansible
$(BINDIR)/fake-openshift-ansible: contrib/fake-openshift-ansible/fake-openshift-ansible
$(DOCKER_CMD) cp contrib/fake-openshift-ansible/fake-openshift-ansible $(BINDIR)
# This section contains the code generation stuff
#################################################
.generate_exes: $(BINDIR)/defaulter-gen \
$(BINDIR)/deepcopy-gen \
$(BINDIR)/conversion-gen \
$(BINDIR)/client-gen \
$(BINDIR)/lister-gen \
$(BINDIR)/informer-gen \
$(BINDIR)/openapi-gen
touch $@
$(BINDIR)/defaulter-gen: .init
$(DOCKER_CMD) go build -o $@ $(CLUSTER_OPERATOR_PKG)/vendor/k8s.io/code-generator/cmd/defaulter-gen
$(BINDIR)/deepcopy-gen: .init
$(DOCKER_CMD) go build -o $@ $(CLUSTER_OPERATOR_PKG)/vendor/k8s.io/code-generator/cmd/deepcopy-gen
$(BINDIR)/conversion-gen: .init
$(DOCKER_CMD) go build -o $@ $(CLUSTER_OPERATOR_PKG)/vendor/k8s.io/code-generator/cmd/conversion-gen
$(BINDIR)/client-gen: .init
$(DOCKER_CMD) go build -o $@ $(CLUSTER_OPERATOR_PKG)/vendor/k8s.io/code-generator/cmd/client-gen
$(BINDIR)/lister-gen: .init
$(DOCKER_CMD) go build -o $@ $(CLUSTER_OPERATOR_PKG)/vendor/k8s.io/code-generator/cmd/lister-gen
$(BINDIR)/informer-gen: .init
$(DOCKER_CMD) go build -o $@ $(CLUSTER_OPERATOR_PKG)/vendor/k8s.io/code-generator/cmd/informer-gen
$(BINDIR)/openapi-gen: vendor/k8s.io/code-generator/cmd/openapi-gen
$(DOCKER_CMD) go build -o $@ $(CLUSTER_OPERATOR_PKG)/$^
.PHONY: $(BINDIR)/e2e.test
$(BINDIR)/e2e.test: .init
$(DOCKER_CMD) go test -c -o $@ $(CLUSTER_OPERATOR_PKG)/test/e2e
# Regenerate all files if the gen exes changed or any "types.go" files changed
.generate_files: .init .generate_exes $(TYPES_FILES)
# generate apiserver deps
$(DOCKER_CMD) $(BUILD_DIR)/update-apiserver-gen.sh
# generate all pkg/client contents
$(DOCKER_CMD) $(BUILD_DIR)/update-client-gen.sh
touch $@
# Some prereq stuff
###################
.init: $(clusterOperatorBuildImageTarget)
touch $@
.clusterOperatorBuildImage: build/build-image/Dockerfile
sed "s/GO_VERSION/$(GO_VERSION)/g" < build/build-image/Dockerfile | \
docker build -t clusteroperatorbuildimage -
# Util targets
##############
.PHONY: verify verify-generated verify-client-gen verify-mocks
verify: .init .generate_exes verify-generated verify-client-gen verify-mocks $(BINDIR)/coutil
@echo Running gofmt:
@$(DOCKER_CMD) gofmt -l -s $(TOP_SRC_DIRS)>.out 2>&1||true
@[ ! -s .out ] || \
(echo && echo "*** Please 'gofmt -s -d' on the following:" && \
cat .out && echo && rm .out && false)
@rm .out
@#
@echo Running golint, go vet and coutil verify-imports:
@# Exclude the generated (zz) files for now, as well as defaults.go (it
@# observes conventions from upstream that will not pass lint checks).
@$(DOCKER_CMD) sh -c \
'for i in $$(find $(TOP_SRC_DIRS) -name *.go \
| grep -v ^pkg/kubernetes/ \
| grep -v generated \
| grep -v ^pkg/client/ \
| grep -v v1alpha1/defaults.go); \
do \
golint --set_exit_status $$i || exit 1; \
$(BINDIR)/coutil verify-imports -c $(VERIFY_IMPORT_CONFIG) $$i || exit 1; \
done'
@#
$(DOCKER_CMD) go vet ./cmd/... ./test/... ./contrib/... $(go list ./pkg/... | grep -v _generated)
@echo Running repo-infra verify scripts
@$(DOCKER_CMD) vendor/github.com/kubernetes/repo-infra/verify/verify-boilerplate.sh --rootdir=. | grep -v generated | grep -v contrib/ansible/ > .out 2>&1 || true
@[ ! -s .out ] || (cat .out && rm .out && false)
@rm .out
@#
@echo Running errexit checker:
@$(DOCKER_CMD) build/verify-errexit.sh
verify-generated: .init .generate_exes
$(DOCKER_CMD) $(BUILD_DIR)/update-apiserver-gen.sh --verify-only
verify-client-gen: .init .generate_exes
$(DOCKER_CMD) $(BUILD_DIR)/verify-client-gen.sh
verify-mocks:
@echo Running verify mocks generation
@git diff --quiet && git diff --cached --quiet || \
(echo "Cannot verify mocks while there are uncommited changes" && false)
@$(DOCKER_CMD) $(BUILD_DIR)/generate-mocks.sh
@git diff --quiet && git diff --cached --quiet || \
(echo "Please run \"make .generate_mocks\"" && false)
format: .init
$(DOCKER_CMD) gofmt -w -s $(TOP_SRC_DIRS)
coverage: .init
$(DOCKER_CMD) contrib/hack/coverage.sh --html "$(COVERAGE)" \
$(addprefix ./,$(UNIT_TEST_DIRS))
test: .init build test-unit test-integration
# this target checks to see if the go binary is installed on the host
.PHONY: check-go
check-go:
@if [ -z $$(which go) ]; then \
echo "Missing \`go\` binary which is required for development"; \
exit 1; \
fi
# this target uses the host-local go installation to test
.PHONY: test-unit-native
test-unit-native: check-go
go test $(addprefix ${CLUSTER_OPERATOR_PKG}/,${UNIT_TEST_DIRS})
test-unit: .init build .generate_mocks
@echo Running unit tests:
$(DOCKER_CMD) go test -race $(TEST_FLAGS) \
$(addprefix $(CLUSTER_OPERATOR_PKG)/,$(UNIT_TEST_DIRS)) $(TEST_LOG_FLAGS)
.generate_mocks:
$(DOCKER_CMD) $(BUILD_DIR)/generate-mocks.sh
test-integration: .init build
@echo Running integration tests:
$(DOCKER_CMD) go test -parallel 1 -race $(TEST_FLAGS) \
$(addprefix $(CLUSTER_OPERATOR_PKG)/,$(INT_TEST_DIRS)) $(TEST_LOG_FLAGS)
clean-e2e:
rm -f $(BINDIR)/e2e.test
test-e2e: .generate_files $(BINDIR)/e2e.test
$(BINDIR)/e2e.test
clean: clean-bin clean-build-image clean-generated clean-coverage
clean-bin:
$(DOCKER_CMD) rm -rf $(BINDIR)
rm -f .generate_exes
clean-build-image:
$(DOCKER_CMD) rm -rf .pkg
rm -f .clusterOperatorBuildImage
docker rmi -f clusteroperatorbuildimage > /dev/null 2>&1 || true
# clean-generated does a `git checkout --` on all generated files and
# directories. May not work correctly if you have staged some of these files
# or have multiple commits.
clean-generated:
rm -f .generate_files
# rollback changes to generated defaults/conversions/deepcopies
find $(TOP_SRC_DIRS) -name zz_generated* | xargs git checkout --
# rollback changes to types.generated.go
find $(TOP_SRC_DIRS) -name types.generated* | xargs git checkout --
# rollback changes to the generated clientset directories
find $(TOP_SRC_DIRS) -type d -name *_generated | xargs git checkout --
# rollback openapi changes
git checkout -- pkg/openapi/openapi_generated.go
# purge-generated removes generated files from the filesystem.
purge-generated:
find $(TOP_SRC_DIRS) -name zz_generated* -exec rm {} \;
find $(TOP_SRC_DIRS) -type d -name *_generated -exec rm -rf {} \;
rm -f pkg/openapi/openapi_generated.go
echo 'package v1alpha1' > pkg/apis/clusteroperator/v1alpha1/types.generated.go
clean-coverage:
rm -f $(COVERAGE)
# Building Docker Images for our executables
############################################
images: cluster-operator-image \
playbook-mock-image \
cluster-operator-ansible-images \
fake-openshift-ansible-image \
fake-machine-controller-image \
$(BINDIR)/coutil
images-all: $(addprefix arch-image-,$(ALL_ARCH))
arch-image-%:
$(MAKE) ARCH=$* build
$(MAKE) ARCH=$* images
define build-and-tag # (service, image, mutable_image, prefix)
$(eval build_path := "$(4)build/$(1)")
$(eval tmp_build_path := "$(build_path)/tmp")
mkdir -p $(tmp_build_path)
cp -r $(BINDIR)/* $(tmp_build_path)
cp $(build_path)/Dockerfile $(tmp_build_path)
# -i.bak is required for cross-platform compat: https://stackoverflow.com/questions/5694228/sed-in-place-flag-that-works-both-on-mac-bsd-and-linux
sed -i.bak "s|BASEIMAGE|$(BASEIMAGE)|g" $(tmp_build_path)/Dockerfile
rm $(tmp_build_path)/Dockerfile.bak
docker run --rm --privileged multiarch/qemu-user-static:register --reset
docker build -t $(2) $(tmp_build_path)
docker tag $(2) $(3)
rm -rf $(tmp_build_path)
endef
cluster-operator-image: build/cluster-operator/Dockerfile $(BINDIR)/cluster-operator $(BINDIR)/coutil
$(call build-and-tag,"cluster-operator",$(CLUSTER_OPERATOR_IMAGE),$(CLUSTER_OPERATOR_MUTABLE_IMAGE))
ifeq ($(ARCH),amd64)
docker tag $(CLUSTER_OPERATOR_IMAGE) $(REGISTRY)cluster-operator:$(VERSION)
docker tag $(CLUSTER_OPERATOR_MUTABLE_IMAGE) $(REGISTRY)cluster-operator:$(MUTABLE_TAG)
endif
OA_ANSIBLE_URL ?= https://github.com/openshift/openshift-ansible.git
OA_ANSIBLE_BRANCH ?= master
define build-cluster-operator-ansible-image #(dockerfile, repo, branch, imagename, tag, clusterapi_playbook)
$(eval build_path := "build/cluster-operator-ansible")
$(eval tmp_build_path := "$(build_path)/tmp")
mkdir -p $(tmp_build_path)
cp $(build_path)/$1 $(tmp_build_path)/Dockerfile
cp $(build_path)/run $(tmp_build_path)
cp -r $(build_path)/playbooks* $(tmp_build_path)
cp -r $(build_path)/roles.v3_9 $(tmp_build_path)
cp $(tmp_build_path)/playbooks/cluster-api-prep/$6 $(tmp_build_path)/playbooks/cluster-api-prep/deploy-cluster-api.yaml
cp bin/cluster-operator $(tmp_build_path)/playbooks/cluster-api-prep/files
docker build -t "$4:$5" --build-arg=CO_ANSIBLE_URL=$2 --build-arg=CO_ANSIBLE_BRANCH=$3 $(tmp_build_path)
rm -rf $(tmp_build_path)
endef
cluster-operator-ansible-images: build/cluster-operator-ansible/Dockerfile build/cluster-operator-ansible/playbooks/cluster-api-prep/deploy-cluster-api-production.yaml build/cluster-operator-ansible/playbooks/cluster-api-prep/deploy-cluster-api-development.yaml build/cluster-operator-ansible/playbooks/cluster-api-prep/files/cluster-api-template.yaml build/cluster-operator-ansible/playbooks/cluster-operator/node-config-daemonset.yml
# build v3.9 on openshift-ansible:release-3.9
$(call build-cluster-operator-ansible-image,"Dockerfile.v3.9",$(OA_ANSIBLE_URL),"release-3.9",$(CLUSTER_OPERATOR_ANSIBLE_IMAGE_NAME),"v3.9",$(CLUSTER_API_DEPLOYMENT_PLAYBOOK))
# build v3.10 on openshift-ansible:release-3.10
$(call build-cluster-operator-ansible-image,"Dockerfile.v3.10",$(OA_ANSIBLE_URL),"release-3.10",$(CLUSTER_OPERATOR_ANSIBLE_IMAGE_NAME),"v3.10",$(CLUSTER_API_DEPLOYMENT_PLAYBOOK))
# build v3.10 development version
$(call build-cluster-operator-ansible-image,"Dockerfile.v3.10",$(OA_ANSIBLE_URL),"release-3.10",$(CLUSTER_OPERATOR_ANSIBLE_IMAGE_NAME),"v3.10-dev",$(CLUSTER_API_DEPLOYMENT_PLAYBOOK_DEV))
# build master/canary
$(call build-cluster-operator-ansible-image,"Dockerfile",$(OA_ANSIBLE_URL),$(OA_ANSIBLE_BRANCH),$(CLUSTER_OPERATOR_ANSIBLE_IMAGE_NAME),$(VERSION),$(CLUSTER_API_DEPLOYMENT_PLAYBOOK))
docker tag $(CLUSTER_OPERATOR_ANSIBLE_IMAGE_NAME):$(VERSION) $(CLUSTER_OPERATOR_ANSIBLE_IMAGE_NAME):$(MUTABLE_TAG)
# build master/canary development version
$(call build-cluster-operator-ansible-image,"Dockerfile",$(OA_ANSIBLE_URL),$(OA_ANSIBLE_BRANCH),$(CLUSTER_OPERATOR_ANSIBLE_IMAGE_NAME),$(DEVELOPMENT_TAG),$(CLUSTER_API_DEPLOYMENT_PLAYBOOK_DEV))
fake-openshift-ansible-image: cluster-operator-ansible-images build/fake-openshift-ansible/Dockerfile $(BINDIR)/fake-openshift-ansible
$(call build-and-tag,"fake-openshift-ansible",$(FAKE_OPENSHIFT_ANSIBLE_IMAGE),$(FAKE_OPENSHIFT_ANSIBLE_MUTABLE_IMAGE))
docker tag $(FAKE_OPENSHIFT_ANSIBLE_IMAGE) $(REGISTRY)fake-openshift-ansible:$(VERSION)
docker tag $(FAKE_OPENSHIFT_ANSIBLE_MUTABLE_IMAGE) $(REGISTRY)fake-openshift-ansible:$(MUTABLE_TAG)
playbook-mock-image: build/playbook-mock/Dockerfile $(BINDIR)/coutil
$(call build-and-tag,"playbook-mock",$(PLAYBOOK_MOCK_IMAGE),$(PLAYBOOK_MOCK_MUTABLE_IMAGE))
docker tag $(PLAYBOOK_MOCK_IMAGE) $(REGISTRY)playbook-mock:$(VERSION)
docker tag $(PLAYBOOK_MOCK_MUTABLE_IMAGE) $(REGISTRY)playbook-mock:$(MUTABLE_TAG)
.PHONY: fake-machine-controller-image
fake-machine-controller-image: build/fake-machine-controller/Dockerfile $(BINDIR)/fake-machine-controller
$(call build-and-tag,"fake-machine-controller",$(FAKE_MACHINE_CONTROLLER_IMAGE),$(FAKE_MACHINE_CONTROLLER_MUTABLE_IMAGE))
docker tag $(FAKE_MACHINE_CONTROLLER_IMAGE) $(FAKE_MACHINE_CONTROLLER_MUTABLE_IMAGE)
# Push our Docker Images to the integrated registry:
INTEGRATED_REGISTRY ?= 172.30.1.1
integrated-registry-push:
# WARNING: this will fail if logged in as system:admin, see README for creating an "admin" account
# you can use separately that will work here:
$(eval OPENSHIFT_TOKEN := $(shell oc whoami -t))
docker login -u admin -p $(OPENSHIFT_TOKEN) $(INTEGRATED_REGISTRY):5000
# NOTE: the in-cluster ImageStream tag we use is latest:
docker tag cluster-operator:$(MUTABLE_TAG) $(INTEGRATED_REGISTRY):5000/openshift-cluster-operator/cluster-operator:latest
docker push $(INTEGRATED_REGISTRY):5000/openshift-cluster-operator/cluster-operator:latest
docker tag fake-machine-controller:$(MUTABLE_TAG) $(INTEGRATED_REGISTRY):5000/openshift-cluster-operator/fake-machine-controller:latest
docker push $(INTEGRATED_REGISTRY):5000/openshift-cluster-operator/fake-machine-controller:latest
# Push our Docker Images to a registry
######################################
push: cluster-operator-push
cluster-operator-push: cluster-operator-image
docker push $(CLUSTER_OPERATOR_IMAGE)
docker push $(CLUSTER_OPERATOR_MUTABLE_IMAGE)
ifeq ($(ARCH),amd64)
docker push $(REGISTRY)cluster-operator:$(VERSION)
docker push $(REGISTRY)cluster-operator:$(MUTABLE_TAG)
endif
release-push: $(addprefix release-push-,$(ALL_ARCH))
release-push-%:
$(MAKE) ARCH=$* build
$(MAKE) ARCH=$* push