diff --git a/Makefile b/Makefile index 3c7d2080..74f32d64 100644 --- a/Makefile +++ b/Makefile @@ -52,10 +52,14 @@ test: install: build install bin/kubectl-operator $(shell go env GOPATH)/bin -.PHONY: gen-demo -gen-demo: +.PHONY: gen-demo-v0 +gen-demo-v0: ./assets/demo/gen-demo.sh +.PHONY: gen-demo-v1 +gen-demo-v1: + ./assets/demo/gen-demo_v1.sh + .PHONY: lint lint: $(GOLANGCI_LINT) $(GOLANGCI_LINT) --timeout 3m run diff --git a/README.md b/README.md index 902e0238..6e9ecba4 100644 --- a/README.md +++ b/README.md @@ -5,12 +5,22 @@ for Operators in your cluster. It simplifies adding and removing Operator catalogs, and it has familiar commands for installing, uninstalling, and listing available and installed Operators. +kubectl operator can be used for both OLM VO and V1. + +To see the OLM V1 related commands , run + +``` +kubectl operator olmv1 --help + +``` > **NOTE**: This plugin requires Operator Lifecycle Manager to be installed in your cluster. See the OLM installation instructions [here](https://olm.operatorframework.io/docs/getting-started/) ## Demo +### OLM V0 + ![asciicast](assets/demo/demo.gif) ## Install diff --git a/assets/demo/demo.v1.asciinema.json b/assets/demo/demo.v1.asciinema.json new file mode 100644 index 00000000..e1704be0 --- /dev/null +++ b/assets/demo/demo.v1.asciinema.json @@ -0,0 +1,71 @@ +{"version": 2, "width": 238, "height": 59, "timestamp": 1741035122, "env": {"SHELL": "/bin/bash", "TERM": "xterm-256color"}} +[0.00694, "o", "\r\n$ "] +[1.008812, "o", "k"] +[1.071419, "o", "u"] +[1.134045, "o", "b"] +[1.196899, "o", "e"] +[1.259644, "o", "c"] +[1.322171, "o", "t"] +[1.38458, "o", "l"] +[1.446732, "o", " "] +[1.509282, "o", "o"] +[1.571752, "o", "p"] +[1.633689, "o", "e"] +[1.69634, "o", "r"] +[1.758733, "o", "a"] +[1.820696, "o", "t"] +[1.883169, "o", "o"] +[1.945297, "o", "r"] +[2.007862, "o", " "] +[2.070137, "o", "o"] +[2.132464, "o", "l"] +[2.195207, "o", "m"] +[2.257525, "o", "v"] +[2.320083, "o", "1"] +[2.382616, "o", " "] +[2.444575, "o", "-"] +[2.507354, "o", "-"] +[2.569846, "o", "h"] +[2.632602, "o", "e"] +[2.69464, "o", "l"] +[2.757316, "o", "p"] +[2.820534, "o", "\r\n"] +[3.165561, "o", "Manage operators via OLMv1 in a cluster from the command line.\r\n\r\n"] +[3.165893, "o", "Usage:\r\n operator olmv1 [command]\r\n\r\nAvailable Commands:\r\n get Display one or many OLMv1-specific resource(s)\r\n install Install an operator\r\n uninstall Uninstall an operator\r\n\r\nFlags:\r\n -h, --help help for olmv1\r\n\r\nGlobal Flags:\r\n -n, --namespace string If present, namespace scope for this CLI request\r\n --timeout duration The amount of time to wait before giving up on an operation. (default 1m0s)\r\n\r\nUse \"operator olmv1 [command] --help\" for more information about a command.\r\n"] +[3.16888, "o", "\r\n$ "] +[4.171663, "o", "k"] +[4.23439, "o", "u"] +[4.297189, "o", "b"] +[4.35961, "o", "e"] +[4.421938, "o", "c"] +[4.484191, "o", "t"] +[4.546896, "o", "l"] +[4.608991, "o", " "] +[4.671543, "o", "o"] +[4.734268, "o", "p"] +[4.79688, "o", "e"] +[4.858947, "o", "r"] +[4.921002, "o", "a"] +[4.983269, "o", "t"] +[5.045912, "o", "o"] +[5.108658, "o", "r"] +[5.170577, "o", " "] +[5.232759, "o", "o"] +[5.294904, "o", "l"] +[5.357823, "o", "m"] +[5.420124, "o", "v"] +[5.48196, "o", "1"] +[5.544323, "o", " "] +[5.606796, "o", "g"] +[5.66873, "o", "e"] +[5.731189, "o", "t"] +[5.793563, "o", " "] +[5.856048, "o", "c"] +[5.917862, "o", "a"] +[5.980359, "o", "t"] +[6.043011, "o", "a"] +[6.105319, "o", "l"] +[6.167778, "o", "o"] +[6.230328, "o", "g"] +[6.292729, "o", "\r\n"] +[6.655321, "o", "NAME AVAILABILITY PRIORITY LASTUNPACKED SERVING AGE\r\noperatorhubio Available 0 3h12m True 3h12m\r\n"] diff --git a/assets/demo/demo_v1.sh b/assets/demo/demo_v1.sh new file mode 100755 index 00000000..905e19dc --- /dev/null +++ b/assets/demo/demo_v1.sh @@ -0,0 +1,28 @@ +#!/usr/bin/env bash + +INTERACTIVE=${INTERACTIVE:-"1"} + +run() { + type "kubectl operator olmv1 --help" + type "kubectl operator olmv1 get catalog" +} + +prompt() { + echo "" + echo -n "$ " +} + +type() { + prompt + sleep 1 + for (( i=0; i<${#1}; i++ )); do + echo -n "${1:$i:1}" + sleep 0.06 + done + echo "" + sleep 0.25 + eval $1 + [[ "$INTERACTIVE" == "1" ]] && read -p "" +} + +run diff --git a/assets/demo/gen-demo_v1.sh b/assets/demo/gen-demo_v1.sh new file mode 100755 index 00000000..63a5f9ef --- /dev/null +++ b/assets/demo/gen-demo_v1.sh @@ -0,0 +1,8 @@ +#!/bin/bash + +set -o errexit +set -o pipefail + +INTERACTIVE=0 asciinema rec --overwrite -c ./assets/demo/demo_v1.sh ./assets/demo/demo.v1.asciinema.json +asciicast2gif -w 102 -h 34 ./assets/demo/demo.v1.asciinema.json ./assets/demo/demo-v1.gif +rm ./assets/demo/demo.v1.asciinema.json