Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support structured config #575

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
154 changes: 154 additions & 0 deletions deploy/crds/pulumi.com_stacks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,83 @@ spec:
which can be optionally specified inline. If this is omitted, configuration
is assumed to be checked in and taken from the source repository.
type: object
configRefs:
description: (optional) ConfigRefs is an optional list of configuration
values for this stack, which can be specified through each ConfigRef.
If this is omitted, configuration is assumed to be checked in and
taken from the source repository. If present, ConfigRefs values
Comment on lines +86 to +87
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this mean we over-write in-repo configs entirely? Why not overlay these configs on top of source?

It seems surprising to be able to commit some changes to config, deploy it, but then not see the new config take effect. Is this the existing behavior of the operator?

will be merged with the ones passed through Config field (ConfigRefs
values have precedence, and configs will the same key name will
be overwritten).
items:
additionalProperties:
description: ConfigRef identifies a resource from which config
information can be loaded. Environment variables, files on the
filesystem, Kubernetes Secrets, ConfigMaps, structured and config
literal values strings are currently supported.
properties:
configmap:
description: ConfigMap refers to a Kubernetes ConfigMap. It
will be assumed the ConfigMap key content is the stack config
in YAML format.
properties:
key:
description: Key within the ConfigMap to use.
type: string
name:
description: Name of the ConfigMap
type: string
namespace:
description: Namespace where the ConfigMap is stored.
Deprecated; non-empty values will be considered invalid
unless namespace isolation is disabled in the controller.
type: string
Comment on lines +109 to +113
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's not add new things that are already deprecated.

Suggested change
namespace:
description: Namespace where the ConfigMap is stored.
Deprecated; non-empty values will be considered invalid
unless namespace isolation is disabled in the controller.
type: string

required:
- key
- name
type: object
env:
description: Env selects an environment variable set on the
operator process
Comment on lines +119 to +120
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems like this was copy-pasted, let's make sure the doc strings are accurate.

properties:
name:
description: Name of the environment variable
type: string
required:
- name
type: object
filesystem:
description: FileSystem selects a file on the operator's file
system
properties:
path:
description: Path on the filesystem to use to load information
from.
type: string
required:
- path
type: object
literal:
description: Literal refers to a literal config value. It
could be both a single or a structured (in YAML format)
ones.
Comment on lines +140 to +142
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This says it accepts YAML, but below it takes a JSON value.

Suggested change
description: Literal refers to a literal config value. It
could be both a single or a structured (in YAML format)
ones.
description: A YAML object to inject as config.

properties:
value:
description: Value to load
x-kubernetes-preserve-unknown-fields: true
required:
- value
type: object
type:
description: 'SelectorType is required and signifies the type
of selector. Must be one of: Env, FS, Secret, ConfigMap,
Structured, Literal'
Comment on lines +152 to +153
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
of selector. Must be one of: Env, FS, Secret, ConfigMap,
Structured, Literal'
of selector. Must be one of: Env, FS, ConfigMap, or Literal.'

Or just ConfigMap/Literal if you scope it down to those two.

type: string
required:
- type
type: object
type: object
type: array
continueResyncOnCommitMatch:
description: (optional) ContinueResyncOnCommitMatch - when true -
informs the operator to continue trying to update stacks even if
Expand Down Expand Up @@ -898,6 +975,83 @@ spec:
which can be optionally specified inline. If this is omitted, configuration
is assumed to be checked in and taken from the source repository.
type: object
configRefs:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It was suggested that we keep this limited to an alpha version like this before adding it to v1. That way we aren't immediately locked in to the API.

description: (optional) ConfigRefs is an optional list of configuration
values for this stack, which can be specified through each ConfigRef.
If this is omitted, configuration is assumed to be checked in and
taken from the source repository. If present, ConfigRefs values
will be merged with the ones passed through Config field (ConfigRefs
values have precedence, and configs will the same key name will
be overwritten).
items:
additionalProperties:
description: ConfigRef identifies a resource from which config
information can be loaded. Environment variables, files on the
filesystem, Kubernetes Secrets, ConfigMaps, structured and config
literal values strings are currently supported.
properties:
configmap:
description: ConfigMap refers to a Kubernetes ConfigMap. It
will be assumed the ConfigMap key content is the stack config
in YAML format.
properties:
key:
description: Key within the ConfigMap to use.
type: string
name:
description: Name of the ConfigMap
type: string
namespace:
description: Namespace where the ConfigMap is stored.
Deprecated; non-empty values will be considered invalid
unless namespace isolation is disabled in the controller.
type: string
required:
- key
- name
type: object
env:
description: Env selects an environment variable set on the
operator process
properties:
name:
description: Name of the environment variable
type: string
required:
- name
type: object
filesystem:
description: FileSystem selects a file on the operator's file
system
properties:
path:
description: Path on the filesystem to use to load information
from.
type: string
required:
- path
type: object
literal:
description: Literal refers to a literal config value. It
could be both a single or a structured (in YAML format)
ones.
properties:
value:
description: Value to load
x-kubernetes-preserve-unknown-fields: true
required:
- value
type: object
type:
description: 'SelectorType is required and signifies the type
of selector. Must be one of: Env, FS, Secret, ConfigMap,
Structured, Literal'
type: string
required:
- type
type: object
type: object
type: array
continueResyncOnCommitMatch:
description: (optional) ContinueResyncOnCommitMatch - when true -
informs the operator to continue trying to update stacks even if
Expand Down
Loading
Loading