Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- kmajumde@localhost:git/ocs-osd-deployer ‹master*›$ bash -v tools/deploy-with-olm.sh quay.io/ezio_auditore
- #!/bin/bash
- # enable !! command completion
- set -o history -o histexpand
- source "$(dirname ${0})/colors.sh"
- #!/bin/bash
- BLACK='\033[0;30m' # Black
- RED='\033[0;31m' # Red
- GREEN='\033[0;32m' # Green
- YELLOW='\033[0;33m' # Yellow
- BLUE='\033[0;34m' # Blue
- PURPLE='\033[0;35m' # Purple
- CYAN='\033[0;36m' # Cyan
- WHITE='\033[0;37m' # White
- NC='\033[0m' # No Color
- function black {
- _colored_echo "${1}" ${BLACK}
- }
- function red {
- _colored_echo "${1}" ${RED}
- }
- function green {
- _colored_echo "${1}" ${GREEN}
- }
- function yellow {
- _colored_echo "${1}" ${YELLOW}
- }
- function blue {
- _colored_echo "${1}" ${BLUE}
- }
- function purple {
- _colored_echo "${1}" ${PURPLE}
- }
- function cyan {
- _colored_echo "${1}" ${CYAN}
- }
- function white {
- _colored_echo "${1}" ${WHITE}
- }
- function _colored_echo {
- echo -e "${2}${1}${NC}"
- }
- # Allow controlled exit on error
- function exit_on_err() {
- "$@"
- EXIT_CODE=$?
- if [ ${EXIT_CODE} -ne 0 ]; then
- >&2 echo "\"${@}\" command failed with exit code ${EXIT_CODE}."
- exit ${EXIT_CODE}
- fi
- }
- # tools definitions
- K8S_CLIENT=${K8S_CLIENT:-kubectl}
- OP_SDK=${OP_SDK:-operator-sdk}
- # Bundle definition
- IMAGE_REPO=${IMAGE_REPO:-${1}}
- if [[ -z ${IMAGE_REPO} ]]; then
- red "Error: target repository was not set via a command line argument or the IMAGE_REPO environment variable"
- exit 1
- fi
- # Bundle image
- BUNDLE_NAME=${BUNDLE_NAME:-ocs-osd-deployer-bundle}
- BUNDLE_VERSION=${BUNDLE_VERSION:-latest}
- BUNDLE_IMAGE=${BUNDLE_IMAGE:-${IMAGE_REPO}/${BUNDLE_NAME}:${BUNDLE_VERSION}}
- # Deployer image
- DEPLOYER_NAME=${DEPLOYER_NAME:-ocs-osd-deployer}
- DEPLOYER_VERSION=${DEPLOYER_VERSION:-latest}
- DEPLOYER_IMAGE=${DEPLOYER_IMAGE:-${IMAGE_REPO}/${DEPLOYER_NAME}:${DEPLOYER_VERSION}}
- # Deploy target
- TARGET_NAMESPACE=${TARGET_NAMESPACE:-openshift-storage}
- # CSV environment variables
- ADDON_NAME=${ADDON_NAME:-ocs-converged}
- BUNDLE_FILE=bundle/manifests/ocs-osd-deployer.clusterserviceversion.yaml
- CLUSTER_SIZE=${CLUSTER_SIZE:-1}
- # Generate the deployer image
- blue "Generate deployer image: ${DEPLOYER_IMAGE}"
- Generate deployer image: quay.io/ezio_auditore/ocs-osd-deployer:latest
- exit_on_err make docker-build IMG=${DEPLOYER_IMAGE}
- //home/kmajumde/go/bin/controller-gen object:headerFile="hack/boilerplate.go.txt" paths="./..."
- go fmt ./...
- go vet ./...
- //home/kmajumde/go/bin/controller-gen "crd:trivialVersions=true" rbac:roleName=manager-role webhook paths="./..." output:crd:artifacts:config=config/crd/bases
- mkdir -p /home/kmajumde/work/git/ocs-osd-deployer/testbin
- test -f /home/kmajumde/work/git/ocs-osd-deployer/testbin/setup-envtest.sh || curl -sSLo /home/kmajumde/work/git/ocs-osd-deployer/testbin/setup-envtest.sh https://raw.githubusercontent.com/kubernetes-sigs/controller-runtime/v0.6.3/hack/setup-envtest.sh
- source /home/kmajumde/work/git/ocs-osd-deployer/testbin/setup-envtest.sh; fetch_envtest_tools /home/kmajumde/work/git/ocs-osd-deployer/testbin; setup_envtest_env /home/kmajumde/work/git/ocs-osd-deployer/testbin; go test ./... -coverprofile cover.out
- Using cached envtest tools from /home/kmajumde/work/git/ocs-osd-deployer/testbin
- setting up env vars
- ? github.com/openshift/ocs-osd-deployer [no test files]
- ? github.com/openshift/ocs-osd-deployer/api/v1alpha1 [no test files]
- ok github.com/openshift/ocs-osd-deployer/controllers 80.733s coverage: 85.5% of statements
- ? github.com/openshift/ocs-osd-deployer/readinessProbe [no test files]
- ok github.com/openshift/ocs-osd-deployer/readinessProbe/readiness 8.190s coverage: 73.3% of statements
- ? github.com/openshift/ocs-osd-deployer/templates [no test files]
- ? github.com/openshift/ocs-osd-deployer/testutils [no test files]
- ? github.com/openshift/ocs-osd-deployer/utils [no test files]
- docker build . -t quay.io/ezio_auditore/ocs-osd-deployer:latest
- Sending build context to Docker daemon 292.8MB
- Step 1/19 : FROM golang:1.13 as builder
- ---> d6f3656320fe
- Step 2/19 : WORKDIR /workspace
- ---> Using cache
- ---> 78e87533e952
- Step 3/19 : COPY go.mod go.mod
- ---> Using cache
- ---> 84d196607dd4
- Step 4/19 : COPY go.sum go.sum
- ---> Using cache
- ---> b223eb7178db
- Step 5/19 : RUN go mod download
- ---> Using cache
- ---> f917f6528304
- Step 6/19 : COPY main.go main.go
- ---> Using cache
- ---> e503be6c48b4
- Step 7/19 : COPY api/ api/
- ---> Using cache
- ---> adc342f4a17e
- Step 8/19 : COPY controllers/ controllers/
- ---> Using cache
- ---> 9d1c213170ed
- Step 9/19 : COPY utils/ utils/
- ---> Using cache
- ---> 794d70f1d8c0
- Step 10/19 : COPY templates/ templates/
- ---> Using cache
- ---> 5bb9c674dc8c
- Step 11/19 : COPY readinessProbe/ readinessProbe/
- ---> Using cache
- ---> 09fdc18b161f
- Step 12/19 : RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 GO111MODULE=on go build -a -o manager main.go
- ---> Using cache
- ---> 98dc8fba37b4
- Step 13/19 : RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 GO111MODULE=on go build -a -o readinessServer readinessProbe/main.go
- ---> Using cache
- ---> eff03e96bae3
- Step 14/19 : FROM gcr.io/distroless/static:nonroot
- ---> fb7b4da47366
- Step 15/19 : WORKDIR /
- ---> Using cache
- ---> f9b077cbf9db
- Step 16/19 : COPY --from=builder /workspace/manager .
- ---> Using cache
- ---> 9c19f54f736c
- Step 17/19 : COPY --from=builder /workspace/readinessServer .
- ---> Using cache
- ---> 27a0729e1ae0
- Step 18/19 : USER nonroot:nonroot
- ---> Using cache
- ---> 0ec106f689bc
- Step 19/19 : ENTRYPOINT ["/manager"]
- ---> Using cache
- ---> 00c90af8aa75
- Successfully built 00c90af8aa75
- Successfully tagged quay.io/ezio_auditore/ocs-osd-deployer:latest
- exit_on_err make docker-push IMG=${DEPLOYER_IMAGE}
- docker push quay.io/ezio_auditore/ocs-osd-deployer:latest
- The push refers to repository [quay.io/ezio_auditore/ocs-osd-deployer]
- e8d23e2cc9d7: Layer already exists
- a3e4d996485b: Layer already exists
- 417cb9b79ade: Layer already exists
- latest: digest: sha256:2e771cf0c20203f32755aa3bf2dbd1138d8c356da8223038b952b0ce026e487d size: 951
- # Generate the olm bundle image
- blue "Generate and push the olm bundle image: ${BUNDLE_IMAGE}"
- Generate and push the olm bundle image: quay.io/ezio_auditore/ocs-osd-deployer-bundle:latest
- exit_on_err make bundle IMG=${DEPLOYER_IMAGE} OUTPUT_DIR=./tools/bundle
- //home/kmajumde/go/bin/controller-gen "crd:trivialVersions=true" rbac:roleName=manager-role webhook paths="./..." output:crd:artifacts:config=config/crd/bases
- operator-sdk generate kustomize manifests -q
- cd config/manager && //home/kmajumde/go/bin/kustomize edit set image controller=quay.io/ezio_auditore/ocs-osd-deployer:latest
- //home/kmajumde/go/bin/kustomize build config/manifests | operator-sdk generate bundle -q --overwrite --version 0.0.1 --output-dir=./tools/bundle
- INFO[0001] Creating bundle.Dockerfile
- INFO[0001] Creating tools/bundle/metadata/annotations.yaml
- INFO[0001] Bundle metadata generated suceessfully
- cp config/metadata/* bundle/metadata/
- operator-sdk bundle validate ./bundle
- FATA[0000] unable to find a csv in bundle directory bundle/manifests
- make: *** [Makefile:168: bundle] Error 1
- "make bundle IMG=quay.io/ezio_auditore/ocs-osd-deployer:latest OUTPUT_DIR=./tools/bundle" command failed with exit code 2.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement