-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
move pkg/build to external client and types #20659
move pkg/build to external client and types #20659
Conversation
b7f1d9e
to
81ccd3e
Compare
this isn't going into 3.11 is it? @adambkaplan @coreydaley @nalind fyi, i don't think this will conflict w/ anything you're doing since that code should be using the external api already, if it's doing anything. |
@bparees I don't see a reason why this should not land in 3.11 (this is not a feature, just technical debt) |
For CLI parts: /cc @soltysh |
@mfojtik: GitHub didn't allow me to request PR reviews from the following users: or, for, CLI, parts. Note that only openshift members and repo collaborators can review this PR, and authors cannot review their own PRs. In response to this:
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. |
FYI: I will split this big commit into interesting and boring changes tomorrow (and this will be ready for review) |
well we are trying to minimize the risk of 3.11 slipping, so if there's any chance this can regress something, that is a reason not to do it in 3.11. |
why are we merging any significant changesets to the 3.11 codestream? I agree with ben here, this seems like a bad idea. Especially given that we are actively trying to get branches set up ASAP for 3.11 maintenance |
i followed up off list, but i think this pr is low risk and has future benefits. |
9726f21
to
96c5791
Compare
@@ -10,6 +10,7 @@ import ( | |||
"github.com/docker/distribution/registry/api/errcode" | |||
"github.com/golang/glog" | |||
|
|||
corev1 "k8s.io/api/core/v1" |
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.
This might conflict with @soltysh 's current PR :)
from := buildapihelpers.GetInputReference(strategy) | ||
func (p *pruner) addBuildStrategyImageReferencesToGraph(referrer *corev1.ObjectReference, strategy buildapi.BuildStrategy, predecessor gonum.Node) []error { | ||
externalStrategy := buildv1.BuildStrategy{} | ||
if err := legacyscheme.Scheme.Convert(&strategy, &externalStrategy, nil); err != nil { |
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.
Could we use pkg/build/apis/build/v1#Convert_build_BuildStrategy_To_v1_BuildStrategy
instead here?
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.
both legacyscheme and this are ugly, I found legacyscheme a little less ugly as it allow us to track the usages
@@ -217,7 +217,7 @@ func (o *CancelBuildOptions) RunCancelBuild() error { | |||
return err | |||
} | |||
|
|||
if stateMatch && !buildutil.IsTerminalPhase(internalBuildStatus.Phase) { | |||
if stateMatch && !buildapi.IsInternalTerminalPhase(internalBuildStatus.Phase) { |
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.
nit: s/IsInternalTerminalPhase/IsTerminalPhaseInternal
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.
that sounds like the intent of that check is to determine if the phase is "internal" ;-)
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.
"is internal terminal phase" sounds like that too. So let's go w/ @juanvallejo's suggestion so it's at least consistent w/ the other helpers, unless there's a third alternative.
pkg/oc/cli/set/env.go
Outdated
@@ -371,21 +371,32 @@ func (o *EnvOptions) RunEnv() error { | |||
continue | |||
} | |||
|
|||
// TODO: For Maciej: the ConvertInteralPodSpecToExternal should not be needed? |
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 am removing the need for this in https://github.com/openshift/origin/pull/20645/files#diff-54f6ccf572703b420951c9249df04b84L522
|
||
triggerExternal := &buildv1.BuildTriggerPolicy{} | ||
|
||
if err := legacyscheme.Scheme.Convert(&trigger, triggerExternal, nil); err != nil { |
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.
Convert_build_BuildTriggerPolicy_To_v1_BuildTriggerPolicy?
@@ -256,7 +258,7 @@ func printTemplateList(list *templateapi.TemplateList, w io.Writer, opts kprinte | |||
return nil | |||
} | |||
|
|||
func printBuild(build *buildapi.Build, w io.Writer, opts kprinters.PrintOptions) error { | |||
func printBuild(build *buildv1.Build, w io.Writer, opts kprinters.PrintOptions) error { |
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.
hm, does it make sense to have external handlers in the internalversion
package? Might make more sense to duplicate externals into a package of their own within oc
tree?
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.
agree, I don't like mixing these here as well, but I don't want to bloat this PR with that change. Will you be ok with follow up to fix this?
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.
Yep, followup PR is fine
left a few comments for cli pieces. A portion of the changes will overlap with Maciej's graph PR |
96c5791
to
ee165b5
Compare
560d071
to
f6c1d1c
Compare
@deads2k @bparees @soltysh this should get green tests and should merge immediately after tagged. There are couple follow ups here that we can distribute perhaps:
|
/retest |
3 similar comments
/retest |
/retest |
/retest |
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.
/lgtm
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: mfojtik, soltysh 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 |
Moves
pkg/build
to external clients and external types.Follow ups:
/cc @bparees
/cc @deads2k