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 and apimachinery to 0.16.15 #1794

Merged
merged 4 commits into from
Sep 9, 2020

Conversation

markmandel
Copy link
Member

What type of PR is this?

Uncomment only one /kind <> line, hit enter to put that in a new line, and remove leading whitespace from that line:

/kind breaking

/kind bug
/kind cleanup
/kind documentation
/kind feature
/kind hotfix

What this PR does / Why we need it:

Upgrading the supporting libraries to be inline with the updated Kubernetes version to 1.16.x.

Which issue(s) this PR fixes:

Work on #1649

Special notes for your reviewer:

Worth noting that cache.WaitForCacheSync has changed its internal implementation to now use err := wait.PollImmediateUntil(...), so there is no more implicit 100ms sleep before the sync. Therefore it didn't actually wait to populate from Watch or allow events to fire - it just made room for it to occur.

So had to now using assert/require.Eventually() to make sure that the system is in a state that matches what we expect before testing.

@agones-bot
Copy link
Collaborator

Build Failed 😱

Build Id: 68a4c348-6b8f-40f8-ad6a-eaadb9d85c1d

To get permission to view the Cloud Build view, join the agones-discuss Google Group.

@markmandel
Copy link
Member Author

sdk-conformance failure 😢

@agones-bot
Copy link
Collaborator

Build Succeeded 👏

Build Id: 058f6e17-de56-42a8-93b4-aa9b924dc536

The following development artifacts have been built, and will exist for the next 30 days:

A preview of the website (the last 30 builds are retained):

To install this version:

  • git fetch https://github.com/googleforgames/agones.git pull/1794/head:pr_1794 && git checkout pr_1794
  • helm install ./install/helm/agones --namespace agones-system --name agones --set agones.image.tag=1.9.0-66ce69b

k8s.io/utils v0.0.0-20200124190032-861946025e34 // indirect
)

replace google.golang.org/grpc v1.23.0 => google.golang.org/grpc v1.20.1 // apiserver updated grpc, but we aren't using that, so it's fine.
Copy link
Member

Choose a reason for hiding this comment

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

We should update at some point; want to file a bug to follow up on this?

Copy link
Member Author

Choose a reason for hiding this comment

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

Agreed - makes sense. We should take this as a motivator to keep grpc up to date 👍

@@ -1452,30 +1458,43 @@ func TestControllerGameServerPod(t *testing.T) {
}

t.Run("no pod exists", func(t *testing.T) {
c, gs, _, stop, cancel := setup()
c, gs, _, _, cancel := setup()
Copy link
Member

Choose a reason for hiding this comment

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

It looks like stop is never used from setup() now so it can just be removed as a return var.

Copy link
Member Author

@markmandel markmandel Sep 8, 2020

Choose a reason for hiding this comment

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

Just found where we do use this (and shows an example of what you mentioned below)
https://github.com/markmandel/agones/blob/66ce69bf64c1e58b0e38fd642556e282ee70d060/pkg/gameservers/controller_test.go#L1504-L1512

SYAC

		c, gs, fakeWatch, stop, cancel := setup()
		defer cancel()

		pod := &corev1.Pod{ObjectMeta: metav1.ObjectMeta{Name: gs.ObjectMeta.Name, Labels: map[string]string{agonesv1.GameServerPodLabel: gs.ObjectMeta.Name, "owned": "false"}}}
		fakeWatch.Add(pod.DeepCopy())

		// gate
		cache.WaitForCacheSync(stop, c.podSynced)

pkg/gameservers/portallocator_test.go Show resolved Hide resolved
@roberthbailey roberthbailey self-assigned this Sep 5, 2020
@markmandel markmandel mentioned this pull request Sep 6, 2020
require.NoError(t, err)
return len(list) == expected
}, 5*time.Second, time.Second)
// write a good message if something goes wrong
Copy link
Collaborator

@aLekSer aLekSer Sep 7, 2020

