diff --git a/manifest-templates/virt-footer.yaml.template b/manifest-templates/virt-footer.yaml.template index 568a281..a3769ca 100644 --- a/manifest-templates/virt-footer.yaml.template +++ b/manifest-templates/virt-footer.yaml.template @@ -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. \ No newline at end of file + 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 diff --git a/manifest-templates/virt-platform.yaml.template b/manifest-templates/virt-platform.yaml.template index 640f37e..79f92d4 100644 --- a/manifest-templates/virt-platform.yaml.template +++ b/manifest-templates/virt-platform.yaml.template @@ -6,5 +6,5 @@ sha256: "${VIRT_BUNDLE_SHA256}" files: - from: "/virtctl/${VIRT_BUNDLE_BINARY}" - to: "." - bin: "./${VIRT_BUNDLE_BINARY}" \ No newline at end of file + to: "${VIRT_BUNDLE_BINARY_TARGET}" + bin: "${VIRT_BUNDLE_BINARY_TARGET}" \ No newline at end of file diff --git a/scripts/functions b/scripts/functions index 56ea117..7a18cda 100644 --- a/scripts/functions +++ b/scripts/functions @@ -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 @@ -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