Skip to content

Commit

Permalink
Release: v0.3.7
Browse files Browse the repository at this point in the history
  • Loading branch information
chenjiandongx committed Feb 19, 2022
1 parent 4a0ef25 commit d452e56
Show file tree
Hide file tree
Showing 104 changed files with 14 additions and 18,071 deletions.
6 changes: 3 additions & 3 deletions cmd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
"github.com/spf13/cobra"
)

const version = "0.3.6"
const version = "0.3.7"

var rootCmd *cobra.Command

Expand All @@ -35,9 +35,9 @@ func init() {
columns, _ := cmd.Flags().GetString("columns")
format, _ := cmd.Flags().GetString("output-format")
allNamespace, _ := cmd.Flags().GetBool("all-namespaces")
kubeconfig, _ := cmd.Flags().GetString("kubeconfig")
kubeConfig, _ := cmd.Flags().GetString("kubeConfig")
context, _ := cmd.Flags().GetString("context")
kubeImage := kubeimage.NewKubeImage(regx, allNamespace, namespace, columns, kubeconfig, context)
kubeImage := kubeimage.NewKubeImage(regx, allNamespace, namespace, columns, kubeConfig, context)
kubeImage.Render(format)
},
}
Expand Down
16 changes: 11 additions & 5 deletions kubectl_images.go
Original file line number Diff line number Diff line change
Expand Up @@ -204,9 +204,9 @@ func (ki *KubeImage) summary() {
containerCnt += 1
}

fmt.Println(fmt.Sprintf("[Summary]: %d namespaces, %d pods, %d containers and %d different images",
fmt.Printf("[Summary]: %d namespaces, %d pods, %d containers and %d different images\n",
namespaceCnt.Count(), podCnt.Count(), containerCnt, imageCnt.Count(),
))
)
}

// Render renders and displays the table output.
Expand Down Expand Up @@ -241,11 +241,17 @@ func (ki *KubeImage) Render(format string) {
Image string
ImagePullPolicy string
}
var rec []PodRecord
var records []PodRecord
for _, v := range ki.entities {
rec = append(rec, PodRecord{v.Namespace, v.PodName, v.ContainerName, v.ContainerImage, v.ImagePullPolicy})
records = append(records, PodRecord{
Namespace: v.Namespace,
Pod: v.PodName,
Container: v.ContainerName,
Image: v.ContainerImage,
ImagePullPolicy: v.ImagePullPolicy,
})
}
output, err := json.Marshal(rec)
output, err := json.Marshal(records)
if err != nil {
fmt.Println("[Oh...] failed to marshal JSON data")
return
Expand Down
15 changes: 0 additions & 15 deletions vendor/github.com/davecgh/go-spew/LICENSE

This file was deleted.

145 changes: 0 additions & 145 deletions vendor/github.com/davecgh/go-spew/spew/bypass.go

This file was deleted.

38 changes: 0 additions & 38 deletions vendor/github.com/davecgh/go-spew/spew/bypasssafe.go

This file was deleted.

Loading

0 comments on commit d452e56

Please sign in to comment.