Skip to content

Commit

Permalink
manifest.yaml improvements
Browse files Browse the repository at this point in the history
Improve manifest template content:
- Improve caveat and documentation sections
- Change platform file copying to rename binary excluding the version and platform

Remove shellcheck warnings.
  • Loading branch information
dhiller committed Jun 7, 2019
1 parent 34ba2e7 commit 7a86bce
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 11 deletions.
35 changes: 30 additions & 5 deletions manifest-templates/virt-footer.yaml.template
Original file line number Diff line number Diff line change
@@ -1,10 +1,35 @@
shortDescription: controls virtual machine related operations.
homepage: https://kubevirt.io
caveats: |
Usage:
kubectl virt
virt plugin is a wrapper for virtctl originating from the kubevirt.io project. In order to use virtctl you will
need to have kubevirt installed on your kubernetes cluster to use it. See https://kubevirt.io/ for details

Documentation:
https://kubevirt.io/user-guide/docs/latest/administration/intro.html#client-side-virtctl-deployment
Run

kubectl virt help

to get an overview of the available commands

See

https://kubevirt.io/user-guide/docs/latest/using-virtual-machines/graphical-and-console-access.html

for a usage example
description: |
virt plugin controls virtual machine related operations on your kubernetes cluster.
virt plugin is a wrapper for virtctl originating from the kubevirt project. KubeVirt is a virtualization add-on to
Kubernetes, i.e. it enables to run existing virtual machines on kubernetes clusters. virtctl controls virtual
machine related operations on your kubernetes cluster.

Kubevirt documentation:
Overview:
https://kubevirt.io/
Installation:
https://kubevirt.io/user-guide/docs/latest/administration/intro.html
User Guide:
https://kubevirt.io/user-guide/docs/latest/welcome/index.html
Minikube Quickstart:
https://kubevirt.io/quickstart_minikube/
Virtctl usage examples:
https://kubevirt.io/user-guide/docs/latest/using-virtual-machines/graphical-and-console-access.html
https://kubevirt.io/user-guide/docs/latest/using-virtual-machines/expose-service.html
https://kubevirt.io/user-guide/docs/latest/using-virtual-machines/virtual-machine-replica-set.html
4 changes: 2 additions & 2 deletions manifest-templates/virt-platform.yaml.template
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@
sha256: "${VIRT_BUNDLE_SHA256}"
files:
- from: "/virtctl/${VIRT_BUNDLE_BINARY}"
to: "."
bin: "./${VIRT_BUNDLE_BINARY}"
to: "${VIRT_BUNDLE_BINARY_TARGET}"
bin: "${VIRT_BUNDLE_BINARY_TARGET}"
13 changes: 9 additions & 4 deletions scripts/functions
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env bash

SRC_DIR=$(dirname "${BASH_SOURCE[0]}")
BASE_DIR=$(cd $SRC_DIR; cd ..; pwd)
SRC_DIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd || exit 1)
BASE_DIR=$(cd "$SRC_DIR" && cd ..; pwd || exit 1)

function usage {
local message
Expand Down Expand Up @@ -123,11 +123,16 @@ function create_krew_manifest_yaml {
release_file_binary_name="${release_file_name%.tar.gz}"
regexp='virtctl-(v[0-9\.]+)-([a-z]+)-([a-z0-9]+)(\.exe)?\.tar\.gz'

export VIRT_OS=$(echo $release_file_name | sed -E 's/'"$regexp"'/\2/g')
export VIRT_ARCH=$(echo $release_file_name | sed -E 's/'"$regexp"'/\3/g')
VIRT_OS=$(echo "$release_file_name" | sed -E 's/'"$regexp"'/\2/g')
export VIRT_OS
VIRT_ARCH=$(echo "$release_file_name" | sed -E 's/'"$regexp"'/\3/g')
export VIRT_ARCH
export VIRT_BUNDLE_URI="https://github.com/dhiller/kubectl-virt-plugin/releases/download/$version/$release_file_name"
export VIRT_BUNDLE_SHA256="$release_file_sah256sum"
export VIRT_BUNDLE_BINARY="$release_file_binary_name"
VIRT_BUNDLE_BINARY_TARGET="$(echo "$release_file_binary_name" | \
sed -E 's/virtctl-(v[0-9\.]+)-([a-z]+)-([a-z0-9]+)(\.exe)?/virtctl\4/g')"
export VIRT_BUNDLE_BINARY_TARGET
(cat "$BASE_DIR/manifest-templates/virt-platform.yaml.template" | envsubst) >> "$output_file"
done

Expand Down

0 comments on commit 7a86bce

Please sign in to comment.