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

switch logs, idle commands to externals #20343

Conversation

juanvallejo
Copy link
Contributor

@juanvallejo juanvallejo commented Jul 17, 2018

cc @deads2k

Depends on #20362

Switches more commands to deal with external versions of objects
Picks kubernetes/kubernetes#66352

@openshift-ci-robot openshift-ci-robot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jul 17, 2018
@openshift-ci-robot openshift-ci-robot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Jul 17, 2018
@juanvallejo juanvallejo force-pushed the jvallejo/switch-more-cmds-to-externals branch 2 times, most recently from 60f9c87 to 2d5e0e4 Compare July 17, 2018 20:50
appsapi.Resource("deploymentconfigs"):
case appsapiv1.Resource("deploymentconfig"),
appsapiv1.Resource("deploymentconfigs"):
// TODO: switch to using appsapiv1.DeploymentLogOptions once originpolymorphichelpers.LogsForObjectFn supports appsv1
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@deads2k fyi. Using the external api here to create the DeploymentLogOptions object would also involve changes to the logsforobject Origin polymorphic helper: https://github.com/openshift/origin/blob/master/pkg/oc/originpolymorphichelpers/logsforobject.go#L33

Copy link
Contributor

Choose a reason for hiding this comment

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

@deads2k fyi. Using the external api here to create the DeploymentLogOptions object would also involve changes to the logsforobject Origin polymorphic helper:

update that in this pull..

@juanvallejo
Copy link
Contributor Author

/test extended_clusterup

@juanvallejo juanvallejo force-pushed the jvallejo/switch-more-cmds-to-externals branch from 2d5e0e4 to 0733f44 Compare July 17, 2018 22:08
@juanvallejo
Copy link
Contributor Author

/test gcp

@juanvallejo juanvallejo force-pushed the jvallejo/switch-more-cmds-to-externals branch 3 times, most recently from f2dc629 to 5c4ee6b Compare July 18, 2018 20:13
if err != nil {
return nil, err
}
return appsmanualclient.NewRolloutLogClient(appsClient.Apps().RESTClient(), t.Namespace).Logs(t.Name, *dopts), nil
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@deads2k not sure how to handle this - do we have a rollout client (or buildlogClient for the case below) whose Logs method receives versioned options?

Copy link
Contributor

Choose a reason for hiding this comment

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

i made an external version for this here #20362

@juanvallejo juanvallejo force-pushed the jvallejo/switch-more-cmds-to-externals branch 2 times, most recently from 8240000 to 16898e0 Compare July 19, 2018 14:18
@openshift-bot openshift-bot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jul 19, 2018
@juanvallejo juanvallejo force-pushed the jvallejo/switch-more-cmds-to-externals branch from 16898e0 to fe66212 Compare July 19, 2018 14:33
@openshift-bot openshift-bot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jul 19, 2018
@juanvallejo juanvallejo force-pushed the jvallejo/switch-more-cmds-to-externals branch from fe66212 to ee05326 Compare July 19, 2018 22:08
@openshift-ci-robot openshift-ci-robot added size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Jul 19, 2018
@openshift-bot openshift-bot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jul 19, 2018
@juanvallejo juanvallejo force-pushed the jvallejo/switch-more-cmds-to-externals branch from ee05326 to 7eb89e6 Compare July 20, 2018 15:27
@openshift-bot openshift-bot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jul 20, 2018
@juanvallejo
Copy link
Contributor Author

@DirectXMan12 could you give a quick look to the unidling_controller changes? Should be just the second commit

@DirectXMan12
Copy link
Contributor

unidling changes look fine.

@openshift-bot openshift-bot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jul 20, 2018
@juanvallejo juanvallejo force-pushed the jvallejo/switch-more-cmds-to-externals branch from 7eb89e6 to a9a649a Compare July 23, 2018 18:30
@juanvallejo juanvallejo changed the title [WIP] switch logs to externals switch logs to externals Jul 23, 2018
@openshift-bot openshift-bot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jul 25, 2018
Copy link
Member

@soltysh soltysh left a comment

Choose a reason for hiding this comment

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

We need to be strict about the import aliases so that they are self-explanatory. Fix them and rebase, please.

