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

BUILD-87: secret configmap volume mounts in builds #245

Merged
merged 2 commits into from Jun 23, 2021
Merged

BUILD-87: secret configmap volume mounts in builds #245

merged 2 commits into from Jun 23, 2021

Conversation

coreydaley
Copy link
Member

@coreydaley coreydaley commented May 11, 2021

@coreydaley
Copy link
Member Author

/assign @adambkaplan @gabemontero

@coreydaley
Copy link
Member Author

/retest

pkg/build/builder/daemonless.go Outdated Show resolved Hide resolved
pkg/build/builder/daemonless.go Outdated Show resolved Hide resolved
pkg/build/builder/daemonless.go Outdated Show resolved Hide resolved
pkg/build/builder/daemonless.go Outdated Show resolved Hide resolved
pkg/build/builder/daemonless.go Outdated Show resolved Hide resolved
pkg/build/builder/daemonless.go Outdated Show resolved Hide resolved
pkg/build/builder/daemonless.go Outdated Show resolved Hide resolved
@gabemontero
Copy link
Contributor

gabemontero commented May 14, 2021

FYI there is auto linking of PRs to Jira items if you

/retitle BUILD-87 secret configmap volume mounts in builds

@gabemontero
Copy link
Contributor

gabemontero commented May 14, 2021

/retitle BUILD-87: secret configmap volume mounts in builds

@gabemontero
Copy link
Contributor

Course I don't have permissions to do it @coreydaley :-)

@openshift-ci openshift-ci bot changed the title Jira build 87 secret configmap volume mounts in builds BUILD-87 secret configmap volume mounts in builds May 14, 2021
@openshift-ci openshift-ci bot changed the title BUILD-87 secret configmap volume mounts in builds BUILD-87: secret configmap volume mounts in builds May 14, 2021
@adambkaplan
Copy link
Contributor

/hold

Given the complexity of the feature and the time remaining before 4.8 reaches "final freeze" period, we are going to hold this until master opens for 4.9

@openshift-ci openshift-ci bot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label May 18, 2021
@coreydaley
Copy link
Member Author

/retest unit

@openshift-ci
Copy link
Contributor

openshift-ci bot commented May 20, 2021

@coreydaley: The /retest command does not accept any targets.
The following commands are available to trigger jobs:

  • /test e2e-aws
  • /test e2e-aws-builds
  • /test e2e-aws-image-ecosystem
  • /test e2e-aws-proxy
  • /test images
  • /test unit
  • /test verify

Use /test all to run the following jobs:

  • pull-ci-openshift-builder-master-e2e-aws
  • pull-ci-openshift-builder-master-e2e-aws-builds
  • pull-ci-openshift-builder-master-e2e-aws-image-ecosystem
  • pull-ci-openshift-builder-master-images
  • pull-ci-openshift-builder-master-unit
  • pull-ci-openshift-builder-master-verify

In response to this:

/retest unit

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@coreydaley
Copy link
Member Author

@adambkaplan ptal

@coreydaley
Copy link
Member Author

/retest

@xiuwang
Copy link

xiuwang commented Jun 15, 2021

Test on PR launched cluster launch #245,openshift/openshift-controller-manager#183,openshift/openshift-apiserver#208,openshift/oc#843 following test cases https://url.corp.redhat.com/buildvolumes , no critical issues found.

/label qe-approved

@openshift-ci openshift-ci bot added the qe-approved Signifies that QE has signed off on this PR label Jun 15, 2021
@coreydaley
Copy link
Member Author

/retest

1 similar comment
@coreydaley
Copy link
Member Author

/retest

@coreydaley
Copy link
Member Author

/hold cancel

@openshift-ci openshift-ci bot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jun 22, 2021
@coreydaley
Copy link
Member Author

/retest

@coreydaley
Copy link
Member Author

@adambkaplan @gabemontero ptal, tests are passing and it is ready for review.

Copy link
Contributor

@gabemontero gabemontero left a comment

Choose a reason for hiding this comment

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

A few comments, but no big blockers ... other than perhaps sharing some functions between builder and OCM in https://github.com/openshift/runtime-utils most likely these are just questions of mine you can answer @coreydaley and we can move on.


// appends a transient mount to the map and returns an error if a duplicate
// destination is detected
func (t TransientMounts) append(mount TransientMount) error {
Copy link
Contributor

Choose a reason for hiding this comment

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

might be the first time I've seen in practice a non-struct ptr used for this .... cool :-)

Copy link
Contributor

Choose a reason for hiding this comment

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

btw, the map ref is a ptr under the cover iirc correctly, hence you need nil checks when checking map variables, re: related to my comment above with the funcs off of the TransientMount struct

Copy link
Member Author

Choose a reason for hiding this comment

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

might be the first time I've seen in practice a non-struct ptr used for this .... cool :-)

I'm not going to say that this is common practice, or even the correct thing to do, but it worked :)

Copy link
Member Author

Choose a reason for hiding this comment

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

btw, the map ref is a ptr under the cover iirc correctly, hence you need nil checks when checking map variables, re: related to my comment above with the funcs off of the TransientMount struct

I believe that ok := t[mount.Destination]; equates to a nil check, as it returns false if the key does not exist. Beyond that we are really only doing a few operations here:

  • Checking for duplicate keys
  • Adding a key/value pair
  • Outputting the map as a slice of strings constructed from the transient mount that is the value
    If there is a specific place you think that I should be checking for nil let me know and I will add it.

Copy link
Contributor

Choose a reason for hiding this comment

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

yeah I'm good with this one ... go ahead and mark this one resolved ... but the other thread needs to be "unresolved"

pkg/build/builder/transient_mounts.go Outdated Show resolved Hide resolved
@@ -150,3 +154,15 @@ func ParseProxyURL(proxy string) (*url.URL, error) {

return proxyURL, err
}

// NameForBuildVolume returns a valid pod volume name for the provided build volume name.
Copy link
Contributor

Choose a reason for hiding this comment

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

Did I see an exchange in a library-go PR that landed with NOT including a method like this there?

I ask because I presume (though I have not visited your PR there super recently) there is a need for such a method in openshift-controller-manager, and we'd ideally share the impl (albeit this is a simple thing).

But it may not be a given, and if so, say as much @coreydaley and we can resolve this thread ... but I'll mention it here anyway just in case.

So just let me know and we can go from there.

Copy link
Contributor

Choose a reason for hiding this comment

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

we do have https://github.com/openshift/runtime-utils already for sharing build specific logic that could be a landing spot for such common methods that is specific to builds vs. library-go

Copy link
Member Author

Choose a reason for hiding this comment

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

It was decided by the powers that be that this code should be duplicated between the repos instead of shared via library-go, and as such, the library-go pull request has been closed.

As for runtime-utils, all I see there is a doc.go in the build directory?

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 decided by the powers that be that this code should be duplicated between the repos instead of shared via library-go, and as such, the library-go pull request has been closed.

ok so my recollection was correct in this case

As for runtime-utils, all I see there is a doc.go in the build directory?

no there is also a pkg directory, with currently a "registries" subdir

technically speaking, per the readme, this repo was a common ground for https://github.com/containers related shared libs that build code would leverage, but there is no reason IMO would could not expand that a bit

@adambkaplan and @bparees are in the OWNER file

also note, that repo arose when similar utility functions were rejected by library-go

pkg/build/builder/util.go Show resolved Hide resolved
Copy link
Contributor

@adambkaplan adambkaplan left a comment

Choose a reason for hiding this comment

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

/approve

@rolfedh @RickJWagner ptal - we need "docs-approved" and "px-approved" labels before we merge.

@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jun 23, 2021
Copy link
Contributor

@gabemontero gabemontero left a comment

Choose a reason for hiding this comment

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

ok, employing the same

/lgtm

with

/hold

while we wait on @adambkaplan to chime in on expanding https://github.com/openshift/runtime-utils to capture these common build specific constants and funcs that are denied inclusion into openshift/library-go

if we don't use it, unhold @coreydaley

@openshift-ci openshift-ci bot 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 23, 2021
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Jun 23, 2021

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: adambkaplan, coreydaley, gabemontero

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@adambkaplan
Copy link
Contributor

Keeping the hold for docs/px approvals.

I don't think we should expand the scope of runtime-utils to add this copied code, since it pollutes that repo's purpose. I am disappointed that our PR to library-go was rejected, since other code in that repository doesn't meet their criteria.

@coreydaley
Copy link
Member Author

/hold cancel

@openshift-ci openshift-ci bot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jun 23, 2021
@openshift-merge-robot openshift-merge-robot merged commit 4ec427e into openshift:master Jun 23, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged. qe-approved Signifies that QE has signed off on this PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants