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

Update client-go dependency to K8s 1.11 #2121

Merged
merged 2 commits into from
Sep 21, 2018

Conversation

travisn
Copy link
Member

@travisn travisn commented Sep 12, 2018

Description of your changes:
client-go has moved on from v1.8.2, which Rook is still using. We need to update to a newer release of the client so we can pick up fixes in the last few releases. The latest stable version is 1.11.3, which we will now use with client-go v8.0.

dep ensure may need to be run on dev machines if build dependencies are not found.

The most notable issue known caused by this is #1553, which may cause a volume to be re-formatted even when it was previously formatted.

Which issue is resolved by this Pull Request:
Resolves #1553

Checklist:

  • Documentation has been updated, if necessary.
  • Pending release notes updated with breaking and/or notable changes, if necessary.
  • Upgrade from previous release is tested and upgrade user guide is updated, if necessary.
  • Code generation (make codegen) has been run to update object specifications, if necessary.
  • make vendor does not cause changes.
  • Comments have been added or updated based on the standards set in CONTRIBUTING.md

@travisn travisn requested a review from jbw976 September 12, 2018 22:48
@travisn travisn changed the title K8s 1.11 dependency Update client-go dependency to K8s 1.11 Sep 12, 2018
@travisn travisn force-pushed the k8s-1.11-dependency branch 3 times, most recently from 36151db to 18b07ad Compare September 17, 2018 19:05
@@ -201,30 +201,6 @@ func (a *Agent) discoverFlexvolumeDir() (flexvolumeDirPath, source string) {
return getDefaultFlexvolumeDir()
}

// unmarshal to a NodeConfigKubelet
configKubelet := NodeConfigKubelet{}
Copy link
Member

Choose a reason for hiding this comment

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

do these types not even exist anymore in the new 1.11 client-go?

Copy link
Member Author

Choose a reason for hiding this comment

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

no, i couldn't find them. I'll take another look to be sure.

Copy link
Member Author

@travisn travisn Sep 19, 2018

Choose a reason for hiding this comment

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

I don't see the VolumePluginDir anywhere, and there was also discussion in a previous issue about this property not being included anymore. So this code must not have been exercised anyway since it hasn't been possible to detect. We really just rely on setting the FLEXVOLUME_DIR_PATH env var in the operator yaml as described [here](https://rook.io/docs/rook/v0.8/flexvolume.html#configuring-the-rook-operator. I'll clean up this function a bit better to make that more clear.

@@ -76,7 +76,7 @@ func TestProvisionImage(t *testing.T) {
assert.Equal(t, "pvc-uid-1-1", pv.Name)
assert.NotNil(t, pv.Spec.PersistentVolumeSource.FlexVolume)
assert.Equal(t, v1.PersistentVolumeReclaimRetain, pv.Spec.PersistentVolumeReclaimPolicy)
assert.Equal(t, "foo.io/rook-system", pv.Spec.PersistentVolumeSource.FlexVolume.Driver)
Copy link
Member

Choose a reason for hiding this comment

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

why did these asserts change? i'm not sure i see the reason yet

Copy link
Member Author

Choose a reason for hiding this comment

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

This was a subtle change... The mocking changed such that the version of k8s is coming back as master instead of 1.11.3 or some other specific version. The side effect is that the checks for k8s version in the RookDriverName function doesn't know what version it's running, so it falls back to return the default flex driver name rook.

Copy link
Member Author

Choose a reason for hiding this comment

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

The flex volume directory detection now is based only on the rook env variable or the default location. There is also a unit test added TestDiscoverFlexDir. It's already squashed to get the build going and potentially merged sooner.

@travisn travisn force-pushed the k8s-1.11-dependency branch from 18b07ad to 64fe087 Compare September 19, 2018 21:09
@ganeshmaharaj ganeshmaharaj mentioned this pull request Sep 20, 2018
6 tasks
@travisn travisn force-pushed the k8s-1.11-dependency branch 2 times, most recently from 6be15ad to c34b61a Compare September 21, 2018 20:26
Signed-off-by: travisn <tnielsen@redhat.com>
Signed-off-by: travisn <tnielsen@redhat.com>
@travisn travisn force-pushed the k8s-1.11-dependency branch from c34b61a to dd9d68c Compare September 21, 2018 21:42
@travisn travisn merged commit 896ff18 into rook:master Sep 21, 2018
@travisn travisn deleted the k8s-1.11-dependency branch September 21, 2018 23:14
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.

rook-agent formatted an in use volume
2 participants