@@ -49,11 +49,11 @@ permission profile. Additional configuration can be provided via flags.`,
49
49
},
50
50
}
51
51
52
- var runConfig RunFlags
52
+ var runFlags RunFlags
53
53
54
54
func init () {
55
55
// Add run flags
56
- AddRunFlags (runCmd , & runConfig )
56
+ AddRunFlags (runCmd , & runFlags )
57
57
58
58
// This is used for the K8s operator which wraps the run command, but shouldn't be visible to users.
59
59
if err := runCmd .Flags ().MarkHidden ("k8s-pod-patch" ); err != nil {
@@ -81,33 +81,33 @@ func runCmdFunc(cmd *cobra.Command, args []string) error {
81
81
debugMode , _ := cmd .Flags ().GetBool ("debug" )
82
82
83
83
// Build the run configuration
84
- runnerConfig , err := BuildRunnerConfig (ctx , & runConfig , serverOrImage , cmdArgs , debugMode , cmd )
84
+ runnerConfig , err := BuildRunnerConfig (ctx , & runFlags , serverOrImage , cmdArgs , debugMode , cmd )
85
85
if err != nil {
86
86
return err
87
87
}
88
88
89
- if runConfig .Group != "" {
89
+ if runFlags .Group != "" {
90
90
groupManager , err := groups .NewManager ()
91
91
if err != nil {
92
92
return fmt .Errorf ("failed to create group manager: %v" , err )
93
93
}
94
94
95
95
// Check if the workload is already in a group
96
- group , err := groupManager .GetWorkloadGroup (ctx , runConfig .Name )
96
+ group , err := groupManager .GetWorkloadGroup (ctx , runFlags .Name )
97
97
if err != nil {
98
98
return fmt .Errorf ("failed to get workload group: %v" , err )
99
99
}
100
- if group != nil && group .Name != runConfig .Group {
101
- return fmt .Errorf ("workload '%s' is already in group '%s'" , runConfig .Name , group .Name )
100
+ if group != nil && group .Name != runFlags .Group {
101
+ return fmt .Errorf ("workload '%s' is already in group '%s'" , runFlags .Name , group .Name )
102
102
}
103
103
104
104
// Validate that the group specified exists
105
- exists , err := groupManager .Exists (ctx , runConfig .Group )
105
+ exists , err := groupManager .Exists (ctx , runFlags .Group )
106
106
if err != nil {
107
107
return fmt .Errorf ("failed to check if group exists: %v" , err )
108
108
}
109
109
if ! exists {
110
- return fmt .Errorf ("group '%s' does not exist" , runConfig .Group )
110
+ return fmt .Errorf ("group '%s' does not exist" , runFlags .Group )
111
111
}
112
112
}
113
113
@@ -118,7 +118,7 @@ func runCmdFunc(cmd *cobra.Command, args []string) error {
118
118
}
119
119
workloadManager := workloads .NewManagerFromRuntime (rt )
120
120
121
- if runConfig .Foreground {
121
+ if runFlags .Foreground {
122
122
err = workloadManager .RunWorkload (ctx , runnerConfig )
123
123
} else {
124
124
// Run the workload in detached mode
0 commit comments