Skip to content

Commit

Permalink
Merge pull request #17 from sunya-ch/v1.0.0
Browse files Browse the repository at this point in the history
fix image build and makefile
  • Loading branch information
sunya-ch authored May 10, 2023
2 parents 6b8b58c + c467d14 commit 9bfe550
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 13 deletions.
20 changes: 10 additions & 10 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
# To re-generate a bundle for another specific version without changing the standard setup, you can:
# - use the VERSION as arg of the bundle target (e.g make bundle VERSION=0.0.2)
# - use environment variables to overwrite this value (e.g export VERSION=0.0.2)
export VERSION ?= 0.0.1
export VERSION ?= 1.0.0

# CHANNELS define the bundle channels used in the bundle.
# Add a new line here if you would like to change its default config. (E.g CHANNELS = "preview,fast,stable")
Expand All @@ -29,27 +29,29 @@ endif
BUNDLE_METADATA_OPTS ?= $(BUNDLE_CHANNELS) $(BUNDLE_DEFAULT_CHANNEL)


export IMAGE_REGISTRY ?= your-repo
export IMAGE_REGISTRY ?= ghcr.io/ibm
# IMAGE_TAG_BASE defines the docker.io namespace and part of the image name for remote images.
# This variable is used to construct full image tags for bundle and catalog images.
#
# For example, running 'make bundle-build bundle-push catalog-build catalog-push' will build and push both
# cogadvisor.io/cpe-operator-bundle:$VERSION and cogadvisor.io/cpe-operator-catalog:$VERSION.
IMAGE_TAG_BASE ?= cpe/operator
IMAGE_TAG_BASE ?= cpe-operator

# BUNDLE_IMG defines the image:tag used for the bundle.
# You can use it as an arg. (E.g make bundle-build BUNDLE_IMG=<some-registry>/<project-name-bundle>:<tag>)
# BUNDLE_IMG ?= $(IMAGE_TAG_BASE)-bundle:v$(VERSION)
BUNDLE_IMG ?= $(IMAGE_REGISTRY)/$(IMAGE_TAG_BASE)-bundle:v$(VERSION)
BUNDLE_IMG ?= $(IMAGE_REGISTRY)/$(IMAGE_TAG_BASE)/bundle:v$(VERSION)

# Image URL to use all building/pushing image targets
# IMG ?= controller:latest
IMG ?= $(IMAGE_REGISTRY)/$(IMAGE_TAG_BASE)-controller:v$(VERSION)
PARSER_IMG ?= $(IMAGE_REGISTRY)/cpe/parser:v$(VERSION)
IMG ?= $(IMAGE_REGISTRY)/$(IMAGE_TAG_BASE)/controller:v$(VERSION)
export PARSER_IMG ?= $(IMAGE_REGISTRY)/$(IMAGE_TAG_BASE)/parser:v$(VERSION)

# Produce CRDs that work back to Kubernetes 1.11 (no version conversion)
CRD_OPTIONS ?= "crd:trivialVersions=true,preserveUnknownFields=false"

SHELL := /bin/bash

# Get the currently used golang install path (in GOPATH/bin, unless GOBIN is set)
ifeq (,$(shell go env GOBIN))
GOBIN=$(shell go env GOPATH)/bin
Expand All @@ -60,8 +62,6 @@ endif

# CPE environments
export PUSHGATEWAY_URL ?= pushgateway-prometheus-pushgateway.cpe-monitoring-system:9091
export COS_SECRET ?= cpe-cos-key
export PULL_SECRET ?= res-cpe-team-docker-local
export CLUSTER_ID ?= $(shell kubectl config current-context | cut -d "/" -f 1)

all: build
Expand Down Expand Up @@ -96,8 +96,8 @@ fmt: ## Run go fmt against code.
vet: ## Run go vet against code.
go vet ./...


ENVTEST_ASSETS_DIR=$(shell pwd)/testbin
test: SHELL := /bin/bash
test: manifests generate fmt vet ## Run tests.
mkdir -p ${ENVTEST_ASSETS_DIR}
test -f ${ENVTEST_ASSETS_DIR}/setup-envtest.sh || curl -sSLo ${ENVTEST_ASSETS_DIR}/setup-envtest.sh https://raw.githubusercontent.com/kubernetes-sigs/controller-runtime/v0.7.2/hack/setup-envtest.sh
Expand Down Expand Up @@ -223,4 +223,4 @@ parser-docker-build: ## Build docker image for parser
docker build -t ${PARSER_IMG} -f ./cpe-parser/Dockerfile ./cpe-parser

parser-docker-push: ## Push docker image for parser
docker push ${PARSER_IMG}
docker push ${PARSER_IMG}
2 changes: 1 addition & 1 deletion config/manager/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,5 @@ apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
images:
- name: controller
newName: your-repo/cpe/operator-controller
newName: ghcr.io/ibm/cpe/operator-controller
newTag: v0.0.1
2 changes: 1 addition & 1 deletion config/parser/parser.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ spec:
spec:
containers:
- name: cpe-parser
image: your-repo/cpe/parser:v0.0.1
image: ghcr.io/ibm/cpe/parser:v0.0.1
imagePullPolicy: Always
ports:
- containerPort: 8080
Expand Down
4 changes: 3 additions & 1 deletion cpe-parser/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ FROM golang:1.16
ENV GOOS=linux
ENV GOARCH=amd64

ENV PATH="$PATH:/go/bin/linux_amd64:/go/bin"

WORKDIR /go/src/cpe-parser
COPY parser parser
COPY common common
Expand All @@ -13,4 +15,4 @@ RUN go mod tidy
RUN go get -d -v ./...
RUN go install -v ./...

CMD ["/go/bin/linux_amd64/cpe-parser"]
CMD ["cpe-parser"]

0 comments on commit 9bfe550

Please sign in to comment.