Skip to content

Commit 6dab66a

Browse files
committed
namespacing issue
1 parent 9207317 commit 6dab66a

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

cmd/analyze.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ var (
1616
pricePath string
1717
queryBefore string
1818
details bool
19+
namespace string
1920
)
2021

2122
// todo these should change to tetrate-hosted s3 files, with which we can send over cluster information
@@ -85,5 +86,6 @@ func init() {
8586
rootCmd.PersistentFlags().StringVar(&pricePath, "pricePath", "", "if custom egress rates are provided, dapani will use the rates in this file.")
8687
rootCmd.PersistentFlags().StringVar(&queryBefore, "queryBefore", "0s", "if provided a time duration (go format), dapani will only use data from that much time ago and before.")
8788
rootCmd.PersistentFlags().BoolVar(&details, "details", false, "if true, tool will provide a more detailed view of egress costs, including both destination and source")
89+
rootCmd.PersistentFlags().StringVar(&namespace, "namespace", "default", "analyze the cost of a certain namespace")
8890
rootCmd.AddCommand(analyzeCmd)
8991
}

pkg/kube.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ func (k *KubeClient) GetLocalityCalls(podCalls []*PodCall, cloud string) ([]*Cal
9595

9696
// getPodNode gets the node associated with a given pod name in the default namespece.
9797
func (k *KubeClient) getPodNode(name string) (string, error) {
98-
pod, err := k.clientSet.CoreV1().Pods("default").Get(context.TODO(), name, metav1.GetOptions{})
98+
pod, err := k.clientSet.CoreV1().Pods("").Get(context.TODO(), name, metav1.GetOptions{})
9999
if err != nil {
100100
fmt.Printf("error in getting pod %v: %v\n", name, err)
101101
return "", err

0 commit comments

Comments
 (0)