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

Adding ConfigMap build sources to api #43

Merged
merged 1 commit into from Jun 19, 2018

Conversation

adambkaplan
Copy link
Contributor

@adambkaplan adambkaplan commented Apr 25, 2018

  • New type ConfigMapBuildSource
  • Added ConfigMap collections to CommonSpec
  • 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

@openshift-ci-robot openshift-ci-robot added the size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. label Apr 25, 2018
@adambkaplan
Copy link
Contributor Author

ping @openshift/api-review

@@ -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 {
Copy link
Contributor

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

Copy link
Contributor Author

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.

// 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
Copy link
Contributor

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.
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
Copy link
Contributor

Choose a reason for hiding this comment

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

revert

// 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
Copy link
Contributor

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)

@@ -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"`
Copy link
Contributor

Choose a reason for hiding this comment

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

ConfigMaps?

Copy link
Contributor Author

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.


// 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"`
Copy link
Contributor

Choose a reason for hiding this comment

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

ConfigMaps?

@adambkaplan
Copy link
Contributor Author

@liggitt feature is proposed for 3.11. API changes are stable, but shouldn't be merged until 3.10 is cut.

@adambkaplan
Copy link
Contributor Author

@adambkaplan
Copy link
Contributor Author

/hold

@openshift-ci-robot openshift-ci-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label May 14, 2018
@adambkaplan adambkaplan force-pushed the feature/build-source-configs branch from 861ca95 to 65c6054 Compare May 14, 2018 17:00
@openshift-ci-robot openshift-ci-robot added size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. and removed size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. labels May 14, 2018
* 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
@adambkaplan adambkaplan force-pushed the feature/build-source-configs branch from 65c6054 to fe60953 Compare May 14, 2018 17:02
@adambkaplan
Copy link
Contributor Author

/hold cancel

@openshift-ci-robot openshift-ci-robot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label May 15, 2018
@liggitt liggitt added this to the v3.11 milestone Jun 3, 2018
@liggitt
Copy link
Contributor

liggitt commented Jun 3, 2018

/lgtm

/hold
for 3.10 branch cuts

@openshift-ci-robot openshift-ci-robot added do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. lgtm Indicates that a PR is ready to be merged. labels Jun 3, 2018
@bparees
Copy link
Contributor

bparees commented Jun 19, 2018

/hold cancel

@openshift-ci-robot openshift-ci-robot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jun 19, 2018
@bparees bparees merged commit 0ce1df2 into openshift:master Jun 19, 2018
openshift-cherrypick-robot pushed a commit to openshift-cherrypick-robot/api that referenced this pull request Feb 1, 2021
Drop status subresource from generated CRD manifests
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lgtm Indicates that a PR is ready to be merged. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants