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

Upgrade client-go version to 10.0.0 #3588

Merged
merged 1 commit into from
Mar 29, 2019

Conversation

qiell
Copy link
Contributor

@qiell qiell commented Mar 29, 2019

This PR will

Upgrade:

  • k8s.io/client-go v10.0.0
  • k8s.io/api version to kubernetes-1.13.0
  • k8s.io/apimachinery version to kubernetes-1.13.0
  • github.com/imdario/mergo to v0.3.5

Add:

  • k8s.io/klog v0.1.0
  • sigs.k8s.io/yaml v1.1.0

Changes:

  • modified: probe/kubernetes/client.go
  • modified: probe/kubernetes/controls.go

This is the first code drop towards kubectl describe change. (#1143)

To ScaleUp and ScaleDown a Deployment, Scale method was used,
which is removed in client-go-10.0.0. PR (kubernetes/kubernetes#70437)
Instead of Scale use UpdateScale method of Deployment to
ScaleUp and ScaleDown the Deployment.

Signed-off-by: Akash Srivastava akashsrivastava4927@gmail.com

This will
Upgrade:
        - k8s.io/client-go v10.0.0
	- k8s.io/api version to kubernetes-1.13.0
	- k8s.io/apimachinery version to kubernetes-1.13.0
        - github.com/imdario/mergo to v0.3.5

Add:
        - k8s.io/klog v0.1.0
        - sigs.k8s.io/yaml v1.1.0

Changes:
        - modified:   probe/kubernetes/client.go
        - modified:   probe/kubernetes/controls.go

To ScaleUp and ScaleDown a Deployment, Scale method was used,
which is removed in client-go-10.0.0
Instead of Scale use UpdateScale method of Deployment to
ScaleUp and ScaleDown the Deployment.

Signed-off-by: Akash Srivastava <akashsrivastava4927@gmail.com>
@qiell
Copy link
Contributor Author

qiell commented Mar 29, 2019

Commands Used:-

gvt delete k8s.io/client-go
gvt delete k8s.io/api
gvt delete k8s.io/apimachinery
gvt delete github.com/imdario/mergo


gvt fetch --no-recurse -tag v10.0.0 k8s.io/client-go
gvt fetch --no-recurse -tag kubernetes-1.13.0 k8s.io/api
gvt fetch --no-recurse -tag kubernetes-1.13.0 k8s.io/apimachinery
gvt fetch --no-recurse -tag v0.1.0 k8s.io/klog
gvt fetch --no-recurse -tag v1.1.0 sigs.k8s.io/yaml
gvt fetch --no-recurse -tag v0.3.5 github.com/imdario/mergo

scale, err := scaler.Get(resource, id)
func (c *client) modifyScale(namespaceID, id string, f func(*apiextensionsv1beta1.Scale)) error {
scaler := c.client.ExtensionsV1beta1().Deployments(namespaceID)
scale, err := scaler.GetScale(id, metav1.GetOptions{})
Copy link
Contributor

Choose a reason for hiding this comment

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

Just to be clear, is scaler.GetScale a new thing that doesn't require passing resource around and that's why we can get rid of resource?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, that is correct.

Copy link
Collaborator

@bboreham bboreham left a comment

Choose a reason for hiding this comment

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

Thanks!

@bboreham bboreham merged commit 50cd878 into weaveworks:master Mar 29, 2019
@qiell qiell deleted the upgrade/client-go branch March 29, 2019 16:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants