Skip to content
This repository has been archived by the owner on Sep 12, 2023. It is now read-only.

Create expectation package #74

Merged
merged 3 commits into from
Apr 30, 2020
Merged

Conversation

Jeffwan
Copy link
Member

@Jeffwan Jeffwan commented Apr 16, 2020

Resolve #48. Besides #73, this is the last PR to remove direct Kubernetes dependency. I think current strategy is folk PodControlInterface and Expectations from main Kubernetes pkg and maintain in common repo. This also helps to make sure our code is reliable without worrying about changes K8s version upgrade brings.

For long term, I will try to brings these changes to kubernetes/client-go and we can use client-go directly. Track progress here. kubernetes/client-go#332

The purpose of this PR is to get ride of direct Kubernetes dependency. Expectation is being used in JobController to tell the number of pods/services they expect.

In the future, Instead of import k8s.io/kubernetes/pkg/controller, User need to import github.com/kubeflow/common/pkg/controller.v1/expectation and use expectation.NewControllerExpectations instead.

Signed-off-by: Jiaxin Shan [email protected]

/cc @gaocegege @terrytangyuan

@kubeflow-bot
Copy link

This change is Reviewable

@Jeffwan
Copy link
Member Author

Jeffwan commented Apr 16, 2020

pkg/controller.v1/expectation/expectation_test.go:87:19: Error return value of `e.SetExpectations` is not checked (errcheck)
638	e.SetExpectations(rcKey, adds, dels)
639	                 ^
640pkg/controller.v1/expectation/expectation_test.go:123:19: Error return value of `e.SetExpectations` is not checked (errcheck)
641	e.SetExpectations(rcKey, 1, 2)
642	                 ^
643The command "golangci-lint run ./..." exited with 1.

This is too restrict.. it's pretty common to ignore output check. Disable errcheck for this.

@Jeffwan
Copy link
Member Author

Jeffwan commented Apr 16, 2020

/hold

Please help on review first. I will run some real test against this version manually.

The purpose of this PR is to get ride of direct Kubernetes dependency. Expectation is being used in JobController to tell the number of pods/services they expect. This is the only library we reference in common code base. It makes sense to copy to our code base.

In the future, Instead of “import k8s.io/kubernetes/pkg/controller”,  User need to “import github.com/kubeflow/common/pkg/controller.v1/expectation" and use `expectation.NewControllerExpectations` instead.

Signed-off-by: Jiaxin Shan <[email protected]>
@Jeffwan
Copy link
Member Author

Jeffwan commented Apr 17, 2020

@gaocegege This one bring expectation back to repo. We remove all the direct dependency of Kubernetes now.

@terrytangyuan
Copy link
Member

Is this still on hold?

@Jeffwan
Copy link
Member Author

Jeffwan commented Apr 29, 2020

/hold cancel

This can be merged. @terrytangyuan

Copy link
Member

@terrytangyuan terrytangyuan left a comment

Choose a reason for hiding this comment

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

/lgtm
/approve

@k8s-ci-robot
Copy link

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: terrytangyuan

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

@k8s-ci-robot k8s-ci-robot merged commit 521f3dd into kubeflow:master Apr 30, 2020
georgkaleido pushed a commit to georgkaleido/common that referenced this pull request Jun 9, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Delete direct dependency of kubernetes
4 participants