Skip to content

Commit 33b1d10

Browse files
authored
Merge pull request #4530 from MarlonGamez/quiet-logs
Add suppress-logs flag
2 parents a9d53d1 + acdab49 commit 33b1d10

File tree

3 files changed

+19
-0
lines changed

3 files changed

+19
-0
lines changed

cmd/skaffold/app/cmd/flags.go

+8
Original file line numberDiff line numberDiff line change
@@ -365,6 +365,14 @@ var flagRegistry = []Flag{
365365
FlagAddMethod: "BoolVar",
366366
DefinedOn: []string{"render"},
367367
},
368+
{
369+
Name: "suppress-logs",
370+
Usage: "Suppress logs for specified stages in pipeline (build, deploy, status-check, none, all)",
371+
Value: &opts.SuppressLogs,
372+
DefValue: []string{},
373+
FlagAddMethod: "StringSliceVar",
374+
DefinedOn: []string{"dev", "run", "debug", "build", "deploy"},
375+
},
368376
}
369377

370378
func (fl *Flag) flag() *pflag.Flag {

docs/content/en/docs/references/cli/_index.md

+10
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,7 @@ Options:
149149
--rpc-http-port=50052: tcp port to expose event REST API over HTTP
150150
--rpc-port=50051: tcp port to expose event API
151151
--skip-tests=false: Whether to skip the tests after building
152+
--suppress-logs=[]: Suppress logs for specified stages in pipeline (build, deploy, status-check, none, all)
152153
-t, --tag='': The optional custom tag to use for images which overrides the current Tagger configuration
153154
--toot=false: Emit a terminal beep after the deploy is complete
154155
@@ -181,6 +182,7 @@ Env vars:
181182
* `SKAFFOLD_RPC_HTTP_PORT` (same as `--rpc-http-port`)
182183
* `SKAFFOLD_RPC_PORT` (same as `--rpc-port`)
183184
* `SKAFFOLD_SKIP_TESTS` (same as `--skip-tests`)
185+
* `SKAFFOLD_SUPPRESS_LOGS` (same as `--suppress-logs`)
184186
* `SKAFFOLD_TAG` (same as `--tag`)
185187
* `SKAFFOLD_TOOT` (same as `--toot`)
186188

@@ -356,6 +358,7 @@ Options:
356358
--rpc-port=50051: tcp port to expose event API
357359
--skip-tests=false: Whether to skip the tests after building
358360
--status-check=true: Wait for deployed resources to stabilize
361+
--suppress-logs=[]: Suppress logs for specified stages in pipeline (build, deploy, status-check, none, all)
359362
-t, --tag='': The optional custom tag to use for images which overrides the current Tagger configuration
360363
--tail=false: Stream logs from deployed objects (true by default for `skaffold dev` and `skaffold debug`)
361364
--toot=false: Emit a terminal beep after the deploy is complete
@@ -394,6 +397,7 @@ Env vars:
394397
* `SKAFFOLD_RPC_PORT` (same as `--rpc-port`)
395398
* `SKAFFOLD_SKIP_TESTS` (same as `--skip-tests`)
396399
* `SKAFFOLD_STATUS_CHECK` (same as `--status-check`)
400+
* `SKAFFOLD_SUPPRESS_LOGS` (same as `--suppress-logs`)
397401
* `SKAFFOLD_TAG` (same as `--tag`)
398402
* `SKAFFOLD_TAIL` (same as `--tail`)
399403
* `SKAFFOLD_TOOT` (same as `--toot`)
@@ -475,6 +479,7 @@ Options:
475479
--rpc-port=50051: tcp port to expose event API
476480
--skip-render=false: Don't render the manifests, just deploy them
477481
--status-check=true: Wait for deployed resources to stabilize
482+
--suppress-logs=[]: Suppress logs for specified stages in pipeline (build, deploy, status-check, none, all)
478483
--tail=false: Stream logs from deployed objects (true by default for `skaffold dev` and `skaffold debug`)
479484
--toot=false: Emit a terminal beep after the deploy is complete
480485
@@ -505,6 +510,7 @@ Env vars:
505510
* `SKAFFOLD_RPC_PORT` (same as `--rpc-port`)
506511
* `SKAFFOLD_SKIP_RENDER` (same as `--skip-render`)
507512
* `SKAFFOLD_STATUS_CHECK` (same as `--status-check`)
513+
* `SKAFFOLD_SUPPRESS_LOGS` (same as `--suppress-logs`)
508514
* `SKAFFOLD_TAIL` (same as `--tail`)
509515
* `SKAFFOLD_TOOT` (same as `--toot`)
510516

@@ -539,6 +545,7 @@ Options:
539545
--rpc-port=50051: tcp port to expose event API
540546
--skip-tests=false: Whether to skip the tests after building
541547
--status-check=true: Wait for deployed resources to stabilize
548+
--suppress-logs=[]: Suppress logs for specified stages in pipeline (build, deploy, status-check, none, all)
542549
-t, --tag='': The optional custom tag to use for images which overrides the current Tagger configuration
543550
--tail=false: Stream logs from deployed objects (true by default for `skaffold dev` and `skaffold debug`)
544551
--toot=false: Emit a terminal beep after the deploy is complete
@@ -578,6 +585,7 @@ Env vars:
578585
* `SKAFFOLD_RPC_PORT` (same as `--rpc-port`)
579586
* `SKAFFOLD_SKIP_TESTS` (same as `--skip-tests`)
580587
* `SKAFFOLD_STATUS_CHECK` (same as `--status-check`)
588+
* `SKAFFOLD_SUPPRESS_LOGS` (same as `--suppress-logs`)
581589
* `SKAFFOLD_TAG` (same as `--tag`)
582590
* `SKAFFOLD_TAIL` (same as `--tail`)
583591
* `SKAFFOLD_TOOT` (same as `--toot`)
@@ -790,6 +798,7 @@ Options:
790798
--rpc-port=50051: tcp port to expose event API
791799
--skip-tests=false: Whether to skip the tests after building
792800
--status-check=true: Wait for deployed resources to stabilize
801+
--suppress-logs=[]: Suppress logs for specified stages in pipeline (build, deploy, status-check, none, all)
793802
-t, --tag='': The optional custom tag to use for images which overrides the current Tagger configuration
794803
--tail=false: Stream logs from deployed objects (true by default for `skaffold dev` and `skaffold debug`)
795804
--toot=false: Emit a terminal beep after the deploy is complete
@@ -827,6 +836,7 @@ Env vars:
827836
* `SKAFFOLD_RPC_PORT` (same as `--rpc-port`)
828837
* `SKAFFOLD_SKIP_TESTS` (same as `--skip-tests`)
829838
* `SKAFFOLD_STATUS_CHECK` (same as `--status-check`)
839+
* `SKAFFOLD_SUPPRESS_LOGS` (same as `--suppress-logs`)
830840
* `SKAFFOLD_TAG` (same as `--tag`)
831841
* `SKAFFOLD_TAIL` (same as `--tail`)
832842
* `SKAFFOLD_TOOT` (same as `--toot`)

pkg/skaffold/config/options.go

+1
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@ type SkaffoldOptions struct {
8181
// remove minikubeProfile from here and instead detect it by matching the
8282
// kubecontext API Server to minikube profiles
8383
MinikubeProfile string
84+
SuppressLogs []string
8485
}
8586

8687
// Prune returns true iff the user did NOT specify the --no-prune flag,

0 commit comments

Comments
 (0)