chore: Create new channel to install Eclipse Che next in AllNamespaces mode with DWO dependency

Signed-off-by: Flavius Lacatusu <flacatus@redhat.com>
pull/1079/head
Flavius Lacatusu 2021-09-20 13:58:05 +02:00
parent ff8d7c9ee4
commit e4bf44f0e1
No known key found for this signature in database
GPG Key ID: 1F5C00691820AC13
14 changed files with 2733 additions and 5 deletions

View File

@ -38,6 +38,7 @@ jobs:
- name: Build and push images to quay.io
run: >
${GITHUB_WORKSPACE}/olm/buildAndPushBundleImages.sh -c 'next' -p 'openshift' &&
${GITHUB_WORKSPACE}/olm/buildAndPushBundleImages.sh -c 'next-all-namespaces' -p 'openshift' &&
${GITHUB_WORKSPACE}/olm/buildAndPushBundleImages.sh -c 'next' -p 'kubernetes'
env:
IMAGE_REGISTRY_HOST: quay.io

View File

@ -476,7 +476,7 @@ bundle: generate manifests kustomize ## Generate bundle manifests and metadata,
echo "[INFO] Updating OperatorHub bundle for platform '$${platform}'"
NEXT_BUNDLE_PATH=$$($(MAKE) getBundlePath platform="$${platform}" channel="next" -s)
NEXT_BUNDLE_PATH=$$($(MAKE) getBundlePath platform="$${platform}" channel="$${channel}" -s)
NEW_CSV=$${NEXT_BUNDLE_PATH}/manifests/che-operator.clusterserviceversion.yaml
newNextBundleVersion=$$(yq -r ".spec.version" "$${NEW_CSV}")
echo "[INFO] Creation new next bundle version: $${newNextBundleVersion}"
@ -484,7 +484,7 @@ bundle: generate manifests kustomize ## Generate bundle manifests and metadata,
createdAtOld=$$(yq -r ".metadata.annotations.createdAt" "$${NEW_CSV}")
BUNDLE_PACKAGE="eclipse-che-preview-$(platform)"
BUNDLE_DIR="bundle/$(DEFAULT_CHANNEL)/$${BUNDLE_PACKAGE}"
BUNDLE_DIR="bundle/"$${channel}"/$${BUNDLE_PACKAGE}"
GENERATED_CSV_NAME=$${BUNDLE_PACKAGE}.clusterserviceversion.yaml
DESIRED_CSV_NAME=che-operator.clusterserviceversion.yaml
GENERATED_CRD_NAME=org.eclipse.che_checlusters.yaml
@ -655,6 +655,31 @@ bundle: generate manifests kustomize ## Generate bundle manifests and metadata,
yq -riSY '(.spec.install.spec.deployments[0].spec.template.spec.containers[0].securityContext."runAsNonRoot") = true' "$${NEW_CSV}"
fi
# set InstallMode for next-all-namespaces
if [[ $${channel} == 'next-all-namespaces' ]];then
yq -Yi '.spec.installModes[] |= if .type=="OwnNamespace" then .supported |= false else . end' "$${NEW_CSV}"
yq -Yi '.spec.installModes[] |= if .type=="SingleNamespace" then .supported |= false else . end' "$${NEW_CSV}"
yq -Yi '.spec.installModes[] |= if .type=="MultiNamespace" then .supported |= false else . end' "$${NEW_CSV}"
yq -Yi '.spec.installModes[] |= if .type=="AllNamespaces" then .supported |= true else . end' "$${NEW_CSV}"
sed -ri 's|operatorframework.io/suggested-namespace: eclipse-che|operatorframework.io/suggested-namespace: openshift-operators|' "$${NEW_CSV}"
# Enable by default devWorkspace engine in `next-all-namespaces` channel
CSV_CR_SAMPLES=$$(yq -r ".metadata.annotations[\"alm-examples\"] | \
fromjson | \
( .[] | select(.kind == \"CheCluster\") | .spec.devWorkspace.enable) |= true" $${NEW_CSV} | sed -r 's/"/\\"/g')
yq -riY ".metadata.annotations[\"alm-examples\"] = \"$${CSV_CR_SAMPLES}\"" $${NEW_CSV}
# Set next-all-namespaces channel name
ANNOTATION_METADATA_YAML="$${NEXT_BUNDLE_PATH}/metadata/annotations.yaml"
sed \
-e 's/operators.operatorframework.io.bundle.channels.v1: *next/operators.operatorframework.io.bundle.channels.v1: 'next-all-namespaces'/' \
-e 's/operators.operatorframework.io.bundle.channel.default.v1: *next/operators.operatorframework.io.bundle.channel.default.v1: 'next-all-namespaces'/' \
-i "$${ANNOTATION_METADATA_YAML}"
# Set specific OpenShift version
echo -e "\n com.redhat.openshift.versions: \"v4.8\"" >> "$${ANNOTATION_METADATA_YAML}"
fi
# Base cluster service version file has got correctly sorted CRDs.
# They are sorted with help of annotation markers in the api type files ("api/v1" folder).
# Example such annotation: +operator-sdk:csv:customresourcedefinitions:order=0
@ -695,7 +720,7 @@ increment-next-version:
exit 1
fi
NEXT_BUNDLE_PATH=$$($(MAKE) getBundlePath platform="$(platform)" channel="next" -s)
NEXT_BUNDLE_PATH=$$($(MAKE) getBundlePath platform="$(platform)" channel="$(channel)" -s)
OPM_BUNDLE_MANIFESTS_DIR="$${NEXT_BUNDLE_PATH}/manifests"
CSV="$${OPM_BUNDLE_MANIFESTS_DIR}/che-operator.clusterserviceversion.yaml"
@ -753,9 +778,16 @@ get-next-version-increment:
update-resources: SHELL := /bin/bash
update-resources: check-requirements update-resource-images update-roles
for platform in 'kubernetes' 'openshift'
for platform in 'openshift' 'kubernetes'
do
$(MAKE) bundle "platform=$${platform}"
for channel in 'next-all-namespaces' 'next'
do
# Skip next-all-namespaces in kubernetes platform, is not supported
if [[ $${channel} == "next-all-namespaces" && $${platform} == "kubernetes" ]];then
continue
fi
$(MAKE) bundle "platform=$${platform}" "channel=$${channel}"
done
done
check-requirements:

