From e931a5ee55c3ffa4da79c2b63efa0332bdb90663 Mon Sep 17 00:00:00 2001 From: timflannagan Date: Fri, 15 Apr 2022 13:44:23 -0400 Subject: [PATCH] Remove the run-console-local Makefile target Signed-off-by: timflannagan --- Makefile | 5 --- README.md | 14 +------- scripts/run_console_local.sh | 67 ------------------------------------ 3 files changed, 1 insertion(+), 85 deletions(-) delete mode 100755 scripts/run_console_local.sh diff --git a/Makefile b/Makefile index 708ffc2dc3..321e1313be 100644 --- a/Makefile +++ b/Makefile @@ -254,11 +254,6 @@ endif # OLM - Install/Uninstall/Run # ################################ -.PHONY: run-console-local -run-console-local: - @echo Running script to run the OLM console locally: - . ./scripts/run_console_local.sh - .PHONY: uninstall uninstall: @echo Uninstalling OLM: diff --git a/README.md b/README.md index 80c371c71b..538eefbb0e 100644 --- a/README.md +++ b/README.md @@ -56,18 +56,6 @@ Install OLM on a Kubernetes cluster by following the [installation guide][instal For a complete end-to-end example of how OLM fits into the Operator Framework, see the [Operator Framework website](https://operatorframework.io/about/) and the [Getting Started guide on OperatorHub.io](https://operatorhub.io/getting-started). -## User Interface (Running the console Locally) - -Use the admin console to interact with and visualize the resources managed by OLM. Create subscriptions, approve install plans, identify Operator-managed resources, and more. - -Ensure `kubectl` is pointing at a cluster and run: - -```shell -make run-console-local -``` - -Then visit `http://localhost:9000` to view the console. - ## Contributing your Operator Have an awesome Operator you want to share? Checkout the [publishing docs](https://operatorhub.io/contribute) to learn about contributing to [OperatorHub.io](https://operatorhub.io/). @@ -97,7 +85,7 @@ Learn more about the components used by OLM by reading about the [architecture] OLM standardizes interactions with operators by requiring that the interface to an operator be via the Kubernetes API. Because we expect users to define the interfaces to their applications, OLM currently uses CRDs to define the Kubernetes API interactions. -Examples: [EtcdCluster CRD](https://github.com/redhat-openshift-ecosystem/community-operators-prod/blob/main/operators/etcd/0.9.4/etcdclusters.etcd.database.coreos.com.crd.yaml), +Examples: [EtcdCluster CRD](https://github.com/redhat-openshift-ecosystem/community-operators-prod/blob/main/operators/etcd/0.9.4/etcdclusters.etcd.database.coreos.com.crd.yaml), [EtcdBackup CRD](https://github.com/redhat-openshift-ecosystem/community-operators-prod/blob/main/operators/etcd/0.9.4/etcdbackups.etcd.database.coreos.com.crd.yaml) ## Descriptors diff --git a/scripts/run_console_local.sh b/scripts/run_console_local.sh deleted file mode 100755 index 08ccecee8d..0000000000 --- a/scripts/run_console_local.sh +++ /dev/null @@ -1,67 +0,0 @@ -#!/bin/sh - -# Colors definition -readonly RED=$(tput setaf 1) -readonly RESET=$(tput sgr0) -readonly GREEN=$(tput setaf 2) - -# Check if Podman binary exists -verify_podman_binary() { - if hash podman 2>/dev/null; then - POD_MANAGER="podman" - else - POD_MANAGER="docker" - fi -} - -# Add port as 9000:9000 as arg when the SO is MacOS or Win -add_host_port_arg (){ - args="--net=host" - if [ -z "${OSTYPE##*"darwin"*}" ] || uname -r | grep -q 'Microsoft'; then - args="-p 9000:9000" - fi -} - -pull_ocp_console_image (){ - $POD_MANAGER pull quay.io/openshift/origin-console:latest -} - -run_ocp_console_image (){ - secretname=$(kubectl get serviceaccount default --namespace=kube-system -o jsonpath='{.secrets[0].name}') - endpoint=$(kubectl config view -o json | jq '{myctx: .["current-context"], ctxs: .contexts[], clusters: .clusters[]}' | jq 'select(.myctx == .ctxs.name)' | jq 'select(.ctxs.context.cluster == .clusters.name)' | jq '.clusters.cluster.server' -r) - - echo "Using $endpoint" - $POD_MANAGER run -d --rm $args \ - -e BRIDGE_USER_AUTH="disabled" \ - -e BRIDGE_K8S_MODE="off-cluster" \ - -e BRIDGE_K8S_MODE_OFF_CLUSTER_ENDPOINT="$endpoint" \ - -e BRIDGE_K8S_MODE_OFF_CLUSTER_SKIP_VERIFY_TLS=true \ - -e BRIDGE_K8S_AUTH="bearer-token" \ - -e BRIDGE_K8S_AUTH_BEARER_TOKEN="$(kubectl get secret "$secretname" --namespace=kube-system -o template --template='{{.data.token}}' | base64 --decode)" \ - quay.io/openshift/origin-console:latest > /dev/null 2>&1 & -} - -verify_ocp_console_image (){ - # Try for 5 seconds to reach the image - for i in 1 2 3 4 5; do - if [ "$($POD_MANAGER ps -q -f label=io.openshift.build.source-location=https://github.com/openshift/console)" ]; then - container_id="$($POD_MANAGER ps -q -l -f label=io.openshift.build.source-location=https://github.com/openshift/console)" - echo "${GREEN}The OLM is accessible via web console at:${RESET}" - echo "${GREEN}http://localhost:9000/${RESET}" - echo "${GREEN}Press Ctrl-C to quit${RESET}"; - $POD_MANAGER attach "$container_id" - exit 0 - fi - sleep 1 # Wait one second to try again - done - echo "${RED}Unable to run the console locally. May this port is in usage already.${RESET}" - echo "${RED}Check if the OLM is not accessible via web console at: http://localhost:9000/${RESET}" - exit 1 -} - -# Calling the functions -verify_podman_binary -add_host_port_arg -pull_ocp_console_image -run_ocp_console_image -verify_ocp_console_image