-
Notifications
You must be signed in to change notification settings - Fork 234
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #187 from pwittrock/fix
Support for `update vendor` and `version`
- Loading branch information
Showing
15 changed files
with
298 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,6 +21,7 @@ import ( | |
"text/template" | ||
|
||
"fmt" | ||
|
||
"k8s.io/gengo/generator" | ||
) | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
load("@io_bazel_rules_go//go:def.bzl", "go_library") | ||
|
||
go_library( | ||
name = "go_default_library", | ||
srcs = [ | ||
"update.go", | ||
"vendor.go", | ||
], | ||
importpath = "github.com/kubernetes-incubator/apiserver-builder/cmd/apiserver-boot/boot/update", | ||
visibility = ["//visibility:public"], | ||
deps = [ | ||
"//cmd/apiserver-boot/boot/init_repo:go_default_library", | ||
"//vendor/github.com/emicklei/go-restful/log:go_default_library", | ||
"//vendor/github.com/spf13/cobra:go_default_library", | ||
], | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
/* | ||
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 update | ||
|
||
import ( | ||
"github.com/spf13/cobra" | ||
) | ||
|
||
var updateCmd = &cobra.Command{ | ||
Use: "update", | ||
Short: "Command group for updating the apiserver-builder version.", | ||
Long: `Command group for updating the apiserver-builder version.`, | ||
Example: ` | ||
# Update the vendored dependencies under vendor/ | ||
apiserver-boot update vendor | ||
`, | ||
Run: RunUpdate, | ||
} | ||
|
||
func AddUpdate(cmd *cobra.Command) { | ||
cmd.AddCommand(updateCmd) | ||
AddUpdateVendorCmd(updateCmd) | ||
} | ||
|
||
func RunUpdate(cmd *cobra.Command, args []string) { | ||
cmd.Help() | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
/* | ||
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 update | ||
|
||
import ( | ||
"github.com/spf13/cobra" | ||
|
||
"github.com/emicklei/go-restful/log" | ||
"github.com/kubernetes-incubator/apiserver-builder/cmd/apiserver-boot/boot/init_repo" | ||
) | ||
|
||
var vendorCmd = &cobra.Command{ | ||
Use: "vendor", | ||
Short: "Update the vendor packages managed by apiserver-builder.", | ||
Long: `Update the vendor packages managed by apiserver-builder.`, | ||
Example: `# Replace the vendor packages managed by apiserver-builder with versions for the current install. | ||
apiserver-boot update vendor | ||
`, | ||
Run: RunUpdateVendor, | ||
} | ||
|
||
func AddUpdateVendorCmd(cmd *cobra.Command) { | ||
cmd.AddCommand(vendorCmd) | ||
} | ||
|
||
func RunUpdateVendor(cmd *cobra.Command, args []string) { | ||
init_repo.Update = true | ||
log.Printf("Replacing vendored libraries managed by apiserver-builder with the current version.") | ||
init_repo.CopyGlide() | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
load("@io_bazel_rules_go//go:def.bzl", "go_library") | ||
|
||
go_library( | ||
name = "go_default_library", | ||
srcs = ["version.go"], | ||
importpath = "github.com/kubernetes-incubator/apiserver-builder/cmd/apiserver-boot/boot/version", | ||
visibility = ["//visibility:public"], | ||
deps = ["//cmd/vendor/github.com/spf13/cobra:go_default_library"], | ||
) |
Oops, something went wrong.