Skip to content

Commit

Permalink
Add operatorhub/Makefile for operator bundle gen
Browse files Browse the repository at this point in the history
Add a Makefile to run bundle generator tool in operatorhub/tools

Add a script to install `operator-sdk`

Add a first draft of README.md

Signed-off-by: Nikhil Thomas <[email protected]>
  • Loading branch information
nikhil-thomas committed Sep 3, 2021
1 parent 3ccf28b commit ee0a2cb
Show file tree
Hide file tree
Showing 24 changed files with 320 additions and 328 deletions.
19 changes: 2 additions & 17 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
include operatorhub/Makefile

MODULE = $(shell env GO111MODULE=on $(GO) list -m)
DATE ?= $(shell date +%FT%T%z)
KO_DATA_PATH = $(shell pwd)/cmd/$(TARGET)/operator/kodata
Expand Down Expand Up @@ -109,20 +111,3 @@ generated: | vendor ; $(info $(M) update generated files) ## Update generated fi
vendor: ; $(info $(M) update vendor folder) ## Update vendor folder
$Q ./hack/update-deps.sh

.PHONY: bundlegen
bundlegen:
mkdir csv-stub
kustomize build ../../config/olm-csv-stubs/overlays/openshift > csv-stub/csv-stub.yaml
pwd
kustomize build ../../config/olm-bundle-config/openshift | operator-sdk generate bundle \
--channels stable,preview \
--default-channel stable \
--kustomize-dir csv-stub \
--overwrite \
--package openshift-pipelines-operator-rh \
--version 0.22.0-1
rm -rf csv-stub


bundle:
$(MAKE) -C operatorhub/openshift --file ../../Makefile bundlegen
1 change: 0 additions & 1 deletion config/base/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ resources:
- 300-operator_v1alpha1_pipeline_crd.yaml
- 300-operator_v1alpha1_trigger_crd.yaml
- 300-operator_v1alpha1_config_crd.yaml
- 300-operator_v1alpha1_result_crd.yaml
- 500-webhooks.yaml
- config-logging.yaml
- tekton-config-defaults.yaml
Expand Down
1 change: 1 addition & 0 deletions config/crs/kubernetes/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- dashboard/operator_v1alpha1_dashboard_cr.yaml
- result/operator_v1alpha1_result_cr.yaml
- pipeline/operator_v1alpha1_pipeline_cr.yaml
- trigger/operator_v1alpha1_trigger_cr.yaml
- config/all/operator_v1alpha1_config_cr.yaml
1 change: 1 addition & 0 deletions config/kubernetes/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,5 @@ kind: Kustomization
resources:
- ../base/
- ../base/300-operator_v1alpha1_dashboard_crd.yaml
- ../base/300-operator_v1alpha1_result_crd.yaml
- service_account.yaml
2 changes: 1 addition & 1 deletion config/kubernetes/operator.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,6 @@ spec:
- name: OPERATOR_NAME
value: "tekton-operator"
- name: IMAGE_PIPELINES_PROXY
value: ko://github.com/tektoncd/operator/cmd/kubernetes/proxy-webhook
value: ko://github.com/tektoncd/operator/cmd/kubernetes/proxy-webhook
- name: IMAGE_JOB_PRUNER_TKN
value: gcr.io/tekton-releases/dogfooding/tkn@sha256:f69a02ef099d8915e9e4ea1b74e43b7a9309fc97cf23cb457ebf191e73491677
12 changes: 12 additions & 0 deletions operatorhub/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
BUNDLE_ARGS := $(or ${BUNDLE_ARGS},--help)

OPERATOR_SDK = $(or ${OPERATOR_SDK_BIN},$(BIN)/operator-sdk)

$(BIN)/operator-sdk: | $(BIN) ; $(info $(M) getting operator-sdk)
ls $(BIN)
@./operatorhub/tools/install_operator-sdk.sh $(BIN)

.PHONY: operator-bundle
operator-bundle: | $(OPERATOR_SDK)
@$(info BUNDLE_ARGS: $(BUNDLE_ARGS))
@OPERATOR_SDK=$(OPERATOR_SDK) operatorhub/tools/bundle.py ${BUNDLE_ARGS}
9 changes: 9 additions & 0 deletions operatorhub/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Generating Bundles (release artifact) for OperatorHub

1. From project root run:

```bash
export BUNDLE_ARGS="--workspace=operatorhub/kubernetes --operator-release-version=1.1.1 --channels=a,b --default-channel=a --fetch-strategy-local --upgrade-strategy-semver"
make bundle
```

2 changes: 1 addition & 1 deletion operatorhub/kubernetes/release-artifacts/bundle.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ LABEL operators.operatorframework.io.bundle.metadata.v1=metadata/
LABEL operators.operatorframework.io.bundle.package.v1=tektoncd-operator
LABEL operators.operatorframework.io.bundle.channels.v1=a,b
LABEL operators.operatorframework.io.bundle.channel.default.v1=a
LABEL operators.operatorframework.io.metrics.builder=operator-sdk-v1.8.0
LABEL operators.operatorframework.io.metrics.builder=operator-sdk-v1.7.1+git
LABEL operators.operatorframework.io.metrics.mediatype.v1=metrics+v1
LABEL operators.operatorframework.io.metrics.project_layout=unknown

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ metadata:
creationTimestamp: null
labels:
operator.tekton.dev/release: devel
version: 0.24.1-1
version: devel
name: tektonconfigs.operator.tekton.dev
spec:
group: operator.tekton.dev
Expand All @@ -26,80 +26,8 @@ spec:
schema:
openAPIV3Schema:
description: Schema for the tektonconfigs API
properties:
apiVersion:
description: 'APIVersion defines the versioned schema of this representation
of an object. Servers should convert recognized schemas to the latest
internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#resources'
type: string
kind:
description: 'Kind is a string value representing the REST resource this
object represents. Servers may infer this from the endpoint the client
submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds'
type: string
metadata:
type: object
spec:
description: Spec defines the desired state of TektonConfig
properties:
profile:
description: based on the type of profile where tekton components
will be installed
type: string
targetNamespace:
description: namespace where tekton components will be installed
type: string
type: object
status:
description: Status defines the observed state of TektonConfig
properties:
conditions:
description: The latest available observations of a resource's current
state.
items:
properties:
lastTransitionTime:
description: LastTransitionTime is the last time the condition
transitioned from one status to another. We use VolatileTime
in place of metav1.Time to exclude this from creating equality.Semantic
differences (all other things held constant).
type: string
message:
description: A human readable message indicating details about
the transition.
type: string
reason:
description: The reason for the condition's last transition.
type: string
severity:
description: Severity with which to treat failures of this type
of condition. When this is not specified, it defaults to Error.
type: string
status:
description: Status of the condition, one of True, False, Unknown.
type: string
type:
description: Type of condition.
type: string
required:
- type
- status
type: object
type: array
manifests:
description: The list of tektonconfig manifests, which have been installed
by the operator
items:
type: string
type: array
observedGeneration:
description: The generation last processed by the controller
type: integer
version:
description: The version of the installed release
type: string
type: object
type: object
x-kubernetes-preserve-unknown-fields: true
served: true
storage: true
subresources:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ metadata:
creationTimestamp: null
labels:
operator.tekton.dev/release: devel
version: 0.24.1-1
version: devel
name: tektondashboards.operator.tekton.dev
spec:
group: operator.tekton.dev
Expand All @@ -29,76 +29,8 @@ spec:
schema:
openAPIV3Schema:
description: Schema for the tektondashboards API
properties:
apiVersion:
description: 'APIVersion defines the versioned schema of this representation
of an object. Servers should convert recognized schemas to the latest
internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#resources'
type: string
kind:
description: 'Kind is a string value representing the REST resource this
object represents. Servers may infer this from the endpoint the client
submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds'
type: string
metadata:
type: object
spec:
description: Spec defines the desired state of TektonDashboard
properties:
targetNamespace:
description: namespace where tekton dashboard will be installed
type: string
type: object
status:
description: Status defines the observed state of TektonDashboard
properties:
conditions:
description: The latest available observations of a resource's current
state.
items:
properties:
lastTransitionTime:
description: LastTransitionTime is the last time the condition
transitioned from one status to another. We use VolatileTime
in place of metav1.Time to exclude this from creating equality.Semantic
differences (all other things held constant).
type: string
message:
description: A human readable message indicating details about
the transition.
type: string
reason:
description: The reason for the condition's last transition.
type: string
severity:
description: Severity with which to treat failures of this type
of condition. When this is not specified, it defaults to Error.
type: string
status:
description: Status of the condition, one of True, False, Unknown.
type: string
type:
description: Type of condition.
type: string
required:
- type
- status
type: object
type: array
manifests:
description: The list of dashboard manifests, which have been installed
by the operator
items:
type: string
type: array
observedGeneration:
description: The generation last processed by the controller
type: integer
version:
description: The version of the installed release
type: string
type: object
type: object
x-kubernetes-preserve-unknown-fields: true
served: true
storage: true
subresources:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ metadata:
creationTimestamp: null
labels:
operator.tekton.dev/release: devel
version: 0.24.1-1
version: devel
name: tektonpipelines.operator.tekton.dev
spec:
group: operator.tekton.dev
Expand All @@ -29,76 +29,8 @@ spec:
schema:
openAPIV3Schema:
description: Schema for the tektonpipelines API
properties:
apiVersion:
description: 'APIVersion defines the versioned schema of this representation
of an object. Servers should convert recognized schemas to the latest
internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#resources'
type: string
kind:
description: 'Kind is a string value representing the REST resource this
object represents. Servers may infer this from the endpoint the client
submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds'
type: string
metadata:
type: object
spec:
description: Spec defines the desired state of TektonPipeline
properties:
targetNamespace:
description: namespace where tekton pipelines will be installed
type: string
type: object
status:
description: Status defines the observed state of TektonPipeline
properties:
conditions:
description: The latest available observations of a resource's current
state.
items:
properties:
lastTransitionTime:
description: LastTransitionTime is the last time the condition
transitioned from one status to another. We use VolatileTime
in place of metav1.Time to exclude this from creating equality.Semantic
differences (all other things held constant).
type: string
message:
description: A human readable message indicating details about
the transition.
type: string
reason:
description: The reason for the condition's last transition.
type: string
severity:
description: Severity with which to treat failures of this type
of condition. When this is not specified, it defaults to Error.
type: string
status:
description: Status of the condition, one of True, False, Unknown.
type: string
type:
description: Type of condition.
type: string
required:
- type
- status
type: object
type: array
manifests:
description: The list of pipeline manifests, which have been installed
by the operator
items:
type: string
type: array
observedGeneration:
description: The generation last processed by the controller
type: integer
version:
description: The version of the installed release
type: string
type: object
type: object
x-kubernetes-preserve-unknown-fields: true
served: true
storage: true
subresources:
Expand Down
Loading

0 comments on commit ee0a2cb

Please sign in to comment.