diff --git a/.coderabbit.yaml b/.coderabbit.yaml index 1c35579b..243f1b40 100644 --- a/.coderabbit.yaml +++ b/.coderabbit.yaml @@ -41,6 +41,5 @@ reviews: - "!package-lock.json" - "!locales/en/**" - "!**/*.snap" - - "!charts/**/*.yaml" chat: auto_reply: true diff --git a/.devcontainer/Dockerfile.console b/.devcontainer/Dockerfile.console deleted file mode 100644 index 2d6f3c83..00000000 --- a/.devcontainer/Dockerfile.console +++ /dev/null @@ -1,20 +0,0 @@ -FROM quay.io/openshift/origin-console:latest -COPY --from=openshift/origin-cli:latest /usr/bin/oc /usr/local/bin/oc - -ENV OC_URL=$OC_URL -ENV OC_PASS=$OC_PASS -ENV OC_USER=$OC_USER -ENV OC_PLUGIN_NAME=$OC_PLUGIN_NAME - -USER root -CMD eval "oc login $OC_URL -u $OC_USER -p $OC_PASS --insecure-skip-tls-verify" && \ - /opt/bridge/bin/bridge -public-dir=/opt/bridge/static \ - -i18n-namespaces plugin__$OC_PLUGIN_NAME \ - -plugins $OC_PLUGIN_NAME=http://localhost:9001 \ - -k8s-mode-off-cluster-thanos=$(oc -n openshift-config-managed get configmap monitoring-shared-config -o jsonpath='{.data.thanosPublicURL}') \ - -k8s-mode-off-cluster-endpoint=$(oc whoami --show-server) \ - -k8s-mode-off-cluster-skip-verify-tls=true \ - -k8s-auth-bearer-token=$(oc whoami --show-token) \ - -k8s-auth="bearer-token" \ - -user-auth="disabled" \ - -k8s-mode="off-cluster" diff --git a/.devcontainer/Dockerfile.plugin b/.devcontainer/Dockerfile.plugin deleted file mode 100644 index 59d4d0c8..00000000 --- a/.devcontainer/Dockerfile.plugin +++ /dev/null @@ -1,2 +0,0 @@ -FROM mcr.microsoft.com/vscode/devcontainers/typescript-node:16 as build -COPY --from=openshift/origin-cli:latest /usr/bin/oc /usr/local/bin/oc diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json deleted file mode 100644 index bc6a254a..00000000 --- a/.devcontainer/devcontainer.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "name": "Console + Dynamic Plugin", - "dockerComposeFile": "docker-compose.yml", - "service": "plugin", - "workspaceFolder": "/workspace", - "settings": {}, - "initializeCommand": ".devcontainer/init.sh", - "postCreateCommand": "yarn && eval 'oc login $OC_URL -u $OC_USER -p $OC_PASS --insecure-skip-tls-verify'", - "forwardPorts": [9000,9001], - "portsAttributes": { - "9000": { - "label": "Console", - }, - "9001": { - "label": "Plugin static files", - "onAutoForward": "silent" - } - }, - "features": {}, - "extensions": [ - "ms-azuretools.vscode-docker", - "ms-vscode.vscode-typescript-next", - "dbaeumer.vscode-eslint", - "esbenp.prettier-vscode", - ], -} diff --git a/.devcontainer/docker-compose.yml b/.devcontainer/docker-compose.yml deleted file mode 100644 index 57071ed2..00000000 --- a/.devcontainer/docker-compose.yml +++ /dev/null @@ -1,34 +0,0 @@ -version: '3.8' -# create dev.env with the following values: -# OC_URL -# OC_USER -# OC_PASS -# OC_PLUGIN_NAME -services: - console: - build: - context: .. - dockerfile: .devcontainer/Dockerfile.console - env_file: dev.env - restart: unless-stopped - healthcheck: - test: oc whoami - interval: 1m30s - timeout: 10s - retries: 5 - - plugin: - build: - context: .. - dockerfile: .devcontainer/Dockerfile.plugin - env_file: dev.env - depends_on: - - console - network_mode: service:console - # Overrides default command so things don't shut down after the process ends. - command: sleep infinity - # Cache local workspace and copy shell history. - volumes: - - ..:/workspace:cached - - ~/.bash_history:/root/.bash_history - - ~/.zsh_history:/root/.zsh_history diff --git a/.devcontainer/init.sh b/.devcontainer/init.sh deleted file mode 100755 index 4ddee379..00000000 --- a/.devcontainer/init.sh +++ /dev/null @@ -1,35 +0,0 @@ -#!/bin/bash - -if [[ ! -f .devcontainer/dev.env ]] -then - cat << EOF - env file 'dev.env' does not exist in .devcontainer, please create it and add the the correct values for your cluster. - OC_PLUGIN_NAME=my-plugin - OC_URL=https://api.example.com:6443 - OC_USER=kubeadmin - OC_PASS= -EOF - exit 2 -else - echo 'found 'dev.env' in .devcontainer' -fi - -# if one of the variables are missing, abort the build. -success=1 -! grep -q OC_PLUGIN_NAME= ".devcontainer/dev.env" && success=0 -! grep -q OC_URL= ".devcontainer/dev.env" && success=0 -! grep -q OC_USER= ".devcontainer/dev.env" && success=0 -! grep -q OC_PASS= ".devcontainer/dev.env" && success=0 - -if ((success)); then - echo 'dev.env is formatted correctly, proceeding.' -else - cat << EOF - dev.env is not formatted correctly, please add the the correct values for your cluster. - OC_PLUGIN_NAME=my-plugin - OC_URL=https://api.example.com:6443 - OC_USER=kubeadmin - OC_PASS= -EOF -exit 2 -fi diff --git a/.gitignore b/.gitignore index bde351d5..44372b8d 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,5 @@ node_modules/ dist/ -.devcontainer/dev.env integration-tests/videos integration-tests/screenshots integration-tests/.DS_Store diff --git a/AGENTS.md b/AGENTS.md index 25965587..bbd5a2d1 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -37,7 +37,6 @@ integration-tests/ # Cypress E2E tests fixtures/ # Test data support/ # Cypress support files locales/ # i18n translation files (en, es, fr, ja, ko, zh) -charts/ # Helm chart for cluster deployment plugin-manifest.ts # Console plugin entry point — registers all extensions and exposed modules webpack.config.ts # Webpack config with ConsoleRemotePlugin ``` diff --git a/ARCHITECTURE.md b/ARCHITECTURE.md index d7cd86fe..6e5cef8e 100644 --- a/ARCHITECTURE.md +++ b/ARCHITECTURE.md @@ -104,12 +104,6 @@ Kubernetes API server. The plugin does not make direct API calls. - `Dockerfile` builds using the `rhel-9-base-nodejs-openshift-4.22` builder image, then serves static files via nginx. - `Dockerfile.art` is the ART (Automated Release Tooling) variant used by Red Hat build systems. -### Cluster Deployment - -- A Helm chart in `charts/openshift-console-plugin/` deploys the plugin as an nginx pod with a `ConsolePlugin` CR. -- The chart supports security context, pod security, resource limits, and a patcher job that registers the plugin with - the console operator. - ## CI/CD The project uses Prow and CI Operator (`.ci-operator.yaml`): diff --git a/README.md b/README.md index 34b9de3c..93082e69 100644 --- a/README.md +++ b/README.md @@ -52,24 +52,6 @@ rpm-ostree install qemu-user-static systemctl reboot ``` -### VS Code Dev Container - -An alternative setup uses Docker Compose with -the [Remote Containers](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-containers) -extension: - -1. Create `.devcontainer/dev.env`: - -```bash -OC_PLUGIN_NAME=networking-console-plugin -OC_URL=https://api.example.com:6443 -OC_USER=kubeadmin -OC_PASS= -``` - -2. Open the folder in a dev container: `Ctrl+Shift+P` > `Remote Containers: Open Folder in Container...` -3. Run `npm run start` - ## Development ### Scripts @@ -151,18 +133,6 @@ docker push quay.io/my-repository/networking-console-plugin:latest On Apple silicon, add `--platform=linux/amd64`. -## Deployment - -A [Helm chart](charts/openshift-console-plugin/) deploys the plugin to OpenShift: - -```bash -helm upgrade -i networking-console-plugin charts/openshift-console-plugin \ - -n plugin__networking-console-plugin --create-namespace \ - --set plugin.image= -``` - -See `charts/openshift-console-plugin/values.yaml` for all parameters. - ## Testing ### Frontend Validation @@ -193,4 +163,4 @@ See [CONTRIBUTING.md](CONTRIBUTING.md) for coding standards, PR process, and com |---------------------------------------------------------------------------------|-------------------------------------------------------------| | [OpenShift web console](https://github.com/openshift/console) | Web-based user interface for OpenShift | | [OpenShift Dynamic Plugin SDK](https://github.com/openshift/dynamic-plugin-sdk) | Dynamic plugin SDK for OpenShift user interfaces | -| [PatternFly](https://www.patternfly.org/) | Open-source design system used for OpenShift UI development | \ No newline at end of file +| [PatternFly](https://www.patternfly.org/) | Open-source design system used for OpenShift UI development | diff --git a/charts/openshift-console-plugin/.helmignore b/charts/openshift-console-plugin/.helmignore deleted file mode 100644 index 0e8a0eb3..00000000 --- a/charts/openshift-console-plugin/.helmignore +++ /dev/null @@ -1,23 +0,0 @@ -# Patterns to ignore when building packages. -# This supports shell glob matching, relative path matching, and -# negation (prefixed with !). Only one pattern per line. -.DS_Store -# Common VCS dirs -.git/ -.gitignore -.bzr/ -.bzrignore -.hg/ -.hgignore -.svn/ -# Common backup files -*.swp -*.bak -*.tmp -*.orig -*~ -# Various IDEs -.project -.idea/ -*.tmproj -.vscode/ diff --git a/charts/openshift-console-plugin/Chart.yaml b/charts/openshift-console-plugin/Chart.yaml deleted file mode 100644 index 72bdd846..00000000 --- a/charts/openshift-console-plugin/Chart.yaml +++ /dev/null @@ -1,5 +0,0 @@ -apiVersion: v2 -name: networking-console-plugin -description: A Helm chart for Kubernetes -type: application -version: 0.1.0 diff --git a/charts/openshift-console-plugin/templates/_helpers.tpl b/charts/openshift-console-plugin/templates/_helpers.tpl deleted file mode 100644 index 4d489739..00000000 --- a/charts/openshift-console-plugin/templates/_helpers.tpl +++ /dev/null @@ -1,72 +0,0 @@ -{{/* -Expand the name of the chart. -*/}} -{{- define "openshift-console-plugin.name" -}} -{{- default (default .Chart.Name .Release.Name) .Values.plugin.name | trunc 63 | trimSuffix "-" }} -{{- end }} - - -{{/* -Create chart name and version as used by the chart label. -*/}} -{{- define "openshift-console-plugin.chart" -}} -{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }} -{{- end }} - -{{/* -Common labels -*/}} -{{- define "openshift-console-plugin.labels" -}} -helm.sh/chart: {{ include "openshift-console-plugin.chart" . }} -{{ include "openshift-console-plugin.selectorLabels" . }} -{{- if .Chart.AppVersion }} -app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} -{{- end }} -app.kubernetes.io/managed-by: {{ .Release.Service }} -{{- end }} - -{{/* -Selector labels -*/}} -{{- define "openshift-console-plugin.selectorLabels" -}} -app: {{ include "openshift-console-plugin.name" . }} -app.kubernetes.io/name: {{ include "openshift-console-plugin.name" . }} -app.kubernetes.io/instance: {{ .Release.Name }} -app.kubernetes.io/part-of: {{ include "openshift-console-plugin.name" . }} -{{- end }} - -{{/* -Create the name secret containing the certificate -*/}} -{{- define "openshift-console-plugin.certificateSecret" -}} -{{ default (printf "%s-cert" (include "openshift-console-plugin.name" .)) .Values.plugin.certificateSecretName }} -{{- end }} - -{{/* -Create the name of the service account to use -*/}} -{{- define "openshift-console-plugin.serviceAccountName" -}} -{{- if .Values.plugin.serviceAccount.create }} -{{- default (include "openshift-console-plugin.name" .) .Values.plugin.serviceAccount.name }} -{{- else }} -{{- default "default" .Values.plugin.serviceAccount.name }} -{{- end }} -{{- end }} - -{{/* -Create the name of the patcher -*/}} -{{- define "openshift-console-plugin.patcherName" -}} -{{- printf "%s-patcher" (include "openshift-console-plugin.name" .) }} -{{- end }} - -{{/* -Create the name of the service account to use -*/}} -{{- define "openshift-console-plugin.patcherServiceAccountName" -}} -{{- if .Values.plugin.patcherServiceAccount.create }} -{{- default (printf "%s-patcher" (include "openshift-console-plugin.name" .)) .Values.plugin.patcherServiceAccount.name }} -{{- else }} -{{- default "default" .Values.plugin.patcherServiceAccount.name }} -{{- end }} -{{- end }} \ No newline at end of file diff --git a/charts/openshift-console-plugin/templates/configmap.yaml b/charts/openshift-console-plugin/templates/configmap.yaml deleted file mode 100644 index 07c2170e..00000000 --- a/charts/openshift-console-plugin/templates/configmap.yaml +++ /dev/null @@ -1,24 +0,0 @@ -apiVersion: v1 -kind: ConfigMap -metadata: - name: {{ template "openshift-console-plugin.name" . }} - namespace: {{ .Release.Namespace }} - labels: - {{- include "openshift-console-plugin.labels" . | nindent 4 }} -data: - nginx.conf: | - error_log /dev/stdout info; - events {} - http { - access_log /dev/stdout; - include /etc/nginx/mime.types; - default_type application/octet-stream; - keepalive_timeout 65; - server { - listen {{ .Values.plugin.port }} ssl; - listen [::]:{{ .Values.plugin.port }} ssl; - ssl_certificate /var/cert/tls.crt; - ssl_certificate_key /var/cert/tls.key; - root /usr/share/nginx/html; - } - } diff --git a/charts/openshift-console-plugin/templates/consoleplugin.yaml b/charts/openshift-console-plugin/templates/consoleplugin.yaml deleted file mode 100644 index c70aa50e..00000000 --- a/charts/openshift-console-plugin/templates/consoleplugin.yaml +++ /dev/null @@ -1,18 +0,0 @@ -apiVersion: console.openshift.io/v1 -kind: ConsolePlugin -metadata: - name: {{ template "openshift-console-plugin.name" . }} - namespace: {{ .Release.Namespace }} - labels: - {{- include "openshift-console-plugin.labels" . | nindent 4 }} -spec: - displayName: {{ default (printf "%s Plugin" (include "openshift-console-plugin.name" .)) .Values.plugin.description }} - i18n: - loadType: Preload - backend: - type: Service - service: - name: {{ template "openshift-console-plugin.name" . }} - namespace: {{ .Release.Namespace }} - port: {{ .Values.plugin.port }} - basePath: {{ .Values.plugin.basePath }} \ No newline at end of file diff --git a/charts/openshift-console-plugin/templates/deployment.yaml b/charts/openshift-console-plugin/templates/deployment.yaml deleted file mode 100644 index 4c9c74c9..00000000 --- a/charts/openshift-console-plugin/templates/deployment.yaml +++ /dev/null @@ -1,57 +0,0 @@ -apiVersion: apps/v1 -kind: Deployment -metadata: - name: {{ template "openshift-console-plugin.name" . }} - namespace: {{ .Release.Namespace }} - labels: - {{- include "openshift-console-plugin.labels" . | nindent 4 }} - app.openshift.io/runtime-namespace: {{ .Release.Namespace }} -spec: - replicas: {{ .Values.plugin.replicas }} - selector: - matchLabels: - {{- include "openshift-console-plugin.selectorLabels" . | nindent 6 }} - template: - metadata: - labels: - {{- include "openshift-console-plugin.labels" . | nindent 8 }} - spec: - containers: - - name: {{ template "openshift-console-plugin.name" . }} - image: {{ required "Plugin image must be specified!" .Values.plugin.image }} - ports: - - containerPort: {{ .Values.plugin.port }} - protocol: TCP - imagePullPolicy: {{ .Values.plugin.imagePullPolicy }} - {{- if and (.Values.plugin.securityContext.enabled) (.Values.plugin.containerSecurityContext) }} - securityContext: {{ tpl (toYaml (omit .Values.plugin.containerSecurityContext "enabled")) $ | nindent 12 }} - {{- end }} - resources: - {{- toYaml .Values.plugin.resources | nindent 12 }} - volumeMounts: - - name: {{ template "openshift-console-plugin.certificateSecret" . }} - readOnly: true - mountPath: /var/cert - - name: nginx-conf - readOnly: true - mountPath: /etc/nginx/nginx.conf - subPath: nginx.conf - volumes: - - name: {{ template "openshift-console-plugin.certificateSecret" . }} - secret: - secretName: {{ template "openshift-console-plugin.certificateSecret" . }} - defaultMode: 420 - - name: nginx-conf - configMap: - name: {{ template "openshift-console-plugin.name" . }} - defaultMode: 420 - restartPolicy: Always - dnsPolicy: ClusterFirst - {{- if and (.Values.plugin.securityContext.enabled) (.Values.plugin.podSecurityContext) }} - securityContext: {{ tpl (toYaml (omit .Values.plugin.podSecurityContext "enabled")) $ | nindent 8 }} - {{- end }} - strategy: - type: RollingUpdate - rollingUpdate: - maxUnavailable: 25% - maxSurge: 25% diff --git a/charts/openshift-console-plugin/templates/patch-consoles-job.yaml b/charts/openshift-console-plugin/templates/patch-consoles-job.yaml deleted file mode 100644 index 0b2ccfe3..00000000 --- a/charts/openshift-console-plugin/templates/patch-consoles-job.yaml +++ /dev/null @@ -1,42 +0,0 @@ -{{- if .Values.plugin.jobs.patchConsoles.enabled }} -apiVersion: batch/v1 -kind: Job -metadata: - name: {{ template "openshift-console-plugin.patcherName" . }} - namespace: {{ .Release.Namespace }} - labels: - {{- include "openshift-console-plugin.labels" . | nindent 4 }} - annotations: - helm.sh/hook: post-install,post-upgrade - helm.sh/hook-delete-policy: before-hook-creation -spec: - parallelism: 1 - template: - metadata: - labels: - {{- include "openshift-console-plugin.labels" . | nindent 8 }} - spec: - restartPolicy: OnFailure - serviceAccountName: {{ template "openshift-console-plugin.patcherServiceAccountName" . }} - {{- if and (.Values.plugin.securityContext.enabled) (.Values.plugin.jobs.patchConsoles.podSecurityContext.enabled) }} - securityContext: {{ tpl (toYaml (omit .Values.plugin.jobs.patchConsoles.podSecurityContext "enabled")) $ | nindent 8 }} - {{- end }} - terminationGracePeriodSeconds: 400 - dnsPolicy: ClusterFirst - containers: - - name: {{ template "openshift-console-plugin.patcherName" . }} - image: {{ required "Patcher image must be specified!" .Values.plugin.jobs.patchConsoles.image }} - {{- if and (.Values.plugin.securityContext.enabled) (.Values.plugin.containerSecurityContext) }} - securityContext: {{ tpl (toYaml (omit .Values.plugin.jobs.patchConsoles.containerSecurityContext "enabled")) $ | nindent 12 }} - {{- end }} - resources: - {{- toYaml .Values.plugin.jobs.patchConsoles.resources | nindent 12 }} - command: - - /bin/bash - - -c - - | - existingPlugins=$(oc get consoles.operator.openshift.io cluster -o json | jq -c '.spec.plugins // []') - mergedPlugins=$(jq --argjson existingPlugins "${existingPlugins}" --argjson consolePlugin '["{{ template "openshift-console-plugin.name" . }}"]' -c -n '$existingPlugins + $consolePlugin | unique') - patchedPlugins=$(jq --argjson mergedPlugins $mergedPlugins -n -c '{ "spec": { "plugins": $mergedPlugins } }') - oc patch consoles.operator.openshift.io cluster --patch $patchedPlugins --type=merge -{{- end }} \ No newline at end of file diff --git a/charts/openshift-console-plugin/templates/patcher-clusterrole.yaml b/charts/openshift-console-plugin/templates/patcher-clusterrole.yaml deleted file mode 100644 index 31c050a5..00000000 --- a/charts/openshift-console-plugin/templates/patcher-clusterrole.yaml +++ /dev/null @@ -1,13 +0,0 @@ -{{- if .Values.plugin.jobs.patchConsoles.enabled }} -apiVersion: rbac.authorization.k8s.io/v1 -kind: ClusterRole -metadata: - name: {{ template "openshift-console-plugin.patcherName" . }} - namespace: {{ .Release.Namespace }} - labels: - {{- include "openshift-console-plugin.labels" . | nindent 4 }} -rules: - - apiGroups: ["operator.openshift.io"] - resources: ["consoles"] - verbs: ["get","list","patch", "update"] -{{- end }} \ No newline at end of file diff --git a/charts/openshift-console-plugin/templates/patcher-clusterrolebinding.yaml b/charts/openshift-console-plugin/templates/patcher-clusterrolebinding.yaml deleted file mode 100644 index d93b8721..00000000 --- a/charts/openshift-console-plugin/templates/patcher-clusterrolebinding.yaml +++ /dev/null @@ -1,17 +0,0 @@ -{{- if .Values.plugin.jobs.patchConsoles.enabled }} -apiVersion: rbac.authorization.k8s.io/v1 -kind: ClusterRoleBinding -metadata: - name: {{ template "openshift-console-plugin.patcherName" . }} - namespace: {{ .Release.Namespace }} - labels: - {{- include "openshift-console-plugin.labels" . | nindent 4 }} -roleRef: - apiGroup: rbac.authorization.k8s.io - kind: ClusterRole - name: {{ template "openshift-console-plugin.patcherName" . }} -subjects: - - kind: ServiceAccount - name: {{ template "openshift-console-plugin.patcherServiceAccountName" . }} - namespace: {{ .Release.Namespace }} -{{- end }} \ No newline at end of file diff --git a/charts/openshift-console-plugin/templates/patcher-serviceaccount.yaml b/charts/openshift-console-plugin/templates/patcher-serviceaccount.yaml deleted file mode 100644 index 4af6a6b9..00000000 --- a/charts/openshift-console-plugin/templates/patcher-serviceaccount.yaml +++ /dev/null @@ -1,12 +0,0 @@ -{{- if and (.Values.plugin.patcherServiceAccount.create) (.Values.plugin.jobs.patchConsoles.enabled) -}} -apiVersion: v1 -kind: ServiceAccount -metadata: - name: {{ include "openshift-console-plugin.patcherServiceAccountName" . }} - labels: - {{- include "openshift-console-plugin.labels" . | nindent 4 }} - {{- with .Values.plugin.patcherServiceAccount.annotations }} - annotations: - {{- toYaml . | nindent 4 }} - {{- end }} -{{- end }} diff --git a/charts/openshift-console-plugin/templates/service.yaml b/charts/openshift-console-plugin/templates/service.yaml deleted file mode 100644 index cb6c9bfc..00000000 --- a/charts/openshift-console-plugin/templates/service.yaml +++ /dev/null @@ -1,21 +0,0 @@ -apiVersion: v1 -kind: Service -metadata: - {{- if not .Values.certificateSecretName }} - annotations: - service.alpha.openshift.io/serving-cert-secret-name: {{ template "openshift-console-plugin.certificateSecret" . }} - {{- end }} - name: {{ template "openshift-console-plugin.name" . }} - namespace: {{ .Release.Namespace }} - labels: - {{- include "openshift-console-plugin.labels" . | nindent 4 }} -spec: - ports: - - name: {{ .Values.plugin.port }}-tcp - protocol: TCP - port: {{ .Values.plugin.port }} - targetPort: {{ .Values.plugin.port }} - selector: - {{- include "openshift-console-plugin.selectorLabels" . | nindent 4 }} - type: ClusterIP - sessionAffinity: None diff --git a/charts/openshift-console-plugin/templates/serviceaccount.yaml b/charts/openshift-console-plugin/templates/serviceaccount.yaml deleted file mode 100644 index 5c3dffe4..00000000 --- a/charts/openshift-console-plugin/templates/serviceaccount.yaml +++ /dev/null @@ -1,12 +0,0 @@ -{{- if .Values.plugin.serviceAccount.create -}} -apiVersion: v1 -kind: ServiceAccount -metadata: - name: {{ include "openshift-console-plugin.serviceAccountName" . }} - labels: - {{- include "openshift-console-plugin.labels" . | nindent 4 }} - {{- with .Values.plugin.serviceAccount.annotations }} - annotations: - {{- toYaml . | nindent 4 }} - {{- end }} -{{- end }} diff --git a/charts/openshift-console-plugin/values.yaml b/charts/openshift-console-plugin/values.yaml deleted file mode 100644 index 6cc865ba..00000000 --- a/charts/openshift-console-plugin/values.yaml +++ /dev/null @@ -1,54 +0,0 @@ ---- -plugin: - name: "" - description: "" - image: "" - imagePullPolicy: IfNotPresent - replicas: 2 - port: 9443 - securityContext: - enabled: true - podSecurityContext: - enabled: true - runAsNonRoot: true - seccompProfile: - type: RuntimeDefault - containerSecurityContext: - enabled: true - allowPrivilegeEscalation: false - capabilities: - drop: - - ALL - resources: - requests: - cpu: 10m - memory: 50Mi - basePath: / - certificateSecretName: "" - serviceAccount: - create: true - annotations: {} - name: "" - patcherServiceAccount: - create: true - annotations: {} - name: "" - jobs: - patchConsoles: - enabled: true - image: "registry.redhat.io/openshift4/ose-tools-rhel8@sha256:e44074f21e0cca6464e50cb6ff934747e0bd11162ea01d522433a1a1ae116103" - podSecurityContext: - enabled: true - runAsNonRoot: true - seccompProfile: - type: RuntimeDefault - containerSecurityContext: - enabled: true - allowPrivilegeEscalation: false - capabilities: - drop: - - ALL - resources: - requests: - cpu: 10m - memory: 50Mi diff --git a/ct.yaml b/ct.yaml deleted file mode 100644 index f178aec1..00000000 --- a/ct.yaml +++ /dev/null @@ -1,5 +0,0 @@ -chart-dirs: - - charts -validate-maintainers: false -remote: origin -target-branch: main diff --git a/integration-tests/tests/example-page.cy.ts b/integration-tests/tests/example-page.cy.ts deleted file mode 100644 index 922011c7..00000000 --- a/integration-tests/tests/example-page.cy.ts +++ /dev/null @@ -1,76 +0,0 @@ -import { checkErrors } from '../support'; - -const PLUGIN_TEMPLATE_NAME = 'networking-console-plugin'; -const PLUGIN_TEMPLATE_PULL_SPEC = Cypress.env('PLUGIN_TEMPLATE_PULL_SPEC'); -export const isLocalDevEnvironment = Cypress.config('baseUrl').includes('localhost'); - -const installHelmChart = (path: string) => { - cy.exec( - `cd ../../networking-console-plugin && ${path} upgrade -i ${PLUGIN_TEMPLATE_NAME} charts/openshift-console-plugin -n ${PLUGIN_TEMPLATE_NAME} --create-namespace --set plugin.image=${PLUGIN_TEMPLATE_PULL_SPEC}`, - { - failOnNonZeroExit: false, - }, - ) - .get('[data-test="refresh-web-console"]', { timeout: 300000 }) - .should('exist') - .then((result) => { - cy.reload(); - cy.visit(`/dashboards`); - cy.log('Error installing helm chart: ', result.stderr); - cy.log('Successfully installed helm chart: ', result.stdout); - }); -}; -const deleteHelmChart = (path: string) => { - cy.exec( - `cd ../../networking-console-plugin && ${path} uninstall ${PLUGIN_TEMPLATE_NAME} -n ${PLUGIN_TEMPLATE_NAME} && oc delete namespaces ${PLUGIN_TEMPLATE_NAME}`, - { - failOnNonZeroExit: false, - }, - ).then((result) => { - cy.log('Error uninstalling helm chart: ', result.stderr); - cy.log('Successfully uninstalled helm chart: ', result.stdout); - }); -}; - -describe.skip('Console plugin template test', () => { - before(() => { - cy.login(); - - if (!isLocalDevEnvironment) { - console.log('this is not a local env, installig helm'); - - cy.exec('cd ../../networking-console-plugin && ./install_helm.sh', { - failOnNonZeroExit: false, - }).then((result) => { - cy.log('Error installing helm binary: ', result.stderr); - cy.log('Successfully installed helm binary in "/tmp" directory: ', result.stdout); - - installHelmChart('/tmp/helm'); - }); - } else { - console.log('this is a local env, not installing helm'); - - installHelmChart('helm'); - } - }); - - afterEach(() => { - checkErrors(); - }); - - after(() => { - if (!isLocalDevEnvironment) { - deleteHelmChart('/tmp/helm'); - } else { - deleteHelmChart('helm'); - } - cy.logout(); - }); - - it('Verify the example page title', () => { - cy.get('[data-quickstart-id="qs-nav-home"]').click(); - cy.get('[data-test="nav"]').contains('Plugin Example').click(); - cy.url().should('include', '/example'); - cy.get('[data-test="example-page-title"]').should('contain', 'Hello, Plugin!'); - }); -});