OADP CLI is a kubectl plugin (kubectl oadp) that provides a command-line interface for OADP (OpenShift API for Data Protection) operations. It simplifies backup, restore, and data protection management tasks. Supports cross-architecture builds and distributed as platform-specific binaries.
- Primary Language: Go
- Module:
github.com/migtools/oadp-cli - Default Branch:
oadp-dev
# Build the kubectl plugin binary
make build
# Build and install to ~/.local/bin
make install
# Install to ~/bin
make install-bin
# Install to /usr/local/bin (requires sudo)
make install-system
# Build for a specific platform
make build PLATFORM=linux/amd64
# Build for all platforms (release)
make release-build
# Create release archives with checksums
make release-archives# Run all tests
make test
# Run unit tests only
make test-unit
# Run integration tests only
make test-integration
# Run specific tests
go test ./internal/... -run TestName
go test ./cmd/... -run TestName
# Vet code
go vet ./...# Run golangci-lint
make lint
# Run golangci-lint with auto-fix and formatting
make lint-fixConfiguration: .golangci.yml
- kubectl plugin pattern (binary named
kubectl-oadp) - Commands in
cmd/directory using cobra - Internal packages in
internal/ - Documentation in
docs/ - Follow Go conventions for CLI tools
- Error messages should be user-friendly (this is a user-facing tool)
cmd/ - CLI command definitions (cobra commands)
root.go - Root command and global flags
backup/ - Backup subcommands
restore/ - Restore subcommands
internal/ - Private packages
client/ - Kubernetes client helpers
util/ - Utility functions
docs/ - User documentation and guides
- GitHub Actions workflows in
.github/workflows/:cross-arch-build-test.yml— Cross-architecture build testinglint.yml— Linting checkstest.yml— Test suiterelease.yml— Release automation
- Linter config:
.golangci.yml - Reproduce CI locally:
make build make lint make test
- Create a new cobra command in
cmd/ - Add subcommand to the parent command registration
- Implement logic in
internal/packages - Add unit tests
- Update documentation in
docs/
make uninstall # User locations
make uninstall-system # System locations
make uninstall-all # All locationsmake release # Builds all platforms and creates tar.gz archives with SHA256 checksumsmake status # Shows build status and installation info