@@ -12,9 +12,10 @@ import (
kcmd "k8s.io/kubernetes/pkg/kubectl/cmd"
"k8s.io/kubernetes/pkg/kubectl/genericclioptions"

buildapi "github.com/openshift/api/build/v1"
Copy link
Member

Choose a reason for hiding this comment

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

buildv1 always

appsapi "github.com/openshift/origin/pkg/apps/apis/apps"
buildapi "github.com/openshift/origin/pkg/build/apis/build"
buildfake "github.com/openshift/origin/pkg/build/generated/internalclientset/fake"
internalbuildapi "github.com/openshift/origin/pkg/build/apis/build"
Copy link
Member

Choose a reason for hiding this comment

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

buildapi always

Object: tc.o,
Namespace: "foo",
},
Client: fakebc.Build(),
}
if err := o.RunLog(); err != nil {
if err := o.runLogPipeline(); err != nil {
Copy link
Member

Choose a reason for hiding this comment

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

Why this change?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The test TestRunLogForPipelineStrategy was only testing that portion of the code. Splitting it out made it easier to test

"github.com/openshift/api/apps"
"github.com/openshift/api/build"
appsapi "github.com/openshift/origin/pkg/apps/apis/apps"
appsapiv1 "github.com/openshift/api/apps/v1"
Copy link
Member

Choose a reason for hiding this comment

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

appsv1

appsapi "github.com/openshift/origin/pkg/apps/apis/apps"
appsapiv1 "github.com/openshift/api/apps/v1"
buildapiv1 "github.com/openshift/api/build/v1"
buildclientv1 "github.com/openshift/client-go/build/clientset/versioned/typed/build/v1"
Copy link
Member

Choose a reason for hiding this comment

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

buildv1client

@@ -8,6 +8,7 @@ import (
appsclient "github.com/openshift/origin/pkg/apps/generated/internalclientset/typed/apps/internalversion"
"github.com/openshift/origin/pkg/cmd/server/bootstrappolicy"
unidlingcontroller "github.com/openshift/origin/pkg/unidling/controller"
kubernetes "k8s.io/client-go/kubernetes/typed/core/v1"
Copy link
Member

Choose a reason for hiding this comment

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

corev1

extensions "k8s.io/api/extensions/v1beta1"
"k8s.io/apimachinery/pkg/api/meta"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/runtime/schema"
"k8s.io/apimachinery/pkg/types"
"k8s.io/apimachinery/pkg/util/strategicpatch"
"k8s.io/client-go/kubernetes"
Copy link
Member

Choose a reason for hiding this comment

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

clientset

@@ -20,6 +20,7 @@ import (
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/types"
utilruntime "k8s.io/apimachinery/pkg/util/runtime"
kubernetes "k8s.io/client-go/kubernetes/typed/core/v1"
Copy link
Member

Choose a reason for hiding this comment

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

corev1client

kextapi "k8s.io/api/extensions/v1beta1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/types"
"k8s.io/apimachinery/pkg/util/strategicpatch"
kubernetes "k8s.io/client-go/kubernetes/typed/core/v1"
Copy link
Member

Choose a reason for hiding this comment

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

corev1client

@soltysh soltysh self-assigned this Jul 26, 2018
return nil, err
}
return appsmanualclientv1.NewRolloutLogClient(appsClient.RESTClient(), t.Namespace).Logs(t.Name, *dopts), nil
case *buildapiv1.Build:
Copy link
Member

Choose a reason for hiding this comment

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

You're missing buildv1.BuildConfig as well.

if err != nil {
return nil, err
}
return buildmanualclientv1.NewBuildLogClient(buildClient.RESTClient(), t.Namespace).Logs(t.Name, *bopts), nil
case *buildapi.Build:
Copy link
Member

Choose a reason for hiding this comment

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

Additionally, since we've just migrated logs to external, do we need internals here?

Copy link
Member

Choose a reason for hiding this comment

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

Actually, I take that back, I see we're using this in quite a few places so we need to provide a smooth path. Sighs....

@juanvallejo juanvallejo force-pushed the jvallejo/switch-more-cmds-to-externals branch from 53905d1 to c44f49e Compare July 26, 2018 13:47
@openshift-bot openshift-bot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jul 26, 2018
@openshift-ci-robot openshift-ci-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. labels Jul 26, 2018
@juanvallejo juanvallejo force-pushed the jvallejo/switch-more-cmds-to-externals branch 2 times, most recently from 6ef5eba to 2c27df7 Compare July 26, 2018 17:48
Copy link
Member

@soltysh soltysh 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 nits, fix them a feel free to lgtm
/approve

"github.com/openshift/api/build"
appsapi "github.com/openshift/origin/pkg/apps/apis/apps"
appsv1 "github.com/openshift/api/apps/v1"
buildapiv1 "github.com/openshift/api/build/v1"
Copy link
Member

Choose a reason for hiding this comment

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

buildv1

@soltysh soltysh added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jul 26, 2018
@openshift-ci-robot
Copy link

[APPROVALNOTIFIER] This PR is APPROVED

Approval requirements bypassed by manually added approval.

This pull-request has been approved by: juanvallejo, 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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@juanvallejo juanvallejo force-pushed the jvallejo/switch-more-cmds-to-externals branch from 399a79d to ee1036b Compare July 26, 2018 20:38
@juanvallejo
Copy link
Contributor Author

/test extended_clusterup

@juanvallejo juanvallejo added the lgtm Indicates that a PR is ready to be merged. label Jul 26, 2018
@juanvallejo
Copy link
Contributor Author

/test extended_builds

@juanvallejo juanvallejo force-pushed the jvallejo/switch-more-cmds-to-externals branch from ee1036b to 62c5374 Compare July 26, 2018 22:17
@openshift-ci-robot openshift-ci-robot removed the lgtm Indicates that a PR is ready to be merged. label Jul 26, 2018
@openshift-ci-robot
Copy link

New changes are detected. LGTM label has been removed.

@juanvallejo juanvallejo added the lgtm Indicates that a PR is ready to be merged. label Jul 26, 2018
@openshift-merge-robot openshift-merge-robot merged commit 3940adf into openshift:master Jul 27, 2018
@juanvallejo juanvallejo deleted the jvallejo/switch-more-cmds-to-externals branch July 27, 2018 20:27
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. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

8 participants