Skip to content

Commit

Permalink
namespacing issue
Browse files Browse the repository at this point in the history
  • Loading branch information
adiprerepa committed May 26, 2022
1 parent 9207317 commit 6dab66a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions cmd/analyze.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ var (
pricePath string
queryBefore string
details bool
namespace string
)

// todo these should change to tetrate-hosted s3 files, with which we can send over cluster information
Expand Down Expand Up @@ -85,5 +86,6 @@ func init() {
rootCmd.PersistentFlags().StringVar(&pricePath, "pricePath", "", "if custom egress rates are provided, dapani will use the rates in this file.")
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.")
rootCmd.PersistentFlags().BoolVar(&details, "details", false, "if true, tool will provide a more detailed view of egress costs, including both destination and source")
rootCmd.PersistentFlags().StringVar(&namespace, "namespace", "default", "analyze the cost of a certain namespace")
rootCmd.AddCommand(analyzeCmd)
}
2 changes: 1 addition & 1 deletion pkg/kube.go
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ func (k *KubeClient) GetLocalityCalls(podCalls []*PodCall, cloud string) ([]*Cal

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

0 comments on commit 6dab66a

Please sign in to comment.