Repository: dapr/cli
Pull request #1482 (2025-02-03 16:22:20)

Remove deprecated flags
This PR updates the CLI to use the correct flags for max body size and read buffer size.


Patch:
diff --git a/cmd/annotate.go b/cmd/annotate.go
index ab77757..6dd5737 100644
--- a/cmd/annotate.go
+++ b/cmd/annotate.go
@@ -385,8 +385,8 @@ func init() {
 	AnnotateCmd.Flags().StringVar(&annotateDaprImage, "dapr-image", "", "The image to use for the dapr sidecar container")
 	AnnotateCmd.Flags().BoolVar(&annotateAppSSL, "app-ssl", false, "Enable SSL for the app")
 	AnnotateCmd.Flags().MarkDeprecated("app-ssl", "This flag is deprecated and will be removed in a future release. Use \"app-protocol\" flag with https or grpcs instead")
-	AnnotateCmd.Flags().IntVar(&annotateMaxRequestBodySize, "max-request-body-size", -1, "The maximum request body size to use")
-	AnnotateCmd.Flags().IntVar(&annotateReadBufferSize, "http-read-buffer-size", -1, "The maximum size of HTTP header read buffer in kilobytes")
+	AnnotateCmd.Flags().IntVar(&annotateMaxRequestBodySize, "max-body-size", -1, "The maximum request body size to use")
+	AnnotateCmd.Flags().IntVar(&annotateReadBufferSize, "read-buffer-size", -1, "The maximum size of HTTP header read buffer in kilobytes")
 	AnnotateCmd.Flags().BoolVar(&annotateHTTPStreamRequestBody, "http-stream-request-body", false, "Enable streaming request body for HTTP")
 	AnnotateCmd.Flags().IntVar(&annotateGracefulShutdownSeconds, "graceful-shutdown-seconds", -1, "The number of seconds to wait for the app to shutdown")
 	AnnotateCmd.Flags().BoolVar(&annotateEnableAPILogging, "enable-api-logging", false, "Enable API logging for the Dapr sidecar")
diff --git a/cmd/run.go b/cmd/run.go
index 7999523..c6dfdd9 100644
--- a/cmd/run.go
+++ b/cmd/run.go
@@ -473,8 +473,8 @@ func init() {
 	RunCmd.Flags().MarkDeprecated("app-ssl", "This flag is deprecated and will be removed in the future releases. Use \"app-protocol\" flag with https or grpcs values instead")
 	RunCmd.Flags().IntVarP(&metricsPort, "metrics-port", "M", -1, "The port of metrics on dapr")
 	RunCmd.Flags().BoolP("help", "h", false, "Print this help message")
-	RunCmd.Flags().IntVarP(&maxRequestBodySize, "dapr-http-max-request-size", "", -1, "Max size of request body in MB")
-	RunCmd.Flags().IntVarP(&readBufferSize, "dapr-http-read-buffer-size", "", -1, "HTTP header read buffer in KB")
+	RunCmd.Flags().IntVarP(&maxRequestBodySize, "max-body-size", "", -1, "Max size of request body in MB")
+	RunCmd.Flags().IntVarP(&readBufferSize, "read-buffer-size", "", -1, "HTTP header read buffer in KB")
 	RunCmd.Flags().StringVarP(&unixDomainSocket, "unix-domain-socket", "u", "", "Path to a unix domain socket dir. If specified, Dapr API servers will use Unix Domain Sockets")
 	RunCmd.Flags().BoolVar(&enableAppHealth, "enable-app-health-check", false, "Enable health checks for the application using the protocol defined with app-protocol")
 	RunCmd.Flags().StringVar(&appHealthPath, "app-health-check-path", "", "Path used for health checks; HTTP only")
diff --git a/pkg/kubernetes/annotator.go b/pkg/kubernetes/annotator.go
index 251a9c6..17b074b 100644
--- a/pkg/kubernetes/annotator.go
+++ b/pkg/kubernetes/annotator.go
@@ -55,8 +55,8 @@ const (
 	daprReadinessProbeThresholdKey      = "dapr.io/sidecar-readiness-probe-threshold"
 	daprImageKey                        = "dapr.io/sidecar-image"
 	daprAppSSLKey                       = "dapr.io/app-ssl"
-	daprMaxRequestBodySizeKey           = "dapr.io/http-max-request-size"
-	daprReadBufferSizeKey               = "dapr.io/http-read-buffer-size"
+	daprMaxRequestBodySizeKey           = "dapr.io/max-body-size"
+	daprReadBufferSizeKey               = "dapr.io/read-buffer-size"
 	daprHTTPStreamRequestBodyKey        = "dapr.io/http-stream-request-body"
 	daprGracefulShutdownSecondsKey      = "dapr.io/graceful-shutdown-seconds"
 	daprEnableAPILoggingKey             = "dapr.io/enable-api-logging"
diff --git a/pkg/standalone/list.go b/pkg/standalone/list.go
index fa064a6..da25807 100644
--- a/pkg/standalone/list.go
+++ b/pkg/standalone/list.go
@@ -105,9 +105,9 @@ func List() ([]ListOutput, error) {
 				enableMetrics = true
 			}
 
-			maxRequestBodySize := getIntArg(argumentsMap, "http-max-request-size", runtime.DefaultMaxRequestBodySize)
+			maxRequestBodySize := getIntArg(argumentsMap, "max-body-size", runtime.DefaultMaxRequestBodySize)
 
-			httpReadBufferSize := getIntArg(argumentsMap, "http-read-buffer-size", runtime.DefaultReadBufferSize)
+			httpReadBufferSize := getIntArg(argumentsMap, "read-buffer-size", runtime.DefaultReadBufferSize)
 
 			appID := argumentsMap["--app-id"]
 			appCmd := ""
diff --git a/pkg/standalone/run.go b/pkg/standalone/run.go
index 57781e4..2752eda 100644
--- a/pkg/standalone/run.go
+++ b/pkg/standalone/run.go
@@ -79,8 +79,8 @@ type SharedRunConfig struct {
 	ResourcesPaths []string `arg:"resources-path" yaml:"resourcesPaths"`
 	// Speicifcally omitted from annotations as appSSL is deprecated.
 	AppSSL             bool   `arg:"app-ssl" yaml:"appSSL"`
-	MaxRequestBodySize int    `arg:"dapr-http-max-request-size" annotation:"dapr.io/http-max-request-size" yaml:"daprHTTPMaxRequestSize" default:"-1"`
-	HTTPReadBufferSize int    `arg:"dapr-http-read-buffer-size" annotation:"dapr.io/http-read-buffer-size" yaml:"daprHTTPReadBufferSize" default:"-1"`
+	MaxRequestBodySize int    `arg:"max-body-size" annotation:"dapr.io/max-body-size" yaml:"maxBodySize" default:"-1"`
+	HTTPReadBufferSize int    `arg:"read-buffer-size" annotation:"dapr.io/read-buffer-size" yaml:"readBufferSize" default:"-1"`
 	EnableAppHealth    bool   `arg:"enable-app-health-check" annotation:"dapr.io/enable-app-health-check" yaml:"enableAppHealthCheck"`
 	AppHealthPath      string `arg:"app-health-check-path" annotation:"dapr.io/app-health-check-path" yaml:"appHealthCheckPath"`
 	AppHealthInterval  int    `arg:"app-health-probe-interval" annotation:"dapr.io/app-health-probe-interval" ifneq:"0" yaml:"appHealthProbeInterval"`


Test patch:
diff --git a/.github/workflows/kind_e2e.yaml b/.github/workflows/kind_e2e.yaml
index dd2eb52..eda30b4 100644
--- a/.github/workflows/kind_e2e.yaml
+++ b/.github/workflows/kind_e2e.yaml
@@ -50,7 +50,7 @@ jobs:
     name: E2E tests for K8s (KinD)
     runs-on: ubuntu-latest
     env:
-      DAPR_RUNTIME_PINNED_VERSION: 1.13.5
+      DAPR_RUNTIME_PINNED_VERSION: 1.14.4
       DAPR_DASHBOARD_PINNED_VERSION: 0.14.0
       DAPR_RUNTIME_LATEST_STABLE_VERSION:
       DAPR_DASHBOARD_LATEST_STABLE_VERSION:
diff --git a/.github/workflows/self_hosted_e2e.yaml b/.github/workflows/self_hosted_e2e.yaml
index f5a220a..5a42eb6 100644
--- a/.github/workflows/self_hosted_e2e.yaml
+++ b/.github/workflows/self_hosted_e2e.yaml
@@ -38,7 +38,7 @@ jobs:
       GOARCH: ${{ matrix.target_arch }}
       GOPROXY: https://proxy.golang.org
       ARCHIVE_OUTDIR: dist/archives
-      DAPR_RUNTIME_PINNED_VERSION: "1.13.5"
+      DAPR_RUNTIME_PINNED_VERSION: "1.14.4"
       DAPR_DASHBOARD_PINNED_VERSION: 0.14.0
       DAPR_RUNTIME_LATEST_STABLE_VERSION: ""
       DAPR_DASHBOARD_LATEST_STABLE_VERSION: ""
diff --git a/pkg/runexec/runexec_test.go b/pkg/runexec/runexec_test.go
index 8b24a2f..14ff619 100644
--- a/pkg/runexec/runexec_test.go
+++ b/pkg/runexec/runexec_test.go
@@ -120,9 +120,9 @@ func assertCommonArgs(t *testing.T, basicConfig *standalone.RunConfig, output *R
 	assertArgumentEqual(t, "components-path", standalone.GetDaprComponentsPath(daprPath), output.DaprCMD.Args)
 	assertArgumentEqual(t, "app-ssl", "", output.DaprCMD.Args)
 	assertArgumentEqual(t, "metrics-port", "9001", output.DaprCMD.Args)
-	assertArgumentEqual(t, "dapr-http-max-request-size", "-1", output.DaprCMD.Args)
+	assertArgumentEqual(t, "max-body-size", "-1", output.DaprCMD.Args)
 	assertArgumentEqual(t, "dapr-internal-grpc-port", "5050", output.DaprCMD.Args)
-	assertArgumentEqual(t, "dapr-http-read-buffer-size", "-1", output.DaprCMD.Args)
+	assertArgumentEqual(t, "read-buffer-size", "-1", output.DaprCMD.Args)
 	assertArgumentEqual(t, "dapr-listen-addresses", "127.0.0.1", output.DaprCMD.Args)
 }