From d2c93065d55d6d46cd21e284ecffc201e796f28e Mon Sep 17 00:00:00 2001 From: Jeffrey Regan Date: Tue, 18 Jun 2019 11:08:11 -0700 Subject: [PATCH] Move kustomize main to cmd directory. --- .gitignore | 1 - build/goreleaser.yaml | 2 +- cmd/kustomize/main.go | 17 ++++++++++++++++ docs/INSTALL.md | 47 +++++++++++++++++++++++-------------------- examples/README.md | 2 +- kustomize.go | 30 --------------------------- 6 files changed, 44 insertions(+), 55 deletions(-) create mode 100644 cmd/kustomize/main.go delete mode 100644 kustomize.go diff --git a/.gitignore b/.gitignore index b1ca51477..72a65096f 100644 --- a/.gitignore +++ b/.gitignore @@ -4,7 +4,6 @@ *.dll *.so *.dylib -kustomize # Test binary, build with `go test -c` *.test diff --git a/build/goreleaser.yaml b/build/goreleaser.yaml index 4e4c7dee7..0f85602c7 100644 --- a/build/goreleaser.yaml +++ b/build/goreleaser.yaml @@ -6,7 +6,7 @@ # project_name: kustomize builds: -- main: ./kustomize.go +- main: ./cmd/kustomize/main.go binary: kustomize ldflags: -s -X sigs.k8s.io/kustomize/pkg/commands/misc.kustomizeVersion={{.Version}} -X sigs.k8s.io/kustomize/pkg/commands/misc.gitCommit={{.Commit}} -X sigs.k8s.io/kustomize/pkg/commands/misc.buildDate={{.Date}} goos: diff --git a/cmd/kustomize/main.go b/cmd/kustomize/main.go new file mode 100644 index 000000000..550009e32 --- /dev/null +++ b/cmd/kustomize/main.go @@ -0,0 +1,17 @@ +// Copyright 2019 The Kubernetes Authors. +// SPDX-License-Identifier: Apache-2.0 + +package main + +import ( + "os" + + "sigs.k8s.io/kustomize/pkg/commands" +) + +func main() { + if err := commands.NewDefaultCommand().Execute(); err != nil { + os.Exit(1) + } + os.Exit(0) +} diff --git a/docs/INSTALL.md b/docs/INSTALL.md index 1c386951f..31ba5012a 100644 --- a/docs/INSTALL.md +++ b/docs/INSTALL.md @@ -3,28 +3,11 @@ ## Installation -On macOS, you can install kustomize with Homebrew package -manager: - - brew install kustomize - -On windows, you can install kustomize with Chocolatey package -manager. - - choco install kustomize - -For support on the chocolatey package and prior releases, please reference the following links: -- [Choco Package](https://chocolatey.org/packages/kustomize) -- [Package Source](https://github.com/kenmaglio/choco-kustomize) - - -For all operating systems, download a binary from the +For linux, macOs and Windows, +download a binary from the [release page]. - -Or try this to grab the latest official release -using the command line: - +Or try this command: ``` opsys=linux # or darwin, or windows curl -s https://api.github.com/repos/kubernetes-sigs/kustomize/releases/latest |\ @@ -36,9 +19,29 @@ mv kustomize_*_${opsys}_amd64 kustomize chmod u+x kustomize ``` -To install from head with [Go] v1.10.1 or higher: +To install from head with [Go] v1.12 or higher: ``` -go get sigs.k8s.io/kustomize +go install sigs.k8s.io/kustomize/cmd/kustomize ``` + +### Other methods + +#### macOS + +``` +brew install kustomize +``` + +#### windows + +``` +choco install kustomize +``` + +For support on the chocolatey package +and prior releases, see: +- [Choco Package](https://chocolatey.org/packages/kustomize) +- [Package Source](https://github.com/kenmaglio/choco-kustomize) + diff --git a/examples/README.md b/examples/README.md index aea610f0b..42b06efb7 100644 --- a/examples/README.md +++ b/examples/README.md @@ -9,7 +9,7 @@ tests, and should work with HEAD ``` -go get sigs.k8s.io/kustomize +go get sigs.k8s.io/kustomize/cmd/kustomize ``` Basic Usage diff --git a/kustomize.go b/kustomize.go deleted file mode 100644 index 584b559e8..000000000 --- a/kustomize.go +++ /dev/null @@ -1,30 +0,0 @@ -/* -Copyright 2017 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package main - -import ( - "os" - - "sigs.k8s.io/kustomize/pkg/commands" -) - -func main() { - if err := commands.NewDefaultCommand().Execute(); err != nil { - os.Exit(1) - } - os.Exit(0) -}