Skip to content

Commit

Permalink
Issue vmware#128: Adopt bundle format for the Operator
Browse files Browse the repository at this point in the history
Support bundle format for NCP operator. Update bundle manifest files/
Dockerfile/Makefile for generating bundle image.
Current workflow is:
  1.Generate CSV files with tool faq.
  2.Build image contains CSV files.
  3.Index the image with version using tool opm.
After NCP operator finishes refactoring with new version of operator-sdk,
the workflow will be simplified to generating bundle image automatically
with operator-sdk.
  • Loading branch information
jwsui committed Sep 10, 2021
1 parent d31adea commit 768ba9a
Show file tree
Hide file tree
Showing 9 changed files with 1,218 additions and 0 deletions.
6 changes: 6 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,12 @@ build:
bin:
GOOS=linux $(GO) build -o $(BINDIR)/$(OPERATOR_NAME) $(GOFLAGS) -ldflags '$(LDFLAGS)' ./cmd/manager

.PHONY: bundle
bundle:
docker build -t $(BUNDLE_REPO)/$(BUNDLE_IMG_NAME):tmp -f bundle.Dockerfile .
docker push $(BUNDLE_REPO)/$(BUNDLE_IMG_NAME):tmp
opm index add --build-tool docker --bundles $(BUNDLE_REPO)/$(BUNDLE_IMG_NAME):tmp --tag $(BUNDLE_REPO)/$(BUNDLE_IMG_NAME):$(BUNDLE_VERSION)

.PHONY: test-unit
test-unit:
GOOS=linux $(GO) test -race -cover github.com/vmware/nsx-container-plugin-operator/pkg...
Expand Down
16 changes: 16 additions & 0 deletions bundle.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
FROM scratch

LABEL operators.operatorframework.io.bundle.mediatype.v1=registry+v1
LABEL operators.operatorframework.io.bundle.manifests.v1=manifests/
LABEL operators.operatorframework.io.bundle.metadata.v1=metadata/
LABEL operators.operatorframework.io.bundle.package.v1=nsx-container-plugin-operator
LABEL operators.operatorframework.io.bundle.channels.v1=alpha
LABEL operators.operatorframework.io.bundle.channel.default.v1=alpha
LABEL operators.operatorframework.io.test.config.v1=tests/scorecard/
LABEL operators.operatorframework.io.test.mediatype.v1=scorecard+v1

COPY bundle/manifests /manifests/
COPY bundle/metadata /metadata/
COPY bundle/tests/scorecard /tests/scorecard/
LABEL com.redhat.openshift.versions=v4.6,v4.7,v4.8
LABEL com.redhat.delivery.operator.bundle=true
Loading

0 comments on commit 768ba9a

Please sign in to comment.