View File

@ -0,0 +1,23 @@
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=eclipse-che-preview-openshift
LABEL operators.operatorframework.io.bundle.channels.v1=next-all-namespaces
LABEL operators.operatorframework.io.bundle.channel.default.v1=next-all-namespaces
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=go.kubebuilder.io/v3
# 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 manifests /manifests/
COPY metadata /metadata/
COPY tests/scorecard /tests/scorecard/
LABEL com.redhat.openshift.versions="v4.8"

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,9 @@
apiVersion: v1
kind: ServiceAccount
metadata:
creationTimestamp: null
labels:
app.kubernetes.io/component: che-operator
app.kubernetes.io/instance: che
app.kubernetes.io/name: che
name: che-operator

View File

@ -0,0 +1,9 @@
apiVersion: v1
kind: ServiceAccount
metadata:
creationTimestamp: null
labels:
app.kubernetes.io/component: che-operator
app.kubernetes.io/instance: che
app.kubernetes.io/name: che
name: default

View File

@ -0,0 +1,17 @@
apiVersion: v1
data:
controller_manager_config.yaml: |
apiVersion: controller-runtime.sigs.k8s.io/v1alpha1
kind: ControllerManagerConfig
health:
healthProbeBindAddress: :6789
metrics:
bindAddress: 127.0.0.1:60000
webhook:
port: 9443
leaderElection:
leaderElect: true
resourceName: e79b08a4.org.eclipse.che
kind: ConfigMap
metadata:
name: manager-config

View File

@ -0,0 +1,126 @@
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.4.1
creationTimestamp: null
name: chebackupserverconfigurations.org.eclipse.che
spec:
group: org.eclipse.che
names:
kind: CheBackupServerConfiguration
listKind: CheBackupServerConfigurationList
plural: chebackupserverconfigurations
singular: chebackupserverconfiguration
scope: Namespaced
versions:
- name: v1
schema:
openAPIV3Schema:
description: The `CheBackupServerConfiguration` custom resource allows defining and managing Eclipse Che Backup Server Configurations
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/sig-architecture/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/sig-architecture/api-conventions.md#types-kinds'
type: string
metadata:
type: object
spec:
description: CheBackupServerConfigurationSpec defines the desired state of CheBackupServerConfiguration Only one type of backup server is allowed to be configured per CR.
properties:
awss3:
description: Amazon S3 or compatible alternatives.
properties:
awsAccessKeySecretRef:
description: Reference to secret that contains awsAccessKeyId and awsSecretAccessKey keys.
type: string
hostname:
description: Server hostname, defaults to 's3.amazonaws.com'. Might be customized in case of alternative server.
type: string
port:
description: Backup server port. Usually default value is used. Might be customized in case of alternative server.
type: integer
protocol:
description: Protocol to use when connection to the server. Might be customized in case of alternative server.
type: string
repositoryPasswordSecretRef:
description: Holds reference to a secret with restic repository password under 'repo-password' field to encrypt / decrypt its content.
type: string
repositoryPath:
description: Bucket name and repository, e.g. bucket/repo
type: string
required:
- awsAccessKeySecretRef
- repositoryPasswordSecretRef
- repositoryPath
type: object
rest:
description: Rest backup server configuration.
properties:
credentialsSecretRef:
description: Secret that contains username and password fields to login into restic server. Note, each repository is encrypted with own password. See ResticRepoPasswordSecretRef field.
type: string
hostname:
description: Backup server host
type: string
port:
description: Backup server port
type: integer
protocol:
description: Protocol to use when connection to the server Defaults to https.
type: string
repositoryPasswordSecretRef:
description: Holds reference to a secret with restic repository password under 'repo-password' field to encrypt / decrypt its content.
type: string
repositoryPath:
description: Restic repository path
type: string
required:
- hostname
- repositoryPasswordSecretRef
type: object
sftp:
description: Sftp backup server configuration.
properties:
hostname:
description: Backup server host
type: string
port:
description: Backup server port
type: integer
repositoryPasswordSecretRef:
description: Holds reference to a secret with restic repository password under 'repo-password' field to encrypt / decrypt its content.
type: string
repositoryPath:
description: Restic repository path, relative or absolute, e.g. /srv/repo
type: string
sshKeySecretRef:
description: Private ssh key under 'ssh-privatekey' field for passwordless login
type: string
username:
description: User login on the remote server
type: string
required:
- hostname
- repositoryPasswordSecretRef
- repositoryPath
- sshKeySecretRef
- username
type: object
type: object
status:
description: CheBackupServerConfigurationStatus defines the observed state of CheBackupServerConfiguration
type: object
type: object
served: true
storage: true
subresources:
status: {}
status:
acceptedNames:
kind: ""
plural: ""
conditions: []
storedVersions: []

View File

@ -0,0 +1,69 @@
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.4.1
creationTimestamp: null
name: checlusterbackups.org.eclipse.che
spec:
group: org.eclipse.che
names:
kind: CheClusterBackup
listKind: CheClusterBackupList
plural: checlusterbackups
singular: checlusterbackup
scope: Namespaced
versions:
- name: v1
schema:
openAPIV3Schema:
description: The `CheClusterBackup` custom resource allows defining and managing Eclipse Che backup
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/sig-architecture/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/sig-architecture/api-conventions.md#types-kinds'
type: string
metadata:
type: object
spec:
description: CheClusterBackupSpec defines the desired state of CheClusterBackup
properties:
backupServerConfigRef:
description: Name of custom resource with a backup server configuration to use for this backup. Note, UseInternalBackupServer field can configure internal backup server automatically.
type: string
useInternalBackupServer:
description: Automatically setup pod with REST backup server and use the server in this configuration. Note, this flag takes precedence and will overwrite existing backup server configuration.
type: boolean
type: object
status:
description: CheClusterBackupStatus defines the observed state of CheClusterBackup
properties:
cheVersion:
description: Version that was backed up
type: string
message:
description: Message explaining the state of the backup or an error message
type: string
snapshotId:
description: Last backup snapshot ID
type: string
stage:
description: Describes backup progress
type: string
state:
description: 'Backup progress state: InProgress, Failed, Succeeded'
type: string
type: object
type: object
served: true
storage: true
subresources:
status: {}
status:
acceptedNames:
kind: ""
plural: ""
conditions: []
storedVersions: []

View File

@ -0,0 +1,63 @@
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.4.1
creationTimestamp: null
name: checlusterrestores.org.eclipse.che
spec:
group: org.eclipse.che
names:
kind: CheClusterRestore
listKind: CheClusterRestoreList
plural: checlusterrestores
singular: checlusterrestore
scope: Namespaced
versions:
- name: v1
schema:
openAPIV3Schema:
description: The `CheClusterRestore` custom resource allows defining and managing Eclipse Che restore
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/sig-architecture/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/sig-architecture/api-conventions.md#types-kinds'
type: string
metadata:
type: object
spec:
description: CheClusterRestoreSpec defines the desired state of CheClusterRestore
properties:
backupServerConfigRef:
description: Name of custom resource with a backup server configuration to use for this restore. Can be omitted if only one server configuration object exists within the namespace.
type: string
snapshotId:
description: If omitted, latest snapshot will be used.
type: string
type: object
status:
description: CheClusterRestoreStatus defines the observed state of CheClusterRestore
properties:
message:
description: Restore result or error message
type: string
stage:
description: Describes phase of restore progress
type: string
state:
description: 'Restore progress state: InProgress, Failed, Succeeded'
type: string
type: object
type: object
served: true
storage: true
subresources:
status: {}
status:
acceptedNames:
kind: ""
plural: ""
conditions: []
storedVersions: []

View File

@ -0,0 +1,17 @@
annotations:
# 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: eclipse-che-preview-openshift
operators.operatorframework.io.bundle.channels.v1: next-all-namespaces
operators.operatorframework.io.bundle.channel.default.v1: next-all-namespaces
operators.operatorframework.io.metrics.builder: operator-sdk-v1.6.1+git
operators.operatorframework.io.metrics.mediatype.v1: metrics+v1
operators.operatorframework.io.metrics.project_layout: go.kubebuilder.io/v3
# Annotations for testing.
operators.operatorframework.io.test.mediatype.v1: scorecard+v1
operators.operatorframework.io.test.config.v1: tests/scorecard/
com.redhat.openshift.versions: "v4.8"

View File

@ -0,0 +1,5 @@
dependencies:
- type: olm.package
value:
packageName: devworkspace-operator
version: ">=0.8.0"

View File

@ -0,0 +1,49 @@
apiVersion: scorecard.operatorframework.io/v1alpha3
kind: Configuration
metadata:
name: config
stages:
- parallel: true
tests:
- entrypoint:
- scorecard-test
- basic-check-spec
image: quay.io/operator-framework/scorecard-test:v1.7.1
labels:
suite: basic
test: basic-check-spec-test
- entrypoint:
- scorecard-test
- olm-bundle-validation
image: quay.io/operator-framework/scorecard-test:v1.7.1
labels:
suite: olm
test: olm-bundle-validation-test
- entrypoint:
- scorecard-test
- olm-crds-have-validation
image: quay.io/operator-framework/scorecard-test:v1.7.1
labels:
suite: olm
test: olm-crds-have-validation-test
- entrypoint:
- scorecard-test
- olm-crds-have-resources
image: quay.io/operator-framework/scorecard-test:v1.7.1
labels:
suite: olm
test: olm-crds-have-resources-test
- entrypoint:
- scorecard-test
- olm-spec-descriptors
image: quay.io/operator-framework/scorecard-test:v1.7.1
labels:
suite: olm
test: olm-spec-descriptors-test
- entrypoint:
- scorecard-test
- olm-status-descriptors
image: quay.io/operator-framework/scorecard-test:v1.7.1
labels:
suite: olm
test: olm-status-descriptors-test