diff --git a/.github/workflows/nexus-operator-integration-checks.yaml b/.github/workflows/nexus-operator-integration-checks.yaml index 69eda8b8..36fead97 100644 --- a/.github/workflows/nexus-operator-integration-checks.yaml +++ b/.github/workflows/nexus-operator-integration-checks.yaml @@ -102,7 +102,6 @@ jobs: integration_tests: name: Integration Tests # we should wait for an ok from the other two - needs: [golint, unit_test] runs-on: ubuntu-latest env: CLUSTER_NAME: operator-test @@ -134,18 +133,11 @@ jobs: - name: Install Operator SDK run: | ./hack/ci/install-operator-sdk.sh - - name: Install KIND - run: | - ./hack/ci/install-kind.sh - echo "$GITHUB_WORKSPACE/bin" >> $GITHUB_PATH - - name: Start KIND - run: ./hack/ci/start-kind.sh - - - name: Generate Manifests - run: make bundle - - - name: Build Operator Image - run: make operator-build BUILDER=docker - - name: Run Operator OLM Integration Test run: make ci-olm-test + - name: Archive test results + if: ${{ always() }} + uses: actions/upload-artifact@v2 + with: + name: test-logs + path: /tmp/op-test/log.out \ No newline at end of file diff --git a/Makefile b/Makefile index 363a1fde..c7088a4f 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,6 @@ SHELL := /bin/bash # Current Operator version -VERSION ?= 0.4.0 +VERSION ?= 0.5.0 # Default bundle image tag BUNDLE_IMG ?= controller-bundle:$(VERSION) # Options for 'bundle-build' @@ -18,7 +18,7 @@ IMG ?= controller:latest CRD_OPTIONS ?= "crd:trivialVersions=true" # Image URL for the operator final image -OPERATOR_IMG ?= quay.io/m88i/nexus-operator:$(VERSION) +OPERATOR_IMG ?= quay.io/kaitou786/nexus-operator:$(VERSION) export OP_VERSION = $(VERSION) BUILDER ?= podman @@ -149,7 +149,7 @@ bundle-build: #################### CUSTOM NEXUS OPERATOR TASKS ###################### # Run the OLM test on CI ci-olm-test: - ./hack/ci/load-operator-image.sh + #./hack/ci/load-operator-image.sh ./hack/ci/operator-olm-test.sh .PHONY: pr-prep diff --git a/bundle/manifests/nexus-operator.clusterserviceversion.yaml b/bundle/manifests/nexus-operator.clusterserviceversion.yaml index 8b2f7e7e..6a8024a7 100644 --- a/bundle/manifests/nexus-operator.clusterserviceversion.yaml +++ b/bundle/manifests/nexus-operator.clusterserviceversion.yaml @@ -35,7 +35,7 @@ metadata: capabilities: Seamless Upgrades categories: Developer Tools certified: "false" - containerImage: quay.io/m88i/nexus-operator:0.4.0 + containerImage: quay.io/kaitou786/nexus-operator:0.5.0 createdAt: "2019-11-16T13:12:22Z" description: Nexus Operator to deploy and manage Nexus 3.x servers operators.operatorframework.io/builder: operator-sdk-v1.0.1 @@ -43,7 +43,7 @@ metadata: repository: https://github.com/m88i/nexus-operator support: m88i Labs tectonic-visibility: ocs - name: nexus-operator.v0.4.0 + name: nexus-operator.v0.5.0 namespace: placeholder spec: apiservicedefinitions: {} @@ -214,17 +214,6 @@ spec: control-plane: controller-manager spec: containers: - - args: - - --metrics-addr=127.0.0.1:8080 - - --enable-leader-election - command: - - /manager - image: quay.io/m88i/nexus-operator:0.4.0 - name: manager - resources: - requests: - cpu: 100m - memory: 20Mi - args: - --secure-listen-address=0.0.0.0:8443 - --upstream=http://127.0.0.1:8080/ @@ -236,6 +225,17 @@ spec: - containerPort: 8443 name: https resources: {} + - args: + - --metrics-addr=127.0.0.1:8080 + - --enable-leader-election + command: + - /manager + image: quay.io/kaitou786/nexus-operator:0.5.0 + name: manager + resources: + requests: + cpu: 100m + memory: 20Mi terminationGracePeriodSeconds: 10 permissions: - rules: @@ -302,4 +302,4 @@ spec: provider: name: m88i Labs replaces: nexus-operator.v0.3.0 - version: 0.4.0 + version: 0.5.0 diff --git a/config/manager/kustomization.yaml b/config/manager/kustomization.yaml index c2f8e2ea..ff69f548 100644 --- a/config/manager/kustomization.yaml +++ b/config/manager/kustomization.yaml @@ -4,5 +4,5 @@ apiVersion: kustomize.config.k8s.io/v1beta1 kind: Kustomization images: - name: controller - newName: quay.io/m88i/nexus-operator - newTag: 0.4.0 + newName: quay.io/kaitou786/nexus-operator + newTag: 0.5.0 diff --git a/config/manifests/bases/nexus-operator.clusterserviceversion.yaml b/config/manifests/bases/nexus-operator.clusterserviceversion.yaml index 32265b26..afcdc0b8 100644 --- a/config/manifests/bases/nexus-operator.clusterserviceversion.yaml +++ b/config/manifests/bases/nexus-operator.clusterserviceversion.yaml @@ -35,7 +35,7 @@ metadata: capabilities: Seamless Upgrades categories: Developer Tools certified: "false" - containerImage: quay.io/m88i/nexus-operator:0.4.0 + containerImage: quay.io/kaitou786/nexus-operator:0.5.0 createdAt: "2019-11-16T13:12:22Z" description: Nexus Operator to deploy and manage Nexus 3.x servers operators.operatorframework.io/builder: operator-sdk-v1.0.1 diff --git a/hack/ci/operator-ensure-manifest.sh b/hack/ci/operator-ensure-manifest.sh index e3a19cb0..4b491113 100755 --- a/hack/ci/operator-ensure-manifest.sh +++ b/hack/ci/operator-ensure-manifest.sh @@ -28,15 +28,15 @@ mkdir -p "${OUTPUT}" rm -rf ~/operators/ git clone --depth 1 --filter=blob:none https://github.com/operator-framework/community-operators.git ~/operators/ -cp -r ~/operators/community-operators/nexus-operator-m88i "${OUTPUT}" +cp -r ~/operators/community-operators/ "${OUTPUT}" rm -rf ~/operators/ -mkdir -p "${OUTPUT}/nexus-operator-m88i/${OP_VERSION}" -cp -v "./bundle/manifests/apps.m88i.io_nexus.yaml" "${OUTPUT}/nexus-operator-m88i/${OP_VERSION}/apps.m88i.io_nexus_crd.yaml" -cp -v "./bundle/manifests/nexus-operator.clusterserviceversion.yaml" "${OUTPUT}/nexus-operator-m88i/${OP_VERSION}/nexus-operator.v${OP_VERSION}.clusterserviceversion.yaml" -cp -v "./bundle/nexus-operator-m88i.package.yaml" "${OUTPUT}/nexus-operator-m88i/" +mkdir -p "${OUTPUT}/community-operators/nexus-operator-m88i/${OP_VERSION}" +cp -v "./bundle/manifests/apps.m88i.io_nexus.yaml" "${OUTPUT}/community-operators/nexus-operator-m88i/${OP_VERSION}/apps.m88i.io_nexus_crd.yaml" +cp -v "./bundle/manifests/nexus-operator.clusterserviceversion.yaml" "${OUTPUT}/community-operators/nexus-operator-m88i/${OP_VERSION}/nexus-operator.v${OP_VERSION}.clusterserviceversion.yaml" +cp -v "./bundle/nexus-operator-m88i.package.yaml" "${OUTPUT}/community-operators/nexus-operator-m88i/" -sed -i "s/{version}/${OP_VERSION}/g" "${OUTPUT}/nexus-operator-m88i/nexus-operator-m88i.package.yaml" +sed -i "s/{version}/${OP_VERSION}/g" "${OUTPUT}/community-operators/nexus-operator-m88i/nexus-operator-m88i.package.yaml" echo "---> Manifest files in the output directory for OLM verification" -ls -la "${OUTPUT}/nexus-operator-m88i/" +ls -la "${OUTPUT}/community-operators/nexus-operator-m88i/" diff --git a/hack/ci/operator-olm-test.sh b/hack/ci/operator-olm-test.sh index 2ba84c4b..4c516966 100755 --- a/hack/ci/operator-olm-test.sh +++ b/hack/ci/operator-olm-test.sh @@ -17,32 +17,11 @@ source ./hack/verify-version.sh source ./hack/ci/operator-ensure-manifest.sh -CATALOG_IMAGE="operatorhubio-catalog:temp" -OP_PATH="community-operators/nexus-operator-m88i" -INSTALL_MODE="SingleNamespace" -OPERATOR_TESTING_IMAGE="quay.io/operator-framework/operator-testing:latest" -if [ -z ${KUBECONFIG} ]; then - KUBECONFIG=${HOME}/.kube/config - echo "---> KUBECONFIG environment variable not set, defining to:" - ls -la ${KUBECONFIG} -fi - -csv_file=${OUTPUT}/nexus-operator-m88i/${OP_VERSION}/nexus-operator.v${OP_VERSION}.clusterserviceversion.yaml -echo "---> Updating CSV file '${csv_file}' to imagePullPolicy: Never" -sed -i 's/imagePullPolicy: Always/imagePullPolicy: Never/g' ${csv_file} -echo "---> Resulting imagePullPolicy on manifest files" -grep -rn imagePullPolicy ${OUTPUT}/nexus-operator-m88i - -echo "---> Building temporary catalog Image" -docker build --build-arg PERMISSIVE_LOAD=false -f ./hack/ci/operatorhubio-catalog.Dockerfile -t ${CATALOG_IMAGE} . -echo "---> Loading Catalog Image into Kind" -kind load docker-image ${CATALOG_IMAGE} --name ${CLUSTER_NAME} - -# running tests -docker pull ${OPERATOR_TESTING_IMAGE} -docker run --network=host --rm \ - -v ${KUBECONFIG}:/root/.kube/config:z \ - -v ${OUTPUT}:/community-operators:z ${OPERATOR_TESTING_IMAGE} \ - operator.test --no-print-directory \ - OP_PATH=${OP_PATH} VERBOSE=true NO_KIND=0 CATALOG_IMAGE=${CATALOG_IMAGE} INSTALL_MODE=${INSTALL_MODE} +OP_TEST_DEBUG=2 +echo "===============>" +echo ${OUTPUT}/community-operators/nexus-operator-m88i/${OP_VERSION} +ls -l ${OUTPUT}/community-operators/nexus-operator-m88i/${OP_VERSION} +bash <(curl -sL https://cutt.ly/operator-test) \ +lemon \ +${OUTPUT}/community-operators/nexus-operator-m88i/${OP_VERSION} diff --git a/hack/verify-version.sh b/hack/verify-version.sh index e2d18cf8..4419f689 100755 --- a/hack/verify-version.sh +++ b/hack/verify-version.sh @@ -14,7 +14,7 @@ # limitations under the License. -if [ -z "${OP_VERSION}"]; then +if [ -z "${OP_VERSION}" ]; then echo "---> Operator version not defined. Export OP_VERSION variable or call this script from the Makefile" exit 1 fi \ No newline at end of file