Commit Graph

237 Commits

Author SHA1 Message Date
Shihang Zhang
d2859cd89b plumb service account token down to csi driver 2020-11-12 09:26:43 -08:00
Marek Siarkowicz
973218b17d Add datapolicy tags to pkg/volume/ 2020-10-30 15:51:36 +01:00
Srini Brahmaroutu
fbe5daed73 Change code to use staging/k8s.io/mount-utils 2020-09-16 21:51:24 -07:00
Davanum Srinivas
442a69c3bd
switch over k/k to use klog v2
Signed-off-by: Davanum Srinivas <davanum@gmail.com>
2020-05-16 07:54:27 -04:00
Hemant Kumar
75fdb6d554 When casting resource.Quantity to int64 it may overflow
We need to ensure that when converting resource.Quantity
to int64 it does not overflow and if it does, then an error is
returned back to the use rather than attempting expansion and
provisioning operations with scaled value.
2020-05-13 21:22:59 -04:00
Michelle Au
63ee9b3f4f Clean up event messages for errors.
Change-Id: Ib70b50e676b917c4d976f32ee7a19f8fc63b6bc6
2020-04-02 15:25:36 -07:00
Mike Danese
c58e69ec79 automated refactor 2020-03-05 14:59:46 -08:00
Mike Danese
25651408ae generated: run refactor 2020-02-08 12:30:21 -05:00
Mike Danese
3aa59f7f30 generated: run refactor 2020-02-07 18:16:47 -08:00
Travis Rhoden
0c5c3d8bb9
Remove pkg/util/mount (moved out of tree)
This patch removes pkg/util/mount completely, and replaces it with the
mount package now located at k8s.io/utils/mount. The code found at
k8s.io/utils/mount was moved there from pkg/util/mount, so the code is
identical, just no longer in-tree to k/k.
2019-11-15 08:29:12 -07:00
Kubernetes Prow Robot
372ebd24f5
Merge pull request #83098 from ddebroy/disable-intree
CSI Migration phase 2: disable probing of in-tree plugins
2019-11-14 20:51:42 -08:00
Deep Debroy
129f15328b Disable in-tree plugins migrated to CSI
Signed-off-by: Deep Debroy <ddebroy@docker.com>
2019-11-14 17:28:21 -08:00
Travis Rhoden
367f879131
Retire mount.Exec for k8s.io/utils/exec
This patch removes mount.Exec entirely and instead uses the common
utility from k8s.io/utils/exec.

