Skip to content

Commit

Permalink
change type structs encoding tag to json
Browse files Browse the repository at this point in the history
Signed-off-by: Josh Wolf <josh@wolfs.io>
  • Loading branch information
joshrwolf committed May 6, 2023
1 parent bc23957 commit db72872
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
16 changes: 8 additions & 8 deletions pkg/build/types/build_option.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,30 +17,30 @@ package types
// ListOption describes an optional deviation to a list, for example, a
// list of packages.
type ListOption struct {
Add []string `yaml:"add,omitempty"`
Remove []string `yaml:"remove,omitempty"`
Add []string `json:"add,omitempty"`
Remove []string `json:"remove,omitempty"`
}

// ContentsOption describes an optional deviation to an apko environment's
// contents block.
type ContentsOption struct {
Packages ListOption `yaml:"packages,omitempty"`
Packages ListOption `json:"packages,omitempty"`
}

// AccountsOption describes an optional deviation to an apko environment's
// run-as setting.
type AccountsOption struct {
RunAs string `yaml:"run-as,omitempty"`
RunAs string `json:"run-as,omitempty"`
}

// BuildOption describes an optional deviation to an apko environment.
type BuildOption struct {
Contents ContentsOption `yaml:"contents,omitempty"`
Accounts AccountsOption `yaml:"accounts,omitempty"`
Contents ContentsOption `json:"contents,omitempty"`
Accounts AccountsOption `json:"accounts,omitempty"`

Environment map[string]string `yaml:"environment,omitempty"`
Environment map[string]string `json:"environment,omitempty"`

Entrypoint ImageEntrypoint `yaml:"entrypoint,omitempty"`
Entrypoint ImageEntrypoint `json:"entrypoint,omitempty"`
}

// Apply applies a patch described by a BuildOption to an apko environment.
Expand Down
6 changes: 3 additions & 3 deletions pkg/build/types/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import (

type User struct {
// Required: The name of the user
UserName string `json:"user_name"`
UserName string `json:"username"`
// Required: The user ID
UID uint32 `json:"uid"`
// Required: The user's group ID
Expand All @@ -33,7 +33,7 @@ type User struct {

type Group struct {
// Required: The name of the group
GroupName string `json:"group_name"`
GroupName string `json:"groupname"`
// Required: The group ID
GID uint32 `json:"gid"`
// Required: The list of members of the group
Expand Down Expand Up @@ -87,7 +87,7 @@ type ImageEntrypoint struct {
// Optional: The type of entrypoint. Only "service-bundle" is supported.
Type string `json:"type,omitempty"`
// Required: The command of the entrypoint
Command string `json:"command,omitempty"`
Command string `json:"command"`
// Optional: The shell fragment of the entrypoint command
ShellFragment string `json:"shell-fragment,omitempty"`

Expand Down

0 comments on commit db72872

Please sign in to comment.