Skip to content

Commit

Permalink
Fixes
Browse files Browse the repository at this point in the history
Signed-off-by: Anatolii Bazko <[email protected]>
  • Loading branch information
tolusha committed Jun 14, 2021
1 parent 5f86f7e commit 79b1f5a
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -86,13 +86,13 @@ metadata:
categories: Developer Tools
certified: "false"
containerImage: quay.io/eclipse/che-operator:nightly
createdAt: "2021-06-11T10:04:22Z"
createdAt: "2021-06-14T08:25:08Z"
description: A Kube-native development solution that delivers portable and collaborative
developer workspaces.
operatorframework.io/suggested-namespace: eclipse-che
repository: https://github.com/eclipse-che/che-operator
support: Eclipse Foundation
name: eclipse-che-preview-kubernetes.v7.32.0-200.nightly
name: eclipse-che-preview-kubernetes.v7.32.0-206.nightly
namespace: placeholder
spec:
apiservicedefinitions: {}
Expand Down Expand Up @@ -1056,9 +1056,7 @@ spec:
- name: MAX_CONCURRENT_RECONCILES
value: "1"
- name: CONTROLLER_SERVICE_ACCOUNT_NAME
valueFrom:
fieldRef:
fieldPath: spec.serviceAccountName
value: devworkspace-controller-serviceaccount
- name: RELATED_IMAGE_gateway
value: quay.io/eclipse/che--traefik:v2.3.2-6e6d4dc5a19afe06778ca092cdbbb98e31cb9f9c313edafa23f81a0e6ddf8a23
- name: RELATED_IMAGE_gateway_configurer
Expand Down Expand Up @@ -1242,4 +1240,4 @@ spec:
maturity: stable
provider:
name: Eclipse Foundation
version: 7.32.0-200.nightly
version: 7.32.0-206.nightly
Original file line number Diff line number Diff line change
Expand Up @@ -77,13 +77,13 @@ metadata:
categories: Developer Tools, OpenShift Optional
certified: "false"
containerImage: quay.io/eclipse/che-operator:nightly
createdAt: "2021-06-11T10:04:28Z"
createdAt: "2021-06-14T08:25:15Z"
description: A Kube-native development solution that delivers portable and collaborative
developer workspaces in OpenShift.
operatorframework.io/suggested-namespace: eclipse-che
repository: https://github.com/eclipse-che/che-operator
support: Eclipse Foundation
name: eclipse-che-preview-openshift.v7.32.0-200.nightly
name: eclipse-che-preview-openshift.v7.32.0-206.nightly
namespace: placeholder
spec:
apiservicedefinitions: {}
Expand Down Expand Up @@ -1125,9 +1125,7 @@ spec:
- name: MAX_CONCURRENT_RECONCILES
value: "1"
- name: CONTROLLER_SERVICE_ACCOUNT_NAME
valueFrom:
fieldRef:
fieldPath: spec.serviceAccountName
value: devworkspace-controller-serviceaccount
- name: RELATED_IMAGE_gateway
value: quay.io/eclipse/che--traefik:v2.3.2-6e6d4dc5a19afe06778ca092cdbbb98e31cb9f9c313edafa23f81a0e6ddf8a23
- name: RELATED_IMAGE_gateway_configurer
Expand Down Expand Up @@ -1319,4 +1317,4 @@ spec:
maturity: stable
provider:
name: Eclipse Foundation
version: 7.32.0-200.nightly
version: 7.32.0-206.nightly
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
#
# Copyright (c) 2019-2021 Red Hat, Inc.
# This program and the accompanying materials are made
# available under the terms of the Eclipse Public License 2.0
# which is available at https://www.eclipse.org/legal/epl-2.0/
#
# SPDX-License-Identifier: EPL-2.0
#
# Contributors:
# Red Hat, Inc. - initial API and implementation
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
Expand Down
4 changes: 1 addition & 3 deletions deploy/operator.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -149,9 +149,7 @@ spec:
- name: MAX_CONCURRENT_RECONCILES
value: "1"
- name: CONTROLLER_SERVICE_ACCOUNT_NAME
valueFrom:
fieldRef:
fieldPath: spec.serviceAccountName
value: devworkspace-controller-serviceaccount
- name: RELATED_IMAGE_gateway
value: quay.io/eclipse/che--traefik:v2.3.2-6e6d4dc5a19afe06778ca092cdbbb98e31cb9f9c313edafa23f81a0e6ddf8a23
- name: RELATED_IMAGE_gateway_configurer
Expand Down
19 changes: 13 additions & 6 deletions olm/update-resources.sh
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ generateCRD() {
"${OPERATOR_SDK_BINARY}" generate k8s
"${OPERATOR_SDK_BINARY}" generate crds --crd-version $version

addLicenseHeader ${ROOT_PROJECT_DIR}/deploy/crds/org.eclipse.che_checlusters_crd.yaml
ensureLicense ${ROOT_PROJECT_DIR}/deploy/crds/org.eclipse.che_checlusters_crd.yaml

if [[ $version == "v1" ]]; then
mv ${ROOT_PROJECT_DIR}/deploy/crds/org.eclipse.che_checlusters_crd.yaml ${ROOT_PROJECT_DIR}/deploy/crds/org_v1_che_crd.yaml
Expand Down Expand Up @@ -188,7 +188,11 @@ updateOperatorYaml() {
yq -riY ".spec.template.spec.containers[1].securityContext.readOnlyRootFilesystem = false" ${OPERATOR_YAML}
yq -riY ".spec.template.spec.containers[1].securityContext.capabilities.drop[0] = \"ALL\"" ${OPERATOR_YAML}

addLicenseHeader $OPERATOR_YAML
# update env variable
yq -riY "del( .spec.template.spec.containers[1].env[] | select(.name == \"CONTROLLER_SERVICE_ACCOUNT_NAME\") | .valueFrom)" ${OPERATOR_YAML}
yq -riY "( .spec.template.spec.containers[1].env[] | select(.name == \"CONTROLLER_SERVICE_ACCOUNT_NAME\") | .value) = \"devworkspace-controller-serviceaccount\"" ${OPERATOR_YAML}

ensureLicense $OPERATOR_YAML
}

updateDockerfile() {
Expand Down Expand Up @@ -319,9 +323,10 @@ updateNighltyBundle() {
yq -rY "." "${NEW_CSV}" > "${NEW_CSV}.old"
mv "${NEW_CSV}.old" "${NEW_CSV}"

addLicenseHeader "${NIGHTLY_BUNDLE_PATH}/manifests/che-operator.clusterserviceversion.yaml"
addLicenseHeader "${NIGHTLY_BUNDLE_PATH}/manifests/chemanagers.che.eclipse.org.CustomResourceDefinition.yaml"
addLicenseHeader "${NIGHTLY_BUNDLE_PATH}/manifests/devworkspaceroutings.controller.devfile.io.CustomResourceDefinition.yaml"
ensureLicense "${NIGHTLY_BUNDLE_PATH}/manifests/org_v1_che_crd.yaml"
ensureLicense "${NIGHTLY_BUNDLE_PATH}/manifests/che-operator.clusterserviceversion.yaml"
ensureLicense "${NIGHTLY_BUNDLE_PATH}/manifests/chemanagers.che.eclipse.org.CustomResourceDefinition.yaml"
ensureLicense "${NIGHTLY_BUNDLE_PATH}/manifests/devworkspaceroutings.controller.devfile.io.CustomResourceDefinition.yaml"
done
}

Expand All @@ -333,7 +338,8 @@ updateDW() {
-o ${ROOT_PROJECT_DIR}/deploy/crds/devworkspaceroutings.controller.devfile.io.CustomResourceDefinition.yaml
}

addLicenseHeader() {
ensureLicense() {
if [[ $(sed -n '/^#$/p;q' $1) != "#" ]]; then
echo -e "#
# Copyright (c) 2019-2021 Red Hat, Inc.
# This program and the accompanying materials are made
Expand All @@ -345,6 +351,7 @@ echo -e "#
# Contributors:
# Red Hat, Inc. - initial API and implementation
$(cat $1)" > $1
fi
}

checkOperatorSDKVersion
Expand Down

0 comments on commit 79b1f5a

Please sign in to comment.