feat: Create editors definitions configmaps
Signed-off-by: Anatolii Bazko <abazko@redhat.com>pull/1838/head
parent
5ad8b51f42
commit
ccae74e71e
|
|
@ -37,11 +37,11 @@ COPY go.sum go.sum
|
|||
# Copy the go source
|
||||
COPY main.go main.go
|
||||
COPY vendor/ vendor/
|
||||
COPY mocks/ mocks/
|
||||
COPY api/ api/
|
||||
COPY config/ config/
|
||||
COPY controllers/ controllers/
|
||||
COPY pkg/ pkg/
|
||||
COPY editors-definitions /tmp/editors-definitions
|
||||
|
||||
# build operator
|
||||
# to test FIPS compliance, run https://github.com/openshift/check-payload#scan-a-container-or-operator-image against a built image
|
||||
|
|
@ -53,6 +53,7 @@ RUN export ARCH="$(uname -m)" && if [[ ${ARCH} == "x86_64" ]]; then export ARCH=
|
|||
FROM registry.access.redhat.com/ubi8-minimal:8.9-1161
|
||||
|
||||
COPY --from=builder /tmp/header-rewrite-traefik-plugin /tmp/header-rewrite-traefik-plugin
|
||||
COPY --from=builder /tmp/editors-definitions /tmp/editors-definitions
|
||||
COPY --from=builder /che-operator/che-operator /manager
|
||||
|
||||
ENTRYPOINT ["/manager"]
|
||||
|
|
|
|||
8
Makefile
8
Makefile
|
|
@ -359,7 +359,7 @@ genenerate-env:
|
|||
cat $(BASH_ENV_FILE)
|
||||
|
||||
install-che-operands: SHELL := /bin/bash
|
||||
install-che-operands: generate manifests download-kustomize download-gateway-resources
|
||||
install-che-operands: generate manifests download-kustomize download-gateway-resources copy-editors-definitions
|
||||
echo "[INFO] Running on $(PLATFORM)"
|
||||
if [[ ! "$$($(K8S_CLI) get checluster eclipse-che -n $(ECLIPSE_CHE_NAMESPACE) || false )" ]]; then
|
||||
[[ $(PLATFORM) == "kubernetes" ]] && $(MAKE) install-certmgr
|
||||
|
|
@ -378,6 +378,12 @@ install-che-operands: generate manifests download-kustomize download-gateway-res
|
|||
$(MAKE) store_tls_cert
|
||||
$(MAKE) create-checluster-cr
|
||||
|
||||
|
||||
# Copy editors definitions to /tmp/editors-definitions
|
||||
copy-editors-definitions:
|
||||
mkdir -p /tmp/editors-definitions
|
||||
cp -r $(PROJECT_DIR)/editors-definitions/* /tmp/editors-definitions
|
||||
|
||||
# Downloads Gateway resources
|
||||
download-gateway-resources:
|
||||
GATEWAY_RESOURCES=/tmp/header-rewrite-traefik-plugin
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ package v2
|
|||
import (
|
||||
"github.com/devfile/api/v2/pkg/apis/workspaces/v1alpha2"
|
||||
"github.com/devfile/devworkspace-operator/apis/controller/v1alpha1"
|
||||
v1 "k8s.io/api/core/v1"
|
||||
"k8s.io/api/core/v1"
|
||||
"k8s.io/apimachinery/pkg/runtime"
|
||||
)
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,80 @@
|
|||
#!/bin/bash
|
||||
#
|
||||
# Copyright (c) 2019-2024 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
|
||||
#
|
||||
|
||||
set -e
|
||||
|
||||
OPERATOR_REPO=$(dirname "$(dirname "$(dirname "$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")")")")
|
||||
EDITORS_DEFINITIONS_DIR="${OPERATOR_REPO}/editors-definitions"
|
||||
MANAGER_YAML="${OPERATOR_REPO}/config/manager/manager.yaml"
|
||||
|
||||
init() {
|
||||
unset VERSION
|
||||
unset ENVS
|
||||
|
||||
COMMAND=$1
|
||||
shift
|
||||
|
||||
while [[ "$#" -gt 0 ]]; do
|
||||
case $1 in
|
||||
'--version') VERSION=$2; shift 1;;
|
||||
esac
|
||||
shift 1
|
||||
done
|
||||
}
|
||||
|
||||
usage () {
|
||||
echo "Editor definitions utils."
|
||||
echo
|
||||
echo "Usage:"
|
||||
echo -e "\t$0 release --version RELEASE_VERSION"
|
||||
echo -e "\t$0 add-env-vars"
|
||||
}
|
||||
|
||||
release() {
|
||||
if [[ ! ${VERSION} ]]; then usage; exit 1; fi
|
||||
|
||||
yq -riY ".metadata.attributes.version = \"${VERSION}\"" "${EDITORS_DEFINITIONS_DIR}/che-code-latest.yaml"
|
||||
yq -riY "(.components[] | select(.name==\"che-code-injector\") | .container.image) = \"quay.io/che-incubator/che-code:${VERSION}\"" "${EDITORS_DEFINITIONS_DIR}/che-code-latest.yaml"
|
||||
}
|
||||
|
||||
addEnvVars() {
|
||||
for EDITOR_DEFINITION_FILE in $(find "${EDITORS_DEFINITIONS_DIR}" -name "*.yaml"); do
|
||||
NAME=$(yq -r '.metadata.name' "${EDITOR_DEFINITION_FILE}")
|
||||
VERSION=$(yq -r '.metadata.attributes.version' "${EDITOR_DEFINITION_FILE}")
|
||||
for COMPONENT in $(yq -r '.components[] | .name' "${EDITOR_DEFINITION_FILE}"); do
|
||||
ENV_VALUE=$(yq -r ".components[] | select(.name==\"${COMPONENT}\") | .container.image" "${EDITOR_DEFINITION_FILE}")
|
||||
ENV_NAME=$(echo "RELATED_IMAGE_editor_definition_${NAME}_${VERSION}_${COMPONENT}" | sed 's|[-\.]|_|g')
|
||||
|
||||
if [[ ! ${ENV_VALUE} == "null" ]]; then
|
||||
ENV="{ name: \"${ENV_NAME}\", value: \"${ENV_VALUE}\"}"
|
||||
if [[ -z ${ENVS} ]]; then
|
||||
ENVS="${ENV}"
|
||||
else
|
||||
ENVS="${ENVS}, ${ENV}"
|
||||
fi
|
||||
fi
|
||||
done
|
||||
done
|
||||
|
||||
yq -riY "(.spec.template.spec.containers[0].env ) += [${ENVS}]" "${MANAGER_YAML}"
|
||||
}
|
||||
|
||||
init "$@"
|
||||
|
||||
pushd "${OPERATOR_REPO}" >/dev/null
|
||||
case $COMMAND in
|
||||
'release') release;;
|
||||
'add-env-vars') release;;
|
||||
*) usage; exit 1;;
|
||||
esac
|
||||
popd >/dev/null
|
||||
|
|
@ -179,6 +179,17 @@ replaceTag() {
|
|||
echo "${1}" | sed -e "s/\(.*:\).*/\1${2}/"
|
||||
}
|
||||
|
||||
releaseEditorsDefinitions() {
|
||||
echo "[INFO] Releasing editor definitions"
|
||||
|
||||
. "${OPERATOR_REPO}/build/scripts/release/editors-definitions.sh" release --version "${RELEASE}"
|
||||
. "${OPERATOR_REPO}/build/scripts/release/editors-definitions.sh" add-env-vars
|
||||
|
||||
git add editors-definitions
|
||||
git add "${OPERATOR_REPO}/config/manager/manager.yaml"
|
||||
git commit -m "ci: Release editors definitions to $RELEASE" --signoff
|
||||
}
|
||||
|
||||
updateVersionFile() {
|
||||
echo "[INFO] updating version.go file"
|
||||
# change version/version.go file
|
||||
|
|
@ -268,7 +279,7 @@ createPRToMainBranch() {
|
|||
resetChanges main
|
||||
local tmpBranch="copy-csv-to-main"
|
||||
git checkout -B $tmpBranch
|
||||
git diff refs/heads/${BRANCH}...refs/heads/${RELEASE_BRANCH} ':(exclude)config/manager/manager.yaml' ':(exclude)deploy' ':(exclude)Dockerfile' | git apply -3
|
||||
git diff refs/heads/${BRANCH}...refs/heads/${RELEASE_BRANCH} ':(exclude)config/manager/manager.yaml' ':(exclude)deploy' ':(exclude)editors-definitions' ':(exclude)Dockerfile' | git apply -3
|
||||
if git status --porcelain; then
|
||||
git add -A || true # add new generated CSV files in olm/ folder
|
||||
git commit -am "ci: Copy "$RELEASE" csv to main" --signoff
|
||||
|
|
@ -291,6 +302,7 @@ run() {
|
|||
|
||||
checkoutToReleaseBranch
|
||||
updateVersionFile
|
||||
releaseEditorsDefinitions
|
||||
releaseOperatorCode
|
||||
if [[ $RELEASE_OLM_FILES == "true" ]]; then
|
||||
releaseOlmFiles
|
||||
|
|
|
|||
|
|
@ -0,0 +1,145 @@
|
|||
#
|
||||
# Copyright (c) 2019-2023 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
|
||||
#
|
||||
|
||||
schemaVersion: 2.2.2
|
||||
metadata:
|
||||
name: che-code
|
||||
displayName: VS Code - Open Source
|
||||
description: Microsoft Visual Studio Code - Open Source IDE for Eclipse Che - Insiders
|
||||
build
|
||||
tags:
|
||||
- Tech-Preview
|
||||
attributes:
|
||||
publisher: che-incubator
|
||||
version: insiders
|
||||
title: Microsoft Visual Studio Code - Open Source IDE for Eclipse Che - Insiders
|
||||
build
|
||||
repository: https://github.com/che-incubator/che-code
|
||||
firstPublicationDate: '2021-10-31'
|
||||
icon-mediatype: image/svg+xml
|
||||
icon-data: |
|
||||
<svg width="100" height="100" viewBox="0 0 100 100" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<mask id="mask0" mask-type="alpha" maskUnits="userSpaceOnUse" x="0" y="0" width="100" height="100">
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M70.9119 99.3171C72.4869 99.9307 74.2828 99.8914 75.8725 99.1264L96.4608 89.2197C98.6242 88.1787 100 85.9892 100 83.5872V16.4133C100 14.0113 98.6243 11.8218 96.4609 10.7808L75.8725 0.873756C73.7862 -0.130129 71.3446 0.11576 69.5135 1.44695C69.252 1.63711 69.0028 1.84943 68.769 2.08341L29.3551 38.0415L12.1872 25.0096C10.589 23.7965 8.35363 23.8959 6.86933 25.2461L1.36303 30.2549C-0.452552 31.9064 -0.454633 34.7627 1.35853 36.417L16.2471 50.0001L1.35853 63.5832C-0.454633 65.2374 -0.452552 68.0938 1.36303 69.7453L6.86933 74.7541C8.35363 76.1043 10.589 76.2037 12.1872 74.9905L29.3551 61.9587L68.769 97.9167C69.3925 98.5406 70.1246 99.0104 70.9119 99.3171ZM75.0152 27.2989L45.1091 50.0001L75.0152 72.7012V27.2989Z" fill="white"/>
|
||||
</mask>
|
||||
<g mask="url(#mask0)">
|
||||
<path d="M96.4614 10.7962L75.8569 0.875542C73.4719 -0.272773 70.6217 0.211611 68.75 2.08333L1.29858 63.5832C-0.515693 65.2373 -0.513607 68.0937 1.30308 69.7452L6.81272 74.754C8.29793 76.1042 10.5347 76.2036 12.1338 74.9905L93.3609 13.3699C96.086 11.3026 100 13.2462 100 16.6667V16.4275C100 14.0265 98.6246 11.8378 96.4614 10.7962Z" fill="#0065A9"/>
|
||||
<g filter="url(#filter0_d)">
|
||||
<path d="M96.4614 89.2038L75.8569 99.1245C73.4719 100.273 70.6217 99.7884 68.75 97.9167L1.29858 36.4169C-0.515693 34.7627 -0.513607 31.9063 1.30308 30.2548L6.81272 25.246C8.29793 23.8958 10.5347 23.7964 12.1338 25.0095L93.3609 86.6301C96.086 88.6974 100 86.7538 100 83.3334V83.5726C100 85.9735 98.6246 88.1622 96.4614 89.2038Z" fill="#007ACC"/>
|
||||
</g>
|
||||
<g filter="url(#filter1_d)">
|
||||
<path d="M75.8578 99.1263C73.4721 100.274 70.6219 99.7885 68.75 97.9166C71.0564 100.223 75 98.5895 75 95.3278V4.67213C75 1.41039 71.0564 -0.223106 68.75 2.08329C70.6219 0.211402 73.4721 -0.273666 75.8578 0.873633L96.4587 10.7807C98.6234 11.8217 100 14.0112 100 16.4132V83.5871C100 85.9891 98.6234 88.1786 96.4586 89.2196L75.8578 99.1263Z" fill="#1F9CF0"/>
|
||||
</g>
|
||||
<g style="mix-blend-mode:overlay" opacity="0.25">
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M70.8511 99.3171C72.4261 99.9306 74.2221 99.8913 75.8117 99.1264L96.4 89.2197C98.5634 88.1787 99.9392 85.9892 99.9392 83.5871V16.4133C99.9392 14.0112 98.5635 11.8217 96.4001 10.7807L75.8117 0.873695C73.7255 -0.13019 71.2838 0.115699 69.4527 1.44688C69.1912 1.63705 68.942 1.84937 68.7082 2.08335L29.2943 38.0414L12.1264 25.0096C10.5283 23.7964 8.29285 23.8959 6.80855 25.246L1.30225 30.2548C-0.513334 31.9064 -0.515415 34.7627 1.29775 36.4169L16.1863 50L1.29775 63.5832C-0.515415 65.2374 -0.513334 68.0937 1.30225 69.7452L6.80855 74.754C8.29285 76.1042 10.5283 76.2036 12.1264 74.9905L29.2943 61.9586L68.7082 97.9167C69.3317 98.5405 70.0638 99.0104 70.8511 99.3171ZM74.9544 27.2989L45.0483 50L74.9544 72.7012V27.2989Z" fill="url(#paint0_linear)"/>
|
||||
</g>
|
||||
</g>
|
||||
<defs>
|
||||
<filter id="filter0_d" x="-8.39411" y="15.8291" width="116.727" height="92.2456" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB">
|
||||
<feFlood flood-opacity="0" result="BackgroundImageFix"/>
|
||||
<feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0"/>
|
||||
<feOffset/>
|
||||
<feGaussianBlur stdDeviation="4.16667"/>
|
||||
<feColorMatrix type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.25 0"/>
|
||||
<feBlend mode="overlay" in2="BackgroundImageFix" result="effect1_dropShadow"/>
|
||||
<feBlend mode="normal" in="SourceGraphic" in2="effect1_dropShadow" result="shape"/>
|
||||
</filter>
|
||||
<filter id="filter1_d" x="60.4167" y="-8.07558" width="47.9167" height="116.151" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB">
|
||||
<feFlood flood-opacity="0" result="BackgroundImageFix"/>
|
||||
<feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0"/>
|
||||
<feOffset/>
|
||||
<feGaussianBlur stdDeviation="4.16667"/>
|
||||
<feColorMatrix type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.25 0"/>
|
||||
<feBlend mode="overlay" in2="BackgroundImageFix" result="effect1_dropShadow"/>
|
||||
<feBlend mode="normal" in="SourceGraphic" in2="effect1_dropShadow" result="shape"/>
|
||||
</filter>
|
||||
<linearGradient id="paint0_linear" x1="49.9392" y1="0.257812" x2="49.9392" y2="99.7423" gradientUnits="userSpaceOnUse">
|
||||
<stop stop-color="white"/>
|
||||
<stop offset="1" stop-color="white" stop-opacity="0"/>
|
||||
</linearGradient>
|
||||
</defs>
|
||||
</svg>
|
||||
commands:
|
||||
- id: init-container-command
|
||||
apply:
|
||||
component: che-code-injector
|
||||
- id: init-che-code-command
|
||||
exec:
|
||||
component: che-code-runtime-description
|
||||
commandLine: nohup /checode/entrypoint-volume.sh > /checode/entrypoint-logs.txt
|
||||
2>&1 &
|
||||
events:
|
||||
preStart:
|
||||
- init-container-command
|
||||
postStart:
|
||||
- init-che-code-command
|
||||
components:
|
||||
- name: che-code-injector
|
||||
container:
|
||||
image: quay.io/che-incubator/che-code:insiders
|
||||
command:
|
||||
- /entrypoint-init-container.sh
|
||||
volumeMounts:
|
||||
- name: checode
|
||||
path: /checode
|
||||
memoryLimit: 256Mi
|
||||
memoryRequest: 32Mi
|
||||
cpuLimit: 500m
|
||||
cpuRequest: 30m
|
||||
- name: che-code-runtime-description
|
||||
container:
|
||||
image: quay.io/devfile/universal-developer-image:latest
|
||||
memoryLimit: 1024Mi
|
||||
memoryRequest: 256Mi
|
||||
cpuLimit: 500m
|
||||
cpuRequest: 30m
|
||||
volumeMounts:
|
||||
- name: checode
|
||||
path: /checode
|
||||
endpoints:
|
||||
- name: che-code
|
||||
attributes:
|
||||
type: main
|
||||
cookiesAuthEnabled: true
|
||||
discoverable: false
|
||||
urlRewriteSupported: true
|
||||
targetPort: 3100
|
||||
exposure: public
|
||||
secure: true
|
||||
protocol: https
|
||||
- name: code-redirect-1
|
||||
targetPort: 13131
|
||||
exposure: public
|
||||
protocol: https
|
||||
attributes:
|
||||
discoverable: false
|
||||
urlRewriteSupported: false
|
||||
- name: code-redirect-2
|
||||
targetPort: 13132
|
||||
exposure: public
|
||||
protocol: https
|
||||
attributes:
|
||||
discoverable: false
|
||||
urlRewriteSupported: false
|
||||
- name: code-redirect-3
|
||||
targetPort: 13133
|
||||
exposure: public
|
||||
protocol: https
|
||||
attributes:
|
||||
discoverable: false
|
||||
urlRewriteSupported: false
|
||||
attributes:
|
||||
app.kubernetes.io/component: che-code-runtime
|
||||
app.kubernetes.io/part-of: che-code.eclipse.org
|
||||
controller.devfile.io/container-contribution: true
|
||||
- name: checode
|
||||
volume: {}
|
||||
|
|
@ -0,0 +1,131 @@
|
|||
schemaVersion: 2.2.2
|
||||
metadata:
|
||||
name: che-code
|
||||
displayName: VS Code - Open Source
|
||||
description: Microsoft Visual Studio Code - Open Source IDE for Eclipse Che
|
||||
attributes:
|
||||
publisher: che-incubator
|
||||
version: latest
|
||||
title: Microsoft Visual Studio Code - Open Source IDE for Eclipse Che
|
||||
repository: https://github.com/che-incubator/che-code
|
||||
firstPublicationDate: '2021-10-31'
|
||||
icon-mediatype: image/svg+xml
|
||||
icon-data: |
|
||||
<svg width="100" height="100" viewBox="0 0 100 100" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<mask id="mask0" mask-type="alpha" maskUnits="userSpaceOnUse" x="0" y="0" width="100" height="100">
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M70.9119 99.3171C72.4869 99.9307 74.2828 99.8914 75.8725 99.1264L96.4608 89.2197C98.6242 88.1787 100 85.9892 100 83.5872V16.4133C100 14.0113 98.6243 11.8218 96.4609 10.7808L75.8725 0.873756C73.7862 -0.130129 71.3446 0.11576 69.5135 1.44695C69.252 1.63711 69.0028 1.84943 68.769 2.08341L29.3551 38.0415L12.1872 25.0096C10.589 23.7965 8.35363 23.8959 6.86933 25.2461L1.36303 30.2549C-0.452552 31.9064 -0.454633 34.7627 1.35853 36.417L16.2471 50.0001L1.35853 63.5832C-0.454633 65.2374 -0.452552 68.0938 1.36303 69.7453L6.86933 74.7541C8.35363 76.1043 10.589 76.2037 12.1872 74.9905L29.3551 61.9587L68.769 97.9167C69.3925 98.5406 70.1246 99.0104 70.9119 99.3171ZM75.0152 27.2989L45.1091 50.0001L75.0152 72.7012V27.2989Z" fill="white"/>
|
||||
</mask>
|
||||
<g mask="url(#mask0)">
|
||||
<path d="M96.4614 10.7962L75.8569 0.875542C73.4719 -0.272773 70.6217 0.211611 68.75 2.08333L1.29858 63.5832C-0.515693 65.2373 -0.513607 68.0937 1.30308 69.7452L6.81272 74.754C8.29793 76.1042 10.5347 76.2036 12.1338 74.9905L93.3609 13.3699C96.086 11.3026 100 13.2462 100 16.6667V16.4275C100 14.0265 98.6246 11.8378 96.4614 10.7962Z" fill="#0065A9"/>
|
||||
<g filter="url(#filter0_d)">
|
||||
<path d="M96.4614 89.2038L75.8569 99.1245C73.4719 100.273 70.6217 99.7884 68.75 97.9167L1.29858 36.4169C-0.515693 34.7627 -0.513607 31.9063 1.30308 30.2548L6.81272 25.246C8.29793 23.8958 10.5347 23.7964 12.1338 25.0095L93.3609 86.6301C96.086 88.6974 100 86.7538 100 83.3334V83.5726C100 85.9735 98.6246 88.1622 96.4614 89.2038Z" fill="#007ACC"/>
|
||||
</g>
|
||||
<g filter="url(#filter1_d)">
|
||||
<path d="M75.8578 99.1263C73.4721 100.274 70.6219 99.7885 68.75 97.9166C71.0564 100.223 75 98.5895 75 95.3278V4.67213C75 1.41039 71.0564 -0.223106 68.75 2.08329C70.6219 0.211402 73.4721 -0.273666 75.8578 0.873633L96.4587 10.7807C98.6234 11.8217 100 14.0112 100 16.4132V83.5871C100 85.9891 98.6234 88.1786 96.4586 89.2196L75.8578 99.1263Z" fill="#1F9CF0"/>
|
||||
</g>
|
||||
<g style="mix-blend-mode:overlay" opacity="0.25">
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M70.8511 99.3171C72.4261 99.9306 74.2221 99.8913 75.8117 99.1264L96.4 89.2197C98.5634 88.1787 99.9392 85.9892 99.9392 83.5871V16.4133C99.9392 14.0112 98.5635 11.8217 96.4001 10.7807L75.8117 0.873695C73.7255 -0.13019 71.2838 0.115699 69.4527 1.44688C69.1912 1.63705 68.942 1.84937 68.7082 2.08335L29.2943 38.0414L12.1264 25.0096C10.5283 23.7964 8.29285 23.8959 6.80855 25.246L1.30225 30.2548C-0.513334 31.9064 -0.515415 34.7627 1.29775 36.4169L16.1863 50L1.29775 63.5832C-0.515415 65.2374 -0.513334 68.0937 1.30225 69.7452L6.80855 74.754C8.29285 76.1042 10.5283 76.2036 12.1264 74.9905L29.2943 61.9586L68.7082 97.9167C69.3317 98.5405 70.0638 99.0104 70.8511 99.3171ZM74.9544 27.2989L45.0483 50L74.9544 72.7012V27.2989Z" fill="url(#paint0_linear)"/>
|
||||
</g>
|
||||
</g>
|
||||
<defs>
|
||||
<filter id="filter0_d" x="-8.39411" y="15.8291" width="116.727" height="92.2456" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB">
|
||||
<feFlood flood-opacity="0" result="BackgroundImageFix"/>
|
||||
<feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0"/>
|
||||
<feOffset/>
|
||||
<feGaussianBlur stdDeviation="4.16667"/>
|
||||
<feColorMatrix type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.25 0"/>
|
||||
<feBlend mode="overlay" in2="BackgroundImageFix" result="effect1_dropShadow"/>
|
||||
<feBlend mode="normal" in="SourceGraphic" in2="effect1_dropShadow" result="shape"/>
|
||||
</filter>
|
||||
<filter id="filter1_d" x="60.4167" y="-8.07558" width="47.9167" height="116.151" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB">
|
||||
<feFlood flood-opacity="0" result="BackgroundImageFix"/>
|
||||
<feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0"/>
|
||||
<feOffset/>
|
||||
<feGaussianBlur stdDeviation="4.16667"/>
|
||||
<feColorMatrix type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.25 0"/>
|
||||
<feBlend mode="overlay" in2="BackgroundImageFix" result="effect1_dropShadow"/>
|
||||
<feBlend mode="normal" in="SourceGraphic" in2="effect1_dropShadow" result="shape"/>
|
||||
</filter>
|
||||
<linearGradient id="paint0_linear" x1="49.9392" y1="0.257812" x2="49.9392" y2="99.7423" gradientUnits="userSpaceOnUse">
|
||||
<stop stop-color="white"/>
|
||||
<stop offset="1" stop-color="white" stop-opacity="0"/>
|
||||
</linearGradient>
|
||||
</defs>
|
||||
</svg>
|
||||
commands:
|
||||
- id: init-container-command
|
||||
apply:
|
||||
component: che-code-injector
|
||||
- id: init-che-code-command
|
||||
exec:
|
||||
component: che-code-runtime-description
|
||||
commandLine: nohup /checode/entrypoint-volume.sh > /checode/entrypoint-logs.txt
|
||||
2>&1 &
|
||||
events:
|
||||
preStart:
|
||||
- init-container-command
|
||||
postStart:
|
||||
- init-che-code-command
|
||||
components:
|
||||
- name: che-code-injector
|
||||
container:
|
||||
image: quay.io/che-incubator/che-code:latest
|
||||
command:
|
||||
- /entrypoint-init-container.sh
|
||||
volumeMounts:
|
||||
- name: checode
|
||||
path: /checode
|
||||
memoryLimit: 256Mi
|
||||
memoryRequest: 32Mi
|
||||
cpuLimit: 500m
|
||||
cpuRequest: 30m
|
||||
- name: che-code-runtime-description
|
||||
container:
|
||||
image: quay.io/devfile/universal-developer-image:latest
|
||||
memoryLimit: 1024Mi
|
||||
memoryRequest: 256Mi
|
||||
cpuLimit: 500m
|
||||
cpuRequest: 30m
|
||||
volumeMounts:
|
||||
- name: checode
|
||||
path: /checode
|
||||
endpoints:
|
||||
- name: che-code
|
||||
attributes:
|
||||
type: main
|
||||
cookiesAuthEnabled: true
|
||||
discoverable: false
|
||||
urlRewriteSupported: true
|
||||
targetPort: 3100
|
||||
exposure: public
|
||||
secure: true
|
||||
protocol: https
|
||||
- name: code-redirect-1
|
||||
targetPort: 13131
|
||||
exposure: public
|
||||
protocol: https
|
||||
attributes:
|
||||
discoverable: false
|
||||
urlRewriteSupported: false
|
||||
- name: code-redirect-2
|
||||
targetPort: 13132
|
||||
exposure: public
|
||||
protocol: https
|
||||
attributes:
|
||||
discoverable: false
|
||||
urlRewriteSupported: false
|
||||
- name: code-redirect-3
|
||||
targetPort: 13133
|
||||
exposure: public
|
||||
protocol: https
|
||||
attributes:
|
||||
discoverable: false
|
||||
urlRewriteSupported: false
|
||||
attributes:
|
||||
app.kubernetes.io/component: che-code-runtime
|
||||
app.kubernetes.io/part-of: che-code.eclipse.org
|
||||
controller.devfile.io/container-contribution: true
|
||||
- name: checode
|
||||
volume: {}
|
||||
attributes:
|
||||
version: null
|
||||
|
|
@ -0,0 +1,166 @@
|
|||
#
|
||||
# Copyright (c) 2019-2023 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
|
||||
#
|
||||
|
||||
schemaVersion: 2.2.2
|
||||
metadata:
|
||||
name: che-idea
|
||||
displayName: IntelliJ IDEA Community
|
||||
description: JetBrains IntelliJ IDEA Community IDE for Eclipse Che
|
||||
tags:
|
||||
- Tech-Preview
|
||||
attributes:
|
||||
publisher: che-incubator
|
||||
version: latest
|
||||
title: JetBrains IntelliJ IDEA Community IDE for Eclipse Che
|
||||
repository: https://github.com/che-incubator/jetbrains-editor-images
|
||||
firstPublicationDate: '2022-01-11'
|
||||
icon-mediatype: image/svg+xml
|
||||
icon-data: |
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="70" height="70" fill="none" viewBox="0 0 70 70">
|
||||
<defs>
|
||||
<linearGradient id="a" x1="5.17435" x2="40.0136" y1="39.8894" y2="38.1233" gradientUnits="userSpaceOnUse">
|
||||
<stop offset="0.0910927" stop-color="#FC801D"/>
|
||||
<stop offset="0.2312" stop-color="#B07F61"/>
|
||||
<stop offset="0.4086" stop-color="#577DB3"/>
|
||||
<stop offset="0.5334" stop-color="#1E7CE6"/>
|
||||
<stop offset="0.5934" stop-color="#087CFA"/>
|
||||
</linearGradient>
|
||||
<linearGradient id="b" x1="61.991" x2="50.158" y1="36.9152" y2="1.55723" gradientUnits="userSpaceOnUse">
|
||||
<stop offset="0" stop-color="#FE2857"/>
|
||||
<stop offset="0.0784" stop-color="#CB3979"/>
|
||||
<stop offset="0.1601" stop-color="#9E4997"/>
|
||||
<stop offset="0.2474" stop-color="#7557B2"/>
|
||||
<stop offset="0.3392" stop-color="#5362C8"/>
|
||||
<stop offset="0.4365" stop-color="#386CDA"/>
|
||||
<stop offset="0.5414" stop-color="#2373E8"/>
|
||||
<stop offset="0.6576" stop-color="#1478F2"/>
|
||||
<stop offset="0.794" stop-color="#0B7BF8"/>
|
||||
<stop offset="1" stop-color="#087CFA"/>
|
||||
</linearGradient>
|
||||
<linearGradient id="c" x1="10.0665" x2="53.8764" y1="16.4955" y2="88.9597" gradientUnits="userSpaceOnUse">
|
||||
<stop offset="0" stop-color="#FE2857"/>
|
||||
<stop offset="0.0800816" stop-color="#FE295F"/>
|
||||
<stop offset="0.2065" stop-color="#FF2D76"/>
|
||||
<stop offset="0.3034" stop-color="#FF318C"/>
|
||||
<stop offset="0.3846" stop-color="#EA3896"/>
|
||||
<stop offset="0.5532" stop-color="#B248AE"/>
|
||||
<stop offset="0.7923" stop-color="#5A63D6"/>
|
||||
<stop offset="1" stop-color="#087CFA"/>
|
||||
</linearGradient>
|
||||
</defs>
|
||||
<path fill="url(#a)" d="M11.2 49.4668L0.699951 41.3001L9 26L18.5 33.5L11.2 49.4668Z"/>
|
||||
<path fill="#087CFA" d="M69.9999 18.6666L68.8333 59.2666L41.7666 70L27.0666 60.4333L41.7666 37.5L69.9999 18.6666Z"/>
|
||||
<path fill="url(#b)" d="M70 18.6666L55.5 33L37 15L48.0666 1.16663L70 18.6666Z"/>
|
||||
<path fill="url(#c)" d="M27.0667 60.4333L5.6 68.3667L10.0333 52.5L15.8667 33.1333L0 27.7667L10.0333 0L33.1333 2.8L54.5 31L55.5 33L27.0667 60.4333Z"/>
|
||||
<g>
|
||||
<path fill="#000000" d="M56 14H14V56H56V14Z"/>
|
||||
</g>
|
||||
<g>
|
||||
<path fill="#FFFFFF" d="M27.1366 22.1433V19.25H19.2733V22.1433H21.4666V32.1067H19.2733V34.9767H27.1366V32.1067H24.92V22.1433H27.1366Z"/>
|
||||
<path fill="#FFFFFF" d="M34.6967 35.21C33.46 35.21 32.4334 34.9767 31.6167 34.51C30.7767 34.0433 30.1 33.4833 29.5634 32.8533L31.7334 30.4267C32.1767 30.9167 32.6434 31.3133 33.0867 31.5933C33.5534 31.8733 34.0434 32.0133 34.6034 32.0133C35.2567 32.0133 35.77 31.8033 36.1434 31.3833C36.5167 30.9633 36.7034 30.31 36.7034 29.4V19.2733H40.25V29.5633C40.25 30.4967 40.1334 31.3133 39.8767 32.0133C39.62 32.7133 39.2467 33.2967 38.78 33.7633C38.29 34.2533 37.7067 34.6033 37.0067 34.86C36.3067 35.0933 35.5367 35.21 34.6967 35.21Z"/>
|
||||
<path fill="#FFFFFF" d="M34.4166 48.6499H18.6666V51.3332H34.4166V48.6499Z"/>
|
||||
</g>
|
||||
</svg>
|
||||
commands:
|
||||
- id: init-container-command
|
||||
apply:
|
||||
component: che-idea-injector
|
||||
- id: init-che-idea-command
|
||||
exec:
|
||||
component: che-idea-runtime-description
|
||||
commandLine: nohup /projector/entrypoint-volume.sh > /projector/entrypoint-logs.txt
|
||||
2>&1 &
|
||||
events:
|
||||
preStart:
|
||||
- init-container-command
|
||||
postStart:
|
||||
- init-che-idea-command
|
||||
components:
|
||||
- name: che-idea-runtime-description
|
||||
container:
|
||||
image: quay.io/devfile/universal-developer-image:latest
|
||||
env:
|
||||
- name: PROJECTOR_ASSEMBLY_DIR
|
||||
value: /projector
|
||||
- name: PROJECTOR_CONFIG_DIR
|
||||
value: /home/user/.jetbrains
|
||||
volumeMounts:
|
||||
- name: projector-volume
|
||||
path: /projector
|
||||
- name: projector-configuration
|
||||
path: /home/user/.jetbrains
|
||||
- name: projector-java-configuration
|
||||
path: /home/user/.java
|
||||
memoryLimit: 6144Mi
|
||||
memoryRequest: 2048Mi
|
||||
cpuLimit: 2000m
|
||||
cpuRequest: 1500m
|
||||
endpoints:
|
||||
- name: intellij
|
||||
attributes:
|
||||
type: main
|
||||
cookiesAuthEnabled: true
|
||||
discoverable: false
|
||||
urlRewriteSupported: true
|
||||
targetPort: 8887
|
||||
exposure: public
|
||||
path: /?backgroundColor=434343&wss
|
||||
secure: true
|
||||
protocol: https
|
||||
- name: intellij-redirect-1
|
||||
targetPort: 13131
|
||||
exposure: public
|
||||
protocol: https
|
||||
attributes:
|
||||
discoverable: false
|
||||
urlRewriteSupported: false
|
||||
- name: intellij-redirect-2
|
||||
targetPort: 13132
|
||||
exposure: public
|
||||
protocol: https
|
||||
attributes:
|
||||
discoverable: false
|
||||
urlRewriteSupported: false
|
||||
- name: intellij-redirect-3
|
||||
targetPort: 13133
|
||||
exposure: public
|
||||
protocol: https
|
||||
attributes:
|
||||
discoverable: false
|
||||
urlRewriteSupported: false
|
||||
attributes:
|
||||
app.kubernetes.io/component: che-idea-runtime
|
||||
app.kubernetes.io/part-of: che-idea.eclipse.org
|
||||
controller.devfile.io/container-contribution: true
|
||||
- name: projector-volume
|
||||
volume: {}
|
||||
- name: projector-configuration
|
||||
volume: {}
|
||||
- name: projector-java-configuration
|
||||
volume: {}
|
||||
- name: che-idea-injector
|
||||
container:
|
||||
image: quay.io/che-incubator/che-idea:latest
|
||||
command:
|
||||
- /projector/entrypoint-init-container.sh
|
||||
env:
|
||||
- name: PROJECTOR_VOLUME_MOUNT
|
||||
value: /projector-volume
|
||||
- name: PROJECTOR_ASSEMBLY_DIR
|
||||
value: /projector
|
||||
volumeMounts:
|
||||
- name: projector-volume
|
||||
path: /projector-volume
|
||||
memoryLimit: 128Mi
|
||||
memoryRequest: 32Mi
|
||||
cpuLimit: 500m
|
||||
cpuRequest: 30m
|
||||
|
|
@ -0,0 +1,166 @@
|
|||
#
|
||||
# Copyright (c) 2019-2023 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
|
||||
#
|
||||
|
||||
schemaVersion: 2.2.2
|
||||
metadata:
|
||||
name: che-idea
|
||||
displayName: IntelliJ IDEA Community
|
||||
description: JetBrains IntelliJ IDEA Community IDE for Eclipse Che - next
|
||||
tags:
|
||||
- Tech-Preview
|
||||
attributes:
|
||||
publisher: che-incubator
|
||||
version: next
|
||||
title: JetBrains IntelliJ IDEA Community IDE for Eclipse Che - next
|
||||
repository: https://github.com/che-incubator/jetbrains-editor-images
|
||||
firstPublicationDate: '2022-01-11'
|
||||
icon-mediatype: image/svg+xml
|
||||
icon-data: |
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="70" height="70" fill="none" viewBox="0 0 70 70">
|
||||
<defs>
|
||||
<linearGradient id="a" x1="5.17435" x2="40.0136" y1="39.8894" y2="38.1233" gradientUnits="userSpaceOnUse">
|
||||
<stop offset="0.0910927" stop-color="#FC801D"/>
|
||||
<stop offset="0.2312" stop-color="#B07F61"/>
|
||||
<stop offset="0.4086" stop-color="#577DB3"/>
|
||||
<stop offset="0.5334" stop-color="#1E7CE6"/>
|
||||
<stop offset="0.5934" stop-color="#087CFA"/>
|
||||
</linearGradient>
|
||||
<linearGradient id="b" x1="61.991" x2="50.158" y1="36.9152" y2="1.55723" gradientUnits="userSpaceOnUse">
|
||||
<stop offset="0" stop-color="#FE2857"/>
|
||||
<stop offset="0.0784" stop-color="#CB3979"/>
|
||||
<stop offset="0.1601" stop-color="#9E4997"/>
|
||||
<stop offset="0.2474" stop-color="#7557B2"/>
|
||||
<stop offset="0.3392" stop-color="#5362C8"/>
|
||||
<stop offset="0.4365" stop-color="#386CDA"/>
|
||||
<stop offset="0.5414" stop-color="#2373E8"/>
|
||||
<stop offset="0.6576" stop-color="#1478F2"/>
|
||||
<stop offset="0.794" stop-color="#0B7BF8"/>
|
||||
<stop offset="1" stop-color="#087CFA"/>
|
||||
</linearGradient>
|
||||
<linearGradient id="c" x1="10.0665" x2="53.8764" y1="16.4955" y2="88.9597" gradientUnits="userSpaceOnUse">
|
||||
<stop offset="0" stop-color="#FE2857"/>
|
||||
<stop offset="0.0800816" stop-color="#FE295F"/>
|
||||
<stop offset="0.2065" stop-color="#FF2D76"/>
|
||||
<stop offset="0.3034" stop-color="#FF318C"/>
|
||||
<stop offset="0.3846" stop-color="#EA3896"/>
|
||||
<stop offset="0.5532" stop-color="#B248AE"/>
|
||||
<stop offset="0.7923" stop-color="#5A63D6"/>
|
||||
<stop offset="1" stop-color="#087CFA"/>
|
||||
</linearGradient>
|
||||
</defs>
|
||||
<path fill="url(#a)" d="M11.2 49.4668L0.699951 41.3001L9 26L18.5 33.5L11.2 49.4668Z"/>
|
||||
<path fill="#087CFA" d="M69.9999 18.6666L68.8333 59.2666L41.7666 70L27.0666 60.4333L41.7666 37.5L69.9999 18.6666Z"/>
|
||||
<path fill="url(#b)" d="M70 18.6666L55.5 33L37 15L48.0666 1.16663L70 18.6666Z"/>
|
||||
<path fill="url(#c)" d="M27.0667 60.4333L5.6 68.3667L10.0333 52.5L15.8667 33.1333L0 27.7667L10.0333 0L33.1333 2.8L54.5 31L55.5 33L27.0667 60.4333Z"/>
|
||||
<g>
|
||||
<path fill="#000000" d="M56 14H14V56H56V14Z"/>
|
||||
</g>
|
||||
<g>
|
||||
<path fill="#FFFFFF" d="M27.1366 22.1433V19.25H19.2733V22.1433H21.4666V32.1067H19.2733V34.9767H27.1366V32.1067H24.92V22.1433H27.1366Z"/>
|
||||
<path fill="#FFFFFF" d="M34.6967 35.21C33.46 35.21 32.4334 34.9767 31.6167 34.51C30.7767 34.0433 30.1 33.4833 29.5634 32.8533L31.7334 30.4267C32.1767 30.9167 32.6434 31.3133 33.0867 31.5933C33.5534 31.8733 34.0434 32.0133 34.6034 32.0133C35.2567 32.0133 35.77 31.8033 36.1434 31.3833C36.5167 30.9633 36.7034 30.31 36.7034 29.4V19.2733H40.25V29.5633C40.25 30.4967 40.1334 31.3133 39.8767 32.0133C39.62 32.7133 39.2467 33.2967 38.78 33.7633C38.29 34.2533 37.7067 34.6033 37.0067 34.86C36.3067 35.0933 35.5367 35.21 34.6967 35.21Z"/>
|
||||
<path fill="#FFFFFF" d="M34.4166 48.6499H18.6666V51.3332H34.4166V48.6499Z"/>
|
||||
</g>
|
||||
</svg>
|
||||
commands:
|
||||
- id: init-container-command
|
||||
apply:
|
||||
component: che-idea-injector
|
||||
- id: init-che-idea-command
|
||||
exec:
|
||||
component: che-idea-runtime-description
|
||||
commandLine: nohup /projector/entrypoint-volume.sh > /projector/entrypoint-logs.txt
|
||||
2>&1 &
|
||||
events:
|
||||
preStart:
|
||||
- init-container-command
|
||||
postStart:
|
||||
- init-che-idea-command
|
||||
components:
|
||||
- name: che-idea-runtime-description
|
||||
container:
|
||||
image: quay.io/devfile/universal-developer-image:latest
|
||||
env:
|
||||
- name: PROJECTOR_ASSEMBLY_DIR
|
||||
value: /projector
|
||||
- name: PROJECTOR_CONFIG_DIR
|
||||
value: /home/user/.jetbrains
|
||||
volumeMounts:
|
||||
- name: projector-volume
|
||||
path: /projector
|
||||
- name: projector-configuration
|
||||
path: /home/user/.jetbrains
|
||||
- name: projector-java-configuration
|
||||
path: /home/user/.java
|
||||
memoryLimit: 6144Mi
|
||||
memoryRequest: 2048Mi
|
||||
cpuLimit: 2000m
|
||||
cpuRequest: 1500m
|
||||
endpoints:
|
||||
- name: intellij
|
||||
attributes:
|
||||
type: main
|
||||
cookiesAuthEnabled: true
|
||||
discoverable: false
|
||||
urlRewriteSupported: true
|
||||
targetPort: 8887
|
||||
exposure: public
|
||||
path: /?backgroundColor=434343&wss
|
||||
secure: true
|
||||
protocol: https
|
||||
- name: intellij-redirect-1
|
||||
targetPort: 13131
|
||||
exposure: public
|
||||
protocol: https
|
||||
attributes:
|
||||
discoverable: false
|
||||
urlRewriteSupported: false
|
||||
- name: intellij-redirect-2
|
||||
targetPort: 13132
|
||||
exposure: public
|
||||
protocol: https
|
||||
attributes:
|
||||
discoverable: false
|
||||
urlRewriteSupported: false
|
||||
- name: intellij-redirect-3
|
||||
targetPort: 13133
|
||||
exposure: public
|
||||
protocol: https
|
||||
attributes:
|
||||
discoverable: false
|
||||
urlRewriteSupported: false
|
||||
attributes:
|
||||
app.kubernetes.io/component: che-idea-runtime
|
||||
app.kubernetes.io/part-of: che-idea.eclipse.org
|
||||
controller.devfile.io/container-contribution: true
|
||||
- name: projector-volume
|
||||
volume: {}
|
||||
- name: projector-configuration
|
||||
volume: {}
|
||||
- name: projector-java-configuration
|
||||
volume: {}
|
||||
- name: che-idea-injector
|
||||
container:
|
||||
image: quay.io/che-incubator/che-idea:next
|
||||
command:
|
||||
- /projector/entrypoint-init-container.sh
|
||||
env:
|
||||
- name: PROJECTOR_VOLUME_MOUNT
|
||||
value: /projector-volume
|
||||
- name: PROJECTOR_ASSEMBLY_DIR
|
||||
value: /projector
|
||||
volumeMounts:
|
||||
- name: projector-volume
|
||||
path: /projector-volume
|
||||
memoryLimit: 128Mi
|
||||
memoryRequest: 32Mi
|
||||
cpuLimit: 500m
|
||||
cpuRequest: 30m
|
||||
|
|
@ -0,0 +1,126 @@
|
|||
#
|
||||
# Copyright (c) 2019-2023 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
|
||||
#
|
||||
|
||||
schemaVersion: 2.2.2
|
||||
metadata:
|
||||
name: che-idea-server
|
||||
displayName: IntelliJ IDEA Ultimate (desktop)
|
||||
description: JetBrains IntelliJ IDEA Ultimate dev server for Eclipse Che - latest
|
||||
tags:
|
||||
- Tech-Preview
|
||||
attributes:
|
||||
publisher: che-incubator
|
||||
version: latest
|
||||
title: JetBrains IntelliJ IDEA Ultimate dev server for Eclipse Che - latest
|
||||
repository: https://github.com/che-incubator/che-idea-dev-server
|
||||
firstPublicationDate: '2023-30-11'
|
||||
icon-mediatype: image/svg+xml
|
||||
icon-data: |
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="70" height="70" fill="none" viewBox="0 0 70 70">
|
||||
<defs>
|
||||
<linearGradient id="a" x1="5.17435" x2="40.0136" y1="39.8894" y2="38.1233" gradientUnits="userSpaceOnUse">
|
||||
<stop offset="0.0910927" stop-color="#FC801D"/>
|
||||
<stop offset="0.2312" stop-color="#B07F61"/>
|
||||
<stop offset="0.4086" stop-color="#577DB3"/>
|
||||
<stop offset="0.5334" stop-color="#1E7CE6"/>
|
||||
<stop offset="0.5934" stop-color="#087CFA"/>
|
||||
</linearGradient>
|
||||
<linearGradient id="b" x1="61.991" x2="50.158" y1="36.9152" y2="1.55723" gradientUnits="userSpaceOnUse">
|
||||
<stop offset="0" stop-color="#FE2857"/>
|
||||
<stop offset="0.0784" stop-color="#CB3979"/>
|
||||
<stop offset="0.1601" stop-color="#9E4997"/>
|
||||
<stop offset="0.2474" stop-color="#7557B2"/>
|
||||
<stop offset="0.3392" stop-color="#5362C8"/>
|
||||
<stop offset="0.4365" stop-color="#386CDA"/>
|
||||
<stop offset="0.5414" stop-color="#2373E8"/>
|
||||
<stop offset="0.6576" stop-color="#1478F2"/>
|
||||
<stop offset="0.794" stop-color="#0B7BF8"/>
|
||||
<stop offset="1" stop-color="#087CFA"/>
|
||||
</linearGradient>
|
||||
<linearGradient id="c" x1="10.0665" x2="53.8764" y1="16.4955" y2="88.9597" gradientUnits="userSpaceOnUse">
|
||||
<stop offset="0" stop-color="#FE2857"/>
|
||||
<stop offset="0.0800816" stop-color="#FE295F"/>
|
||||
<stop offset="0.2065" stop-color="#FF2D76"/>
|
||||
<stop offset="0.3034" stop-color="#FF318C"/>
|
||||
<stop offset="0.3846" stop-color="#EA3896"/>
|
||||
<stop offset="0.5532" stop-color="#B248AE"/>
|
||||
<stop offset="0.7923" stop-color="#5A63D6"/>
|
||||
<stop offset="1" stop-color="#087CFA"/>
|
||||
</linearGradient>
|
||||
</defs>
|
||||
<path fill="url(#a)" d="M11.2 49.4668L0.699951 41.3001L9 26L18.5 33.5L11.2 49.4668Z"/>
|
||||
<path fill="#087CFA" d="M69.9999 18.6666L68.8333 59.2666L41.7666 70L27.0666 60.4333L41.7666 37.5L69.9999 18.6666Z"/>
|
||||
<path fill="url(#b)" d="M70 18.6666L55.5 33L37 15L48.0666 1.16663L70 18.6666Z"/>
|
||||
<path fill="url(#c)" d="M27.0667 60.4333L5.6 68.3667L10.0333 52.5L15.8667 33.1333L0 27.7667L10.0333 0L33.1333 2.8L54.5 31L55.5 33L27.0667 60.4333Z"/>
|
||||
<g>
|
||||
<path fill="#000000" d="M56 14H14V56H56V14Z"/>
|
||||
</g>
|
||||
<g>
|
||||
<path fill="#FFFFFF" d="M27.1366 22.1433V19.25H19.2733V22.1433H21.4666V32.1067H19.2733V34.9767H27.1366V32.1067H24.92V22.1433H27.1366Z"/>
|
||||
<path fill="#FFFFFF" d="M34.6967 35.21C33.46 35.21 32.4334 34.9767 31.6167 34.51C30.7767 34.0433 30.1 33.4833 29.5634 32.8533L31.7334 30.4267C32.1767 30.9167 32.6434 31.3133 33.0867 31.5933C33.5534 31.8733 34.0434 32.0133 34.6034 32.0133C35.2567 32.0133 35.77 31.8033 36.1434 31.3833C36.5167 30.9633 36.7034 30.31 36.7034 29.4V19.2733H40.25V29.5633C40.25 30.4967 40.1334 31.3133 39.8767 32.0133C39.62 32.7133 39.2467 33.2967 38.78 33.7633C38.29 34.2533 37.7067 34.6033 37.0067 34.86C36.3067 35.0933 35.5367 35.21 34.6967 35.21Z"/>
|
||||
<path fill="#FFFFFF" d="M34.4166 48.6499H18.6666V51.3332H34.4166V48.6499Z"/>
|
||||
</g>
|
||||
</svg>
|
||||
commands:
|
||||
- id: inject-editor
|
||||
apply:
|
||||
component: editor-injector
|
||||
- id: start-idea-server
|
||||
exec:
|
||||
component: editor-runtime
|
||||
commandLine: nohup /idea-server/entrypoint-volume.sh > /idea-server/std.out
|
||||
2>&1 &
|
||||
events:
|
||||
preStart:
|
||||
- inject-editor
|
||||
postStart:
|
||||
- start-idea-server
|
||||
components:
|
||||
- name: idea-server
|
||||
volume: {}
|
||||
- name: editor-injector
|
||||
container:
|
||||
image: quay.io/che-incubator/che-idea-dev-server:latest
|
||||
command:
|
||||
- /entrypoint-init-container.sh
|
||||
volumeMounts:
|
||||
- name: idea-server
|
||||
path: /idea-server
|
||||
memoryLimit: 256Mi
|
||||
memoryRequest: 32Mi
|
||||
cpuLimit: 500m
|
||||
cpuRequest: 30m
|
||||
- name: editor-runtime
|
||||
container:
|
||||
image: quay.io/devfile/universal-developer-image:latest
|
||||
memoryLimit: 6144Mi
|
||||
memoryRequest: 2048Mi
|
||||
cpuLimit: 2000m
|
||||
cpuRequest: 1500m
|
||||
volumeMounts:
|
||||
- name: idea-server
|
||||
path: /idea-server
|
||||
endpoints:
|
||||
- name: idea-server
|
||||
attributes:
|
||||
type: main
|
||||
cookiesAuthEnabled: true
|
||||
discoverable: false
|
||||
urlRewriteSupported: true
|
||||
targetPort: 3400
|
||||
exposure: public
|
||||
secure: true
|
||||
protocol: https
|
||||
attributes:
|
||||
app.kubernetes.io/component: editor-runtime
|
||||
app.kubernetes.io/part-of: idea-server.eclipse.org
|
||||
controller.devfile.io/container-contribution: true
|
||||
|
|
@ -0,0 +1,126 @@
|
|||
#
|
||||
# Copyright (c) 2019-2023 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
|
||||
#
|
||||
|
||||
schemaVersion: 2.2.2
|
||||
metadata:
|
||||
name: che-idea-server
|
||||
displayName: IntelliJ IDEA Ultimate (desktop)
|
||||
description: JetBrains IntelliJ IDEA Ultimate dev server for Eclipse Che - next
|
||||
tags:
|
||||
- Tech-Preview
|
||||
attributes:
|
||||
publisher: che-incubator
|
||||
version: next
|
||||
title: JetBrains IntelliJ IDEA Ultimate dev server for Eclipse Che - next
|
||||
repository: https://github.com/che-incubator/che-idea-dev-server
|
||||
firstPublicationDate: '2023-30-11'
|
||||
icon-mediatype: image/svg+xml
|
||||
icon-data: |
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="70" height="70" fill="none" viewBox="0 0 70 70">
|
||||
<defs>
|
||||
<linearGradient id="a" x1="5.17435" x2="40.0136" y1="39.8894" y2="38.1233" gradientUnits="userSpaceOnUse">
|
||||
<stop offset="0.0910927" stop-color="#FC801D"/>
|
||||
<stop offset="0.2312" stop-color="#B07F61"/>
|
||||
<stop offset="0.4086" stop-color="#577DB3"/>
|
||||
<stop offset="0.5334" stop-color="#1E7CE6"/>
|
||||
<stop offset="0.5934" stop-color="#087CFA"/>
|
||||
</linearGradient>
|
||||
<linearGradient id="b" x1="61.991" x2="50.158" y1="36.9152" y2="1.55723" gradientUnits="userSpaceOnUse">
|
||||
<stop offset="0" stop-color="#FE2857"/>
|
||||
<stop offset="0.0784" stop-color="#CB3979"/>
|
||||
<stop offset="0.1601" stop-color="#9E4997"/>
|
||||
<stop offset="0.2474" stop-color="#7557B2"/>
|
||||
<stop offset="0.3392" stop-color="#5362C8"/>
|
||||
<stop offset="0.4365" stop-color="#386CDA"/>
|
||||
<stop offset="0.5414" stop-color="#2373E8"/>
|
||||
<stop offset="0.6576" stop-color="#1478F2"/>
|
||||
<stop offset="0.794" stop-color="#0B7BF8"/>
|
||||
<stop offset="1" stop-color="#087CFA"/>
|
||||
</linearGradient>
|
||||
<linearGradient id="c" x1="10.0665" x2="53.8764" y1="16.4955" y2="88.9597" gradientUnits="userSpaceOnUse">
|
||||
<stop offset="0" stop-color="#FE2857"/>
|
||||
<stop offset="0.0800816" stop-color="#FE295F"/>
|
||||
<stop offset="0.2065" stop-color="#FF2D76"/>
|
||||
<stop offset="0.3034" stop-color="#FF318C"/>
|
||||
<stop offset="0.3846" stop-color="#EA3896"/>
|
||||
<stop offset="0.5532" stop-color="#B248AE"/>
|
||||
<stop offset="0.7923" stop-color="#5A63D6"/>
|
||||
<stop offset="1" stop-color="#087CFA"/>
|
||||
</linearGradient>
|
||||
</defs>
|
||||
<path fill="url(#a)" d="M11.2 49.4668L0.699951 41.3001L9 26L18.5 33.5L11.2 49.4668Z"/>
|
||||
<path fill="#087CFA" d="M69.9999 18.6666L68.8333 59.2666L41.7666 70L27.0666 60.4333L41.7666 37.5L69.9999 18.6666Z"/>
|
||||
<path fill="url(#b)" d="M70 18.6666L55.5 33L37 15L48.0666 1.16663L70 18.6666Z"/>
|
||||
<path fill="url(#c)" d="M27.0667 60.4333L5.6 68.3667L10.0333 52.5L15.8667 33.1333L0 27.7667L10.0333 0L33.1333 2.8L54.5 31L55.5 33L27.0667 60.4333Z"/>
|
||||
<g>
|
||||
<path fill="#000000" d="M56 14H14V56H56V14Z"/>
|
||||
</g>
|
||||
<g>
|
||||
<path fill="#FFFFFF" d="M27.1366 22.1433V19.25H19.2733V22.1433H21.4666V32.1067H19.2733V34.9767H27.1366V32.1067H24.92V22.1433H27.1366Z"/>
|
||||
<path fill="#FFFFFF" d="M34.6967 35.21C33.46 35.21 32.4334 34.9767 31.6167 34.51C30.7767 34.0433 30.1 33.4833 29.5634 32.8533L31.7334 30.4267C32.1767 30.9167 32.6434 31.3133 33.0867 31.5933C33.5534 31.8733 34.0434 32.0133 34.6034 32.0133C35.2567 32.0133 35.77 31.8033 36.1434 31.3833C36.5167 30.9633 36.7034 30.31 36.7034 29.4V19.2733H40.25V29.5633C40.25 30.4967 40.1334 31.3133 39.8767 32.0133C39.62 32.7133 39.2467 33.2967 38.78 33.7633C38.29 34.2533 37.7067 34.6033 37.0067 34.86C36.3067 35.0933 35.5367 35.21 34.6967 35.21Z"/>
|
||||
<path fill="#FFFFFF" d="M34.4166 48.6499H18.6666V51.3332H34.4166V48.6499Z"/>
|
||||
</g>
|
||||
</svg>
|
||||
commands:
|
||||
- id: inject-editor
|
||||
apply:
|
||||
component: editor-injector
|
||||
- id: start-idea-server
|
||||
exec:
|
||||
component: editor-runtime
|
||||
commandLine: nohup /idea-server/entrypoint-volume.sh > /idea-server/std.out
|
||||
2>&1 &
|
||||
events:
|
||||
preStart:
|
||||
- inject-editor
|
||||
postStart:
|
||||
- start-idea-server
|
||||
components:
|
||||
- name: idea-server
|
||||
volume: {}
|
||||
- name: editor-injector
|
||||
container:
|
||||
image: quay.io/che-incubator/che-idea-dev-server:next
|
||||
command:
|
||||
- /entrypoint-init-container.sh
|
||||
volumeMounts:
|
||||
- name: idea-server
|
||||
path: /idea-server
|
||||
memoryLimit: 256Mi
|
||||
memoryRequest: 32Mi
|
||||
cpuLimit: 500m
|
||||
cpuRequest: 30m
|
||||
- name: editor-runtime
|
||||
container:
|
||||
image: quay.io/devfile/universal-developer-image:latest
|
||||
memoryLimit: 6144Mi
|
||||
memoryRequest: 2048Mi
|
||||
cpuLimit: 2000m
|
||||
cpuRequest: 1500m
|
||||
volumeMounts:
|
||||
- name: idea-server
|
||||
path: /idea-server
|
||||
endpoints:
|
||||
- name: idea-server
|
||||
attributes:
|
||||
type: main
|
||||
cookiesAuthEnabled: true
|
||||
discoverable: false
|
||||
urlRewriteSupported: true
|
||||
targetPort: 3400
|
||||
exposure: public
|
||||
secure: true
|
||||
protocol: https
|
||||
attributes:
|
||||
app.kubernetes.io/component: editor-runtime
|
||||
app.kubernetes.io/part-of: idea-server.eclipse.org
|
||||
controller.devfile.io/container-contribution: true
|
||||
|
|
@ -1,81 +0,0 @@
|
|||
// Code generated by MockGen. DO NOT EDIT.
|
||||
// Source: pkg/util/process.go
|
||||
|
||||
// Package mock_util is a generated GoMock package.
|
||||
package mock_util
|
||||
|
||||
import (
|
||||
reflect "reflect"
|
||||
|
||||
gomock "github.com/golang/mock/gomock"
|
||||
)
|
||||
|
||||
// MockRunnable is a mock of Runnable interface
|
||||
type MockRunnable struct {
|
||||
ctrl *gomock.Controller
|
||||
recorder *MockRunnableMockRecorder
|
||||
}
|
||||
|
||||
// MockRunnableMockRecorder is the mock recorder for MockRunnable
|
||||
type MockRunnableMockRecorder struct {
|
||||
mock *MockRunnable
|
||||
}
|
||||
|
||||
// NewMockRunnable creates a new mock instance
|
||||
func NewMockRunnable(ctrl *gomock.Controller) *MockRunnable {
|
||||
mock := &MockRunnable{ctrl: ctrl}
|
||||
mock.recorder = &MockRunnableMockRecorder{mock}
|
||||
return mock
|
||||
}
|
||||
|
||||
// EXPECT returns an object that allows the caller to indicate expected use
|
||||
func (m *MockRunnable) EXPECT() *MockRunnableMockRecorder {
|
||||
return m.recorder
|
||||
}
|
||||
|
||||
// Run mocks base method
|
||||
func (m *MockRunnable) Run(name string, args ...string) error {
|
||||
m.ctrl.T.Helper()
|
||||
varargs := []interface{}{name}
|
||||
for _, a := range args {
|
||||
varargs = append(varargs, a)
|
||||
}
|
||||
ret := m.ctrl.Call(m, "Run", varargs...)
|
||||
ret0, _ := ret[0].(error)
|
||||
return ret0
|
||||
}
|
||||
|
||||
// Run indicates an expected call of Run
|
||||
func (mr *MockRunnableMockRecorder) Run(name interface{}, args ...interface{}) *gomock.Call {
|
||||
mr.mock.ctrl.T.Helper()
|
||||
varargs := append([]interface{}{name}, args...)
|
||||
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Run", reflect.TypeOf((*MockRunnable)(nil).Run), varargs...)
|
||||
}
|
||||
|
||||
// GetStdOut mocks base method
|
||||
func (m *MockRunnable) GetStdOut() string {
|
||||
m.ctrl.T.Helper()
|
||||
ret := m.ctrl.Call(m, "GetStdOut")
|
||||
ret0, _ := ret[0].(string)
|
||||
return ret0
|
||||
}
|
||||
|
||||
// GetStdOut indicates an expected call of GetStdOut
|
||||
func (mr *MockRunnableMockRecorder) GetStdOut() *gomock.Call {
|
||||
mr.mock.ctrl.T.Helper()
|
||||
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetStdOut", reflect.TypeOf((*MockRunnable)(nil).GetStdOut))
|
||||
}
|
||||
|
||||
// GetStdErr mocks base method
|
||||
func (m *MockRunnable) GetStdErr() string {
|
||||
m.ctrl.T.Helper()
|
||||
ret := m.ctrl.Call(m, "GetStdErr")
|
||||
ret0, _ := ret[0].(string)
|
||||
return ret0
|
||||
}
|
||||
|
||||
// GetStdErr indicates an expected call of GetStdErr
|
||||
func (mr *MockRunnableMockRecorder) GetStdErr() *gomock.Call {
|
||||
mr.mock.ctrl.T.Helper()
|
||||
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetStdErr", reflect.TypeOf((*MockRunnable)(nil).GetStdErr))
|
||||
}
|
||||
|
|
@ -124,6 +124,7 @@ const (
|
|||
GatewayAuthenticationContainerName = "oauth-proxy"
|
||||
GatewayAuthorizationContainerName = "kube-rbac-proxy"
|
||||
KubernetesImagePullerComponentName = "kubernetes-image-puller"
|
||||
EditorDefinitionComponentName = "editor-definition"
|
||||
|
||||
// common
|
||||
CheFlavor = "che"
|
||||
|
|
|
|||
|
|
@ -1,51 +0,0 @@
|
|||
//
|
||||
// Copyright (c) 2019-2023 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
|
||||
//
|
||||
|
||||
package utils
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"os/exec"
|
||||
)
|
||||
|
||||
type Runnable interface {
|
||||
Run(name string, args ...string) error
|
||||
GetStdOut() string
|
||||
GetStdErr() string
|
||||
}
|
||||
|
||||
type Process struct {
|
||||
cmd *exec.Cmd
|
||||
stdout bytes.Buffer
|
||||
stderr bytes.Buffer
|
||||
}
|
||||
|
||||
func NewRunnable() Runnable {
|
||||
return &Process{}
|
||||
}
|
||||
|
||||
func (p *Process) Run(name string, args ...string) error {
|
||||
p.cmd = exec.Command(name, args...)
|
||||
p.stderr.Reset()
|
||||
p.stdout.Reset()
|
||||
p.cmd.Stdout = &p.stdout
|
||||
p.cmd.Stderr = &p.stderr
|
||||
return p.cmd.Run()
|
||||
}
|
||||
|
||||
func (p *Process) GetStdOut() string {
|
||||
return string(p.stdout.Bytes())
|
||||
}
|
||||
|
||||
func (p *Process) GetStdErr() string {
|
||||
return string(p.stderr.Bytes())
|
||||
}
|
||||
|
|
@ -1,5 +1,5 @@
|
|||
//
|
||||
// Copyright (c) 2019-2023 Red Hat, Inc.
|
||||
// Copyright (c) 2019-2024 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/
|
||||
|
|
@ -23,4 +23,6 @@ func init() {
|
|||
|
||||
infrastructure.InitializeForTesting(infrastructure.OpenShiftv4)
|
||||
defaults.InitializeForTesting("../../../config/manager/manager.yaml")
|
||||
|
||||
editorsDefinitionsDir = "./test-editors-definitions"
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
//
|
||||
// Copyright (c) 2019-2023 Red Hat, Inc.
|
||||
// Copyright (c) 2019-2024 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/
|
||||
|
|
@ -16,6 +16,9 @@ import (
|
|||
"fmt"
|
||||
"strings"
|
||||
|
||||
appsv1 "k8s.io/api/apps/v1"
|
||||
corev1 "k8s.io/api/core/v1"
|
||||
|
||||
"github.com/eclipse-che/che-operator/pkg/common/chetypes"
|
||||
"github.com/eclipse-che/che-operator/pkg/common/constants"
|
||||
"github.com/eclipse-che/che-operator/pkg/deploy/gateway"
|
||||
|
|
@ -35,12 +38,25 @@ func NewPluginRegistryReconciler() *PluginRegistryReconciler {
|
|||
|
||||
func (p *PluginRegistryReconciler) Reconcile(ctx *chetypes.DeployContext) (reconcile.Result, bool, error) {
|
||||
if ctx.CheCluster.Spec.Components.PluginRegistry.DisableInternalRegistry {
|
||||
ctx.CheCluster.Status.PluginRegistryURL = ""
|
||||
err := deploy.UpdateCheCRStatus(ctx, "PluginRegistryURL", "")
|
||||
return reconcile.Result{}, err == nil, err
|
||||
_, _ = deploy.DeleteNamespacedObject(ctx, constants.PluginRegistryName, &corev1.Service{})
|
||||
_, _ = deploy.DeleteNamespacedObject(ctx, constants.PluginRegistryName, &corev1.ConfigMap{})
|
||||
_, _ = deploy.DeleteNamespacedObject(ctx, editorsDefinitionsConfigMapName, &corev1.ConfigMap{})
|
||||
_, _ = deploy.DeleteNamespacedObject(ctx, gateway.GatewayConfigMapNamePrefix+constants.PluginRegistryName, &corev1.ConfigMap{})
|
||||
_, _ = deploy.DeleteNamespacedObject(ctx, constants.PluginRegistryName, &appsv1.Deployment{})
|
||||
|
||||
if ctx.CheCluster.Status.PluginRegistryURL != "" {
|
||||
ctx.CheCluster.Status.PluginRegistryURL = ""
|
||||
err := deploy.UpdateCheCRStatus(ctx, "PluginRegistryURL", "")
|
||||
return reconcile.Result{}, err == nil, err
|
||||
}
|
||||
}
|
||||
|
||||
done, err := p.syncService(ctx)
|
||||
done, err := p.syncEditors(ctx)
|
||||
if !done {
|
||||
return reconcile.Result{}, false, err
|
||||
}
|
||||
|
||||
done, err = p.syncService(ctx)
|
||||
if !done {
|
||||
return reconcile.Result{}, false, err
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,129 @@
|
|||
//
|
||||
// Copyright (c) 2019-2024 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
|
||||
//
|
||||
|
||||
package pluginregistry
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"regexp"
|
||||
|
||||
"github.com/eclipse-che/che-operator/pkg/common/chetypes"
|
||||
"github.com/eclipse-che/che-operator/pkg/common/constants"
|
||||
"github.com/eclipse-che/che-operator/pkg/common/utils"
|
||||
"github.com/eclipse-che/che-operator/pkg/deploy"
|
||||
corev1 "k8s.io/api/core/v1"
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
"sigs.k8s.io/yaml"
|
||||
)
|
||||
|
||||
var (
|
||||
editorsDefinitionsDir = "/tmp/editors-definitions"
|
||||
editorsDefinitionsConfigMapName = "editors-definitions"
|
||||
)
|
||||
|
||||
func (p *PluginRegistryReconciler) syncEditors(ctx *chetypes.DeployContext) (bool, error) {
|
||||
editorDefinitions, err := readEditorDefinitions()
|
||||
if err != nil {
|
||||
return false, err
|
||||
}
|
||||
|
||||
done, err := syncEditorDefinitions(ctx, editorDefinitions)
|
||||
if !done {
|
||||
return false, err
|
||||
}
|
||||
|
||||
return true, nil
|
||||
}
|
||||
|
||||
func readEditorDefinitions() (map[string][]byte, error) {
|
||||
editorDefinitions := make(map[string][]byte)
|
||||
|
||||
files, err := os.ReadDir(editorsDefinitionsDir)
|
||||
if err != nil {
|
||||
return editorDefinitions, err
|
||||
}
|
||||
|
||||
for _, file := range files {
|
||||
if !file.IsDir() {
|
||||
fileName := file.Name()
|
||||
|
||||
editorContent, err := os.ReadFile(filepath.Join(editorsDefinitionsDir, fileName))
|
||||
if err != nil {
|
||||
return editorDefinitions, err
|
||||
}
|
||||
|
||||
var devfile map[string]interface{}
|
||||
err = yaml.Unmarshal(editorContent, &devfile)
|
||||
if err != nil {
|
||||
return editorDefinitions, err
|
||||
}
|
||||
|
||||
updateEditorDefinitionImageFromEnv(devfile)
|
||||
|
||||
editorContent, err = yaml.Marshal(devfile)
|
||||
if err != nil {
|
||||
return editorDefinitions, err
|
||||
}
|
||||
|
||||
editorDefinitions[fileName] = editorContent
|
||||
}
|
||||
}
|
||||
|
||||
return editorDefinitions, nil
|
||||
}
|
||||
|
||||
func updateEditorDefinitionImageFromEnv(devfile map[string]interface{}) {
|
||||
notAllowedCharsReg, _ := regexp.Compile("[^a-zA-Z0-9]+")
|
||||
|
||||
metadata := devfile["metadata"].(map[string]interface{})
|
||||
devfileName := metadata["name"].(string)
|
||||
attributes := metadata["attributes"].(map[string]interface{})
|
||||
devfileVersion := attributes["version"].(string)
|
||||
|
||||
components := devfile["components"].([]interface{})
|
||||
for _, component := range components {
|
||||
componentName := component.(map[string]interface{})["name"].(string)
|
||||
if container, ok := component.(map[string]interface{})["container"].(map[string]interface{}); ok {
|
||||
imageEnvName := fmt.Sprintf("RELATED_IMAGE_%s_%s_%s", devfileName, devfileVersion, componentName)
|
||||
imageEnvName = notAllowedCharsReg.ReplaceAllString(imageEnvName, "_")
|
||||
imageEnvName = utils.GetArchitectureDependentEnvName(imageEnvName)
|
||||
|
||||
if imageEnvValue, ok := os.LookupEnv(imageEnvName); ok {
|
||||
container["image"] = imageEnvValue
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func syncEditorDefinitions(ctx *chetypes.DeployContext, editorDefinitions map[string][]byte) (bool, error) {
|
||||
cm := &corev1.ConfigMap{
|
||||
TypeMeta: metav1.TypeMeta{
|
||||
Kind: "ConfigMap",
|
||||
APIVersion: "v1",
|
||||
},
|
||||
ObjectMeta: metav1.ObjectMeta{
|
||||
Name: editorsDefinitionsConfigMapName,
|
||||
Namespace: ctx.CheCluster.Namespace,
|
||||
Labels: deploy.GetLabels(constants.EditorDefinitionComponentName),
|
||||
Annotations: map[string]string{},
|
||||
},
|
||||
Data: map[string]string{},
|
||||
}
|
||||
|
||||
for fileName, content := range editorDefinitions {
|
||||
cm.Data[fileName] = string(content)
|
||||
}
|
||||
|
||||
return deploy.Sync(ctx, cm, deploy.ConfigMapDiffOpts)
|
||||
}
|
||||
|
|
@ -0,0 +1,68 @@
|
|||
//
|
||||
// Copyright (c) 2019-2024 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
|
||||
//
|
||||
|
||||
package pluginregistry
|
||||
|
||||
import (
|
||||
"os"
|
||||
"testing"
|
||||
|
||||
"github.com/eclipse-che/che-operator/pkg/common/test"
|
||||
"github.com/stretchr/testify/assert"
|
||||
"k8s.io/apimachinery/pkg/runtime"
|
||||
"sigs.k8s.io/yaml"
|
||||
)
|
||||
|
||||
func TestReadEditorDefinitions(t *testing.T) {
|
||||
err := os.Setenv("RELATED_IMAGE_che_code_1_2_3_component_a", "image-new-a")
|
||||
assert.NoError(t, err)
|
||||
|
||||
defer func() {
|
||||
_ = os.Setenv("RELATED_IMAGE_che_code_1_2_3_component_a", "")
|
||||
}()
|
||||
|
||||
editorDefinitions, err := readEditorDefinitions()
|
||||
assert.NoError(t, err)
|
||||
assert.NotEmpty(t, editorDefinitions)
|
||||
assert.Equal(t, 1, len(editorDefinitions))
|
||||
assert.Contains(t, editorDefinitions, "devfile.yaml")
|
||||
|
||||
var devfile map[string]interface{}
|
||||
err = yaml.Unmarshal(editorDefinitions["devfile.yaml"], &devfile)
|
||||
assert.NoError(t, err)
|
||||
|
||||
components := devfile["components"].([]interface{})
|
||||
|
||||
component := components[0].(map[string]interface{})
|
||||
container := component["container"].(map[string]interface{})
|
||||
assert.Equal(t, "image-new-a", container["image"])
|
||||
|
||||
component = components[1].(map[string]interface{})
|
||||
container = component["container"].(map[string]interface{})
|
||||
assert.Equal(t, "image-b", container["image"])
|
||||
|
||||
component = components[2].(map[string]interface{})
|
||||
container, ok := component["container"].(map[string]interface{})
|
||||
assert.False(t, ok)
|
||||
}
|
||||
|
||||
func TestSyncEditorDefinitions(t *testing.T) {
|
||||
ctx := test.GetDeployContext(nil, []runtime.Object{})
|
||||
|
||||
editorDefinitions, err := readEditorDefinitions()
|
||||
assert.NoError(t, err)
|
||||
assert.NotEmpty(t, editorDefinitions)
|
||||
|
||||
done, err := syncEditorDefinitions(ctx, editorDefinitions)
|
||||
assert.NoError(t, err)
|
||||
assert.True(t, done)
|
||||
}
|
||||
|
|
@ -1,5 +1,5 @@
|
|||
//
|
||||
// Copyright (c) 2019-2023 Red Hat, Inc.
|
||||
// Copyright (c) 2019-2024 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/
|
||||
|
|
@ -37,6 +37,7 @@ func TestPluginRegistryReconcile(t *testing.T) {
|
|||
|
||||
assert.True(t, test.IsObjectExists(ctx.ClusterAPI.Client, types.NamespacedName{Name: "plugin-registry", Namespace: "eclipse-che"}, &corev1.Service{}))
|
||||
assert.True(t, test.IsObjectExists(ctx.ClusterAPI.Client, types.NamespacedName{Name: "plugin-registry", Namespace: "eclipse-che"}, &corev1.ConfigMap{}))
|
||||
assert.True(t, test.IsObjectExists(ctx.ClusterAPI.Client, types.NamespacedName{Name: "editors-definitions", Namespace: "eclipse-che"}, &corev1.ConfigMap{}))
|
||||
assert.True(t, test.IsObjectExists(ctx.ClusterAPI.Client, types.NamespacedName{Name: "plugin-registry", Namespace: "eclipse-che"}, &appsv1.Deployment{}))
|
||||
assert.NotEmpty(t, ctx.CheCluster.Status.PluginRegistryURL)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,25 @@
|
|||
#
|
||||
# Copyright (c) 2019-2024 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
|
||||
#
|
||||
|
||||
schemaVersion: 2.2.2
|
||||
metadata:
|
||||
name: che-code
|
||||
attributes:
|
||||
version: 1.2.3
|
||||
components:
|
||||
- name: component-a
|
||||
container:
|
||||
image: image-a
|
||||
- name: component-b
|
||||
container:
|
||||
image: image-b
|
||||
- name: component-c
|
||||
Loading…
Reference in New Issue