-
Notifications
You must be signed in to change notification settings - Fork 88
CHEF-26075: Implement Kubernetes transport for Train #804
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
sa-progress
wants to merge
10
commits into
main
Choose a base branch
from
CHEF-26075
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Signed-off-by: Samir Anand <[email protected]>
- Add new Kubernetes transport with kubeconfig and cluster endpoint support - Implement kubectl command execution via run_command interface - Support ConfigMaps, Secrets, and container logs access via file interface - Add comprehensive error handling with Train::TransportError - Include platform detection with correct family hierarchy (cloud → api) - Provide secure credential handling and sanitized error messages - Add extensive unit test suite with 90%+ test coverage - Follow Train transport patterns and plugin architecture
…uctions - Added complete Kubernetes transport documentation in docs/kubernetes_transport.md - Updated README.md with Kubernetes usage section - Enhanced .github/copilot-instructions.md to require documentation before PR creation - Added YARD documentation examples and standards - Included troubleshooting guides and security considerations
- Restore proper YAML front matter structure - Fix workflow step numbering and content - Update documentation requirements in change matrix - Ensure file structure is consistent and readable
- Properly quote all YAML values to prevent parsing errors - Use lowercase keys with underscores for YAML compatibility - Remove problematic special characters from metadata values - Ensure valid YAML structure for proper parsing
…ctions - Consolidated two duplicate 'Documentation Requirements' sections - Simplified step 6 to reference the comprehensive requirements section - Removed redundant content while preserving all important details - Improved file structure and readability
…teps - Consolidated TL;DR checklist from 12 to 8 essential steps - Merged 'Unit Test Creation' and 'Test Execution & Validation' into single step - Reduced main workflow from 8 to 7 steps - Removed redundant 'Common ChefStyle Issues' section (basic information) - Updated step numbering and workflow summary accordingly - Maintained all essential requirements while improving clarity and brevity
- Restored focus to core requirements specified in the original format - Removed excessive complexity and redundant sections - Kept only essential elements: folder structure, codegen restrictions, JIRA/MCP integration - Streamlined to 5-step prompt-based workflow as originally specified - Maintained >80% test coverage requirement and GitHub CLI usage - Removed unnecessary technical details and industry-specific additions - Focused on clear, concise instructions for AI-assisted development
…red format - Added complete repository overview and folder structure - Included critical file modification restrictions (*.codegen.go) - Added JIRA integration with atlassian-mcp-server MCP server usage - Implemented comprehensive testing standards (>80% coverage requirement) - Added detailed GitHub CLI & PR creation workflow with runtest:all:stable label - Included prompt-based workflow with step-by-step confirmation process - Added complete 6-step implementation workflow (Analysis → Implementation → Testing → Linting → Documentation → PR) - Included Key Technologies and Supported Transports sections - Added Train-specific development guidelines for transports, platforms, and plugins - Included validation commands, testing standards, and documentation requirements - Added error handling, security considerations, and best practices - Removed unnecessary TL;DR section per feedback - Followed exact format requirements while preserving essential development standards
- Added comprehensive Kubernetes transport with kubectl integration - Supports kubeconfig and direct cluster endpoint connections - Implements Train's command and file interfaces for K8s resources - Added access to ConfigMaps, Secrets, and container logs via file paths - Comprehensive error handling with sanitized error messages - Platform detection integration with cloud/api family hierarchy - Full test coverage with 41 test cases covering all functionality - ChefStyle/RuboCop compliant code - Existing comprehensive documentation in docs/kubernetes_transport.md Acceptance Criteria Met: ✅ Connection establishment via kubeconfig or cluster endpoint ✅ Command execution interface supporting kubectl operations ✅ File interface for accessing ConfigMaps, Secrets, and logs ✅ Robust error handling with meaningful error messages ✅ Secure credential handling without exposing sensitive data ✅ Platform detection and Train family integration ✅ Comprehensive unit test coverage (41 tests, 82 assertions) ✅ Documentation and usage examples ✅ Code quality compliance (ChefStyle/RuboCop) Co-authored-by: GitHub Copilot <[email protected]> Signed-off-by: Samir Anand <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
This PR implements a new Kubernetes transport for Train as specified in CHEF-26075. The transport provides a unified interface to interact with Kubernetes clusters via kubectl commands and API resources.
Key Features
Implementation Details
Train::Transports::Kubernetes
Train::Transports::Kubernetes::Connection
Train::Transports::Kubernetes::File
JIRA
CHEF-26075
Testing
Code Quality
Files Added
lib/train/transports/kubernetes.rb
- Main transport implementationtest/unit/transports/kubernetes_test.rb
- Comprehensive test suite