Skip to content

Commit

Permalink
Omit empty bundle fields
Browse files Browse the repository at this point in the history
We were always writing out some bundle fields, like both path and the
environment variable when it's always an either/or situation with those
fields.
  • Loading branch information
carolynvs-msft committed Mar 26, 2019
1 parent d291299 commit 5c527f4
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
8 changes: 4 additions & 4 deletions pkg/config/manifest.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,13 +52,13 @@ type ParameterDefinition struct {

type CredentialDefinition struct {
Name string `yaml:"name"`
Path string `yaml:"path"`
EnvironmentVariable string `yaml:"env"`
Path string `yaml:"path,omitempty"`
EnvironmentVariable string `yaml:"env,omitempty"`
}

type Location struct {
Path string `yaml:"path"`
EnvironmentVariable string `yaml:"env"`
Path string `yaml:"path,omitempty"`
EnvironmentVariable string `yaml:"env,omitempty"`
}

// ParameterMetadata contains metadata for a parameter definition.
Expand Down
8 changes: 4 additions & 4 deletions pkg/porter/bundle.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,18 +74,18 @@ type InvocationImage struct {
//
// A location may be either a file (by path) or an environment variable.
type Location struct {
Path string `json:"path" toml:"path"`
EnvironmentVariable string `json:"env" toml:"env"`
Path string `json:"path,omitempty" toml:"path"`
EnvironmentVariable string `json:"env,omitempty" toml:"env"`
}

// Maintainer describes a code maintainer of a bundle
type Maintainer struct {
// Name is a user name or organization name
Name string `json:"name" toml:"name"`
// Email is an optional email address to contact the named maintainer
Email string `json:"email" toml:"email"`
Email string `json:"email,omitempty" toml:"email"`
// Url is an optional URL to an address for the named maintainer
URL string `json:"url" toml:"url"`
URL string `json:"url,omitempty" toml:"url"`
}

// Action describes a custom (non-core) action.
Expand Down

0 comments on commit 5c527f4

Please sign in to comment.