From b59d969979a568bd8ddacbaa54c642da83dd9255 Mon Sep 17 00:00:00 2001 From: Joseph Date: Thu, 16 Oct 2025 15:34:20 -0400 Subject: [PATCH 1/3] Remove unused archs for krew manifest --- .github/workflows/release.yml | 6 +----- oadp.yaml | 4 +--- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 2c6e383a..f56dc7a6 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -113,15 +113,13 @@ jobs: export VERSION="${{ github.ref_name }}" export LINUX_AMD64_SHA=$(grep "kubectl-oadp-linux-amd64.tar.gz" checksums.txt | cut -d' ' -f1) export LINUX_ARM64_SHA=$(grep "kubectl-oadp-linux-arm64.tar.gz" checksums.txt | cut -d' ' -f1) - export LINUX_PPC64LE_SHA=$(grep "kubectl-oadp-linux-ppc64le.tar.gz" checksums.txt | cut -d' ' -f1) - export LINUX_S390X_SHA=$(grep "kubectl-oadp-linux-s390x.tar.gz" checksums.txt | cut -d' ' -f1) export DARWIN_AMD64_SHA=$(grep "kubectl-oadp-darwin-amd64.tar.gz" checksums.txt | cut -d' ' -f1) export DARWIN_ARM64_SHA=$(grep "kubectl-oadp-darwin-arm64.tar.gz" checksums.txt | cut -d' ' -f1) export WINDOWS_AMD64_SHA=$(grep "kubectl-oadp-windows-amd64.tar.gz" checksums.txt | cut -d' ' -f1) export WINDOWS_ARM64_SHA=$(grep "kubectl-oadp-windows-arm64.tar.gz" checksums.txt | cut -d' ' -f1) # Validate all checksums were found - if [[ -z "$LINUX_AMD64_SHA" || -z "$LINUX_ARM64_SHA" || -z "$LINUX_PPC64LE_SHA" || -z "$LINUX_S390X_SHA" || -z "$DARWIN_AMD64_SHA" || -z "$DARWIN_ARM64_SHA" || -z "$WINDOWS_AMD64_SHA" || -z "$WINDOWS_ARM64_SHA" ]]; then + if [[ -z "$LINUX_AMD64_SHA" || -z "$LINUX_ARM64_SHA" || -z "$DARWIN_AMD64_SHA" || -z "$DARWIN_ARM64_SHA" || -z "$WINDOWS_AMD64_SHA" || -z "$WINDOWS_ARM64_SHA" ]]; then echo "❌ Some checksums are missing!" echo "Available checksums:" cat checksums.txt @@ -139,8 +137,6 @@ jobs: echo "Version: $VERSION" echo "Linux amd64: ${LINUX_AMD64_SHA:0:16}..." echo "Linux arm64: ${LINUX_ARM64_SHA:0:16}..." - echo "Linux ppc64le: ${LINUX_PPC64LE_SHA:0:16}..." - echo "Linux s390x: ${LINUX_S390X_SHA:0:16}..." echo "Darwin amd64: ${DARWIN_AMD64_SHA:0:16}..." echo "Darwin arm64: ${DARWIN_ARM64_SHA:0:16}..." echo "Windows amd64: ${WINDOWS_AMD64_SHA:0:16}..." diff --git a/oadp.yaml b/oadp.yaml index f8795d45..37c4a2f0 100644 --- a/oadp.yaml +++ b/oadp.yaml @@ -5,7 +5,7 @@ metadata: spec: version: ${VERSION} homepage: https://github.com/migtools/oadp-cli - shortDescription: Manage OpenShift API for Data Protection (OADP) backup and restore operations + shortDescription: CLI for OpenShift API for Data Protection (OADP) description: | kubectl-oadp is a kubectl plugin for managing OpenShift API for Data Protection (OADP) backup and restore operations. @@ -21,12 +21,10 @@ spec: - View backup status and logs - Delete backups - Support for both cluster-admin and namespace-scoped operations - - Integration with kubectl context for namespace detection caveats: | This plugin requires: - OADP operator to be installed in the cluster - Appropriate RBAC permissions for the operations you want to perform - - For non-admin operations: namespace-scoped permissions in your current kubectl context namespace platforms: - selector: matchLabels: From e24b23df85100490aeace48812e8db49520d0a66 Mon Sep 17 00:00:00 2001 From: Joseph Date: Fri, 17 Oct 2025 11:25:38 -0400 Subject: [PATCH 2/3] Add Krew release automation Signed-off-by: Joseph --- .github/workflows/release.yml | 5 ++- .krew.yaml | 60 +++++++++++++++++++++++++++++++++++ 2 files changed, 64 insertions(+), 1 deletion(-) create mode 100644 .krew.yaml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index f56dc7a6..090e80cf 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -192,4 +192,7 @@ jobs: draft: false prerelease: false env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - name: Update new version in krew-index + uses: rajatjindal/krew-release-bot@v0.0.46 \ No newline at end of file diff --git a/.krew.yaml b/.krew.yaml new file mode 100644 index 00000000..d510ec34 --- /dev/null +++ b/.krew.yaml @@ -0,0 +1,60 @@ +apiVersion: krew.googlecontainertools.github.com/v1alpha2 +kind: Plugin +metadata: + name: evict-pod +spec: + version: {{ .TagName }} + homepage: https://github.com/migtools/oadp-cli + platforms: + - selector: + matchLabels: + os: darwin + arch: amd64 + {{addURIAndSha "https://github.com/migtools/oadp-cli/releases/download/{{ .TagName }}/kubectl-oadp_{{ .TagName }}_darwin_amd64.tar.gz" .TagName }} + bin: kubectl-oadp + - selector: + matchLabels: + os: darwin + arch: arm64 + {{addURIAndSha "https://github.com/migtools/oadp-cli/releases/download/{{ .TagName }}/kubectl-oadp_{{ .TagName }}_darwin_arm64.tar.gz" .TagName }} + bin: kubectl-oadp + - selector: + matchLabels: + os: linux + arch: amd64 + {{addURIAndSha "https://github.com/migtools/oadp-cli/releases/download/{{ .TagName }}/kubectl-oadp_{{ .TagName }}_linux_amd64.tar.gz" .TagName }} + bin: kubectl-oadp + - selector: + matchLabels: + os: linux + arch: arm64 + {{addURIAndSha "https://github.com/migtools/oadp-cli/releases/download/{{ .TagName }}/kubectl-oadp_{{ .TagName }}_linux_arm64.tar.gz" .TagName }} + bin: kubectl-oadp + - selector: + matchLabels: + os: windows + arch: amd64 + {{addURIAndSha "https://github.com/migtools/oadp-cli/releases/download/{{ .TagName }}/kubectl-oadp_{{ .TagName }}_windows_amd64.tar.gz" .TagName }} + bin: kubectl-oadp + - selector: + matchLabels: + os: windows + arch: arm64 + {{addURIAndSha "https://github.com/migtools/oadp-cli/releases/download/{{ .TagName }}/kubectl-oadp_{{ .TagName }}_windows_arm64.tar.gz" .TagName }} + bin: kubectl-oadp + shortDescription: CLI for OpenShift APIs for Data Protection (OADP) operator + description: | + kubectl-oadp is a kubectl plugin for managing OpenShift API for Data Protection (OADP) backup and restore operations. + + It provides both admin and non-admin commands: + - Admin commands: Full OADP/Velero backup and restore operations + - Non-admin commands: Namespace-scoped backup operations with automatic namespace detection + + The plugin automatically detects the appropriate namespace from your current kubectl context + for non-admin operations, following the principle of least privilege. + + Features: + - Create and manage OADP backups + - View backup status and logs + - Delete backups + - Support for both cluster-admin and namespace-scoped operations \ No newline at end of file From e8e4341115a9b7db26f94a501dc65f0ebe247262 Mon Sep 17 00:00:00 2001 From: Joseph Date: Fri, 17 Oct 2025 13:57:08 -0400 Subject: [PATCH 3/3] Fix name Signed-off-by: Joseph --- .krew.yaml | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/.krew.yaml b/.krew.yaml index d510ec34..9650feab 100644 --- a/.krew.yaml +++ b/.krew.yaml @@ -1,7 +1,7 @@ apiVersion: krew.googlecontainertools.github.com/v1alpha2 kind: Plugin metadata: - name: evict-pod + name: kubectl-oadp spec: version: {{ .TagName }} homepage: https://github.com/migtools/oadp-cli @@ -57,4 +57,10 @@ spec: - Create and manage OADP backups - View backup status and logs - Delete backups - - Support for both cluster-admin and namespace-scoped operations \ No newline at end of file + - Support for both cluster-admin and namespace-scoped operations + caveats: | + This plugin requires: + - OADP operator to be installed in the cluster + - Ensure the velero namespace (where the server is running) is correct: Run `kubectl oadp client config set namespace=` to set the velero namespace + - Appropriate RBAC permissions for the operations you want to perform + - Read more documentation at: https://github.com/migtools/oadp-cli \ No newline at end of file