diff --git a/.gitignore b/.gitignore index f1e73b7c4e..c20e0f25b1 100644 --- a/.gitignore +++ b/.gitignore @@ -29,3 +29,5 @@ testbin/* # Directory with CRDs for dependencies dep-crds + +kueue.yaml diff --git a/hack/generate_krew.sh b/hack/generate_krew.sh new file mode 100755 index 0000000000..9c46e844a1 --- /dev/null +++ b/hack/generate_krew.sh @@ -0,0 +1,67 @@ +#!/usr/bin/env bash + +# Copyright 2024 The Kubernetes Authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +set -o errexit +set -o nounset +set -o pipefail + +# This script generates a Krew-compatible plugin manifest. + +VERSION=${VERSION:-$(git describe --tags | sed 's/^v//g')} + +# Generate the manifest for a single platform. +function generate_platform { + cat < kueue.yaml +apiVersion: krew.googlecontainertools.github.com/v1alpha2 +kind: Plugin +metadata: + name: kueue +spec: + version: "v${VERSION}" + shortDescription: Controls Kueue queueing manager. + homepage: https://kueue.sigs.k8s.io/docs/reference/kubectl-kueue/ + description: | + The kubectl-kueue plugin, kueuectl, allows you to list, create, resume + and stop kueue resources such as clusterqueues, localqueues and workloads. + + See the documentation for more information: https://kueue.sigs.k8s.io/docs/reference/kubectl-kueue/ + caveats: | + Requires the Kueue operator to be installed: + https://kueue.sigs.k8s.io/docs/installation/ + platforms: +EOF + +generate_platform linux amd64 ./kubectl-kueue >> kueue.yaml +generate_platform linux arm64 ./kubectl-kueue >> kueue.yaml +generate_platform darwin amd64 ./kubectl-kueue >> kueue.yaml +generate_platform darwin arm64 ./kubectl-kueue >> kueue.yaml + +echo "To publish to the krew index, create a pull request on https://github.com/kubernetes-sigs/krew-index/tree/master/plugins to update kueue.yaml with the newly generated kueue.yaml." \ No newline at end of file