Skip to content
This repository was archived by the owner on Jan 24, 2026. It is now read-only.

Conversation

@mrgb7
Copy link
Owner

@mrgb7 mrgb7 commented Jun 8, 2025

Feature: Add --override flag for plugin installation

This PR implements the --override flag feature requested in #48, allowing users to force re-installation/update of plugins with custom configuration values.

🎯 What This PR Does

Adds support for forcing plugin re-installation with custom values:

playground cluster plugin add -n argocd --override \
  --set admin.password=newpass \
  --set server.replicas=3 \
  --set redis.enabled=true \
  --cluster playground

🔧 Key Features

  • --override Flag: Forces re-installation even if plugin is already installed
  • Multiple --set Flags: Support for multiple configuration overrides
  • Nested Key Support: Dot notation for nested values (e.g., server.replicas=3)
  • Type-Aware Parsing: Automatically parses strings, numbers, and booleans
  • Plugin Validation: Each plugin validates allowed override keys
  • Value Merging: Deep merges override values with plugin defaults

📝 Implementation Details

New Interfaces

  • OverrideValidator: Validates override values per plugin
  • OverridablePlugin: Allows plugins to accept override values

ArgoCD Plugin Support

  • Validates allowed override keys (admin.password, server.replicas, etc.)
  • Merges override values with default values from remote configuration
  • Supports all major ArgoCD configuration parameters

CLI Enhancements

  • Added --override boolean flag
  • Added --set stringArray flag for multiple value overrides
  • Robust parameter parsing with error handling

🧪 Testing

  • ✅ Comprehensive unit tests for parameter parsing
  • ✅ Tests for nested value handling
  • ✅ ArgoCD plugin validation tests
  • ✅ Value merging functionality tests
  • ✅ All existing tests continue to pass

🎬 Usage Examples

# Override ArgoCD admin password
playground cluster plugin add -n argocd --override --set admin.password=newsecret --cluster dev

# Override multiple values
playground cluster plugin add -n argocd --override \
  --set admin.password=newsecret \
  --set server.replicas=3 \
  --set redis.enabled=true \
  --cluster production

# Override nested configuration
playground cluster plugin add -n argocd --override \
  --set server.resources.requests.memory=512Mi \
  --set server.resources.requests.cpu=200m \
  --cluster production

🔒 Safety Features

  • Validation: Only allowed keys can be overridden per plugin
  • Type Safety: Values are parsed and validated appropriately
  • Error Handling: Clear error messages for invalid configurations
  • Non-Breaking: Existing functionality remains unchanged

📋 Checklist

  • --override flag implementation
  • Multiple --set flag support
  • Plugin interface extensions
  • ArgoCD plugin override support
  • Parameter parsing and validation
  • Value merging with defaults
  • Comprehensive test coverage
  • Code formatting (go fmt)
  • Linting compliance
  • Documentation in CLI help

Closes #48

@mrgb7 mrgb7 added the enhancement New feature or request label Jun 8, 2025
@mrgb7 mrgb7 closed this Jun 8, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Feature: Add --override flag for plugin installation to force re-install/update

2 participants