The fake exec implementation found in k8s.io/utils/exec differs a bit
than mount.Exec, with the ability to pre-script expected calls to
Command.CombinedOutput(), so tests that previously relied on a callback
mechanism to produce specific output have been updated to use that
mechanism.
2019-11-13 14:09:57 -07:00
zouyee
599fa5583e IP validates if a string is a valid IP address
Signed-off-by: Zou Nengren <zouyee1989@gmail.com>
2019-10-02 08:55:08 +08:00
hwdef
386f981116 fix(pkg): delete unused var or const 2019-09-21 17:13:13 +08:00
Humble Chirammal
c22cc06b90 If volume in delete request does not exist, return success.
Signed-off-by: Humble Chirammal <hchiramm@redhat.com>
2019-07-09 19:43:40 +05:30
nagexiucai
63cb1d65ca Remove selected IP from backup-volfile-servers list to avoid warning in mount logs. 2019-06-17 16:36:53 +08:00
Humble Chirammal
b867f601da Remove unwanted newlines in glusterfs driver
Signed-off-by: Humble Chirammal <hchiramm@redhat.com>
2019-06-06 22:03:15 +05:30
Robert Krawitz
5b97b2860d Change fsGroup to mounterArgs in volume.SetUp() to allow for future extension. 2019-05-29 15:12:28 -04:00
Kubernetes Prow Robot
d5876954e1
Merge pull request #76178 from humblec/endpoint
Create endpoint/service early to avoid unwanted create/delete volume transaction.
2019-05-22 09:58:09 -07:00
Humble Chirammal
e47a7897ea Fail early if driver cant get kubeclient
Signed-off-by: Humble Chirammal <hchiramm@redhat.com>
2019-05-14 10:29:59 +05:30
Kubernetes Prow Robot
2a7eaa30da
Merge pull request #77385 from humblec/gluster-error
Avoid duplicate error reporting in glusterfs
2019-05-07 14:31:28 -07:00
Humble Chirammal
427df38c6b Avoid duplicate error reporting in glusterfs
Signed-off-by: Humble Chirammal <hchiramm@redhat.com>
2019-05-03 13:42:36 +05:30
Kubernetes Prow Robot
ca21efd1c5
Merge pull request #76983 from humblec/rotate
Shuffle addresslist for random mount server and cleanup error messages.
2019-05-03 01:02:47 -07:00
Humble Chirammal
745f12837f Rename createEndpointService() to createOrGetEndpointService()
Signed-off-by: Humble Chirammal <hchiramm@redhat.com>
2019-05-02 21:06:54 +05:30
Travis Rhoden
78d109e201 Always use filepath.Join instead of path.Join
This patch cleans up pkg/util/mount/* and pkg/util/volume/* to always
use filepath.Join instead of path.Join. filepath.Join is preferred
because path.Join can have issues on Windows.
2019-04-29 09:56:05 -06:00
Humble Chirammal
f30b14a408 Shuffle addresslist for random mount server and cleanup error messages.
Signed-off-by: Humble Chirammal <hchiramm@redhat.com>
Signed-off-by: Niels de Vos <ndevos@redhat.com>
2019-04-24 09:08:15 +05:30
Humble Chirammal
c86828b74b Cleanup volume, ep/svc if endpoint update failed.
Signed-off-by: Humble Chirammal <hchiramm@redhat.com>
2019-04-16 11:50:42 +05:30
ialidzhikov
98c976ae4f Clean ineffectual assignment
Signed-off-by: ialidzhikov <i.alidjikov@gmail.com>
2019-04-13 16:23:07 +03:00
Humble Chirammal
58e65c053a Resolve merge conflict
Signed-off-by: Humble Chirammal <hchiramm@redhat.com>
2019-04-10 20:51:02 +05:30
Humble Chirammal
7544b53693 Create endpoint/service early to avoid unwanted create/delete volume transaction.
At times, for some reason endpoint/service creation can fail in a setup. As we
currently create endpoint/service after volume creation, later we need rollback
of this volume transaction if endpoint/service creation failed. Considering
endpoint/service creation is light weight, this patch promote endpoint/service
creation to an early stage.

Signed-off-by: Humble Chirammal <hchiramm@redhat.com>
2019-04-10 19:06:27 +05:30
Humble Chirammal
6eae6bbac5 Use pvc uid in endpoint/service label
If the pvc name is more than 63 chars, the endpoint creation
will fail due to the validation of objectmeta length of fields ie 63 chars at max.
This patch introduce an enhancement where if the pvc name is >=63 the pvc uid
is recorded at label instead of name. To preserve backward compatibility, the pvcname
has been kept in endpoint metadata label if length of pvc name is <63chars.

Signed-off-by: Humble Chirammal <hchiramm@redhat.com>
2019-04-05 20:30:57 +05:30
Jordan Liggitt
d1e865ee34 Update client callers to use explicit versions 2019-02-26 08:36:30 -05:00
Andrew Kim
a62ee8b0a9 clean up volume rounding functions and move to k8s.io/cloud-provider/volume 2019-02-09 01:16:55 -05:00
danielqsj
657a1a1a34 change import alias of utils/strings 2019-01-30 10:44:09 +08:00
danielqsj
093328e57f migrate to k8s.io/utils/strings 2019-01-30 10:24:00 +08:00
Kubernetes Prow Robot
cc1be28943
Merge pull request #72624 from danielqsj/clean_unmount
Cleanup callers of deprecated functions in volume/util
2019-01-28 23:06:20 -08:00
David Zhu
d8c9dc5bb5 Add IsMigratableToCSI to volume plugin interface 2019-01-17 14:43:52 -08:00
danielqsj
d94cd822b7 Cleanup UnmountPath/UnmountMountPoint callers 2019-01-08 22:13:50 +08:00
k8s-ci-robot
d80614d4a7
Merge pull request #70860 from humblec/getVolumeName
GlusterFS: Move GetVolumeName() to unimplemented func.
2018-11-29 07:36:28 -08:00
Davanum Srinivas
954996e231
Move from glog to klog
- Move from the old github.com/golang/glog to k8s.io/klog
- klog as explicit InitFlags() so we add them as necessary
- we update the other repositories that we vendor that made a similar
change from glog to klog
  * github.com/kubernetes/repo-infra
  * k8s.io/gengo/
  * k8s.io/kube-openapi/
  * github.com/google/cadvisor
- Entirely remove all references to glog
- Fix some tests by explicit InitFlags in their init() methods

Change-Id: I92db545ff36fcec83afe98f550c9e630098b3135
2018-11-10 07:50:31 -05:00
Humble Chirammal
e9ed21988d GetVolumeName() is used in a few places, all of which are not applicable to gluster:
AD controller
    kubelet volume manager actual/desired sw for attachable volumes
    volume reconstruction

This is a followup PR based on comment#
https://github.com/kubernetes/kubernetes/pull/60195#discussion_r231675596

Signed-off-by: Humble Chirammal <hchiramm@redhat.com>
2018-11-09 16:09:12 +05:30
k8s-ci-robot
3c10143967
Merge pull request #60195 from humblec/glusterfs-pvspec-3
Refactor GlusterFS PV spec.
2018-11-08 00:24:39 -08:00
Humble Chirammal
bdb051c72d Refactor GlusterFS PV spec.
This patch introduces glusterfsPersistentVolumeSource addition
to glusterfsVolumeSource. All fields remains same as glusterfsVolumeSource
with an addition of a new field
called `EndpointsNamespace` to define namespace of endpoint in the
spec.

Signed-off-by: Humble Chirammal <hchiramm@redhat.com>
2018-11-06 15:51:01 +05:30
Humble Chirammal
734da0edb1 glusterfs: Allow admin to provide custom endpoint/service name prefix
This patch introduces a new SC parameter called `customepnameprefix`
in glusterfs plugin. This new storageclass parameter allow admins
to create endpoints and services with mentioned prefix.
If this parameter has not been set or if its empty,
default prefix string ie "glusterfs-dynamic-" will be used for ep/svc
name.

This patch address below issues#

https://github.com/kubernetes/kubernetes/issues/53939
https://github.com/kubernetes/kubernetes/issues/56379

Additional Ref# #
https://github.com/kubernetes/kubernetes/issues/56380

Signed-off-by: Humble Chirammal <hchiramm@redhat.com>
2018-10-31 18:06:40 +05:30
Michael Adam
870bf314fe glusterfs: remove a redundant comment
This comment exactly states what the line below it does.
There's no point in keeping it.

Signed-off-by: Michael Adam <obnox@redhat.com>
2018-10-29 17:07:08 +01:00
Michael Adam
465bb06533 glusterfs: improve a comment block
moving it to the function it explains and
rewording slightly.

Signed-off-by: Michael Adam <obnox@redhat.com>
2018-10-29 17:07:08 +01:00
Humble Chirammal
a6759a7b22 Fix a typo in source code comment
Signed-off-by: Humble Chirammal <hchiramm@redhat.com>
2018-10-26 20:01:19 +05:30
Humble Chirammal
5bd0b5d841 GlusterFS: Use pvc uid instead of pvc name in glusterfs endpoint name.
At present, endpoints and services are created
for glusterfs pvcs are in form of glusterfs-dynamic-<PVC name>
however this could cause issue if user deletes a PVC and immediately
creates a new one with the same name, PV controller will try to delete
the old PV and its endpoint and at the same the controller will try to create new PV
and the same endpoint. Depending on which event reaches the
controller first, it may create new PV, check that endpoints exists,
then delete the old PVC and delete endpoints already used by the new PV.

This patch changes the endpoint/service name to below format:

`glusterfs-dynamic-<PVC UUID>`.

By the uniqueness of UUID, above mentioned issue will no longer be present.

Signed-off-by: Humble Chirammal <hchiramm@redhat.com>
2018-10-26 20:00:02 +05:30
Humble Chirammal
fdcd58a794 Add log-level mount option support for glusterfs plugin
The glusterfs plugin/driver set log-level to ERROR by default while
mounting glusterfs shares. However at times, its required to supply other
log-level options like INFO, TRACE..etc. This patch enables the support
to provide other log-level values from storageclass.

Additional Ref#
    https://docs.gluster.org/en/v3/Administrator%20Guide/Setting%20Up%20Clients/

Signed-off-by: Humble Chirammal <hchiramm@redhat.com>
2018-10-03 10:16:41 +05:30