Skip to content

Commit

Permalink
cleaning up
Browse files Browse the repository at this point in the history
Signed-off-by: Ricardo Zanini <[email protected]>
  • Loading branch information
ricardozanini committed Oct 12, 2020
1 parent b1d0143 commit e747a84
Show file tree
Hide file tree
Showing 5 changed files with 623 additions and 17 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/nexus-operator-integration-checks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ jobs:
- name: Cache testenv
uses: actions/cache@v2
with:
path: ${{ env.GOPATH }}/testbin
path: ${{ env.PATH }}/nexus-operator/testbin
key: ${{ runner.os }}-testbin-${{ env.OPERATOR_SDK_VERSION }}
restore-keys: |
${{ runner.os }}-testbin-${{ env.OPERATOR_SDK_VERSION }}
Expand Down
8 changes: 6 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -34,18 +34,22 @@ all: manager

# Run tests
ENVTEST_ASSETS_DIR=$(shell pwd)/testbin
test: generate fmt vet manifests bundle
test: generate-installer fmt vet bundle
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/master/hack/setup-envtest.sh
sed -i "s,#\!.*,#\!\/bin\/bash,g" ${ENVTEST_ASSETS_DIR}/setup-envtest.sh
sed -i "/pipefail/d" ${ENVTEST_ASSETS_DIR}/setup-envtest.sh
source ${ENVTEST_ASSETS_DIR}/setup-envtest.sh; fetch_envtest_tools $(ENVTEST_ASSETS_DIR); setup_envtest_env $(ENVTEST_ASSETS_DIR); go test ./... -coverprofile cover.out


# Run the OLM test on CI
ci-olm-test:
./hack/ci/load-operator-image.sh
./hack/ci/operator-olm-test.sh

generate-installer: generate manifests kustomize
cd config/manager && $(KUSTOMIZE) edit set image controller=$(OPERATOR_IMG)
$(KUSTOMIZE) build config/default > nexus-operator.yaml

# Build manager binary
manager: generate fmt vet
go build -o bin/manager main.go
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ If you have any questions please either [open an issue](https://github.com/m88i/

## Quick Install

The installation procedure will create a Namespace named `operators` and will install every resources needed for the operator to run:
The installation procedure will create a Namespace named `nexus-operator-system` and will install every resources needed for the operator to run:

```bash
# requires python and kubectl
Expand Down
19 changes: 6 additions & 13 deletions hack/uninstall.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,19 +14,12 @@
# limitations under the License.


NAMESPACE=nexus
VERSION=$1

echo "....... Uninstalling ......."
echo "....... Deleting CRDs......."
kubectl delete -f deploy/crds/apps.m88i.io_nexus_crd.yaml
if [ -z ${VERSION} ]; then
VERSION=$(curl https://api.github.com/repos/m88i/nexus-operator/releases/latest | python -c "import sys, json; print(json.load(sys.stdin)['tag_name'])")
fi

echo "....... Deleting Rules and Service Account ......."
kubectl delete -f deploy/role.yaml -n ${NAMESPACE}
kubectl delete -f deploy/role_binding.yaml -n ${NAMESPACE}
kubectl delete -f deploy/service_account.yaml -n ${NAMESPACE}
echo "....... Uninstall Nexus Operator ${VERSION} ......."

echo "....... Deleting Operator ......."
kubectl delete -f deploy/operator.yaml -n ${NAMESPACE}

echo "....... Deleting namespace ${NAMESPACE}......."
kubectl delete namespace ${NAMESPACE}
kubectl delete -f https://github.com/m88i/nexus-operator/releases/download/${VERSION}/nexus-operator.yaml
Loading

0 comments on commit e747a84

Please sign in to comment.