Skip to content

Commit

Permalink
Merge pull request #8885 from BlaineEXE/use-intermediate-tmp-for-offl…
Browse files Browse the repository at this point in the history
…ine-image-install-list

build: use intermediate tmp for offline image gen
  • Loading branch information
BlaineEXE committed Sep 30, 2021
2 parents 1f49b6f + 24bf99f commit da52226
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 10 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@ jobs:
run: |
GOPATH=$(go env GOPATH) make clean && make -j$nproc IMAGES='ceph' BUILD_CONTAINER_IMAGE=false build
- name: validate build
working-directory: /Users/runner/go/src/github.com/rook/rook
run: tests/scripts/validate_modified_files.sh build

- name: run codegen
working-directory: /Users/runner/go/src/github.com/rook/rook
run: GOPATH=$(go env GOPATH) make codegen
Expand Down
20 changes: 10 additions & 10 deletions images/ceph/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -124,15 +124,15 @@ csv: $(OPERATOR_SDK) $(YQ) ## Generate a CSV file for OLM.
csv-clean: $(OPERATOR_SDK) $(YQ) ## Remove existing OLM files.
@rm -fr ../../cluster/olm/ceph/deploy/* ../../cluster/olm/ceph/templates/*

# list-image creates list of images for offline installation
list-image:
@echo "producing list of images for offline installation";\
# remove the file if already exists
rm -f $(MANIFESTS_DIR)/images.txt;\
# reading from a file and outputting to the same file can have undefined results, so use this intermediate
IMAGE_TMP="/tmp/rook-ceph-image-list"
list-image: ## Create a list of images for offline installation
@echo "producing list of images for offline installation"
rm -f $(IMAGE_TMP)
awk '/image:/ {print $2}' $(MANIFESTS_DIR)/operator.yaml $(MANIFESTS_DIR)/cluster.yaml | \
cut -d: -f2- |\
tee $(MANIFESTS_DIR)/images.txt; \
cut -d: -f2- | tee $(IMAGE_TMP)
awk '/quay.io/ || /k8s.gcr.io/ {print $3}' ../../pkg/operator/ceph/csi/spec.go | \
cut -d= -f2- |\
tr -d '"' | tee -a $(MANIFESTS_DIR)/images.txt;\
cat $(MANIFESTS_DIR)/images.txt|sort -h|uniq|tee $(MANIFESTS_DIR)/images.txt
cut -d= -f2- | tr -d '"' | tee -a $(IMAGE_TMP)
rm -f $(MANIFESTS_DIR)/images.txt
cat $(IMAGE_TMP) | sort -h | uniq | tee $(MANIFESTS_DIR)/images.txt
rm -f $(IMAGE_TMP)

0 comments on commit da52226

Please sign in to comment.