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
Adding ConfigMap build sources to api #43
Adding ConfigMap build sources to api #43
Conversation
ping @openshift/api-review |
build/v1/types.go
Outdated
@@ -462,15 +466,32 @@ type ImageSourcePath struct { | |||
DestinationDir string `json:"destinationDir" protobuf:"bytes,2,opt,name=destinationDir"` | |||
} | |||
|
|||
// LocalObjectBuildSource is a build source that is copied into a build from a Kubernetes | |||
// key-value store, such as a `Secret` or `ConfigMap`. | |||
type LocalObjectBuildSource interface { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we typically don't declare interfaces or methods on API types... if you want to adapt them like this, do so in application code, not in the API structs themselves
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wanted to keep this interface within Origin proper, but most of the builder code acts upon API structs and not converted internal representations - see https://github.com/openshift/origin/blob/master/pkg/build/builder/docker.go as an example. Exposing this interface at the API level allows most the code for mounting Secrets
and ConfigMaps
to be unified, but may not be the best long-term path.
build/v1/types.go
Outdated
// SecretBuildSource describes a secret and its destination directory that will be | ||
// used only at the build time. The content of the secret referenced here will | ||
// be copied into the destination directory instead of mounting. | ||
type SecretBuildSource struct { | ||
// secret is a reference to an existing secret that you want to use in your | ||
// Secret is a reference to an existing secret that you want to use in your |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
revert this, comments follow the serialized names
build/v1/types.go
Outdated
// build. | ||
Secret corev1.LocalObjectReference `json:"secret" protobuf:"bytes,1,opt,name=secret"` | ||
|
||
// destinationDir is the directory where the files from the secret should be | ||
// DestinationDir is the directory where the files from the secret should be |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
revert
build/v1/types.go
Outdated
// used only at the build time. The content of the configmap referenced here will | ||
// be copied into the destination directory instead of mounting. | ||
type ConfigMapBuildSource struct { | ||
// ConfigMap is a reference to an existing configmap that you want to use in your |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lowercase comments to match serialized names (used to generate API docs)
build/v1/types.go
Outdated
@@ -618,6 +700,9 @@ type CustomBuildStrategy struct { | |||
|
|||
// buildAPIVersion is the requested API version for the Build object serialized and passed to the custom builder | |||
BuildAPIVersion string `json:"buildAPIVersion,omitempty" protobuf:"bytes,7,opt,name=buildAPIVersion"` | |||
|
|||
// Configs is a list of additional configMaps that will be included in the custom build pod | |||
Configs []ConfigSpec `json:"configs,omitempty" protobuf:"bytes,8,rep,name=configs"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ConfigMaps
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I had that debate myself - I'm OK with that convention.
build/v1/types.go
Outdated
|
||
// configs represents a list of configmaps and their destinations that will | ||
// be used for the build. | ||
Configs []ConfigMapBuildSource `json:"configs,omitempty" protobuf:"bytes,9,rep,name=configs"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ConfigMaps
?
21d0274
to
861ca95
Compare
@liggitt feature is proposed for 3.11. API changes are stable, but shouldn't be merged until 3.10 is cut. |
/hold |
861ca95
to
65c6054
Compare
* New type `ConfigMapSource` in common `BuildSource` * Regenerated protobuf, swagger, and deepcopy. Trello card: https://trello.com/c/RMKJxJUm/1020-5-allow-using-a-configmap-as-an-input-to-a-build-builds
65c6054
to
fe60953
Compare
/hold cancel |
/lgtm /hold |
/hold cancel |
Drop status subresource from generated CRD manifests
ConfigMapBuildSource
CommonSpec
Trello card: https://trello.com/c/RMKJxJUm/1020-5-allow-using-a-configmap-as-an-input-to-a-build-builds