Skip to content

Commit

Permalink
add OWNERS, and minor changes
Browse files Browse the repository at this point in the history
  • Loading branch information
gmeghnag committed Jan 21, 2025
1 parent f3eebfa commit 64325f9
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 11 deletions.
8 changes: 8 additions & 0 deletions pkg/cli/admin/top/OWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# See the OWNERS docs: https://git.k8s.io/community/contributors/guide/owners.md
# This file just uses aliases defined in OWNERS_ALIASES.

reviewers:
- gmeghnag
- ardaguclu
approvers:
- ardaguclu
22 changes: 11 additions & 11 deletions pkg/cli/admin/top/persistentvolumeclaims.go
Original file line number Diff line number Diff line change
Expand Up @@ -137,15 +137,15 @@ func (o *options) Complete(f kcmdutil.Factory, cmd *cobra.Command, args []string
}

type persistentVolumeClaimInfo struct {
Namespace string
Name string
UsagePercentage string
namespace string
name string
usagePercentage string
}

func (v persistentVolumeClaimInfo) PrintLine(out io.Writer) {
printValue(out, v.Namespace)
printValue(out, v.Name)
printValue(out, v.UsagePercentage)
printValue(out, v.namespace)
printValue(out, v.name)
printValue(out, v.usagePercentage)
}

func (o *options) Run(ctx context.Context, args []string) error {
Expand Down Expand Up @@ -211,13 +211,13 @@ func (o *options) Run(ctx context.Context, args []string) error {
valueFloatLong, _ := strconv.ParseFloat(usagePercentage.(string), 64)
valueFloat := fmt.Sprintf("%.2f", valueFloatLong)
if len(pvcInfos) > 0 {
if !(namespaceName == pvcInfos[len(pvcInfos)-1].Namespace && pvcName == pvcInfos[len(pvcInfos)-1].Name) {
pvcInfos = append(pvcInfos, persistentVolumeClaimInfo{Namespace: namespaceName, Name: pvcName, UsagePercentage: valueFloat})
infos = append(infos, persistentVolumeClaimInfo{Namespace: namespaceName, Name: pvcName, UsagePercentage: valueFloat})
if !(namespaceName == pvcInfos[len(pvcInfos)-1].namespace && pvcName == pvcInfos[len(pvcInfos)-1].name) {
pvcInfos = append(pvcInfos, persistentVolumeClaimInfo{namespace: namespaceName, name: pvcName, usagePercentage: valueFloat})
infos = append(infos, persistentVolumeClaimInfo{namespace: namespaceName, name: pvcName, usagePercentage: valueFloat})
}
} else {
pvcInfos = append(pvcInfos, persistentVolumeClaimInfo{Namespace: namespaceName, Name: pvcName, UsagePercentage: valueFloat})
infos = append(infos, persistentVolumeClaimInfo{Namespace: namespaceName, Name: pvcName, UsagePercentage: valueFloat})
pvcInfos = append(pvcInfos, persistentVolumeClaimInfo{namespace: namespaceName, name: pvcName, usagePercentage: valueFloat})
infos = append(infos, persistentVolumeClaimInfo{namespace: namespaceName, name: pvcName, usagePercentage: valueFloat})
}
}

Expand Down

0 comments on commit 64325f9

Please sign in to comment.