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

Bump client-go to remove dependence on go-autorest dependency #9488

Merged
merged 3 commits into from
Jan 18, 2023

Conversation

Volatus
Copy link
Contributor

@Volatus Volatus commented Jan 6, 2023

What this PR does / why we need it:

Azure/go-autorest has been deprecated and will no longer be supported. We indirectly had it
as a dependency because of client-go. >= [email protected] have removed this dependency, so we can get rid of it as well.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • CVE Report (Scanner found CVE and adding report)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation only

Which issue/s this PR fixes

fixes #8702

How Has This Been Tested?

Checklist:

  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I've read the CONTRIBUTION guide
  • I have added unit and/or e2e tests to cover my changes.
  • All new and existing tests passed.
  • Added Release Notes.

Does my pull request need a release note?

Any user-visible or operator-visible change qualifies for a release note. This could be a:

  • CLI change
  • API change
  • UI change
  • configuration schema change
  • behavioral change
  • change in non-functional attributes such as efficiency or availability, availability of a new platform
  • a warning about a deprecation
  • fix of a previous Known Issue
  • fix of a vulnerability (CVE)

No release notes are required for changes to the following:

  • Tests
  • Build infrastructure
  • Fixes for unreleased bugs

For more tips on writing good release notes, check out the Release Notes Handbook

PLACE RELEASE NOTES HERE

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Jan 6, 2023
@k8s-ci-robot k8s-ci-robot added the needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. label Jan 6, 2023
@k8s-ci-robot
Copy link
Contributor

@Volatus: This issue is currently awaiting triage.

If Ingress contributors determines this is a relevant issue, they will accept it by applying the triage/accepted label and provide further guidance.

The triage/accepted label can be added by org members by writing /triage accepted in a comment.

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.

@k8s-ci-robot k8s-ci-robot added needs-kind Indicates a PR lacks a `kind/foo` label and requires one. needs-priority size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Jan 6, 2023
@Volatus
Copy link
Contributor Author

Volatus commented Jan 6, 2023

/priority important-longterm
/kind cleanup

@k8s-ci-robot k8s-ci-robot added priority/important-longterm Important over the long term, but may not be staffed and/or may need multiple releases to complete. kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. and removed needs-priority needs-kind Indicates a PR lacks a `kind/foo` label and requires one. labels Jan 6, 2023
@Volatus
Copy link
Contributor Author

Volatus commented Jan 6, 2023

/assign @strongjz

@rikatz
Copy link
Contributor

rikatz commented Jan 7, 2023

@Volatus you probably need to bump all k8s libs to 0.26 (I've seen a bunch still on v0.25 here)

After that, I guess all will pass (I'm worried with some deprecations tho)

@tao12345666333
Copy link
Member

Yes, all k8s libs should be upgraded

@k8s-ci-robot k8s-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jan 9, 2023
@k8s-ci-robot k8s-ci-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Jan 11, 2023
@k8s-ci-robot k8s-ci-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jan 11, 2023
@Volatus
Copy link
Contributor Author

Volatus commented Jan 11, 2023

@tao12345666333 should be ok now

@tao12345666333
Copy link
Member

/retest

@tao12345666333
Copy link
Member

Please check the CI errors.
There are some types that need to be adjusted

Due to changes in the Kubernetes API, we needed to switch to using
v1.IngressLoadBalancerIngress instead of apiv1.LoadBalancerIngress. The
struct is otherwise identical despite the name change.
@rikatz
Copy link
Contributor

rikatz commented Jan 16, 2023

uh did something changed on Kubernetes API??

FAIL: TestRunningAddressesWithPublishService (0.00s)
    --- FAIL: TestRunningAddressesWithPublishService/service_type_ClusterIP (0.00s)
    --- FAIL: TestRunningAddressesWithPublishService/service_type_NodePort (0.00s)
    --- FAIL: TestRunningAddressesWithPublishService/service_type_ExternalName (0.00s)
    --- FAIL: TestRunningAddressesWithPublishService/service_type_LoadBalancer (0.00s)
    --- FAIL: TestRunningAddressesWithPublishService/service_type_LoadBalancer_with_same_externalIP_and_ingress_IP (0.00s)
    --- PASS: TestRunningAddressesWithPublishService/invalid_service_type (0.00s)

@tao12345666333
Copy link
Member

tao12345666333 commented Jan 16, 2023

@rikatz yes! now there have 4 types.

`corev1.LoadBalancerIngress | networkingv1.IngressLoadBalancerIngress | networkingv1beta1.IngressLoadBalancerIngress | extensionsv1beta1.IngressLoadBalancerIngress`

ref: kubernetes/kubernetes#106242

@tao12345666333
Copy link
Member

you can just apply my patch to fix the status errors.

From c0d55637d7322a40a1f959289adf0e24cc861572 Mon Sep 17 00:00:00 2001
From: Jintao Zhang <[email protected]>
Date: Mon, 16 Jan 2023 21:02:00 +0800
Subject: [PATCH] fix ingress status test cases

Signed-off-by: Jintao Zhang <[email protected]>
---
 internal/ingress/status/status_test.go | 20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)

diff --git a/internal/ingress/status/status_test.go b/internal/ingress/status/status_test.go
index 9c6b3f6de..7f8ac68b8 100644
--- a/internal/ingress/status/status_test.go
+++ b/internal/ingress/status/status_test.go
@@ -385,7 +385,7 @@ func TestKeyfunc(t *testing.T) {
 func TestRunningAddressesWithPublishService(t *testing.T) {
 	testCases := map[string]struct {
 		fakeClient  *testclient.Clientset
-		expected    []apiv1.LoadBalancerIngress
+		expected    []networking.IngressLoadBalancerIngress
 		errExpected bool
 	}{
 		"service type ClusterIP": {
@@ -419,7 +419,7 @@ func TestRunningAddressesWithPublishService(t *testing.T) {
 				},
 				},
 			),
-			[]apiv1.LoadBalancerIngress{
+			[]networking.IngressLoadBalancerIngress{
 				{IP: "1.1.1.1"},
 			},
 			false,
@@ -440,7 +440,7 @@ func TestRunningAddressesWithPublishService(t *testing.T) {
 				},
 				},
 			),
-			[]apiv1.LoadBalancerIngress{
+			[]networking.IngressLoadBalancerIngress{
 				{IP: "1.1.1.1"},
 			},
 			false,
@@ -461,7 +461,7 @@ func TestRunningAddressesWithPublishService(t *testing.T) {
 				},
 				},
 			),
-			[]apiv1.LoadBalancerIngress{
+			[]networking.IngressLoadBalancerIngress{
 				{Hostname: "foo.bar"},
 			},
 			false,
@@ -478,8 +478,8 @@ func TestRunningAddressesWithPublishService(t *testing.T) {
 							Type: apiv1.ServiceTypeLoadBalancer,
 						},
 						Status: apiv1.ServiceStatus{
-							LoadBalancer: apiv1.LoadBalancerStatus{
-								Ingress: []apiv1.LoadBalancerIngress{
+							LoadBalancer: networking.IngressLoadBalancerStatus{
+								Ingress: []networking.IngressLoadBalancerIngress{
 									{
 										IP: "10.0.0.1",
 									},
@@ -498,7 +498,7 @@ func TestRunningAddressesWithPublishService(t *testing.T) {
 				},
 				},
 			),
-			[]apiv1.LoadBalancerIngress{
+			[]networking.LoadBalancerIngress{
 				{IP: "10.0.0.1"},
 				{Hostname: "foo"},
 				{
@@ -521,8 +521,8 @@ func TestRunningAddressesWithPublishService(t *testing.T) {
 							ExternalIPs: []string{"10.0.0.1"},
 						},
 						Status: apiv1.ServiceStatus{
-							LoadBalancer: apiv1.LoadBalancerStatus{
-								Ingress: []apiv1.LoadBalancerIngress{
+							LoadBalancer: networking.IngressLoadBalancerStatus{
+								Ingress: []networking.IngressLoadBalancerIngress{
 									{
 										IP: "10.0.0.1",
 									},
@@ -533,7 +533,7 @@ func TestRunningAddressesWithPublishService(t *testing.T) {
 				},
 				},
 			),
-			[]apiv1.LoadBalancerIngress{
+			[]networking.LoadBalancerIngress{
 				{IP: "10.0.0.1"},
 			},
 			false,
-- 
2.39.0

@tao12345666333
Copy link
Member

2023-01-16 21-08-13屏幕截图
my local test result.

@Volatus
Copy link
Contributor Author

Volatus commented Jan 16, 2023

/retest

@Volatus
Copy link
Contributor Author

Volatus commented Jan 17, 2023

uh did something changed on Kubernetes API??

FAIL: TestRunningAddressesWithPublishService (0.00s)
    --- FAIL: TestRunningAddressesWithPublishService/service_type_ClusterIP (0.00s)
    --- FAIL: TestRunningAddressesWithPublishService/service_type_NodePort (0.00s)
    --- FAIL: TestRunningAddressesWithPublishService/service_type_ExternalName (0.00s)
    --- FAIL: TestRunningAddressesWithPublishService/service_type_LoadBalancer (0.00s)
    --- FAIL: TestRunningAddressesWithPublishService/service_type_LoadBalancer_with_same_externalIP_and_ingress_IP (0.00s)
    --- PASS: TestRunningAddressesWithPublishService/invalid_service_type (0.00s)

Yes @rikatz and looks like there are technically "breaking changes" introduced by kubernetes/kubernetes#106242.

Signed-off-by: Jintao Zhang <[email protected]>
Signed-off-by: Ismayil Mirzali <[email protected]>
@strongjz
Copy link
Member

awesome work, thank you

/lgtm
/approve

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jan 18, 2023
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: strongjz, Volatus

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 added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jan 18, 2023
@k8s-ci-robot k8s-ci-robot merged commit fe2e713 into kubernetes:main Jan 18, 2023
strongjz pushed a commit to strongjz/ingress-nginx that referenced this pull request Feb 7, 2023
…rnetes#9488)

* deps: bump k8s dependencies to remove go-autorest

* fix: update use of apiv1.LoadBalancerIngress

Due to changes in the Kubernetes API, we needed to switch to using
v1.IngressLoadBalancerIngress instead of apiv1.LoadBalancerIngress. The
struct is otherwise identical despite the name change.

* fix ingress status test cases

Signed-off-by: Jintao Zhang <[email protected]>
Signed-off-by: Ismayil Mirzali <[email protected]>

Signed-off-by: Jintao Zhang <[email protected]>
Signed-off-by: Ismayil Mirzali <[email protected]>
Co-authored-by: Jintao Zhang <[email protected]>
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. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. lgtm "Looks good to me", indicates that a PR is ready to be merged. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. priority/important-longterm Important over the long term, but may not be staffed and/or may need multiple releases to complete. 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.

Azure/go-autorest deprecation
5 participants