From d87e0512344dadda54dbbe2ccc14d691b63ed06c Mon Sep 17 00:00:00 2001 From: Josh Wolf Date: Fri, 28 Apr 2023 14:09:41 -0400 Subject: [PATCH] change type structs encoding tag to json Signed-off-by: Josh Wolf --- pkg/build/types/build_option.go | 16 ++++++++-------- pkg/build/types/types.go | 6 +++--- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/pkg/build/types/build_option.go b/pkg/build/types/build_option.go index 62c536b85..76c234a55 100644 --- a/pkg/build/types/build_option.go +++ b/pkg/build/types/build_option.go @@ -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. diff --git a/pkg/build/types/types.go b/pkg/build/types/types.go index 1c31962d9..de41c3f83 100644 --- a/pkg/build/types/types.go +++ b/pkg/build/types/types.go @@ -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 @@ -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 @@ -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"`