Skip to content

Commit 941e3c0

Browse files
committed
Update module version extraction and fix links in KubeTidy.psd1; reintroduce ASCII art banner for improved output clarity
Signed-off-by: PixelRobots <[email protected]>
1 parent 3c96419 commit 941e3c0

File tree

4 files changed

+31
-12
lines changed

4 files changed

+31
-12
lines changed

.github/workflows/publish-psgal.yml

+16
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,22 @@ jobs:
1818
- name: Checkout code
1919
uses: actions/checkout@v3
2020

21+
# Extract and update module version from Git tag
22+
- name: Set Module Version from Git Tag
23+
id: set_version
24+
run: |
25+
# Extract version from the Git tag, trimming the 'v' prefix
26+
$tagVersion = '${{ github.ref_name }}' -replace '^v', ''
27+
Write-Host "Setting module version to $tagVersion"
28+
29+
# Load and update the ModuleVersion in the .psd1 file
30+
(Get-Content ./KubeTidy.psd1) -replace "ModuleVersion = '.*'", "ModuleVersion = '$tagVersion'" |
31+
Set-Content ./KubeTidy.psd1
32+
33+
# Output for use in later steps
34+
echo "::set-output name=version::$tagVersion"
35+
shell: pwsh
36+
2137
# Validate PowerShell Code
2238
- name: Run PSScriptAnalyzer and format output in Markdown
2339
run: |

CHANGELOG.md

+5
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,11 @@ All notable changes to this project will be documented in this file.
44

55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
66

7+
## [0.0.21] - 2024-12-06
8+
9+
### Fixed
10+
- **Fixed 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.
11+
712
### [0.0.20] - 2024-10=28
813

914
#### Added

KubeTidy.psd1

+5-5
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ Description = 'A tool to clean up Kubernetes config files.'
3939
# PowerShellHostName = ''
4040

4141
# Minimum version of the PowerShell host required by this module
42-
# PowerShellHostVersion = ''
42+
PowerShellHostVersion = '7.0'
4343

4444
# Minimum version of Microsoft .NET Framework required by this module. This prerequisite is valid for the PowerShell Desktop edition only.
4545
# DotNetFrameworkVersion = ''
@@ -98,16 +98,16 @@ PrivateData = @{
9898
Tags = @('Kubernetes', 'PowerShell', 'Windows', 'DevOps', 'KubeTidy', 'kubeconfig')
9999

100100
# A URL to the license for this module.
101-
LicenseUri = 'https://github.com/PixelRobots/KubeTidy/blob/main/LICENSE'
101+
LicenseUri = 'https://github.com/KubeDeckio/KubeTidy/blob/main/LICENSE'
102102

103103
# A URL to the main website for this project.
104-
ProjectUri = 'https://github.com/PixelRobots/KubeTidy/'
104+
ProjectUri = 'https://github.com/KubeDeckio/KubeTidy/'
105105

106106
# A URL to an icon representing this module.
107-
IconUri = 'https://github.com/PixelRobots/KubeTidy/blob/main/images/KubeTidy.png'
107+
IconUri = 'https://github.com/KubeDeckio/KubeTidy/blob/main/images/KubeTidy.png'
108108

109109
# ReleaseNotes of this module
110-
ReleaseNotes = 'https://github.com/PixelRobots/KubeTidy/blob/main/README.md'
110+
ReleaseNotes = 'https://github.com/KubeDeckio/KubeTidy/blob/main/README.md'
111111

112112
# Prerelease string of this module
113113
# Prerelease = ''

KubeTidy.psm1

+5-7
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@ function Invoke-KubeTidy {
8484
[array]$MergeConfigs,
8585
[string]$DestinationConfig,
8686
[switch]$DryRun,
87+
[switch]$UI,
8788
[Alias("h")] [switch]$Help
8889
)
8990
# END PARAM BLOCK
@@ -106,6 +107,10 @@ function Invoke-KubeTidy {
106107
return
107108
}
108109

110+
if (!$UI) {
111+
Show-KubeTidyBanner
112+
}
113+
109114
<#
110115
.SYNOPSIS
111116
KubeTidy: A script to clean up your Kubernetes config file by removing unreachable clusters and associated users and contexts, or merge multiple config files.
@@ -142,8 +147,6 @@ function Invoke-KubeTidy {
142147
Enables verbose logging for detailed output.
143148
#>
144149

145-
#Show-KubeTidyBanner
146-
147150
# If ExclusionList is not provided, set it to an empty array
148151
if (-not $ExclusionList) {
149152
$ExclusionList = @()
@@ -179,7 +182,6 @@ function Invoke-KubeTidy {
179182
if (-not $DestinationConfig) {
180183
$DestinationConfig = "$env:USERPROFILE\.kube\config"
181184
}
182-
#Show-KubeTidyBanner
183185
Write-Host "Merging kubeconfig files..." -ForegroundColor Yellow
184186

185187
# Call Merge-KubeConfigs with -DryRun only if $DryRun is True
@@ -196,25 +198,21 @@ function Invoke-KubeTidy {
196198
if (-not $DestinationConfig) {
197199
$DestinationConfig = "$HOME/.kube/filtered-config" # Default destination for export
198200
}
199-
#Show-KubeTidyBanner
200201
Write-Host "Exporting specified contexts: `n$ExportContexts`n" -ForegroundColor Yellow
201202
Export-KubeContexts -KubeConfigPath $KubeConfigPath -Contexts $ExportContexts -OutputFile $DestinationConfig
202203
return
203204
}
204205

205206
if ($ListClusters) {
206-
#Show-KubeTidyBanner
207207
Get-AllClusters -KubeConfigPath $KubeConfigPath
208208
return
209209
}
210210

211211
if ($ListContexts) {
212-
#Show-KubeTidyBanner
213212
Get-KubeContexts -KubeConfigPath $KubeConfigPath
214213
return
215214
}
216215

217-
#Show-KubeTidyBanner
218216
Write-Host "Starting KubeTidy cleanup..." -ForegroundColor Yellow
219217
Write-Host ""
220218

0 commit comments

Comments
 (0)