summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authork8s-ci-robot <k8s-ci-robot@users.noreply.github.com>2018-01-25 10:44:16 -0800
committerGitHub <noreply@github.com>2018-01-25 10:44:16 -0800
commit18e58e903c07ae8bf1a447ffb87c920b5ac87978 (patch)
tree90d885a042234b8a41f4493eef08e276cc88b38d
parentc240d1c990a6c5557bde297c59fe7bae519cbc7f (diff)
parenta4dab15ab1096f1c0590e5743e3493d914cd8fdc (diff)
Merge pull request #1675 from cblecker/aliases-generator
Generate OWNERS_ALIASES from sigs.yaml
-rw-r--r--OWNERS_ALIASES39
-rw-r--r--generator/aliases.tmpl13
-rw-r--r--generator/app.go29
-rw-r--r--generator/app_test.go40
-rw-r--r--sig-list.md2
5 files changed, 78 insertions, 45 deletions
diff --git a/OWNERS_ALIASES b/OWNERS_ALIASES
index 16126b6c..079205da 100644
--- a/OWNERS_ALIASES
+++ b/OWNERS_ALIASES
@@ -49,12 +49,12 @@ aliases:
- jaredbhatti
sig-gcp-leads:
- abgworrall
- sig-multicluster-leads:
- - csbell
- - quinton-hoole
sig-instrumentation-leads:
- piosz
- fabxc
+ sig-multicluster-leads:
+ - csbell
+ - quinton-hoole
sig-network-leads:
- thockin
- dcbw
@@ -66,19 +66,19 @@ aliases:
- marcoceppi
- dghubble
sig-openstack-leads:
- - idvoretskyi
- - xsgordon
+ - hogepodge
+ - dklyle
+ - rjmorse
sig-product-management-leads:
- apsinha
- idvoretskyi
- calebamiles
sig-release-leads:
- - pwittrock
+ - jdumars
- calebamiles
sig-scalability-leads:
- wojtek-t
- countspongebob
- - jbeda
sig-scheduling-leads:
- davidopp
- timothysc
@@ -100,19 +100,24 @@ aliases:
- floreks
sig-windows-leads:
- michmike
- wg-resource-management-leads:
- - vishh
- - derekwaynecarr
+ wg-app-def-leads:
+ - ant31
+ - sebgoa
+ wg-cloud-provider-leads:
+ - wlan0
+ - jagosan
+ wg-cluster-api-leads:
+ - kris-nova
+ - roberthbailey
wg-container-identity-leads:
- smarterclayton
- destijl
wg-kubeadm-adoption-leads:
- luxas
- justinsb
- wg-cluster-api-leads:
- - kris-nova
- - pipejakob
- - roberthbailey
- wg-app-def-leads:
- - ant31
- - sebgoa
+ wg-multitenancy-leads:
+ - davidopp
+ - jessfraz
+ wg-resource-management-leads:
+ - vishh
+ - derekwaynecarr
diff --git a/generator/aliases.tmpl b/generator/aliases.tmpl
new file mode 100644
index 00000000..32c71cc6
--- /dev/null
+++ b/generator/aliases.tmpl
@@ -0,0 +1,13 @@
+aliases:
+ {{- range .Sigs}}
+ {{.Dir}}-leads:
+ {{- range .Leads}}
+ - {{.GitHub}}
+ {{- end}}
+ {{- end}}
+ {{- range .WorkingGroups}}
+ {{.Dir}}-leads:
+ {{- range .Leads}}
+ - {{.GitHub}}
+ {{- end}}
+ {{- end}}
diff --git a/generator/app.go b/generator/app.go
index 79e08cd3..d2f9f6aa 100644
--- a/generator/app.go
+++ b/generator/app.go
@@ -31,12 +31,14 @@ import (
)
const (
- readmeTemplate = "readme.tmpl"
- listTemplate = "list.tmpl"
- headerTemplate = "header.tmpl"
+ readmeTemplate = "readme.tmpl"
+ listTemplate = "list.tmpl"
+ aliasesTemplate = "aliases.tmpl"
+ headerTemplate = "header.tmpl"
sigsYamlFile = "sigs.yaml"
sigListOutput = "sig-list.md"
+ aliasesOutput = "OWNERS_ALIASES"
indexFilename = "README.md"
beginMarker = "<!-- BEGIN CUSTOM CONTENT -->"
@@ -154,7 +156,7 @@ func tzUrlEncode(tz string) string {
return strings.Replace(url.QueryEscape(tz), "+", "%20", -1)
}
-func writeTemplate(templatePath, outputPath string, data interface{}) error {
+func writeTemplate(templatePath, outputPath string, customContent bool, data interface{}) error {
// set up template
t, err := template.New(filepath.Base(templatePath)).
Funcs(funcMap).
@@ -194,7 +196,9 @@ func writeTemplate(templatePath, outputPath string, data interface{}) error {
}
// custom content block
- writeCustomContentBlock(f, content)
+ if customContent {
+ writeCustomContentBlock(f, content)
+ }
return nil
}
@@ -230,7 +234,7 @@ func createGroupReadme(groups []Group, prefix string) error {
outputPath := filepath.Join(outputDir, indexFilename)
readmePath := filepath.Join(baseGeneratorDir, templateDir, fmt.Sprintf("%s_%s", prefix, readmeTemplate))
- if err := writeTemplate(readmePath, outputPath, group); err != nil {
+ if err := writeTemplate(readmePath, outputPath, true, group); err != nil {
return err
}
}
@@ -251,11 +255,11 @@ func main() {
}
sort.Slice(ctx.Sigs, func(i, j int) bool {
- return ctx.Sigs[i].Name <= ctx.Sigs[j].Name
+ return strings.ToLower(ctx.Sigs[i].Name) <= strings.ToLower(ctx.Sigs[j].Name)
})
sort.Slice(ctx.WorkingGroups, func(i, j int) bool {
- return ctx.WorkingGroups[i].Name <= ctx.WorkingGroups[j].Name
+ return strings.ToLower(ctx.WorkingGroups[i].Name) <= strings.ToLower(ctx.WorkingGroups[j].Name)
})
err = createGroupReadme(ctx.Sigs, "sig")
@@ -270,7 +274,14 @@ func main() {
fmt.Println("Generating sig-list.md")
outputPath := filepath.Join(baseGeneratorDir, sigListOutput)
- err = writeTemplate(filepath.Join(baseGeneratorDir, templateDir, listTemplate), outputPath, ctx)
+ err = writeTemplate(filepath.Join(baseGeneratorDir, templateDir, listTemplate), outputPath, true, ctx)
+ if err != nil {
+ log.Fatal(err)
+ }
+
+ fmt.Println("Generating OWNERS_ALIASES")
+ outputPath = filepath.Join(baseGeneratorDir, aliasesOutput)
+ err = writeTemplate(filepath.Join(baseGeneratorDir, templateDir, aliasesTemplate), outputPath, false, ctx)
if err != nil {
log.Fatal(err)
}
diff --git a/generator/app_test.go b/generator/app_test.go
index 965e0d47..038e470d 100644
--- a/generator/app_test.go
+++ b/generator/app_test.go
@@ -94,34 +94,38 @@ content!
`
cases := []struct {
- templatePath string
- outputPath string
- data map[string]string
- expectErr bool
- expected string
+ templatePath string
+ outputPath string
+ data map[string]string
+ expectErr bool
+ customContent bool
+ expected string
}{
{
- templatePath: "./testdata/non_existent_template.tmpl",
- expectErr: true,
+ templatePath: "./testdata/non_existent_template.tmpl",
+ expectErr: true,
+ customContent: true,
},
{
- templatePath: "./testdata/example.tmpl",
- outputPath: "/tmp/non_existing_path.md",
- expectErr: false,
- data: map[string]string{"Message": "Hello!"},
- expected: "Hello!",
+ templatePath: "./testdata/example.tmpl",
+ outputPath: "/tmp/non_existing_path.md",
+ expectErr: false,
+ customContent: true,
+ data: map[string]string{"Message": "Hello!"},
+ expected: "Hello!",
},
{
- templatePath: "./testdata/example.tmpl",
- outputPath: "./testdata/example.md",
- expectErr: false,
- data: map[string]string{"Message": "Hello!"},
- expected: customContent,
+ templatePath: "./testdata/example.tmpl",
+ outputPath: "./testdata/example.md",
+ expectErr: false,
+ customContent: true,
+ data: map[string]string{"Message": "Hello!"},
+ expected: customContent,
},
}
for _, c := range cases {
- err := writeTemplate(c.templatePath, c.outputPath, c.data)
+ err := writeTemplate(c.templatePath, c.outputPath, c.customContent, c.data)
if err != nil && c.expectErr == false {
t.Fatalf("Received unexpected error for %s: %v", c.templatePath, err)
}
diff --git a/sig-list.md b/sig-list.md
index d3122202..e2499818 100644
--- a/sig-list.md
+++ b/sig-list.md
@@ -23,11 +23,11 @@ When the need arises, a [new SIG can be created](sig-creation-procedure.md)
| Name | Label | Leads | Contact | Meetings |
|------|--------|-------|---------|----------|
|[API Machinery](sig-api-machinery/README.md)|api-machinery|* [Daniel Smith](https://github.com/lavalamp), Google<br>* [David Eads](https://github.com/deads2k), Red Hat<br>|* [Slack](https://kubernetes.slack.com/messages/sig-api-machinery)<br>* [Mailing List](https://groups.google.com/forum/#!forum/kubernetes-sig-api-machinery)|* Regular SIG Meeting: [Wednesdays at 11:00 PT (Pacific Time) (biweekly)](https://staging.talkgadget.google.com/hangouts/_/google.com/kubernetes-sig)<br>
-|[AWS](sig-aws/README.md)|aws|* [Justin Santa Barbara](https://github.com/justinsb)<br>* [Kris Nova](https://github.com/kris-nova), Heptio<br>* [Chris Love](https://github.com/chrislovecnm)<br>* [Mackenzie Burnett](https://github.com/mfburnett), Redspread<br>|* [Slack](https://kubernetes.slack.com/messages/sig-aws)<br>* [Mailing List](https://groups.google.com/forum/#!forum/kubernetes-sig-aws)|* Regular SIG Meeting: [Fridays at 9:00 PT (Pacific Time) (biweekly)](https://zoom.us/my/k8ssigaws)<br>
|[Apps](sig-apps/README.md)|apps|* [Matt Farina](https://github.com/mattfarina), Samsung SDS<br>* [Adnan Abdulhussein](https://github.com/prydonius), Bitnami<br>* [Kenneth Owens](https://github.com/kow3ns), Google<br>|* [Slack](https://kubernetes.slack.com/messages/sig-apps)<br>* [Mailing List](https://groups.google.com/forum/#!forum/kubernetes-sig-apps)|* Regular SIG Meeting: [Mondays at 9:00 PT (Pacific Time) (weekly)](https://zoom.us/my/sig.apps)<br>* Helm Developer call: [Thursdays at 9:30 PT (Pacific Time) (weekly)](https://zoom.us/j/4526666954)<br>* Charts Chat: [Tuesdays at 9:00 PT (Pacific Time) (biweekly)](https://zoom.us/j/166909412)<br>
|[Architecture](sig-architecture/README.md)|architecture|* [Brian Grant](https://github.com/bgrant0607), Google<br>* [Jaice Singer DuMars](https://github.com/jdumars), Microsoft<br>|* [Slack](https://kubernetes.slack.com/messages/sig-architecture)<br>* [Mailing List](https://groups.google.com/forum/#!forum/kubernetes-sig-architecture)|* Regular SIG Meeting: [Thursdays at 15:30 UTC (weekly)](https://zoom.us/j/2018742972)<br>
|[Auth](sig-auth/README.md)|auth|* [Eric Chiang](https://github.com/ericchiang), CoreOS<br>* [Jordan Liggitt](https://github.com/liggitt), Red Hat<br>* [David Eads](https://github.com/deads2k), Red Hat<br>|* [Slack](https://kubernetes.slack.com/messages/sig-auth)<br>* [Mailing List](https://groups.google.com/forum/#!forum/kubernetes-sig-auth)|* Regular SIG Meeting: [Wednesdays at 11:00 PT (Pacific Time) (biweekly)](https://zoom.us/my/k8s.sig.auth)<br>
|[Autoscaling](sig-autoscaling/README.md)|autoscaling|* [Marcin Wielgus](https://github.com/mwielgus), Google<br>* [Solly Ross](https://github.com/directxman12), Red Hat<br>|* [Slack](https://kubernetes.slack.com/messages/sig-autoscaling)<br>* [Mailing List](https://groups.google.com/forum/#!forum/kubernetes-sig-autoscaling)|* Regular SIG Meeting: [Mondays at 14:00 UTC (biweekly/triweekly)](https://zoom.us/my/k8s.sig.autoscaling)<br>
+|[AWS](sig-aws/README.md)|aws|* [Justin Santa Barbara](https://github.com/justinsb)<br>* [Kris Nova](https://github.com/kris-nova), Heptio<br>* [Chris Love](https://github.com/chrislovecnm)<br>* [Mackenzie Burnett](https://github.com/mfburnett), Redspread<br>|* [Slack](https://kubernetes.slack.com/messages/sig-aws)<br>* [Mailing List](https://groups.google.com/forum/#!forum/kubernetes-sig-aws)|* Regular SIG Meeting: [Fridays at 9:00 PT (Pacific Time) (biweekly)](https://zoom.us/my/k8ssigaws)<br>
|[Azure](sig-azure/README.md)|azure|* [Jason Hansen](https://github.com/slack), Microsoft<br>* [Cole Mickens](https://github.com/colemickens), Microsoft<br>* [Jaice Singer DuMars](https://github.com/jdumars), Microsoft<br>|* [Slack](https://kubernetes.slack.com/messages/sig-azure)<br>* [Mailing List](https://groups.google.com/forum/#!forum/kubernetes-sig-azure)|* Regular SIG Meeting: [Wednesdays at 16:00 UTC (biweekly)](https://deis.zoom.us/j/2018742972)<br>
|[Big Data](sig-big-data/README.md)|big-data|* [Anirudh Ramanathan](https://github.com/foxish), Google<br>* [Erik Erlandson](https://github.com/erikerlandson), Red Hat<br>|* [Slack](https://kubernetes.slack.com/messages/sig-big-data)<br>* [Mailing List](https://groups.google.com/forum/#!forum/kubernetes-sig-big-data)|* Regular SIG Meeting: [Wednesdays at 17:00 UTC (weekly)](https://zoom.us/my/sig.big.data)<br>
|[CLI](sig-cli/README.md)|cli|* [Fabiano Franz](https://github.com/fabianofranz), Red Hat<br>* [Phillip Wittrock](https://github.com/pwittrock), Google<br>* [Tony Ado](https://github.com/AdoHe), Alibaba<br>|* [Slack](https://kubernetes.slack.com/messages/sig-cli)<br>* [Mailing List](https://groups.google.com/forum/#!forum/kubernetes-sig-cli)|* Regular SIG Meeting: [Wednesdays at 09:00 PT (Pacific Time) (biweekly)](https://zoom.us/my/sigcli)<br>