Choose a reason for hiding this comment

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

Not sure I can follow this comment. Could you please remove or explain more what it is for?

Copy link
Member Author

Choose a reason for hiding this comment

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

Updated comment, PTAL!

Copy link
Collaborator

Choose a reason for hiding this comment

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

Now it is much more verbose, I like it.

c.sync()
reader := metricexport.NewReader()

// wait until we have a some nodes and gameservers
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
// wait until we have a some nodes and gameservers
// wait until we have some nodes and gameservers

Worth noting that cache.WaitForCacheSync has changed its internal
implementation to now use `err := wait.PollImmediateUntil(...)`, so
there is no more implicit 100ms sleep before the sync. Therefore it
didn't _actually_ wait to populate from Watch or allow events to fire -
it just made room for it to occur.

So had to now using assert/require.Eventually() to make sure that the
system is in a state that matches what we expect before testing.

Work on googleforgames#1649
@agones-bot
Copy link
Collaborator

Build Failed 😱

Build Id: e2f2d946-e3fc-4a3b-8fb6-fd1b994a8ab7

To get permission to view the Cloud Build view, join the agones-discuss Google Group.

@markmandel
Copy link
Member Author

SDK conformance failure

@agones-bot
Copy link
Collaborator

Build Succeeded 👏

Build Id: 887117ce-35a1-4b89-9dad-e3659d414263

The following development artifacts have been built, and will exist for the next 30 days:

A preview of the website (the last 30 builds are retained):

To install this version:

  • git fetch https://github.com/googleforgames/agones.git pull/1794/head:pr_1794 && git checkout pr_1794
  • helm install ./install/helm/agones --namespace agones-system --name agones --set agones.image.tag=1.9.0-f7daa1b

Copy link
Collaborator

@aLekSer aLekSer left a comment

Choose a reason for hiding this comment

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

Thanks for this PR, tests also were refactored and look much better now.

@google-oss-robot
Copy link

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: aLekSer, markmandel, roberthbailey

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:
  • OWNERS [aLekSer,markmandel,roberthbailey]

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@agones-bot
Copy link
Collaborator

Build Succeeded 👏

Build Id: 22780755-ff66-4489-9751-b573231aa432

The following development artifacts have been built, and will exist for the next 30 days:

A preview of the website (the last 30 builds are retained):

To install this version:

  • git fetch https://github.com/googleforgames/agones.git pull/1794/head:pr_1794 && git checkout pr_1794
  • helm install ./install/helm/agones --namespace agones-system --name agones --set agones.image.tag=1.9.0-9891346

@aLekSer aLekSer changed the title Upgrade client-go and apimachinery to 0.16.5 Upgrade client-go and apimachinery to 0.16.15 Sep 9, 2020
@aLekSer aLekSer merged commit c6636e7 into googleforgames:master Sep 9, 2020
@markmandel markmandel deleted the upgrade/client-go-1.13 branch September 9, 2020 16:20
@markmandel markmandel added this to the 1.9.0 milestone Sep 9, 2020
ilkercelikyilmaz pushed a commit to ilkercelikyilmaz/agones that referenced this pull request Oct 23, 2020
* Update k8s.io/client-go to v0.16.15

* Upgrade k8s.io/apiextensions-apiserver to v0.16.15

Note: overwrote grpc to keep at current version.

* Upgrade client-go and apimachinery to 0.16.5

Worth noting that cache.WaitForCacheSync has changed its internal
implementation to now use `err := wait.PollImmediateUntil(...)`, so
there is no more implicit 100ms sleep before the sync. Therefore it
didn't _actually_ wait to populate from Watch or allow events to fire -
it just made room for it to occur.

So had to now using assert/require.Eventually() to make sure that the
system is in a state that matches what we expect before testing.

Work on googleforgames#1649

Co-authored-by: Alexander Apalikov <alexander.apalikov@globant.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants