Skip to content

Commit

Permalink
OCM-8057 | fix: Ensure the ID of the KubeletConfig is printed by rosa…
Browse files Browse the repository at this point in the history
… describe kubeletconfig
  • Loading branch information
robpblake committed May 16, 2024
1 parent 0e00dea commit 5545239
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
2 changes: 2 additions & 0 deletions pkg/kubeletconfig/output.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,10 @@ func PrintKubeletConfigForHcp(config *cmv1.KubeletConfig, nodePools []*cmv1.Node

func PrintKubeletConfigForClassic(config *cmv1.KubeletConfig) string {
return fmt.Sprintf("\n"+
"ID: %s\n"+
"Name: %s\n"+
"Pod Pids Limit: %d\n",
config.ID(),
getName(config),
config.PodPidsLimit(),
)
Expand Down
8 changes: 4 additions & 4 deletions pkg/kubeletconfig/output_test.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
package kubeletconfig

import (
"fmt"

. "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega"
cmv1 "github.com/openshift-online/ocm-sdk-go/clustersmgmt/v1"
Expand All @@ -11,23 +9,27 @@ import (
)

var classicOutputWithName = `
ID: bar
Name: foo
Pod Pids Limit: 10000
`

var classicOutPutNoName = `
ID: bar
Name: -
Pod Pids Limit: 10000
`

var hcpOutputWithName = `
ID: bar
Name: foo
Pod Pids Limit: 10000
MachinePools Using This KubeletConfig:
- testing
`

var hcpOutputNoName = `
ID: bar
Name: -
Pod Pids Limit: 10000
MachinePools Using This KubeletConfig:
Expand Down Expand Up @@ -55,7 +57,6 @@ var _ = Describe("KubeletConfig Output", func() {
})

output := PrintKubeletConfigForClassic(kubeletConfig)
fmt.Print(output)
Expect(output).To(Equal(classicOutputWithName))
})

Expand All @@ -65,7 +66,6 @@ var _ = Describe("KubeletConfig Output", func() {
})

output := PrintKubeletConfigForClassic(kubeletConfig)
fmt.Print(output)
Expect(output).To(Equal(classicOutPutNoName))
})

Expand Down

0 comments on commit 5545239

Please sign in to comment.