You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: cmd/run.go
+42Lines changed: 42 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -20,13 +20,15 @@ import (
20
20
"os"
21
21
"path/filepath"
22
22
"runtime"
23
+
"slices"
23
24
"strconv"
24
25
"strings"
25
26
"time"
26
27
27
28
"golang.org/x/mod/semver"
28
29
29
30
"github.com/spf13/cobra"
31
+
"github.com/spf13/pflag"
30
32
"github.com/spf13/viper"
31
33
32
34
daprRuntime "github.com/dapr/dapr/pkg/runtime"
@@ -78,6 +80,15 @@ const (
78
80
runtimeWaitTimeoutInSeconds=60
79
81
)
80
82
83
+
// Flags that are compatible with --run-file
84
+
varrunFileCompatibleFlags= []string{
85
+
"kubernetes",
86
+
"help",
87
+
"version",
88
+
"runtime-path",
89
+
"log-as-json",
90
+
}
91
+
81
92
varRunCmd=&cobra.Command{
82
93
Use: "run",
83
94
Short: "Run Dapr and (optionally) your application side by side. Supported platforms: Self-hosted",
@@ -128,6 +139,14 @@ dapr run --run-file /path/to/directory -k
128
139
},
129
140
Run: func(cmd*cobra.Command, args []string) {
130
141
iflen(runFilePath) >0 {
142
+
// Check for incompatible flags
143
+
incompatibleFlags:=detectIncompatibleFlags(cmd)
144
+
iflen(incompatibleFlags) >0 {
145
+
// Print warning message about incompatible flags
146
+
warningMsg:="The following flags are ignored when using --run-file and should be configured in the run file instead: "+strings.Join(incompatibleFlags, ", ")
0 commit comments