Skip to content
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

Adjust columns for kubectl gs get releases #1489

Merged
merged 1 commit into from
Nov 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ and this project's packages adheres to [Semantic Versioning](http://semver.org/s

## [Unreleased]

### Changed

- Adjust columns for `kubectl gs get releases`.

## [4.4.0] - 2024-11-13

### Added
Expand Down
39 changes: 24 additions & 15 deletions cmd/get/releases/printer.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,11 @@ func (r *runner) printOutput(rResource release.Resource) error {
{Name: "Status", Type: "string"},
{Name: "Age", Type: "string", Format: "date-time"},
{Name: "Kubernetes", Type: "string"},
{Name: "Container Linux", Type: "string"},
{Name: "Flatcar", Type: "string"},
{Name: "Cilium", Type: "string"},
{Name: "CoreDNS", Type: "string"},
{Name: "Calico", Type: "string"},
{Name: "Observability Bundle", Type: "string"},
{Name: "Security Bundle", Type: "string"},
},
}

Expand Down Expand Up @@ -109,28 +111,33 @@ func getTableRow(release release.Release) metav1.TableRow {
status := getReleaseStatus(release.CR.Spec.State)

kubernetesVersion := naValue
containerLinuxVersion := naValue
flatcarVersion := naValue
coreDNSVersion := naValue
calicoVersion := naValue
ciliumVersion := naValue
securityBundleVersion := naValue
observabilityBundleVersion := naValue

for _, component := range release.CR.Spec.Components {
if component.Name == "kubernetes" {
kubernetesVersion = component.Version
}
if component.Name == "containerlinux" {
containerLinuxVersion = component.Version
}
if component.Name == "coredns" {
coreDNSVersion = component.Version
}
if component.Name == "calico" {
calicoVersion = component.Version
if component.Name == "flatcar" {
flatcarVersion = component.Version
}
}

for _, app := range release.CR.Spec.Apps {
if app.Name == "coredns" {
coreDNSVersion = app.ComponentVersion
coreDNSVersion = app.Version
}
if app.Name == "cilium" {
ciliumVersion = app.Version
}
if app.Name == "observability-bundle" {
observabilityBundleVersion = app.Version
}
if app.Name == "security-bundle" {
securityBundleVersion = app.Version
}
}

Expand All @@ -140,9 +147,11 @@ func getTableRow(release release.Release) metav1.TableRow {
status,
output.TranslateTimestampSince(release.CR.CreationTimestamp),
kubernetesVersion,
containerLinuxVersion,
flatcarVersion,
ciliumVersion,
coreDNSVersion,
calicoVersion,
observabilityBundleVersion,
securityBundleVersion,
},
Object: runtime.RawExtension{
Object: release.CR,
Expand Down