Skip to content
This repository was archived by the owner on Jul 18, 2025. It is now read-only.

Commit 61d179d

Browse files
author
Matthieu Nottale
committed
metadata: Replace author by maintainers. Adapt.
Signed-off-by: Matthieu Nottale <[email protected]>
1 parent b973243 commit 61d179d

File tree

8 files changed

+54
-22
lines changed

8 files changed

+54
-22
lines changed
Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
version: 0.1.0
22
name: myapp
33
description: ""
4-
author: bearclaw
4+
maintainers:
5+
- name: bearclaw
6+
57
targets:
68
swarm: true
79
kubernetes: true
Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
version: 0.1.0
22
name: myapp
33
description: ""
4-
author: bearclaw
4+
maintainers:
5+
- name: bearclaw
6+
57
targets:
68
swarm: true
79
kubernetes: true

examples/simple/README.md

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -136,13 +136,22 @@ services:
136136

137137
```yaml
138138
# docker-app inspect simple
139-
version: 0.1.0
140-
name: simple
141-
description: ""
142-
author: sakuya.izayoi
143-
targets:
144-
swarm: true
145-
kubernetes: true
139+
simple 0.1.0
140+
Maintained by: sakuya.izayoi <[email protected]>
141+
142+
143+
144+
Setting Default
145+
------- -------
146+
mysql.user.password wordpress
147+
mysql.rootpass axx[<^cz3d.fPb
148+
mysql.database wordpressdata
149+
mysql.user.name wordpress
150+
volumes.db_data.name db_data
151+
debug true
152+
mysql.image.version 8
153+
wordpress.scale.mode global
154+
wordpress.scale.replicas 0
146155
```
147156

148157
### Generate helm package
Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
version: 0.1.0
2-
application:
3-
name: simple
4-
description: ""
5-
author: sakuya.izayoi
2+
name: simple
3+
description: ""
4+
maintainers:
5+
- name: sakuya.izayoi
6+
67
targets:
78
swarm: true
89
kubernetes: true

packager/init.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -217,9 +217,9 @@ func newMetadata(name string) types.AppMetadata {
217217
userName = userData.Username
218218
}
219219
return types.AppMetadata{
220-
Version: "0.1.0",
221-
Targets: target,
222-
Name: name,
223-
Author: userName,
220+
Version: "0.1.0",
221+
Targets: target,
222+
Name: name,
223+
Maintainers: []types.Maintainer{{Name: userName}},
224224
}
225225
}

renderer/helm.go

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,17 @@ type helmMeta struct {
2727
}
2828

2929
func toHelmMeta(meta *types.AppMetadata) (*helmMeta, error) {
30-
return &helmMeta{
30+
res := &helmMeta{
3131
Name: meta.Name,
3232
Version: meta.Version,
3333
Description: meta.Description,
34-
Maintainers: []helmMaintainer{{Name: meta.Author}},
35-
}, nil
34+
}
35+
for _, m := range meta.Maintainers {
36+
res.Maintainers = append(res.Maintainers,
37+
helmMaintainer{Name: m.Name + " <" + m.Email + ">"},
38+
)
39+
}
40+
return res, nil
3641
}
3742

3843
// Helm renders an app as an Helm Chart

renderer/inspect.go

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import (
55
"io/ioutil"
66
"os"
77
"path/filepath"
8+
"strings"
89
"text/tabwriter"
910

1011
"github.com/docker/lunchbox/packager"
@@ -39,8 +40,14 @@ func Inspect(appname string) error {
3940
if err != nil {
4041
return err
4142
}
43+
// build maintainers string
44+
maintainers := ""
45+
for _, m := range meta.Maintainers {
46+
maintainers += m.Name + " <" + m.Email + ">, "
47+
}
48+
maintainers = strings.TrimSuffix(maintainers, ", ")
4249
fmt.Printf("%s %s\n", meta.Name, meta.Version)
43-
fmt.Printf("Maintained by: %s\n", meta.Author)
50+
fmt.Printf("Maintained by: %s\n", maintainers)
4451
fmt.Println("")
4552
fmt.Printf("%s\n", meta.Description)
4653
fmt.Println("")

types/metadata.go

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,17 @@
11
package types
22

3+
// Maintainer represents one of the apps's maintainers
4+
type Maintainer struct {
5+
Name string
6+
Email string
7+
}
8+
39
// AppMetadata is the format of the data found inside the metadata.yml file
410
type AppMetadata struct {
511
Version string
612
Name string
713
Description string
8-
Author string
14+
Maintainers []Maintainer
915
Targets ApplicationTarget
1016
}
1117

0 commit comments

Comments
 (0)