Merge pull request #1240 from hj-johannes-lee/operator-update-image-name

operator: update image name and version
This commit is contained in:
Mikko Ylinen 2022-11-14 07:26:14 +02:00 committed by GitHub
commit cc144c36df
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 25 additions and 26 deletions

View File

@ -8,7 +8,7 @@ Table of Contents
* [Build Container Images](#build-container-images) * [Build Container Images](#build-container-images)
* [Build Against a Newer Version of Kubernetes](#build-against-a-newer-version-of-kubernetes) * [Build Against a Newer Version of Kubernetes](#build-against-a-newer-version-of-kubernetes)
* [Work with Intel Device Plugins Operator Modifications](#work-with-intel-device-plugins-operator-modifications) * [Work with Intel Device Plugins Operator Modifications](#work-with-intel-device-plugins-operator-modifications)
* [Publish a New Version of the Intel Device Plugins Operator to operatorhub.io](#publish-a-new-version-of-the-intel-device-plugins-operator-to-operatorhub.io) * [Publish a New Version of the Intel Device Plugins Operator to operatorhub.io](#publish-a-new-version-of-the-intel-device-plugins-operator-to-operatorhubio)
* [Run E2E Tests](#run-e2e-tests) * [Run E2E Tests](#run-e2e-tests)
* [Run Controller Tests with a Local Control Plane](#run-controller-tests-with-a-local-control-plane) * [Run Controller Tests with a Local Control Plane](#run-controller-tests-with-a-local-control-plane)
* [How to Develop Simple Device Plugins](#how-to-develop-simple-device-plugins) * [How to Develop Simple Device Plugins](#how-to-develop-simple-device-plugins)
@ -126,9 +126,11 @@ There are few useful steps when working with changes to Device Plugins CRDs and
### Publish a New Version of the Intel Device Plugins Operator to operatorhub.io ### Publish a New Version of the Intel Device Plugins Operator to operatorhub.io
Update metadata.annotations.containerImage and metadata.annotations.createdAT fields in the base CSV manifest file Check if the fields mentioned below in the [base CSV manifest file](deployments/operator/manifests/bases/intel-device-plugins-operator.clusterserviceversion.yaml) have the correct values. If not, fix them manually (operator-sdk does not support updating these fields in any other way).
deployments/operator/manifests/bases/intel-device-plugins-operator.clusterserviceversion.yaml - spec.version
to match current operator version and current date - spec.replaces
- metadata.annotations.containerImage
- metadata.annotations.createdAT
Fork the [Community Operators](https://github.com/k8s-operatorhub/community-operators) repo and clone it: Fork the [Community Operators](https://github.com/k8s-operatorhub/community-operators) repo and clone it:
``` ```
@ -137,17 +139,19 @@ $ git clone https://github.com/<GitHub Username>/community-operators
Generate bundle and build bundle image: Generate bundle and build bundle image:
``` ```
$ make bundle OPERATOR_VERSION=0.X.Y CHANNELS=alpha DEFAULT_CHANNEL=alpha $ make bundle TAG=0.X.Y CHANNELS=alpha DEFAULT_CHANNEL=alpha
$ make bundle-build $ make bundle-build
``` ```
> **Note**: You need to push the image to a registry if you want to follow the verification process below. Push the image to a registry:
- If pushing to the Docker hub, specify `docker.io/` in front of the image name for running bundle.
- If pushing to the local registry, put the option `--use-http` for running bundle.
Verify the operator deployment works OK via OLM in your development cluster: Verify the operator deployment works OK via OLM in your development cluster:
``` ```
$ operator-sdk olm install $ operator-sdk olm install
$ kubectl create namespace testoperator $ kubectl create namespace testoperator
$ operator-sdk run bundle <Registry>/<Tag> -n testoperator --use-http $ operator-sdk run bundle <Registry>:<Tag> -n testoperator
# do verification checks # do verification checks
... ...
# do clean up # do clean up
@ -156,21 +160,18 @@ $ kubectl delete namespace testoperator
$ operator-sdk olm uninstall $ operator-sdk olm uninstall
``` ```
Review the package manifests by uploading the generated `packagemanifests` folder to Commit files:
https://operatorhub.io -> Contribute -> Package Your Operator.
Commit files
``` ```
$ cd community-operators $ cd community-operators
$ git add operators/intel-device-plugins-operator/0.X.Y $ git add operators/intel-device-plugins-operator/0.X.Y
$ git commit -am 'operators intel-device-plugins-operator (0.X.Y)' -S $ git commit -am 'operators intel-device-plugins-operator (0.X.Y)' -s
``` ```
Submit a PR Submit a PR to [Community Operators](https://github.com/k8s-operatorhub/community-operators) repo.
Check operator page Check operator page
https://operatorhub.io/operator/intel-device-plugins-operator https://operatorhub.io/operator/intel-device-plugins-operator
after PR is merged after PR is merged.
### Run E2E Tests ### Run E2E Tests

View File

@ -13,10 +13,8 @@ CONTROLLER_GEN_VERSION ?= v0.10.0
GOLANGCI_LINT_VERSION ?= v1.50.0 GOLANGCI_LINT_VERSION ?= v1.50.0
KIND_VERSION ?= v0.16.0 KIND_VERSION ?= v0.16.0
GOLICENSES_VERSION ?= v1.4.0 GOLICENSES_VERSION ?= v1.4.0
# Current Operator version
OPERATOR_VERSION ?= 0.24.0
# Default bundle image tag # Default bundle image tag
BUNDLE_IMG ?= intel-device-plugins-controller-bundle:$(OPERATOR_VERSION) BUNDLE_IMG ?= intel-device-plugins-controller-bundle:$(TAG)
# Options for 'bundle-build' # Options for 'bundle-build'
ifneq ($(origin CHANNELS), undefined) ifneq ($(origin CHANNELS), undefined)
BUNDLE_CHANNELS := --channels=$(CHANNELS) BUNDLE_CHANNELS := --channels=$(CHANNELS)
@ -26,7 +24,7 @@ BUNDLE_DEFAULT_CHANNEL := --default-channel=$(DEFAULT_CHANNEL)
endif endif
BUNDLE_METADATA_OPTS ?= $(BUNDLE_CHANNELS) $(BUNDLE_DEFAULT_CHANNEL) BUNDLE_METADATA_OPTS ?= $(BUNDLE_CHANNELS) $(BUNDLE_DEFAULT_CHANNEL)
OLM_MANIFESTS = deployments/operator/manifests OLM_MANIFESTS = deployments/operator/manifests
BUNDLE_DIR = community-operators/operators/intel-device-plugins-operator/$(OPERATOR_VERSION) BUNDLE_DIR = community-operators/operators/intel-device-plugins-operator/$(TAG)
TESTDATA_DIR = pkg/topology/testdata TESTDATA_DIR = pkg/topology/testdata
@ -122,7 +120,7 @@ bundle:
rm -rf $(BUNDLE_DIR) rm -rf $(BUNDLE_DIR)
mkdir -p $(BUNDLE_DIR) mkdir -p $(BUNDLE_DIR)
$(OPERATOR_SDK) generate kustomize manifests -q --input-dir $(OLM_MANIFESTS) --output-dir $(OLM_MANIFESTS) --apis-dir pkg/apis $(OPERATOR_SDK) generate kustomize manifests -q --input-dir $(OLM_MANIFESTS) --output-dir $(OLM_MANIFESTS) --apis-dir pkg/apis
$(KUSTOMIZE) build $(OLM_MANIFESTS) | sed "s|intel-deviceplugin-operator:devel|intel-deviceplugin-operator:$(OPERATOR_VERSION)|" | $(OPERATOR_SDK) generate bundle -q --overwrite --kustomize-dir $(OLM_MANIFESTS) --version $(OPERATOR_VERSION) $(BUNDLE_METADATA_OPTS) --output-dir . $(KUSTOMIZE) build $(OLM_MANIFESTS) | sed "s|intel-deviceplugin-operator:devel|intel-deviceplugin-operator:$(TAG)|" | $(OPERATOR_SDK) generate bundle -q --overwrite --kustomize-dir $(OLM_MANIFESTS) --version $(TAG) $(BUNDLE_METADATA_OPTS) --output-dir .
# Remove unneeded resources # Remove unneeded resources
rm manifests/*service.yaml rm manifests/*service.yaml
rm manifests/*clusterrole.yaml rm manifests/*clusterrole.yaml

View File

@ -23,7 +23,7 @@ spec:
control-plane: controller-manager control-plane: controller-manager
spec: spec:
containers: containers:
- image: intel/intel-deviceplugin-operator:devel - image: docker.io/intel/intel-deviceplugin-operator:devel
imagePullPolicy: IfNotPresent imagePullPolicy: IfNotPresent
name: manager name: manager
livenessProbe: livenessProbe:

View File

@ -5,15 +5,15 @@ metadata:
alm-examples: '[]' alm-examples: '[]'
capabilities: Seamless Upgrades capabilities: Seamless Upgrades
categories: Drivers and plugins categories: Drivers and plugins
containerImage: intel/intel-deviceplugin-operator:0.24.0 containerImage: docker.io/intel/intel-deviceplugin-operator:0.25.0
createdAt: "2022-05-20" createdAt: "2022-11-09"
description: This operator is a Kubernetes custom controller whose goal is to description: This operator is a Kubernetes custom controller whose goal is to
serve the installation and lifecycle management of Intel device plugins for serve the installation and lifecycle management of Intel device plugins for
Kubernetes. Kubernetes.
operators.operatorframework.io/builder: operator-sdk-v1.20.0 operators.operatorframework.io/builder: operator-sdk-v1.25.0
operators.operatorframework.io/project_layout: go.kubebuilder.io/v2 operators.operatorframework.io/project_layout: go.kubebuilder.io/v2
repository: https://github.com/intel/intel-device-plugins-for-kubernetes repository: https://github.com/intel/intel-device-plugins-for-kubernetes
name: intel-device-plugins-operator.v0.24.0 name: intel-device-plugins-operator.v0.25.0
namespace: placeholder namespace: placeholder
spec: spec:
apiservicedefinitions: {} apiservicedefinitions: {}
@ -122,5 +122,5 @@ spec:
provider: provider:
name: Intel® Corporation name: Intel® Corporation
url: https://intel.com url: https://intel.com
replaces: intel-device-plugins-operator.v0.23.0 replaces: intel-device-plugins-operator.v0.24.0
version: 0.24.0 version: 0.25.0