Skip to content

Prepare oadp-cli for krew addition - #20

Merged
kaovilai merged 7 commits into
migtools:mainfrom
Joeavaikath:krew-init
Jul 16, 2025
Merged

Prepare oadp-cli for krew addition#20
kaovilai merged 7 commits into
migtools:mainfrom
Joeavaikath:krew-init

Conversation

@Joeavaikath

Copy link
Copy Markdown
Contributor

No description provided.

- Add Krew plugin manifest (oadp.yaml) with LICENSE extraction
- Update Makefile with release targets and krew-manifest generation
- Fix .gitignore and clean patterns to preserve design documents
- Add Krew installation instructions to README
- Include LICENSE file in all release archives
- Add comprehensive release process documentation

Ready for Krew plugin distribution with proper licensing.
Update apiVersion from krew.googlecode.com/v1alpha2 to
krew.googlecontainertools.github.com/v1alpha2 for compatibility
with current Krew installation.

Tested locally with:
✅ Local installation with --manifest and --archive flags
✅ Plugin functionality verification
✅ LICENSE file extraction confirmation
✅ Cross-platform installation testing (linux/amd64 on darwin/arm64)
✅ Plugin uninstallation testing

Ready for Krew index submission.
🔧 Makefile Optimizations:
- Centralized platform definitions (PLATFORMS variable) to eliminate duplication
- Removed hardcoded platform arrays from 3 different targets
- Simplified krew-manifest generation with Python script approach
- Added fallback sed approach for environments without Python3
- Consolidated binary naming logic for Windows .exe handling

🗂️ File Structure Cleanup:
- Removed duplicate design.md template file
- Kept kubectl-oadp-design.md as the actual project design document

📊 Impact:
- Reduced Makefile from 188 to 165 lines (-12% size reduction)
- Eliminated 3 instances of hardcoded platform arrays
- Replaced 25 lines of repetitive sed commands with 8 lines of Python
- Improved maintainability and reduced error-prone manual updates

✅ Verified:
- All build targets work correctly
- Platform binary generation successful (5 platforms)
- Help system and documentation updated
- No functionality regressions
Comment thread Makefile Outdated
Comment thread cmd/root.go
@kaovilai
kaovilai requested a review from Copilot July 15, 2025 17:04

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR prepares the OADP CLI for distribution via Krew by adding license headers, creating a Krew plugin manifest, and enhancing build/release scripts and documentation.

  • Added Apache 2.0 license headers to source and test files
  • Introduced oadp.yaml (Krew plugin manifest) and updated CLI examples for plugin usage
  • Enhanced Makefile with versioning, multi-platform release targets, and krew-manifest generation

Reviewed Changes

Copilot reviewed 12 out of 13 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
tests/common.go Added Apache 2.0 license header
oadp.yaml New Krew plugin manifest with plugin metadata
main.go Imported K8s auth plugins and added license header
cmd/root.go Added plugin invocation detection and dynamic usage prefix logic
README.md Added Krew installation instructions and release process notes
Makefile Centralized platform targets, versioning, release and manifest rules
Comments suppressed due to low confidence (3)

oadp.yaml:36

  • Each sha256 field must be populated with the actual checksum of the corresponding archive. Leaving them empty will break Krew plugin verification.
    sha256: ""

README.md:34

  • [nitpick] The step to install Krew via kubectl krew install krew may be confusing or incorrect; link to the official Krew installation instructions instead of using itself.
kubectl krew install krew

Makefile:20

  • [nitpick] The get_binary_name helper is defined but never used; consider removing it or integrating it into your release scripts to avoid dead code.
define get_binary_name

Comment thread Makefile Outdated
@Joeavaikath
Joeavaikath requested a review from kaovilai July 16, 2025 14:38

@NicholasYancey NicholasYancey left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

@kaovilai
kaovilai merged commit 21798a7 into migtools:main Jul 16, 2025
2 checks passed
@Joeavaikath
Joeavaikath deleted the krew-init branch July 16, 2025 17:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants