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

apps: replace legacy client with generated in pkg/deploy/cmd #16149

Merged

Conversation

mfojtik
Copy link
Contributor

@mfojtik mfojtik commented Sep 5, 2017

Ignore first 3 commits, they are part of #16100

@deads2k last bits in apps group

@openshift-ci-robot openshift-ci-robot added the size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. label Sep 5, 2017
@openshift-merge-robot openshift-merge-robot added approved Indicates a PR has been approved by an approver from all required OWNERS files. needs-api-review labels Sep 5, 2017
type updateConfigFunc func(d *deployapi.DeploymentConfig)

// updateConfigWithRetries will try to update a deployment config and ignore any update conflicts.
func updateConfigWithRetries(dn appsinternal.DeploymentConfigsGetter, namespace, name string, applyUpdate updateConfigFunc) (*deployapi.DeploymentConfig, error) {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

this should probably exists in some helper/util package

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@tnozicka do you know if we have this helperized already? i'm pretty sure we doing this in couple places.

Copy link
Contributor

Choose a reason for hiding this comment

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

haven't seen such helper yet

}

// DeploymentConfigHistoryViewer is an implementation of the kubectl HistoryViewer interface
// for deployment configs.
type DeploymentConfigHistoryViewer struct {
rn kcoreclient.ReplicationControllersGetter
dn client.DeploymentConfigsNamespacer
Copy link
Contributor

Choose a reason for hiding this comment

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

this was just dead? weird.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yeah... maybe a leftover from some refact.

kc kclientset.Interface
pollInterval, timeout time.Duration
}

type updateConfigFunc func(d *deployapi.DeploymentConfig)
Copy link
Contributor

Choose a reason for hiding this comment

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

Not a fan. Why do we still have this?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

was just copy from the old client, seems like it is only used in one place, so right, we don't need this.

type updateConfigFunc func(d *deployapi.DeploymentConfig)

// updateConfigWithRetries will try to update a deployment config and ignore any update conflicts.
func updateConfigWithRetries(dn appsinternal.DeploymentConfigsGetter, namespace, name string, applyUpdate updateConfigFunc) (*deployapi.DeploymentConfig, error) {
Copy link
Contributor

Choose a reason for hiding this comment

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

This just shouldn't exist. If you want patch behavior, write a patch.

If this was pre-existing, open an issue.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

lets fix that, low hanging fruit and I will forget about it: #16166

@deads2k
Copy link
Contributor

deads2k commented Sep 5, 2017

/lgtm

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Sep 5, 2017
@openshift-merge-robot openshift-merge-robot removed the lgtm Indicates that a PR is ready to be merged. label Sep 5, 2017
@mfojtik
Copy link
Contributor Author

mfojtik commented Sep 6, 2017

/retest

@openshift-ci-robot openshift-ci-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. labels Sep 6, 2017
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.

lgtm

@@ -221,11 +222,15 @@ func (f *ring1Factory) LogsForObject(object, options runtime.Object, timeout tim

func (f *ring1Factory) Scaler(mapping *meta.RESTMapping) (kubectl.Scaler, error) {
if deployapi.IsKindOrLegacy("DeploymentConfig", mapping.GroupVersionKind.GroupKind()) {
oc, kc, err := f.clientAccessFactory.Clients()
_, kc, err := f.clientAccessFactory.Clients()
Copy link
Member

Choose a reason for hiding this comment

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

I don't like this. Are we planning to change Clients() to return openshift clientsets in the end? I do hope. Although probably it'll happen only when we actually remove pkg/client

Copy link
Contributor

Choose a reason for hiding this comment

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

I don't like this. Are we planning to change Clients() to return openshift clientsets in the end? I do hope. Although probably it'll happen only when we actually remove pkg/client

I think we will remove Clients altogether and create separate helpers for each individual type of client.

@soltysh
Copy link
Member

soltysh commented Sep 6, 2017

There are no actual api changes here, just comments for the generation. Applying the api-approved label.
/lgtm

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Sep 6, 2017
@soltysh
Copy link
Member

soltysh commented Sep 6, 2017

/retest

@openshift-merge-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: deads2k, mfojtik, soltysh

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

Needs approval from an approver in each of these OWNERS Files:

You can indicate your approval by writing /approve in a comment
You can cancel your approval by writing /approve cancel in a comment

@mfojtik
Copy link
Contributor Author

mfojtik commented Sep 6, 2017

/unneeds-api-review

@mfojtik
Copy link
Contributor Author

mfojtik commented Sep 6, 2017

/joke

@openshift-ci-robot
Copy link

@mfojtik: I don't trust stairs. They're always up to something.

In response to this:

/joke

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.

@openshift-merge-robot
Copy link
Contributor

Automatic merge from submit-queue

@openshift-merge-robot openshift-merge-robot merged commit bb340c5 into openshift:master Sep 6, 2017
openshift-merge-robot added a commit that referenced this pull request Sep 12, 2017
Automatic merge from submit-queue

apps: use patch when pausing dc on delete

Ignore the first 2 commits, they are part of #16149

Don't try to emulate PATCH behavior with retrying updates on conflicts (of course patch can also conflict, but chances are low). Also we use PATCH for pausing in `oc rollout pause` already, so this just unify this behavior.

Ref: #16149 (comment)
@mfojtik mfojtik deleted the deploy-clientset-cmd branch September 5, 2018 21:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api-approved 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. needs-api-review 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

7 participants