Add operator-sdk to bingo targets (#14)

Co-authored-by: Periklis Tsirakidis <periklis@redhat.com>
pull/4881/head
Periklis Tsirakidis 4 years ago committed by GitHub
parent 11f699c5a6
commit b31c3316fe
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 6
      .bingo/Variables.mk
  2. 13
      .bingo/operator-sdk.mod
  3. 2
      .bingo/variables.env
  4. 8
      Makefile
  5. 9
      PROJECT
  6. 9
      bundle.Dockerfile
  7. 43
      bundle/manifests/loki-operator.clusterserviceversion.yaml
  8. 11
      bundle/metadata/annotations.yaml
  9. 2
      config/manager/kustomization.yaml

@ -47,3 +47,9 @@ $(KUSTOMIZE): $(BINGO_DIR)/kustomize.mod
@echo "(re)installing $(GOBIN)/kustomize-v3.8.7"
@cd $(BINGO_DIR) && $(GO) build -mod=mod -modfile=kustomize.mod -o=$(GOBIN)/kustomize-v3.8.7 "sigs.k8s.io/kustomize/kustomize/v3"
OPERATOR_SDK := $(GOBIN)/operator-sdk-v1.5.0
$(OPERATOR_SDK): $(BINGO_DIR)/operator-sdk.mod
@# Install binary/ries using Go 1.14+ build command. This is using bwplotka/bingo-controlled, separate go module with pinned dependencies.
@echo "(re)installing $(GOBIN)/operator-sdk-v1.5.0"
@cd $(BINGO_DIR) && $(GO) build -mod=mod -modfile=operator-sdk.mod -o=$(GOBIN)/operator-sdk-v1.5.0 "github.com/operator-framework/operator-sdk/cmd/operator-sdk"

@ -0,0 +1,13 @@
module _ // Auto generated by https://github.com/bwplotka/bingo. DO NOT EDIT
go 1.16
replace github.com/Azure/go-autorest => github.com/Azure/go-autorest v14.2.0+incompatible
replace github.com/containerd/containerd => github.com/containerd/containerd v1.4.3
replace github.com/mattn/go-sqlite3 => github.com/mattn/go-sqlite3 v1.10.0
replace golang.org/x/text => golang.org/x/text v0.3.3
require github.com/operator-framework/operator-sdk v1.5.0 // cmd/operator-sdk

@ -18,3 +18,5 @@ GOLANGCI_LINT="${GOBIN}/golangci-lint-v1.38.0"
KUSTOMIZE="${GOBIN}/kustomize-v3.8.7"
OPERATOR_SDK="${GOBIN}/operator-sdk-v1.5.0"

@ -115,11 +115,11 @@ oci-push:
# Generate bundle manifests and metadata, then validate generated files.
.PHONY: bundle
bundle: manifests $(KUSTOMIZE)
operator-sdk generate kustomize manifests -q
bundle: manifests $(KUSTOMIZE) $(OPERATOR_SDK)
$(OPERATOR_SDK) generate kustomize manifests -q
cd config/manager && $(KUSTOMIZE) edit set image controller=$(IMG)
$(KUSTOMIZE) build config/manifests | operator-sdk generate bundle -q --overwrite --version $(VERSION) $(BUNDLE_METADATA_OPTS)
operator-sdk bundle validate ./bundle
$(KUSTOMIZE) build config/manifests | $(OPERATOR_SDK) generate bundle -q --overwrite --version $(VERSION) $(BUNDLE_METADATA_OPTS)
$(OPERATOR_SDK) bundle validate ./bundle
# Build the bundle image.
.PHONY: bundle-build

@ -3,11 +3,16 @@ layout: go.kubebuilder.io/v3
projectName: loki-operator
repo: github.com/ViaQ/loki-operator
resources:
- crdVersion: v1beta1
- api:
crdVersion: v1beta1
namespaced: true
controller: true
domain: openshift.io
group: loki
kind: LokiStack
path: github.com/ViaQ/loki-operator/api/v1beta1
version: v1beta1
version: 3-alpha
version: "3"
plugins:
manifests.sdk.operatorframework.io/v2: {}
scorecard.sdk.operatorframework.io/v2: {}

@ -1,15 +1,20 @@
FROM scratch
# Core bundle labels.
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=loki-operator
LABEL operators.operatorframework.io.bundle.channels.v1=alpha
LABEL operators.operatorframework.io.metrics.builder=operator-sdk-v1.4.0
LABEL operators.operatorframework.io.metrics.mediatype.v1=metrics+v1
LABEL operators.operatorframework.io.metrics.builder=operator-sdk-unknown
LABEL operators.operatorframework.io.metrics.project_layout=go.kubebuilder.io/v3
LABEL operators.operatorframework.io.test.config.v1=tests/scorecard/
# Labels for testing.
LABEL operators.operatorframework.io.test.mediatype.v1=scorecard+v1
LABEL operators.operatorframework.io.test.config.v1=tests/scorecard/
# Copy files to locations specified by labels.
COPY bundle/manifests /manifests/
COPY bundle/metadata /metadata/
COPY bundle/tests/scorecard /tests/scorecard/

@ -16,7 +16,7 @@ metadata:
}
]
capabilities: Basic Install
operators.operatorframework.io/builder: operator-sdk-v1.4.0
operators.operatorframework.io/builder: operator-sdk-unknown
operators.operatorframework.io/project_layout: go.kubebuilder.io/v3
name: loki-operator.v0.0.1
namespace: placeholder
@ -38,6 +38,34 @@ spec:
spec:
clusterPermissions:
- rules:
- apiGroups:
- ""
resources:
- configmaps
- endpoints
- nodes
- pods
- services
verbs:
- create
- delete
- get
- list
- patch
- update
- watch
- apiGroups:
- apps
resources:
- deployments
verbs:
- create
- delete
- get
- list
- patch
- update
- watch
- apiGroups:
- loki.openshift.io
resources:
@ -64,6 +92,19 @@ spec:
- get
- patch
- update
- apiGroups:
- rbac.authorization.k8s.io
resources:
- clusterrolebindings
- clusterroles
verbs:
- create
- delete
- get
- list
- patch
- update
- watch
- apiGroups:
- authentication.k8s.io
resources:

@ -1,11 +1,14 @@
annotations:
operators.operatorframework.io.bundle.channels.v1: alpha
operators.operatorframework.io.bundle.manifests.v1: manifests/
# Core bundle annotations.
operators.operatorframework.io.bundle.mediatype.v1: registry+v1
operators.operatorframework.io.bundle.manifests.v1: manifests/
operators.operatorframework.io.bundle.metadata.v1: metadata/
operators.operatorframework.io.bundle.package.v1: loki-operator
operators.operatorframework.io.metrics.builder: operator-sdk-v1.4.0
operators.operatorframework.io.bundle.channels.v1: alpha
operators.operatorframework.io.metrics.mediatype.v1: metrics+v1
operators.operatorframework.io.metrics.builder: operator-sdk-unknown
operators.operatorframework.io.metrics.project_layout: go.kubebuilder.io/v3
operators.operatorframework.io.test.config.v1: tests/scorecard/
# Annotations for testing.
operators.operatorframework.io.test.mediatype.v1: scorecard+v1
operators.operatorframework.io.test.config.v1: tests/scorecard/

@ -13,4 +13,4 @@ kind: Kustomization
images:
- name: controller
newName: quay.io/blockloop/loki-operator
newTag: "1616165734"
newTag: latest

Loading…
Cancel
Save