Skip to content

Conversation

@kid1412621
Copy link

@kid1412621 kid1412621 commented Dec 18, 2025

User description

Add support for kubectl kustomize.
And align with oh-my-zsh.


PR Type

Enhancement


Description

  • Add kustomize support with two new kubectl aliases

  • Introduce kapk alias for applying kustomization directories

  • Introduce kdelk alias for deleting kustomization resources

  • Update README documentation with new aliases


Diagram Walkthrough

flowchart LR
  kubectl["kubectl plugin"]
  kustomize["Kustomize support"]
  kapk["kapk: apply -k"]
  kdelk["kdelk: delete -k"]
  docs["README documentation"]
  
  kubectl --> kustomize
  kustomize --> kapk
  kustomize --> kdelk
  kapk --> docs
  kdelk --> docs
Loading

File Walkthrough

Relevant files
Enhancement
kubectl.plugin.sh
Add kustomize kubectl aliases                                                       

plugins/kubectl/kubectl.plugin.sh

  • Add kapk alias for kubectl apply -k to apply kustomization directories
  • Add kdelk alias for kubectl delete -k to delete kustomization
    resources
  • Maintain consistent formatting and organization with existing aliases
+4/-0     
Documentation
README.md
Update documentation for kustomize aliases                             

plugins/kubectl/README.md

  • Document new kapk alias in the aliases table with description
  • Document new kdelk alias in the aliases table with description
  • Maintain consistency with existing documentation format
+2/-0     

@qodo-free-for-open-source-projects

PR Compliance Guide 🔍

Below is a summary of compliance checks for this PR:

Security Compliance
🟢
No security concerns identified No security vulnerabilities detected by AI analysis. Human verification advised for critical code.
Ticket Compliance
🎫 No ticket provided
  • Create ticket/issue
Codebase Duplication Compliance
Codebase context is not defined

Follow the guide to enable codebase context checks.

Custom Compliance
🟢
Generic: Comprehensive Audit Trails

Objective: To create a detailed and reliable record of critical system actions for security analysis
and compliance.

Status: Passed

Learn more about managing compliance generic rules or creating your own custom rules

Generic: Meaningful Naming and Self-Documenting Code

Objective: Ensure all identifiers clearly express their purpose and intent, making code
self-documenting

Status: Passed

Learn more about managing compliance generic rules or creating your own custom rules

Generic: Robust Error Handling and Edge Case Management

Objective: Ensure comprehensive error handling that provides meaningful context and graceful
degradation

Status: Passed

Learn more about managing compliance generic rules or creating your own custom rules

Generic: Secure Error Handling

Objective: To prevent the leakage of sensitive system information through error messages while
providing sufficient detail for internal debugging.

Status: Passed

Learn more about managing compliance generic rules or creating your own custom rules

Generic: Secure Logging Practices

Objective: To ensure logs are useful for debugging and auditing without exposing sensitive
information like PII, PHI, or cardholder data.

Status: Passed

Learn more about managing compliance generic rules or creating your own custom rules

Generic: Security-First Input Validation and Data Handling

Objective: Ensure all data inputs are validated, sanitized, and handled securely to prevent
vulnerabilities

Status: Passed

Learn more about managing compliance generic rules or creating your own custom rules

Compliance status legend 🟢 - Fully Compliant
🟡 - Partial Compliant
🔴 - Not Compliant
⚪ - Requires Further Human Verification
🏷️ - Compliance label

@qodo-free-for-open-source-projects

PR Code Suggestions ✨

Explore these optional code suggestions:

CategorySuggestion                                                                                                                                    Impact
Possible issue
Add confirmation prompt for destructive alias

Convert the kdelk alias into a function that prompts the user for confirmation
before execution to prevent accidental deletion of resources.

plugins/kubectl/kubectl.plugin.sh [31]

-alias kdelk='kubectl delete -k'
+function kdelk() {
+  if [ -z "$1" ]; then
+    command kubectl delete -k
+    return
+  fi
+  echo "This will delete all resources from kustomization in '$1'."
+  read -p "Are you sure? [y/N] " -n 1 -r
+  echo
+  if [[ $REPLY =~ ^[Yy]$ ]]; then
+    command kubectl delete -k "$@"
+  else
+    echo "Aborted."
+  fi
+}
  • Apply / Chat
Suggestion importance[1-10]: 7

__

Why: The suggestion correctly identifies a destructive command and proposes a function with a confirmation prompt, which significantly improves safety by preventing accidental resource deletion.

Medium
  • More

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant