Skip to content

Commit

Permalink
Use namespace (rather than project) uniformly
Browse files Browse the repository at this point in the history
  • Loading branch information
bittner committed Apr 27, 2020
1 parent f7c9c9f commit 98f36df
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 11 deletions.
12 changes: 6 additions & 6 deletions cmd/common.go
Expand Up @@ -98,11 +98,11 @@ func addCommonFlagsForGit(cmd *cobra.Command, defaults *cfg.Configuration) {
}

func listImages() error {
ns, err := kubernetes.Namespace()
namespace, err := kubernetes.Namespace()
if err != nil {
return err
}
imageStreams, err := openshift.ListImageStreams(ns)
imageStreams, err := openshift.ListImageStreams(namespace)
if err != nil {
return err
}
Expand All @@ -111,8 +111,8 @@ func listImages() error {
imageNames = append(imageNames, image.Name)
}
log.WithFields(log.Fields{
"\n - project": ns,
"\n - 📺 images": imageNames,
"\n - namespace": namespace,
"\n - 📺 images": imageNames,
}).Info("Please select an image. The following images are available:")
return nil
}
Expand All @@ -131,7 +131,7 @@ func listConfigMaps(args []string) error {
configMapNames, labels := getNamesAndLabels(configMaps)

log.WithFields(log.Fields{
"\n - project": namespace,
"\n - namespace": namespace,
"\n - 🔓 configMaps": configMapNames,
"\n - 🎫 labels": labels,
}).Info("Please use labels to select ConfigMaps. The following ConfigMaps and Labels are available:")
Expand All @@ -150,7 +150,7 @@ func listSecrets(args []string) error {

secretNames, labels := getNamesAndLabels(secrets)
log.WithFields(log.Fields{
"\n - project": namespace,
"\n - namespace": namespace,
"\n - 🔐 secrets": secretNames,
"\n - 🎫 labels": labels,
}).Info("Please use labels to select Secrets. The following Secrets and Labels are available:")
Expand Down
2 changes: 1 addition & 1 deletion cmd/configmaps.go
Expand Up @@ -21,7 +21,7 @@ var configMapLog *log.Entry
var (
// configMapCmd represents a cobra command to clean up unused ConfigMaps
configMapCmd = &cobra.Command{
Use: "configmaps [PROJECT]",
Use: "configmaps [NAMESPACE]",
Short: "Cleans up your unused ConfigMaps in the Kubernetes cluster",
Long: configMapCommandLongDescription,
Aliases: []string{"configmap", "cm"},
Expand Down
4 changes: 2 additions & 2 deletions cmd/history.go
Expand Up @@ -13,7 +13,7 @@ import (

var (
historyCmd = &cobra.Command{
Use: "history [PROJECT/IMAGE]",
Use: "history [NAMESPACE/IMAGE]",
Aliases: []string{"hist"},
Short: "Clean up excessive image tags",
Long: `Clean up excessive image tags matching the commit hashes (prefix) of the git repository`,
Expand Down Expand Up @@ -62,7 +62,7 @@ func ExecuteHistoryCleanupCommand(args []string) error {

imageStreamObjectTags, err := openshift.GetImageStreamTags(namespace, image)
if err != nil {
return fmt.Errorf("could not retrive image stream '%s/%s': %w", namespace, image, err)
return fmt.Errorf("could not retrieve image stream '%s/%s': %w", namespace, image, err)
}

var imageStreamTags []string
Expand Down
2 changes: 1 addition & 1 deletion cmd/orphans.go
Expand Up @@ -27,7 +27,7 @@ var (
// orphanCmd represents a cobra command to clean up images by comparing the git commit history. It removes any
// image tags that are not found in the git history by given criteria.
orphanCmd = &cobra.Command{
Use: "orphans [PROJECT/IMAGE]",
Use: "orphans [NAMESPACE/IMAGE]",
Short: "Clean up unknown image tags",
Long: orphanCommandLongDescription,
Aliases: []string{"orph", "orphan"},
Expand Down
2 changes: 1 addition & 1 deletion cmd/secrets.go
Expand Up @@ -19,7 +19,7 @@ This command deletes secrets that are not being used anymore.`
var (
// secretCmd represents a cobra command to clean up unused secrets
secretCmd = &cobra.Command{
Use: "secrets [PROJECT]",
Use: "secrets [NAMESPACE]",
Short: "Cleans up your unused secrets in the Kubernetes cluster",
Long: secretCommandLongDescription,
Aliases: []string{"secret"},
Expand Down

0 comments on commit 98f36df

Please sign in to comment.