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

Commit 028580e

Browse files
authored
Merge pull request #22 from mnottale/metadata-flatten
metadata: Flatten struct.
2 parents aec4e7b + 6fbc9dc commit 028580e

File tree

6 files changed

+28
-40
lines changed

6 files changed

+28
-40
lines changed
Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
version: 0.0.1
2-
application:
3-
name: myapp
4-
description: ""
5-
tag: ""
6-
labels:
7-
- alpha
8-
author: bearclaw
2+
name: myapp
3+
description: ""
4+
tag: ""
5+
labels:
6+
- alpha
7+
author: bearclaw
98
targets:
109
swarm: true
1110
kubernetes: true
Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
version: 0.0.1
2-
application:
3-
name: myapp
4-
description: ""
5-
tag: ""
6-
labels:
7-
- alpha
8-
author: bearclaw
2+
name: myapp
3+
description: ""
4+
tag: ""
5+
labels:
6+
- alpha
7+
author: bearclaw
98
targets:
109
swarm: true
1110
kubernetes: true

examples/simple/README.md

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -137,13 +137,12 @@ services:
137137
```yaml
138138
# docker-app inspect simple
139139
version: 0.1.0
140-
application:
141-
name: simple
142-
description: ""
143-
tag: ""
144-
labels:
145-
- alpha
146-
author: sakuya.izayoi
140+
name: simple
141+
description: ""
142+
tag: ""
143+
labels:
144+
- alpha
145+
author: sakuya.izayoi
147146
targets:
148147
swarm: true
149148
kubernetes: true

packager/init.go

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -105,15 +105,12 @@ func newMetadata(name string) types.AppMetadata {
105105
if userData != nil {
106106
userName = userData.Username
107107
}
108-
info := types.ApplicationInfo{
109-
Name: name,
110-
Labels: []string{"alpha"},
111-
Author: userName,
112-
}
113108
return types.AppMetadata{
114-
Version: "0.1.0",
115-
Targets: target,
116-
Application: info,
109+
Version: "0.1.0",
110+
Targets: target,
111+
Name: name,
112+
Labels: []string{"alpha"},
113+
Author: userName,
117114
}
118115
}
119116

renderer/helm.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,11 @@ type helmMeta struct {
2828

2929
func toHelmMeta(meta *types.AppMetadata) (*helmMeta, error) {
3030
return &helmMeta{
31-
Name: meta.Application.Name,
31+
Name: meta.Name,
3232
Version: meta.Version,
33-
Description: meta.Application.Description,
34-
Keywords: meta.Application.Labels,
35-
Maintainers: []helmMaintainer{{Name: meta.Application.Author}},
33+
Description: meta.Description,
34+
Keywords: meta.Labels,
35+
Maintainers: []helmMaintainer{{Name: meta.Author}},
3636
}, nil
3737
}
3838

types/metadata.go

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,12 @@ package types
33
// AppMetadata is the format of the data found inside the metadata.yml file
44
type AppMetadata struct {
55
Version string
6-
Application ApplicationInfo
7-
Targets ApplicationTarget
8-
}
9-
10-
// ApplicationInfo represents general user-provided information about
11-
// a given app package
12-
type ApplicationInfo struct {
136
Name string
147
Description string
158
Tag string
169
Labels []string
1710
Author string
11+
Targets ApplicationTarget
1812
}
1913

2014
// ApplicationTarget represents which platform(s) / orchestrator(s) the

0 commit comments

Comments
 (0)