Repository: GoogleContainerTools/skaffold
Pull request #7625 (2022-07-06 20:40:54)

chore: remove opt.skipRender flag
<!-- Thank you for your contribution! -->

<!-- Include if applicable: -->
Fixes: #7562 <!-- tracking issues that this PR will close -->
**Related**: _Relevant tracking issues, for context_
**Merge before/after**: _Dependent or prerequisite PRs_

**Description**
 - remove opt.skipRender flag and its related references. 




aaron-prindle: Seems there is strange error in kokoro test:
```
=== RUN   TestApplyStatusCheckFailure/status_check_for_config_connector_resources
    util.go:95: Test partition: 3
time="2022-07-06T23:10:12Z" level=info msg="Namespace: skaffoldwdsfz" subtask=-1 task=DevLoop
    apply_test.go:108: Running [skaffold apply --namespace skaffoldwdsfz configconnector.yaml] in testdata/apply
Starting deploy...
 - storagebucket.storage.cnrm.cloud.google.com/random-xxljslierjlj-sample created
Waiting for deployments to stabilize...
 - skaffoldwdsfz:config-connector-resource/storage.cnrm.cloud.google.com/v1beta1, Kind=StorageBucket, Name=random-xxljslierjlj-sample: Update call failed: error applying desired state: summary: googleapi: Error 400: Unknown project id: skaffoldwdsfz, invalid
    - skaffoldwdsfz:StorageBucket/random-xxljslierjlj-sample: Update call failed: error applying desired state: summary: googleapi: Error 400: Unknown project id: skaffoldwdsfz, invalid
Received signal: 15, build might get interrupted.
kex_exchange_identification: Connection closed by remote host
Connection closed by UNKNOWN port 65535
rsync: connection unexpectedly closed (0 bytes received so far) [Receiver]
rsync error: unexplained error (code 255) at io.c(226) [Receiver=3.1.3]
kex_exchange_identification: Connection closed by remote host
Connection closed by UNKNOWN port 65535
```

Perhaps try resubmitting and see if this is green?  I don't think this is related to the changes in this PR

Patch:
diff --git a/cmd/skaffold/app/cmd/deploy.go b/cmd/skaffold/app/cmd/deploy.go
index bbfa050a4..58cc8a503 100644
--- a/cmd/skaffold/app/cmd/deploy.go
+++ b/cmd/skaffold/app/cmd/deploy.go
@@ -35,11 +35,7 @@ func NewCmdDeploy() *cobra.Command {
 		WithExample("Build the artifacts and collect the tags into a file", "build --file-output=tags.json").
 		WithExample("Deploy those tags", "deploy --build-artifacts=tags.json").
 		WithExample("Build the artifacts and then deploy them", "build -q | skaffold deploy --build-artifacts -").
-		WithExample("Deploy without first rendering the manifests", "deploy --skip-render").
 		WithCommonFlags().
-		WithFlags([]*Flag{
-			{Value: &opts.SkipRender, Name: "skip-render", DefValue: false, Usage: "Don't render the manifests, just deploy them", IsEnum: true},
-		}).
 		WithHouseKeepingMessages().
 		NoArgs(doDeploy)
 }
diff --git a/docs-v2/content/en/docs/references/cli/_index.md b/docs-v2/content/en/docs/references/cli/_index.md
index a3221cd6c..f52ce4f4b 100644
--- a/docs-v2/content/en/docs/references/cli/_index.md
+++ b/docs-v2/content/en/docs/references/cli/_index.md
@@ -573,9 +573,6 @@ Examples:
   # Build the artifacts and then deploy them
   skaffold build -q | skaffold deploy --build-artifacts -
 
-  # Deploy without first rendering the manifests
-  skaffold deploy --skip-render
-
 Options:
       --assume-yes=false: If true, skaffold will skip yes/no confirmation from the user and default to yes
   -a, --build-artifacts=: File containing build result from a previous 'skaffold build --file-output'
@@ -604,7 +601,6 @@ Options:
       --resource-selector-rules-file='': Path to JSON file specifying the deny list of yaml objects for skaffold to NOT transform with 'image' and 'label' field replacements.  NOTE: this list is additive to skaffold's default denylist and denylist has priority over allowlist
       --rpc-http-port=: tcp port to expose the Skaffold API over HTTP REST
       --rpc-port=: tcp port to expose the Skaffold API over gRPC
-      --skip-render=false: Don't render the manifests, just deploy them
       --status-check=: Wait for deployed resources to stabilize
       --sync-remote-cache='always': Controls how Skaffold manages the remote config cache (see `remote-cache-dir`). One of `always` (default), `missing`, or `never`. `always` syncs remote repositories to latest on access. `missing` only clones remote repositories if they do not exist locally. `never` means the user takes responsibility for updating remote repositories.
   -t, --tag='': The optional custom tag to use for images which overrides the current Tagger configuration
@@ -651,7 +647,6 @@ Env vars:
 * `SKAFFOLD_RESOURCE_SELECTOR_RULES_FILE` (same as `--resource-selector-rules-file`)
 * `SKAFFOLD_RPC_HTTP_PORT` (same as `--rpc-http-port`)
 * `SKAFFOLD_RPC_PORT` (same as `--rpc-port`)
-* `SKAFFOLD_SKIP_RENDER` (same as `--skip-render`)
 * `SKAFFOLD_STATUS_CHECK` (same as `--status-check`)
 * `SKAFFOLD_SYNC_REMOTE_CACHE` (same as `--sync-remote-cache`)
 * `SKAFFOLD_TAG` (same as `--tag`)
diff --git a/docs/content/en/docs/references/cli/_index.md b/docs/content/en/docs/references/cli/_index.md
index 383e97d2d..08c39c783 100644
--- a/docs/content/en/docs/references/cli/_index.md
+++ b/docs/content/en/docs/references/cli/_index.md
@@ -573,9 +573,6 @@ Examples:
   # Build the artifacts and then deploy them
   skaffold build -q | skaffold deploy --build-artifacts -
 
-  # Deploy without first rendering the manifests
-  skaffold deploy --skip-render
-
 Options:
       --assume-yes=false: If true, skaffold will skip yes/no confirmation from the user and default to yes
   -a, --build-artifacts=: File containing build result from a previous 'skaffold build --file-output'
@@ -604,7 +601,6 @@ Options:
       --resource-selector-rules-file='': Path to JSON file specifying the deny list of yaml objects for skaffold to NOT transform with 'image' and 'label' field replacements.  NOTE: this list is additive to skaffold's default denylist and denylist has priority over allowlist
       --rpc-http-port=: tcp port to expose the Skaffold API over HTTP REST
       --rpc-port=: tcp port to expose the Skaffold API over gRPC
-      --skip-render=false: Don't render the manifests, just deploy them
       --status-check=: Wait for deployed resources to stabilize
       --sync-remote-cache='always': Controls how Skaffold manages the remote config cache (see `remote-cache-dir`). One of `always` (default), `missing`, or `never`. `always` syncs remote repositories to latest on access. `missing` only clones remote repositories if they do not exist locally. `never` means the user takes responsibility for updating remote repositories.
   -t, --tag='': The optional custom tag to use for images which overrides the current Tagger configuration
@@ -651,7 +647,6 @@ Env vars:
 * `SKAFFOLD_RESOURCE_SELECTOR_RULES_FILE` (same as `--resource-selector-rules-file`)
 * `SKAFFOLD_RPC_HTTP_PORT` (same as `--rpc-http-port`)
 * `SKAFFOLD_RPC_PORT` (same as `--rpc-port`)
-* `SKAFFOLD_SKIP_RENDER` (same as `--skip-render`)
 * `SKAFFOLD_STATUS_CHECK` (same as `--status-check`)
 * `SKAFFOLD_SYNC_REMOTE_CACHE` (same as `--sync-remote-cache`)
 * `SKAFFOLD_TAG` (same as `--tag`)
