diff --git a/cmd/apiserver-boot/boot/util/util.go b/cmd/apiserver-boot/boot/util/util.go index cc1093a129..1d7a06205e 100644 --- a/cmd/apiserver-boot/boot/util/util.go +++ b/cmd/apiserver-boot/boot/util/util.go @@ -72,32 +72,13 @@ func WriteIfNotFound(path, templateName, templateValue string, data interface{}) func GetCopyright(file string) string { if len(file) == 0 { - // default to boilerplate.go.txt - if _, err := os.Stat("boilerplate.go.txt"); err == nil { - // Set this because it is passed to generators - file = "boilerplate.go.txt" - cr, err := ioutil.ReadFile(file) - if err != nil { - log.Fatalf("could not read Copyright file %s", file) - } - return string(cr) - } - - log.Fatalf("apiserver-boot create-resource requires the --copyright flag if boilerplate.go.txt does not exist") + file = "boilerplate.go.txt" } - - if _, err := os.Stat(file); err != nil { - if !os.IsNotExist(err) { - log.Fatalf("Could not stat %s: %v", file, err) - } - return "" - } else { - cr, err := ioutil.ReadFile(file) - if err != nil { - log.Fatalf("could not read Copyright file %s", file) - } - return string(cr) + cr, err := ioutil.ReadFile(file) + if err != nil { + log.Fatalf("Must create boilerplate.go.txt file with copyright and file headers") } + return string(cr) } func GetDomain() string { diff --git a/docs/creating_docs.md b/docs/creating_docs.md new file mode 100644 index 0000000000..e69de29bb2 diff --git a/glide.lock b/glide.lock index d3621895bf..87e4c5a257 100644 --- a/glide.lock +++ b/glide.lock @@ -1,5 +1,5 @@ -hash: c82db8488aeedaa60287f686907a78f09bea4d3979d4301072f859647ae1bbc3 -updated: 2017-06-26T10:50:47.941924832-07:00 +hash: a87b96f9245075dd204a9eba558a74c76041211f89dde2866a4c1635dc6232ae +updated: 2017-06-26T17:28:37.142700636-07:00 imports: - name: bitbucket.org/ww/goautoneg version: 75cd24fc2f2c2a2088577d12123ddee5f54e0675 @@ -169,7 +169,7 @@ imports: - name: github.com/juju/ratelimit version: 5b9ff866471762aa2ab2dced63c9fb6f53921342 - name: github.com/kubernetes-incubator/reference-docs - version: 2dfbd12487e43ebd2c7ceb045a0be97a7e11208e + version: 96204a551e6fceeed37f844f8598ad1cb60d7eed subpackages: - gen-apidocs - name: github.com/mailru/easyjson diff --git a/glide.yaml b/glide.yaml index c2a4273997..2c80800710 100644 --- a/glide.yaml +++ b/glide.yaml @@ -40,6 +40,6 @@ import: subpackages: - cmd/libs/go2idl - package: github.com/kubernetes-incubator/reference-docs - version: 2dfbd12487e43ebd2c7ceb045a0be97a7e11208e + version: 96204a551e6fceeed37f844f8598ad1cb60d7eed subpackages: - gen-apidocs diff --git a/vendor/github.com/kubernetes-incubator/reference-docs/Makefile b/vendor/github.com/kubernetes-incubator/reference-docs/Makefile index fa016ec44a..0818d21343 100644 --- a/vendor/github.com/kubernetes-incubator/reference-docs/Makefile +++ b/vendor/github.com/kubernetes-incubator/reference-docs/Makefile @@ -30,7 +30,7 @@ copycli: cli cp -r gen-kubectldocs/generators//build/* $(K8SIOROOT)/docs/user-guide/kubectl/v1.7/ api: cleanapi - go run gen-apidocs/main.go --config-dir=gen-apidocs/generators + go run gen-apidocs/main.go --config-dir=gen-apidocs/generators --munge-groups=false docker run -v $(shell pwd)/gen-apidocs/generators/includes:/source -v $(shell pwd)/gen-apidocs/generators/build:/build -v $(shell pwd)/gen-apidocs/generators/:/manifest pwittrock/brodocs # Build api docs @@ -50,7 +50,7 @@ copyapi: api # Build resource docs resource: cleanapi - go run gen-apidocs/main.go --build-operations=false + go run gen-apidocs/main.go --build-operations=false --munge-groups=false docker run -v $(shell pwd)/gen-apidocs/generators/includes:/source -v $(shell pwd)/gen-apidocs/generators/build:/build -v $(shell pwd)/gen-apidocs/generators/:/manifest pwittrock/brodocs copyresource: resource diff --git a/vendor/github.com/kubernetes-incubator/reference-docs/gen-apidocs/generators/api/config.go b/vendor/github.com/kubernetes-incubator/reference-docs/gen-apidocs/generators/api/config.go index 598af6713d..285063c060 100644 --- a/vendor/github.com/kubernetes-incubator/reference-docs/gen-apidocs/generators/api/config.go +++ b/vendor/github.com/kubernetes-incubator/reference-docs/gen-apidocs/generators/api/config.go @@ -35,6 +35,7 @@ import ( var AllowErrors = flag.Bool("allow-errors", false, "If true, don't fail on errors.") var ConfigDir = flag.String("config-dir", "", "Directory contain api files.") var UseTags = flag.Bool("use-tags", false, "If true, use the openapi tags instead of the config yaml.") +var MungeGroups = flag.Bool("munge-groups", true, "If true, munge the group names for the operations to match.") func (config *Config) genConfigFromTags(specs []*loads.Document) { log.Printf("Using openapi extension tags to configure.") @@ -127,6 +128,7 @@ func NewConfig() *Config { func verifyBlacklisted(operation Operation) { switch { + case strings.Contains(operation.ID, "connectCoreV1Patch"): case strings.Contains(operation.ID, "NamespacedScheduledJob"): case strings.Contains(operation.ID, "ScheduledJobForAllNamespaces"): case strings.Contains(operation.ID, "ScheduledJobListForAllNamespaces"): @@ -277,17 +279,19 @@ func (config *Config) InitOperations(specs []*loads.Document) { // will be unable to match the operationID to the resource because they // don't agree on the name of the group. // TODO: Fix this by getting the group-version-kind in the resource - if v, f := operation.op.Extensions[typeKey]; f { - gvk := v.(map[string]interface{}) - group, ok := gvk["group"].(string) - if !ok { - log.Fatalf("group not type string %v", v) - } - groupId := "" - for _, s := range strings.Split(group, ".") { - groupId = groupId + strings.Title(s) + if *MungeGroups { + if v, f := operation.op.Extensions[typeKey]; f { + gvk := v.(map[string]interface{}) + group, ok := gvk["group"].(string) + if !ok { + log.Fatalf("group not type string %v", v) + } + groupId := "" + for _, s := range strings.Split(group, ".") { + groupId = groupId + strings.Title(s) + } + config.GroupMap[strings.Title(strings.Split(group, ".")[0])] = groupId } - config.GroupMap[strings.Title(strings.Split(group, ".")[0])] = groupId } }) config.Operations = o diff --git a/vendor/github.com/kubernetes-incubator/reference-docs/gen-apidocs/generators/config.yaml b/vendor/github.com/kubernetes-incubator/reference-docs/gen-apidocs/generators/config.yaml index 56c89a4658..d945f531cb 100644 --- a/vendor/github.com/kubernetes-incubator/reference-docs/gen-apidocs/generators/config.yaml +++ b/vendor/github.com/kubernetes-incubator/reference-docs/gen-apidocs/generators/config.yaml @@ -108,9 +108,15 @@ resource_categories: - name: LimitRange version: v1 group: core + - name: ExternalAdmissionHookConfiguration + version: v1alpha1 + group: admissionregistration - name: HorizontalPodAutoscaler version: v1 group: autoscaling + - name: InitializerConfiguration + version: v1alpha1 + group: admissionregistration - name: PodTemplate version: v1 group: core @@ -130,6 +136,9 @@ resource_categories: - name: "Cluster Apis" include: "cluster" resources: + - name: APIService + version: v1beta1 + group: apiregistration - name: Binding version: v1 group: core @@ -180,8 +189,8 @@ resource_categories: version: v1 group: authentication - name: NetworkPolicy - version: v1beta1 - group: extensions + version: v1 + group: networking operation_categories: - name: "Proxy Operations" operation_types: