All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
- Verbose-only output for script execution in both local and Krew storage directories.
- Modified script to check both local and Krew storage paths for
.ps1
files, ensuring failover functionality. - Introduced a
$foundScripts
flag to track sourcing success across directories.
- Improved error handling to terminate execution with an error if no
.ps1
files can be sourced from either path.
- Script now exits with an error message if both local and Krew storage directories lack the required
.ps1
files.
- Re-added ASCII Art Banner: The ASCII art banner has been reintroduced to the KubeTidy output after adjustments to ensure it displays correctly in the updated KubeDeck UI. This change improves compatibility and enhances the visual clarity of the output for users.
- MacOS ARM Compatibility in Krew: Updated the loading process for PowerShell modules to restore support for macOS ARM systems, similar to the compatibility achieved in version 0.0.14.
- Removed ASCII Art Banner: The ASCII art banner was removed from the KubeTidy output as it was not displaying correctly in the new KubeDeck UI. This change improves compatibility with the user interface and enhances the overall visual clarity of the output.
- Darwin ARM64 and Linux ARM64 Support: Added support for Darwin ARM64 and Linux ARM64 platforms, including building and packaging the respective binaries.
- Automatic Update of
KubeTidy.yaml
: The GitHub Actions workflow now automatically updates theKubeTidy.yaml
file during the release process. It replaces placeholders with the correct version, URLs, and SHA256 checksums for each platform (Linux/AMD64, Linux/ARM64, Darwin/AMD64, and Darwin/ARM64). - Upload
KubeTidy.yaml
to GitHub Release: The updatedKubeTidy.yaml
file is now uploaded to the release as an asset, along with the platform-specific tar.gz files and SHA256 checksums.
- Backup Function Return Status: Updated the
New-Backup
function to return a success or failure status via the-PassThru
parameter. The backup process now supports better error handling, allowing the script to abort the cleanup if the backup fails.
- Cleanup Without ExclusionList: Fixed an issue where the cleanup would only run if the
ExclusionList
parameter was provided. The script now defaults theExclusionList
to an empty array, allowing cleanup to proceed even when the parameter is not specified.
- Error Handling for Backups: Enhanced error handling during the backup process using
try/catch
blocks. If the backup fails, the script stops the cleanup process to prevent data loss.
- PowerShell Module Submodule Import: Fixed an issue where submodules were not being correctly imported within the PowerShell module, ensuring smoother module usage and proper functioning of submodule dependencies. Krew module still needs some work.
- List Contexts Option: Added the
-ListContexts
parameter, allowing users to list all available contexts in the kubeconfig. - Export Contexts Option: Introduced the
-ExportContexts
parameter for exporting specific contexts from the kubeconfig. This can be combined with the-DestinationConfig
parameter to specify the output path. - Preserve Current Context: Added logic to preserve the current context in the cleaned kubeconfig unless it belongs to a removed cluster.
- Reusable DestinationConfig: The
-DestinationConfig
parameter is now shared between the merge and export functionalities, simplifying the user experience.
- Current Context Handling: Fixed an issue where the current context could be removed inadvertently during cleanup. The script now retains the current context unless its associated cluster is removed.
- Krew Support: Added support for Krew, allowing users to install and manage KubeTidy as a plugin in their Kubernetes environment.
- Release Notes Automation: Integrated automation to update GitHub release notes with entries from the CHANGELOG.md based on the version being released.
- Refactor Release Process: Improved the release workflow by adding automated steps for generating tar files and checksums, ensuring a smoother release experience.
- Restored Backup feature Whilst splitting out files, Backup parameter went missing. Added back now.
- Minor bug fixes and improvements to enhance performance and stability.
- Importing sub modules error: Fixed an issue where the sub modules were not being imported.
- Dry Run Mode: Introduced the
-DryRun
parameter, allowing users to simulate cleanup and merging processes without making any changes. This provides a preview of actions KubeTidy would perform.
- Merge Kubeconfig Files: Introduced the ability to merge multiple kubeconfig files into one using the
-MergeConfigs
parameter. Users can specify multiple kubeconfig file paths to be merged into the destination kubeconfig file. - DestinationConfig Parameter: Added the
-DestinationConfig
parameter for specifying the output path of the merged kubeconfig file. If not specified, it defaults to"$HOME/.kube/config"
. - Cluster Count Output: The
-ListClusters
parameter now also outputs the total number of clusters present in the kubeconfig file after listing them.
- Clickable Backup Path: Backup path is now clickable if the terminal supports it, making it easier to navigate to backup files.
- Manual YAML Handling for Single Entries: Ensured proper YAML structure when only one cluster, context, or user remains in the kubeconfig file.
- Environment Detection: Enhanced WSL detection and config path handling for both native Linux/macOS and WSL environments.
- KubeConfig Path Handling: Improved logic for determining the kubeconfig path in different environments (Windows, WSL, Linux/macOS).
- Cluster Removal Formatting: Fixed an issue where the kubeconfig format would break when cleaning up to a single cluster, context, or user.
- Cluster Kept Count: fixed so the number is correct. It was 1 out before.
- Fixed exclusion parameter so it is back to
ExclusionList
and notExclusionArray
.
- Introduced the
-ListClusters
parameter, allowing users to list all clusters in the kubeconfig file without performing any cleanup. - Added function
Show-KubeTidyBanner
to display ASCII art and start message as a reusable function. - Updated main command to
Invoke-KubeTidy
for better clarity and consistency.
- Improved documentation to reflect new functionality and renamed the primary function to
Invoke-KubeTidy
. - Updated README to include examples and instructions for the
-ListClusters
option.
- Verbose output option with the
-Verbose
parameter for detailed logging of operations and cluster checks. - Backup creation before cleanup to ensure that no data is lost in case of an error during the operation.
- Exclusion list functionality to skip specific clusters from removal using the
-ExclusionList
parameter.
- Initial release of KubeTidy, featuring Kubernetes cluster reachability checks and cleanup of unreachable clusters, contexts, and users.