Skip to content

Commit 54f60fb

Browse files
authored
Add YAML tags to permission profile structs (#1352)
1 parent d7a2e5d commit 54f60fb

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

pkg/permissions/profile.go

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -22,39 +22,39 @@ const (
2222
// Profile represents a permission profile for a container
2323
type Profile struct {
2424
// Name is the name of the profile
25-
Name string `json:"name,omitempty"`
25+
Name string `json:"name,omitempty" yaml:"name,omitempty"`
2626

2727
// Read is a list of mount declarations that the container can read from
2828
// These can be in the following formats:
2929
// - A single path: The same path will be mounted from host to container
3030
// - host-path:container-path: Different paths for host and container
3131
// - resource-uri:container-path: Mount a resource identified by URI to a container path
32-
Read []MountDeclaration `json:"read,omitempty"`
32+
Read []MountDeclaration `json:"read,omitempty" yaml:"read,omitempty"`
3333

3434
// Write is a list of mount declarations that the container can write to
3535
// These follow the same format as Read mounts but with write permissions
36-
Write []MountDeclaration `json:"write,omitempty"`
36+
Write []MountDeclaration `json:"write,omitempty" yaml:"write,omitempty"`
3737

3838
// Network defines network permissions
39-
Network *NetworkPermissions `json:"network,omitempty"`
39+
Network *NetworkPermissions `json:"network,omitempty" yaml:"network,omitempty"`
4040
}
4141

4242
// NetworkPermissions defines network permissions for a container
4343
type NetworkPermissions struct {
4444
// Outbound defines outbound network permissions
45-
Outbound *OutboundNetworkPermissions `json:"outbound,omitempty"`
45+
Outbound *OutboundNetworkPermissions `json:"outbound,omitempty" yaml:"outbound,omitempty"`
4646
}
4747

4848
// OutboundNetworkPermissions defines outbound network permissions
4949
type OutboundNetworkPermissions struct {
5050
// InsecureAllowAll allows all outbound network connections
51-
InsecureAllowAll bool `json:"insecure_allow_all,omitempty"`
51+
InsecureAllowAll bool `json:"insecure_allow_all,omitempty" yaml:"insecure_allow_all,omitempty"`
5252

5353
// AllowHost is a list of allowed hosts
54-
AllowHost []string `json:"allow_host,omitempty"`
54+
AllowHost []string `json:"allow_host,omitempty" yaml:"allow_host,omitempty"`
5555

5656
// AllowPort is a list of allowed ports
57-
AllowPort []int `json:"allow_port,omitempty"`
57+
AllowPort []int `json:"allow_port,omitempty" yaml:"allow_port,omitempty"`
5858
}
5959

6060
// NewProfile creates a new permission profile

0 commit comments

Comments
 (0)