diff --git a/pkg/skaffold/config/options.go b/pkg/skaffold/config/options.go
index ee82bd5e3..abceeb6bf 100644
--- a/pkg/skaffold/config/options.go
+++ b/pkg/skaffold/config/options.go
@@ -55,7 +55,6 @@ type SkaffoldOptions struct {
 	PropagateProfiles     bool
 	RenderOnly            bool
 	SkipTests             bool
-	SkipRender            bool
 	SkipConfigDefaults    bool
 	Tail                  bool
 	WaitForConnection     bool
diff --git a/pkg/skaffold/deploy/kubectl/kubectl.go b/pkg/skaffold/deploy/kubectl/kubectl.go
index 4f6059831..230879e71 100644
--- a/pkg/skaffold/deploy/kubectl/kubectl.go
+++ b/pkg/skaffold/deploy/kubectl/kubectl.go
@@ -77,7 +77,6 @@ type Deployer struct {
 	kubectl            CLI
 	insecureRegistries map[string]bool
 	labeller           *label.DefaultLabeller
-	skipRender         bool
 	namespaces         *[]string
 
 	transformableAllowlist map[apimachinery.GroupKind]latest.ResourceFilter
@@ -124,7 +123,6 @@ func NewDeployer(cfg Config, labeller *label.DefaultLabeller, d *latest.KubectlD
 		multiLevelRepo:     cfg.MultiLevelRepo(),
 		kubectl:            kubectl,
 		insecureRegistries: cfg.GetInsecureRegistries(),
-		skipRender:         cfg.SkipRender(),
 		labeller:           labeller,
 		// hydratedManifests refers to the DIR in the `skaffold apply DIR`. Used in both v1 and v2.
 		hydratedManifests: cfg.HydratedManifests(),
@@ -198,15 +196,6 @@ func (k *Deployer) Deploy(ctx context.Context, out io.Writer, builds []graph.Art
 		}
 		manifests, err = manifests.SetLabels(k.labeller.Labels(), manifest.NewResourceSelectorLabels(k.transformableAllowlist, k.transformableDenylist))
 		endTrace()
-	} else if k.skipRender {
-		childCtx, endTrace = instrumentation.StartTrace(ctx, "Deploy_readManifests")
-		manifests, err = k.readManifests(childCtx, false)
-		if err != nil {
-			endTrace(instrumentation.TraceEndError(err))
-			return err
-		}
-		manifests, err = manifests.SetLabels(k.labeller.Labels(), manifest.NewResourceSelectorLabels(k.transformableAllowlist, k.transformableDenylist))
-		endTrace()
 	}
 
 	if err != nil {
diff --git a/pkg/skaffold/deploy/types/types.go b/pkg/skaffold/deploy/types/types.go
index 4014093f5..6101c2d66 100644
--- a/pkg/skaffold/deploy/types/types.go
+++ b/pkg/skaffold/deploy/types/types.go
@@ -33,7 +33,6 @@ type Config interface {
 	ConfigurationFile() string
 	DefaultRepo() *string
 	MultiLevelRepo() *bool
-	SkipRender() bool
 	TransformAllowList() []latest.ResourceFilter
 	TransformDenyList() []latest.ResourceFilter
 	TransformRulesFile() string
diff --git a/pkg/skaffold/runner/runcontext/v2/context.go b/pkg/skaffold/runner/runcontext/v2/context.go
index 43d1217b3..f37c5e9d0 100644
--- a/pkg/skaffold/runner/runcontext/v2/context.go
+++ b/pkg/skaffold/runner/runcontext/v2/context.go
@@ -251,7 +251,6 @@ func (rc *RunContext) PortForwardOptions() config.PortForwardOptions { return rc
 func (rc *RunContext) Prune() bool                                   { return rc.Opts.Prune() }
 func (rc *RunContext) RenderOnly() bool                              { return rc.Opts.RenderOnly }
 func (rc *RunContext) RenderOutput() string                          { return rc.Opts.RenderOutput }
-func (rc *RunContext) SkipRender() bool                              { return rc.Opts.SkipRender }
 func (rc *RunContext) StatusCheck() *bool                            { return rc.Opts.StatusCheck.Value() }
 func (rc *RunContext) IterativeStatusCheck() bool                    { return rc.Opts.IterativeStatusCheck }
 func (rc *RunContext) FastFailStatusCheck() bool                     { return rc.Opts.FastFailStatusCheck }


Test patch:
diff --git a/pkg/skaffold/deploy/deploy_problems_test.go b/pkg/skaffold/deploy/deploy_problems_test.go
index fb3454731..b60c8ed5b 100644
--- a/pkg/skaffold/deploy/deploy_problems_test.go
+++ b/pkg/skaffold/deploy/deploy_problems_test.go
@@ -116,7 +116,6 @@ func (m mockConfig) GlobalConfig() string                        { return "" }
 func (m mockConfig) ConfigurationFile() string                   { return "" }
 func (m mockConfig) DefaultRepo() *string                        { return &m.minikube }
 func (m mockConfig) MultiLevelRepo() *bool                       { return nil }
-func (m mockConfig) SkipRender() bool                            { return true }
 func (m mockConfig) Prune() bool                                 { return true }
 func (m mockConfig) ContainerDebugging() bool                    { return false }
 func (m mockConfig) GetKubeContext() string                      { return m.kubeContext }
diff --git a/pkg/skaffold/deploy/kubectl/kubectl_test.go b/pkg/skaffold/deploy/kubectl/kubectl_test.go
index df464be10..b6adc9f9e 100644
--- a/pkg/skaffold/deploy/kubectl/kubectl_test.go
+++ b/pkg/skaffold/deploy/kubectl/kubectl_test.go
@@ -587,7 +587,6 @@ func TestGCSManifests(t *testing.T) {
 		generate    latest.Generate
 		commands    util.Command
 		shouldErr   bool
-		skipRender  bool
 	}{
 		{
 			description: "manifest from GCS",
@@ -624,7 +623,6 @@ func TestGCSManifests(t *testing.T) {
 
 			k, err := NewDeployer(&kubectlConfig{
 				workingDir: ".",
-				skipRender: test.skipRender,
 				RunContext: runcontext.RunContext{Opts: config.SkaffoldOptions{Namespace: TestNamespace}},
 			}, &label.DefaultLabeller{}, &latest.KubectlDeploy{})
 			t.RequireNoError(err)
@@ -676,7 +674,6 @@ type kubectlConfig struct {
 	workingDir            string
 	defaultRepo           string
 	multiLevelRepo        *bool
-	skipRender            bool
 	force                 bool
 	waitForDeletions      config.WaitForDeletions
 }
@@ -684,7 +681,6 @@ type kubectlConfig struct {
 func (c *kubectlConfig) GetKubeContext() string                              { return "kubecontext" }
 func (c *kubectlConfig) GetKubeNamespace() string                            { return c.Opts.Namespace }
 func (c *kubectlConfig) WorkingDir() string                                  { return c.workingDir }
-func (c *kubectlConfig) SkipRender() bool                                    { return c.skipRender }
 func (c *kubectlConfig) ForceDeploy() bool                                   { return c.force }
 func (c *kubectlConfig) DefaultRepo() *string                                { return &c.defaultRepo }
 func (c *kubectlConfig) MultiLevelRepo() *bool                               { return c.multiLevelRepo }