-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
002bb15
commit 1199aae
Showing
11 changed files
with
430 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -156,6 +156,7 @@ func init() { | |
startupCmd, | ||
xdsLatencyCmd, | ||
reproduceCmd, | ||
dumpCmd, | ||
) | ||
} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
package cmd | ||
|
||
import ( | ||
"fmt" | ||
|
||
"github.com/howardjohn/pilot-load/pkg/simulation" | ||
"github.com/howardjohn/pilot-load/pkg/simulation/model" | ||
"github.com/spf13/cobra" | ||
) | ||
|
||
var dumpConfig = model.DumpConfig{} | ||
|
||
func init() { | ||
dumpCmd.PersistentFlags().StringVar(&dumpConfig.Pod, "pod", dumpConfig.Pod, "pod to dump from") | ||
dumpCmd.PersistentFlags().StringVar(&dumpConfig.Namespace, "namespace", dumpConfig.Namespace, "namespace to dump from") | ||
dumpCmd.PersistentFlags().StringVar(&dumpConfig.OutputDir, "out", dumpConfig.OutputDir, "output directory") | ||
} | ||
|
||
var dumpCmd = &cobra.Command{ | ||
Use: "dump", | ||
Short: "dump XDS for a pod to file, rewritten to be runnable with only files", | ||
RunE: func(cmd *cobra.Command, _ []string) error { | ||
args, err := GetArgs() | ||
if err != nil { | ||
return err | ||
} | ||
if dumpConfig.Pod == "" { | ||
return fmt.Errorf("--pod required") | ||
} | ||
if dumpConfig.Namespace == "" { | ||
return fmt.Errorf("--namespace required") | ||
} | ||
args.DumpConfig = dumpConfig | ||
logConfig(args.DumpConfig) | ||
return simulation.Dump(args) | ||
}, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.