Skip to content

Commit d77260c

Browse files
committed
adds updated schema
1 parent b2f5100 commit d77260c

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

ent/schema/policies.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,11 @@ type Policies struct {
1212
ent.Schema
1313
}
1414

15+
type PolicyLabel struct {
16+
Key string `json:"key"`
17+
Value string `json:"value"`
18+
}
19+
1520
type Image struct {
1621
Registry string `json:"registry"`
1722
Name string `json:"name"`
@@ -37,6 +42,9 @@ func (Policies) Fields() []ent.Field {
3742
Comment("Policy name."),
3843
field.JSON("image", Image{}).
3944
Comment("Stores image details like registry, tags."),
45+
field.JSON("labels", PolicyLabels{}).
46+
Optional().
47+
Comment("Policies labels key:value"),
4048
// Todo: Trigger is optional
4149
field.JSON("trigger", map[string]interface{}{}).
4250
Optional().

0 commit comments

Comments
 (0)