Skip to content

Commit

Permalink
Merge pull request kubernetes#8455 from rifelpet/api-env-var
Browse files Browse the repository at this point in the history
Add an EnvVar type to the API
  • Loading branch information
k8s-ci-robot committed Jan 31, 2020
2 parents 4416b24 + eb5d2b7 commit 48eb069
Show file tree
Hide file tree
Showing 8 changed files with 163 additions and 0 deletions.
17 changes: 17 additions & 0 deletions pkg/apis/kops/cluster.go
Expand Up @@ -643,6 +643,23 @@ func (c *Cluster) IsKubernetesGTE(version string) bool {
return clusterVersion.GTE(*parsedVersion)
}

// EnvVar represents an environment variable present in a Container.
type EnvVar struct {
// Name of the environment variable. Must be a C_IDENTIFIER.
Name string `json:"name"`

// Variable references $(VAR_NAME) are expanded
// using the previous defined environment variables in the container and
// any service environment variables. If a variable cannot be resolved,
// the reference in the input string will be unchanged. The $(VAR_NAME)
// syntax can be escaped with a double $$, ie: $$(VAR_NAME). Escaped
// references will never be expanded, regardless of whether the variable
// exists or not.
// Defaults to "".
// +optional
Value string `json:"value,omitempty"`
}

type GossipConfig struct {
Protocol *string `json:"protocol,omitempty"`
Listen *string `json:"listen,omitempty"`
Expand Down
17 changes: 17 additions & 0 deletions pkg/apis/kops/v1alpha1/cluster.go
Expand Up @@ -527,6 +527,23 @@ func (t *TerraformSpec) IsEmpty() bool {
return t.ProviderExtraConfig == nil
}

// EnvVar represents an environment variable present in a Container.
type EnvVar struct {
// Name of the environment variable. Must be a C_IDENTIFIER.
Name string `json:"name"`

// Variable references $(VAR_NAME) are expanded
// using the previous defined environment variables in the container and
// any service environment variables. If a variable cannot be resolved,
// the reference in the input string will be unchanged. The $(VAR_NAME)
// syntax can be escaped with a double $$, ie: $$(VAR_NAME). Escaped
// references will never be expanded, regardless of whether the variable
// exists or not.
// Defaults to "".
// +optional
Value string `json:"value,omitempty"`
}

type GossipConfig struct {
Protocol *string `json:"protocol,omitempty"`
Listen *string `json:"listen,omitempty"`
Expand Down
32 changes: 32 additions & 0 deletions pkg/apis/kops/v1alpha1/zz_generated.conversion.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 16 additions & 0 deletions pkg/apis/kops/v1alpha1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 17 additions & 0 deletions pkg/apis/kops/v1alpha2/cluster.go
Expand Up @@ -540,6 +540,23 @@ func (t *TerraformSpec) IsEmpty() bool {
return t.ProviderExtraConfig == nil
}

// EnvVar represents an environment variable present in a Container.
type EnvVar struct {
// Name of the environment variable. Must be a C_IDENTIFIER.
Name string `json:"name"`

// Variable references $(VAR_NAME) are expanded
// using the previous defined environment variables in the container and
// any service environment variables. If a variable cannot be resolved,
// the reference in the input string will be unchanged. The $(VAR_NAME)
// syntax can be escaped with a double $$, ie: $$(VAR_NAME). Escaped
// references will never be expanded, regardless of whether the variable
// exists or not.
// Defaults to "".
// +optional
Value string `json:"value,omitempty"`
}

type GossipConfig struct {
Protocol *string `json:"protocol,omitempty"`
Listen *string `json:"listen,omitempty"`
Expand Down
32 changes: 32 additions & 0 deletions pkg/apis/kops/v1alpha2/zz_generated.conversion.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 16 additions & 0 deletions pkg/apis/kops/v1alpha2/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 16 additions & 0 deletions pkg/apis/kops/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 48eb069

Please sign in to comment.