Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unhide XXenableManifestGeneration for skaffold init, remove unnecessary print line #5152

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion cmd/skaffold/app/cmd/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ func NewCmdInit() *cobra.Command {
{Value: &enableJibGradleInit, Name: "XXenableJibGradleInit", DefValue: false, Usage: "", Hidden: true, IsEnum: true},
{Value: &enableBuildpacksInit, Name: "XXenableBuildpacksInit", DefValue: false, Usage: "", Hidden: true, IsEnum: true},
{Value: &buildpacksBuilder, Name: "XXdefaultBuildpacksBuilder", DefValue: "gcr.io/buildpacks/builder:v1", Usage: "", Hidden: true},
{Value: &enableManifestGeneration, Name: "XXenableManifestGeneration", DefValue: false, Usage: "", Hidden: true, IsEnum: true},
{Value: &enableManifestGeneration, Name: "generate-manifests", DefValue: false, Usage: "Allows skaffold to try and generate basic kubernetes resources to get your project started", IsEnum: true},
}).
NoArgs(doInit)
}
Expand Down
2 changes: 2 additions & 0 deletions docs/content/en/docs/references/cli/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -714,6 +714,7 @@ Options:
--default-kustomization='': Default Kustomization overlay path (others will be added as profiles)
-f, --filename='skaffold.yaml': Path or URL to the Skaffold config file
--force=false: Force the generation of the Skaffold config
--generate-manifests=false: Allows skaffold to try and generate basic kubernetes resources to get your project started
-k, --kubernetes-manifest=[]: A path or a glob pattern to kubernetes manifests (can be non-existent) to be added to the kubectl deployer (overrides detection of kubernetes manifests). Repeat the flag for multiple entries. E.g.: skaffold init -k pod.yaml -k k8s/*.yml
--skip-build=false: Skip generating build artifacts in Skaffold config

Expand All @@ -732,6 +733,7 @@ Env vars:
* `SKAFFOLD_DEFAULT_KUSTOMIZATION` (same as `--default-kustomization`)
* `SKAFFOLD_FILENAME` (same as `--filename`)
* `SKAFFOLD_FORCE` (same as `--force`)
* `SKAFFOLD_GENERATE_MANIFESTS` (same as `--generate-manifests`)
* `SKAFFOLD_KUBERNETES_MANIFEST` (same as `--kubernetes-manifest`)
* `SKAFFOLD_SKIP_BUILD` (same as `--skip-build`)

Expand Down
2 changes: 1 addition & 1 deletion integration/init_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ func TestInitManifestGeneration(t *testing.T) {
{
name: "hello",
dir: "testdata/init/hello",
args: []string{"--XXenableManifestGeneration"},
args: []string{"--generate-manifests"},
expectedManifestPaths: []string{"deployment.yaml"},
},
// TODO(nkubala): add this back when the --force flag is fixed
Expand Down
3 changes: 0 additions & 3 deletions pkg/skaffold/initializer/build/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@ limitations under the License.
package build

import (
"fmt"
"os"
"path/filepath"

"github.com/GoogleContainerTools/skaffold/pkg/skaffold/build/tag"
Expand Down Expand Up @@ -77,7 +75,6 @@ func Artifacts(artifactInfos []ArtifactInfo) []*latest.Artifact {
workspace = filepath.Dir(info.Builder.Path())
}
if workspace != "." {
fmt.Fprintf(os.Stdout, "using non standard workspace: %s\n", workspace)
artifact.Workspace = workspace
}

Expand Down
2 changes: 1 addition & 1 deletion pkg/skaffold/initializer/prompt/prompt.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ func portForwardResource(out io.Writer, imageName string) (int, error) {
Prompt: &survey.Input{Message: fmt.Sprintf("Select port to forward for %s (leave blank for none): ", imageName)},
Validate: func(val interface{}) error {
str := val.(string)
if _, err := strconv.Atoi(str); err != nil {
if _, err := strconv.Atoi(str); err != nil && str != "" {
return errors.New("response must be a number, or empty")
}
return nil
Expand Down