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

vSphere CSI Driver 2.0 #151

Merged
merged 246 commits into from
Apr 7, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
246 commits
Select commit Hold shift + click to select a range
24eae5c
re-arranged code to rebase with internal repository
divyenpatel Apr 2, 2020
a28c87d
WCP CSI Controller Init Implementation
BaluDontu May 21, 2019
392e1ad
WCP CSI Create Volume implementation
BaluDontu May 30, 2019
874e026
Add support for Unit tests and Integration tests for WCP and its Crea…
BaluDontu May 30, 2019
7d8ffcf
Fix Simulator tests
BaluDontu May 31, 2019
75ef73b
WCP Delete Volume Implementation
BaluDontu May 31, 2019
05b663c
Add support for Unit tests and Integration tests for WCP and its Crea…
BaluDontu Jun 3, 2019
a5cd7d6
Common types to be used by Pod Listener and Metadatasyncer/FullSyncer…
BaluDontu Aug 1, 2019
ca3596c
Define Pod listener gRPC service
BaluDontu Aug 1, 2019
b4f68d4
Implement the Pod listener gRPC service
BaluDontu Aug 1, 2019
51e5d4c
Add a new flag X_CSI_CONTROLLER_TYPE and X_CSI_POD_POLL_INTERVAL_SECO…
BaluDontu Aug 1, 2019
e7b7c5e
Implement WCP CSI Attach by integrating with Pod Listener gRPC servic…
BaluDontu Aug 1, 2019
2bcde79
Update unit test to reflect new metadatasyncer struct
BaluDontu Aug 1, 2019
a683ea6
Minor fix metadata syncer unit test
BaluDontu Aug 1, 2019
9122a3d
Implement WCP Guestcluster CSI Controller Initialization
Jul 17, 2019
5674197
Adding SVmotion test for CSI driver for volume in detached state
divyenpatel Aug 16, 2019
d1a703b
Fix error code sent by controller
RaunakShah Aug 8, 2019
2658a7a
Enable leader election for syncer.
lipingxue Aug 14, 2019
f1b99e9
Adjust the structure of repository
divyenpatel Aug 16, 2019
36a8b01
refactor code to use gitlab.eng.vmware.com/hatchway/govmomi
divyenpatel Aug 22, 2019
1a19db9
removed wrapper methods for cnsclient from cns-lib/vsphere/cns.go
divyenpatel Aug 23, 2019
551097a
set controllerType=VANILLA when X_CSI_CONTROLLER_TYPE is not set in t…
divyenpatel Aug 23, 2019
d44f595
Fix 2406212 where CSI crashes intermittently expecting a env. variabl…
BaluDontu Aug 22, 2019
db2c5cb
Connect to supervisor cluser given cns_csi.conf
Aug 20, 2019
992e137
Remove test code and fix log messages in Guest cluster CSI Init
Aug 28, 2019
7f483a5
Start Pod listener in a go routine
BaluDontu Aug 28, 2019
bb8a783
rbac and deployment yaml changes to enable leader election.
lipingxue Aug 23, 2019
26d15cc
Fixed bug 2404986 by returning the pod once we find the match
SandeepPissay Sep 3, 2019
f67db0a
Send host affinity as policy param to SPBM
subramanian-neelakantan Aug 20, 2019
2673ea5
bumping up taskClientVersion and using GetTaskInfo and GetTaskResult …
divyenpatel Sep 6, 2019
304bf69
Verify Attach/Detach in e2e tests on SV cluster
chethanv28 Aug 27, 2019
9b6927f
Check for NotFound fault during DeleteVolume
chethanv28 Sep 5, 2019
80a6a88
Adding a higher timeout value and missing cleanup steps in wcp e2e tests
chethanv28 Sep 12, 2019
90c3962
setting controllerType to VANILLA to allow checking attached disk usi…
divyenpatel Sep 13, 2019
6be40ab
Fix test/e2e/operationstorm.go
RaunakShah Sep 16, 2019
26ec801
Implement guest cluster create
Sep 3, 2019
28ab3d4
Change log level for csi-provisioner, csi-attacher, vsphere-syncer fr…
lipingxue Sep 17, 2019
0a624f4
Add a unique string for non zone tests to distinguish from zone tests
chethanv28 Sep 14, 2019
02456cb
E2E test for multi-master K8S.
lipingxue Aug 30, 2019
98aa0e6
Changes to support Guest Cluster Delete Volume
chethanv28 Sep 16, 2019
4f82513
Modifying version check during csi controller Init
chethanv28 Sep 23, 2019
f0853e7
Create CNS Operator for CNSNodeVMAttachment API using Operator SDK fr…
BaluDontu Sep 25, 2019
3360f56
Create CnsNodeVMAttachment CRD on CNS Operator Initialization
BaluDontu Sep 25, 2019
fa30cf4
Add a diskUUID const to CnsNodeVmAttachment Types
BaluDontu Sep 25, 2019
44c0959
Deleting resources after each test, even if the test fails.
shalini-b Sep 25, 2019
8813696
Increate timeout for csi provisioner and attacher
chethanv28 Sep 25, 2019
96f3745
Added livenessprobe to driver spec
RaunakShah Sep 26, 2019
1bc4508
Created CnsVolumeMetadata CRD on CNS Operator initialisation
RaunakShah Sep 25, 2019
bd03962
Refactor common types to 2 new types - ConfigInfo and VirtualCenterTypes
BaluDontu Oct 2, 2019
491fda9
Use VirtualCenterTypes and ConfigInfo in CnsOperator controllers
BaluDontu Oct 2, 2019
c9d4ed4
Fix full sync e2e test: Bring down syncer container instead of state…
chethanv28 Sep 24, 2019
5fccdff
Add unit test and integration tests for guest cluster create and dele…
Sep 23, 2019
b65b06d
Add PV/PVC label updates test to the WCP test suite
shalini-b Oct 4, 2019
ba9b9a7
Ensure vsan-health is completely shutdown/fully come-up during full-s…
shalini-b Oct 4, 2019
7e2960e
Common code for file share support
divyenpatel Oct 5, 2019
db3d0e2
Fixed formatting errors on ToT
RaunakShah Oct 7, 2019
f711398
removing hostNetwork setting from CSI controller and node pods
divyenpatel Oct 8, 2019
dfea7e1
fixing rbac rules
divyenpatel Oct 8, 2019
dbd54c7
Defer wait group decrement call
RaunakShah Oct 11, 2019
38e310c
publish deployment yaml and rolesbinding for vsphere-csi-driver and v…
Oct 8, 2019
be75825
Fixed run-e2e-test.sh to set csi-block-e2e as the default ginkgo focu…
SandeepPissay Oct 11, 2019
7aab412
Refactor controller types to common file
RaunakShah Oct 7, 2019
c0d727f
Replace controllerType const with clusterFlavor
RaunakShah Oct 14, 2019
9759da6
Use govmomi bindings cluster flavor
RaunakShah Oct 16, 2019
523b5d6
Updated yamls
RaunakShah Oct 16, 2019
69a8855
CNSOperator Attach Implementation
BaluDontu Oct 17, 2019
3275e1a
Initialize Metadata syncer based on cluster flavor and refactor synce…
RaunakShah Oct 7, 2019
7bf4386
Adding PodSecurityPolicy rule to CSI controller and fix the env name
Oct 17, 2019
8211237
Modify multi-master e2e test to enable test for WCP.
lipingxue Sep 25, 2019
a7bb00c
Update guest cluster deployment yaml to add syncer
RaunakShah Oct 21, 2019
32c6b4b
Changes to support e2e tests to run on guest cluster
chethanv28 Oct 16, 2019
aec0ee8
Adding cleanup steps for statefulsets in AfterEach() when something f…
chethanv28 Oct 28, 2019
54b9f8f
guest cluster attach volume implemenation
divyenpatel Sep 23, 2019
299da4b
Bump up govmomi commit version
shalini-b Oct 30, 2019
a67b231
Create Volume for FileShare type
divyenpatel Oct 4, 2019
0dcbe45
Bump up govmomi version to unblock unittests failure
shalini-b Oct 31, 2019
1b9a080
Consume configmap and secret to connect supervisor cluster and using …
Oct 22, 2019
ca82bd4
CNS Operator Detach Implementation
BaluDontu Nov 1, 2019
941d33c
Client for CnsVolumeMetadata
RaunakShah Sep 27, 2019
d606e95
Removed lister and informers for CnsVolumeMetadata client
RaunakShah Nov 1, 2019
e5fc95f
Add VolumeType field to CNS VolumeCreate Spec for WCP Controller
BaluDontu Nov 5, 2019
39d192c
Support resize
xing-yang Oct 1, 2019
f180bc7
ControllerPublishVolume changes for NFS File Share services
shalini-b Nov 6, 2019
44a8fd7
Fix interface conversion error
xing-yang Nov 6, 2019
814fec0
Added data persistence tests
chethanv28 Oct 31, 2019
af23473
Update the DaemonSet Yaml for guest cluster
Nov 7, 2019
543e4cc
Update the imagePullPolicy in the yaml in guest cluster
Nov 8, 2019
aada991
Update README
chethanv28 Oct 25, 2019
91fc884
Update version number to dynamic version in the yaml for GC
Nov 8, 2019
ef8a56e
Add more e2e tests for resize
xing-yang Nov 7, 2019
fa702ad
Verify vsan datastores in the field "targetvSANFileShareDatastoreURLs…
ankitvaidya Nov 11, 2019
f4a0337
Added EntityReference to CnsVolumeMetadata
RaunakShah Nov 6, 2019
edd17a7
Added support for file volume capability validations.
SandeepPissay Nov 12, 2019
7be3fd3
Set ClusterFlavor to CNS calls
RaunakShah Nov 8, 2019
cc980d5
Fix bug for waiting on diskUUID to be set on VM
RaunakShah Nov 14, 2019
53571b1
Fix unit test logging
RaunakShah Nov 15, 2019
fc3e46e
Implemented create volume workflow for FILE volume type.
SandeepPissay Nov 14, 2019
22418d7
Extend NodeStageVolume and NodePublishVolume for File CSI Driver
shalini-b Nov 16, 2019
0cd9ff7
metadata syncer change for file volume
divyenpatel Nov 8, 2019
ccc9531
Added data persistence tests
chethanv28 Oct 31, 2019
0c50fd8
Cleanup files which are not needed for master branch
chethanv28 Nov 18, 2019
98e5994
Updating Supervisor cluster setup docs
r-shreesha Nov 21, 2019
0079a2c
Addressing lint and static check errors
chethanv28 Oct 31, 2019
6011a2d
E2E test for CSI file.
lipingxue Nov 21, 2019
c0ce31a
Changes to support pvCSI metadatasyncer to update and delete pvc & pv…
chethanv28 Nov 7, 2019
fe8b7d8
pvcsi detach volume implementation
RaunakShah Oct 4, 2019
52beb50
Fixed bug on watching virtual machine object for attach/detach in pvcsi
RaunakShah Nov 27, 2019
f70abd5
NodeUnstageVolume and NodeUnpublishVolume for File share volumes
shalini-b Nov 28, 2019
fb56a90
[E2E] Verify dynamic file volume provisioning works for "ReadOnlyMany…
divyenpatel Nov 27, 2019
d30472f
Fixed vcConfig.DatacenterPaths init code so that it gets initialized …
SandeepPissay Nov 28, 2019
7aa0c9e
Implementation of pvcsi full sync, without support for POD entity types
RaunakShah Nov 6, 2019
548a271
pass right BackingObjectDetails type in the createspec
divyenpatel Dec 3, 2019
90734e7
Test6 and Test8 for file CSI create volume without storage policy.
lipingxue Nov 27, 2019
3dd17d3
Implementation of pvcsi full sync for pod entity types
RaunakShah Nov 6, 2019
bcae091
Validating if file service is enabled on datastores present in Target…
ankitvaidya Dec 10, 2019
a6cbfbc
Remove channel for full sync
RaunakShah Dec 10, 2019
3ce0839
Implemented net permission support in storage class parameters for fi…
SandeepPissay Dec 6, 2019
689db22
full sync changes for file volume driver
divyenpatel Dec 4, 2019
d8d9012
Remove NodeUnstage for file volumes
shalini-b Dec 12, 2019
c76de88
Modifying the stateful testcase
r-shreesha Nov 26, 2019
fcc8fe1
support case insensitive parameters
divyenpatel Dec 12, 2019
8c3563d
removing usage of CnsNfsFileShareBackingDetails for e2e tests
divyenpatel Dec 12, 2019
7cd6f88
Change storage class paramter "fstype" in e2e test.
lipingxue Dec 13, 2019
3d7e743
pvCSI metadataSyncer : Pods Update/Delete
Dec 11, 2019
740b09b
Add yaml files for kubernetes 1.16
xing-yang Dec 12, 2019
4ba0428
Test1 file CSI create volume with storage policy.
lipingxue Dec 10, 2019
3d68f25
Modify e2e test with proper tag.
lipingxue Dec 16, 2019
a55ef38
ignore TopologyRequirement for file volume provisioning
divyenpatel Dec 16, 2019
274ba7d
Fix failing data persistence test for WCP setups
shalini-b Dec 17, 2019
d00e951
fixing zone based volume provisioning
divyenpatel Dec 17, 2019
cba8eb1
Adding Toleration for Node Controllers
r-shreesha Dec 11, 2019
766dd91
allow deprecated storageclass parameter fstype
divyenpatel Dec 16, 2019
6d8a68b
Add GC e2e tests
Dec 11, 2019
6703dc5
Reconcile controller for cnsvolumemetadata instances
RaunakShah Nov 12, 2019
225e1ec
bump up govmomi
divyenpatel Dec 19, 2019
1a2b0c1
Test9 and Test11 for e2e test for create file volume with no storage …
lipingxue Dec 9, 2019
90c9632
bump up govmomi to include cnsfault binding change
divyenpatel Dec 20, 2019
5235415
Scaling down STS pods to zero
r-shreesha Dec 21, 2019
3add902
Make ControllerUnpublish no-op for file volumes
shalini-b Dec 30, 2019
ca7357a
Adding a util function to fetch uuid from vm name and add e2e tests f…
chethanv28 Dec 18, 2019
1658f3f
Create test util for datastore picked from TargetvSANFileShareDatasto…
shalini-b Jan 2, 2020
eb5e4f3
Fixing bug 2470375
r-shreesha Jan 2, 2020
31a503c
remove usage of localized fault messages
divyenpatel Jan 3, 2020
a88ba93
Metadata syncer and fullsync e2e test for file volume.
lipingxue Dec 10, 2019
deb04f4
Only support expand volume for block
xing-yang Nov 28, 2019
bff29e7
upgrade driver containers base image to photon3
divyenpatel Jan 3, 2020
a7aadf2
Test2 and Test3 for file volume create with storage policy.
lipingxue Jan 4, 2020
d5f7873
Reverting commit 19a8c0e
r-shreesha Jan 6, 2020
6c65373
File volume test cases for TargetvSANFileShareDatastoreURLs
shalini-b Jan 9, 2020
7e840cd
upgrading Golang to version 1.13 and fixed building driver from inter…
divyenpatel Jan 7, 2020
a9174d5
Enable certificate check for PVCSI
Dec 27, 2019
247fbe6
Redesigned CnsNodeVmAttachment controller to handle cases where PVC i…
SandeepPissay Jan 8, 2020
e6362f0
Verify node vm exists during guest cluster deletion and remove finali…
chethanv28 Jan 8, 2020
23705c0
Adding label verification for static provisioning
r-shreesha Dec 24, 2019
a8b74f9
Fix broken testcases
shalini-b Jan 10, 2020
ceb1465
Adding managed cluster owner reference to cnsvolumemetadata crd objects
chethanv28 Jan 9, 2020
c0b9a2d
Prevent orphan volumes by storing taskInfo in a map
chethanv28 Nov 22, 2019
7079f43
set go compilation version to 1.13 and pin dependencies to 1.14
divyenpatel Jan 13, 2020
58495be
Return success for DetachVolume when the volume is not found.
lipingxue Jan 10, 2020
ca189e7
Set default csiTimeout value to 300s for resizer sidecar
xing-yang Jan 14, 2020
1d58acb
Establish new connection with updated credential from secret
Jan 14, 2020
60993ee
Query API server if PV is not found using PV lister for PVCUpdate event
BaluDontu Jan 16, 2020
fabf5ec
Add clusterid to entity references
RaunakShah Jan 15, 2020
3c141b6
Fix metadatasyncer PVUpdated pre check
RaunakShah Jan 16, 2020
31fee4f
Fix unit tests : Use test conf file to save the vc credentials and us…
chethanv28 Jan 17, 2020
a7ca734
adding contextual logging using uber zap logging framework
divyenpatel Jan 21, 2020
2fa9f4a
Removing the check for logs from k8s objects
r-shreesha Jan 23, 2020
d0c9c70
Verify cnsnodevmattachment crds in supervisor for guest cluster e2e t…
chethanv28 Jan 14, 2020
800454b
allow setting log level for syncer container
divyenpatel Jan 28, 2020
1ca8b02
Enable operation storm test for WCP supervisor cluster.
lipingxue Jan 24, 2020
836a3b7
watch on configuration changes
divyenpatel Jan 28, 2020
68a3a2e
Using task objects as value for createVolumeTaskInfo Map and Adding n…
chethanv28 Jan 30, 2020
826bfcf
fix lint failures
Jan 16, 2020
dcb2e5d
Run make format
chethanv28 Feb 4, 2020
c0a29ff
Port nodeUpdate method from github to gitlab
chethanv28 Feb 4, 2020
0d3dfd2
Add a check to prevent online volume expansion
xing-yang Feb 6, 2020
d35ac8c
Fixing errors returned by csi controller
RaunakShah Jan 29, 2020
5a4eb83
Update log in pvcsi full sync to avoid panic
RaunakShah Feb 10, 2020
ec2c9ad
Add lock per volume operation on the volumeTaskMap to mitigate race d…
chethanv28 Jan 31, 2020
b170fcb
publishing supported controller capabilities based on vCenter release…
divyenpatel Feb 11, 2020
92df872
Register new vcenter hostname and re-intialize manager instance in vo…
chethanv28 Feb 5, 2020
bcc4beb
Adding e2e test for guest cluster
Feb 7, 2020
9677548
Adding e2e test to check PVC deletion after the password change
r-shreesha Feb 7, 2020
23d66a9
bumping up gocsi and vm-operator-client dependency
divyenpatel Feb 12, 2020
292a877
Add support for worker threads to reconcile cnsnodevmattachment and c…
BaluDontu Feb 13, 2020
55d5a7a
File volume tests with TargetvSANFileShareDatastoreURLs and Storage p…
shalini-b Feb 14, 2020
8dbfa05
Use pvcsi provider credentials path for reload config in GC
chethanv28 Feb 13, 2020
e49c7bd
Reconstruct the manifest to expose the pvcsi.ymal for GC for add-on c…
Feb 14, 2020
39bfbe9
Trigger FullSync as soon as Controller pod starts
shalini-b Feb 20, 2020
23b267c
Change time stamp format to human readable format when log level is p…
chethanv28 Feb 21, 2020
2ff3675
Update ManagedCluster to TanzuKubernetesCluster
Feb 24, 2020
5f580b1
Update golint URL in Makefile
shalini-b Feb 25, 2020
a0d9b75
Script to automate wcp spec bump process into cayman_photon
RaunakShah Feb 15, 2020
88daaad
Restablish connection when credentials change in the secret
chethanv28 Feb 26, 2020
4cf3ffb
Using Update API to patch VM in pvCSI
Feb 27, 2020
bbd713b
Fix bug to update only relevant volume with POD entityrefs
RaunakShah Feb 27, 2020
4c30a13
Add a watcher from GC CreatePVC call to SC instead of Polling
shalini-b Feb 28, 2020
b75967f
Remove commented git push
RaunakShah Feb 28, 2020
733250d
Removing X_CSI_ tags from environment variables
r-shreesha Feb 26, 2020
bc36eaf
Updating CSI deployment YAML for GC
Mar 3, 2020
031acb1
Update script to wait for merge request approval
RaunakShah Mar 4, 2020
f5929cd
using queryvolume pagination for full sync
divyenpatel Feb 28, 2020
b26e8cc
fixing deployment yamls
divyenpatel Mar 5, 2020
c6e8b47
Fix bug in spec bump script
RaunakShah Mar 6, 2020
733476c
Script to run linter checks, ignoring autogenerated files
RaunakShah Mar 4, 2020
9490381
Update run-e2e-test.sh to support additional ginkgo flags/options, fo…
sashrith Mar 7, 2020
189edef
Update run-e2e-test.sh to fix unbound variable issue.
sashrith Mar 8, 2020
de0cf6c
Update govmomi commit id
chethanv28 Mar 9, 2020
310182e
Reverting linter errors on CnsNodeVmAttachment to honor backward comp…
RaunakShah Mar 9, 2020
7a078f7
Rename full sync test for files as it is conflicting with block volum…
chethanv28 Mar 11, 2020
712a339
Fix for PV stuck in terminating upon namespace deletion
r-shreesha Mar 16, 2020
985c7b6
Init deleteVolumes map in controller init for unit tests
chethanv28 Mar 18, 2020
e68467a
Fix test issue in metadatasyncer test for file volume.
lipingxue Mar 16, 2020
11fd009
bringing in PR 102 and 108
divyenpatel Mar 19, 2020
3c33b9c
re-arrange deployment manifest by vsphere releases
divyenpatel Mar 19, 2020
0909eb3
bringing in PR 88 from github
divyenpatel Mar 23, 2020
9ee866d
Implement exponential backoff for CnsNodeVmAttachment reconciler
lipingxue Mar 9, 2020
091da7c
Replace k8sclient with listers in full sync
RaunakShah Mar 19, 2020
eb91dc0
Handle case where full sync may incorrectly delete volumes.
RaunakShah Mar 23, 2020
32d02d3
Update GoCSI to v1.2.1
divyenpatel Mar 25, 2020
007f2aa
Fixed unit test that broke due to change in full sync code
RaunakShah Mar 26, 2020
8ef277b
Sync informers on startup
RaunakShah Mar 26, 2020
2595348
Fix crash in controller cause by informer sync
RaunakShah Mar 27, 2020
ea49feb
ignore default fstype ext4 supplied for file volume
divyenpatel Mar 27, 2020
19469c1
Shift NetPermissions to vSphere Config from Storage Class params
shalini-b Apr 1, 2020
cd838b0
Rename csi-vsphere.conf file to avoid E2E failures
shalini-b Apr 1, 2020
5b958d8
moving to github govmomi repository
divyenpatel Apr 1, 2020
1a62e42
Reduce the latency of create pods
Mar 20, 2020
19e57a4
Adding throughput parameters to supervisor client in guest cluster
RaunakShah Mar 16, 2020
d4ecd3a
Replace generated clients with controller-runtime clients for virtual…
RaunakShah Mar 26, 2020
88e4901
refactoring, fixing merge conflicts, pinning k8s dependencies and rem…
divyenpatel Apr 2, 2020
73d9a10
Removed - unnecessary use of fmt.Sprintf (S1039)
divyenpatel Apr 4, 2020
3f7d4b4
should omit comparison to bool constant
divyenpatel Apr 4, 2020
5db0167
Fixed – unused value of variables, unused variables and unused functions
divyenpatel Apr 4, 2020
3a18344
Fixed: should use make(map[string]string) instead (S1019)
divyenpatel Apr 4, 2020
609008c
staticcheck fixes
divyenpatel Apr 4, 2020
61c891d
fixing ReloadConfiguration for staticcheck verification
divyenpatel Apr 4, 2020
c567ac6
fixed check-vet failures
divyenpatel Apr 4, 2020
ed0f1af
fixed markdown linter check failures
divyenpatel Apr 4, 2020
febe91c
renamed example yamls
divyenpatel Apr 5, 2020
bf84575
setting updateStrategy to RollingUpdate for vsphere-csi-controller de…
divyenpatel Apr 5, 2020
672b73c
fixed integration-unit-test
divyenpatel Apr 6, 2020
c40b35c
changing maintainers of driver docker images
divyenpatel Apr 6, 2020
283dbf6
using new base image for driver
divyenpatel Apr 6, 2020
e47b1e3
fixed shellcheck failures
divyenpatel Apr 6, 2020
1db734c
addressed review comments
divyenpatel Apr 7, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
# Ignore unit-test coverrage report
coverage_report.out

# Ignore the generated kind-config yaml.
/test/integration/kind-config.yaml

# Ignore the unit-test conf files
/pkg/csi/service/vanilla/test_vsphere.conf
/pkg/csi/service/wcp/test_vsphere.conf
/pkg/syncer/test_vsphere.conf

# Ignore the build output.
/.build

Expand Down
85 changes: 58 additions & 27 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ export DIST_OUT ?= $(BUILD_OUT)/dist
################################################################################
## VERIFY GO VERSION ##
################################################################################
# Go 1.11+ required for Go modules.
GO_VERSION_EXP := "go1.11"
# Go 1.13 required for Go modules.
GO_VERSION_EXP := "go1.13"
GO_VERSION_ACT := $(shell a="$$(go version | awk '{print $$3}')" && test $$(printf '%s\n%s' "$${a}" "$(GO_VERSION_EXP)" | sort | tail -n 1) = "$${a}" && printf '%s' "$${a}")
ifndef GO_VERSION_ACT
$(error Requires Go $(GO_VERSION_EXP)+ for Go module support)
Expand Down Expand Up @@ -235,37 +235,68 @@ endif
TEST_FLAGS ?= -v -count=1
.PHONY: unit build-unit-tests
unit unit-test:
env -u VSPHERE_VCENTER -u VSPHERE_DATACENTER -u VSPHERE_PASSWORD -u VSPHERE_USER -u VSPHERE_DATASTORE_URL -u VSPHERE_STORAGE_POLICY_NAME -u VSPHERE_K8S_NODE -u VSPHERE_INSECURE -u KUBECONFIG go test $(TEST_FLAGS) $(PKGS_WITH_TESTS)
env -u VSPHERE_SERVER -u VSPHERE_DATACENTER -u VSPHERE_PASSWORD -u VSPHERE_USER -u VSPHERE_STORAGE_POLICY_NAME -u KUBECONFIG -u WCP_ENDPOINT -u WCP_PORT -u WCP_NAMESPACE -u TOKEN -u CERTIFICATE go test $(TEST_FLAGS) $(PKGS_WITH_TESTS)
build-unit-tests:
$(foreach pkg,$(PKGS_WITH_TESTS),go test $(TEST_FLAGS) -c $(pkg); )

INTEGRATION_TEST_PKGS ?=
.PHONY: integration-unit-test
integration-unit-test:
ifndef VSPHERE_VCENTER
$(error Requires VSPHERE_VCENTER from a deployed testbed to run integration-unit-test)
ifndef TYPE
$(error Requires TYPE from a deployed testbed to run integration-unit-test)
else
ifeq ($(TYPE), guestcluster)
ifndef WCP_ENDPOINT
$(error Requires WCP_ENDPOINT from a deployed testbed to run integration-unit-test)
endif
ifndef WCP_NAMESPACE
$(error Requires WCP_NAMESPACE from a deployed testbed to run integration-unit-test)
endif
ifndef SUPERVISOR_STORAGE_CLASS
$(error Requires SUPERVISOR_STORAGE_CLASS from a deployed testbed to run integration-unit-test)
endif
ifndef TOKEN
$(error Requires TOKEN from a deployed testbed to run integration-unit-test)
endif
ifndef CERTIFICATE
$(error Requires CERTIFICATE from a deployed testbed to run integration-unit-test)
else
$(eval INTEGRATION_TEST_PKGS += ./pkg/csi/service/wcpguest)
endif
else
ifndef VSPHERE_VCENTER
$(error Requires VSPHERE_VCENTER from a deployed testbed to run integration-unit-test)
endif
ifndef VSPHERE_USER
$(error Requires VSPHERE_USER from a deployed testbed to run integration-unit-test)
endif
ifndef VSPHERE_PASSWORD
$(error Requires VSPHERE_PASSWORD from a deployed testbed to run integration-unit-test)
endif
ifndef VSPHERE_DATACENTER
$(error Requires VSPHERE_DATACENTER from a deployed testbed to run integration-unit-test)
endif
ifndef VSPHERE_DATASTORE_URL
$(error Requires VSPHERE_DATASTORE_URL from a deployed testbed to run integration-unit-test)
endif
ifndef VSPHERE_INSECURE
$(error Requires VSPHERE_INSECURE from a deployed testbed to run integration-unit-test)
endif
ifeq ($(TYPE), supervisorcluster)
$(eval INTEGRATION_TEST_PKGS += ./pkg/csi/service/wcp ./pkg/syncer)
else
ifndef VSPHERE_K8S_NODE
$(error Requires VSPHERE_K8S_NODE from a deployed testbed to run integration-unit-test)
endif
ifndef KUBECONFIG
$(error Requires KUBECONFIG from a deployed testbed to run integration-unit-test)
else
$(eval INTEGRATION_TEST_PKGS += ./pkg/csi/service/vanilla ./pkg/syncer)
endif
endif
endif
endif
ifndef VSPHERE_USER
$(error Requires VSPHERE_USER from a deployed testbed to run integration-unit-test)
endif
ifndef VSPHERE_PASSWORD
$(error Requires VSPHERE_PASSWORD from a deployed testbed to run integration-unit-test)
endif
ifndef VSPHERE_DATACENTER
$(error Requires VSPHERE_DATACENTER from a deployed testbed to run integration-unit-test)
endif
ifndef VSPHERE_DATASTORE_URL
$(error Requires VSPHERE_DATASTORE_URL from a deployed testbed to run integration-unit-test)
endif
ifndef VSPHERE_K8S_NODE
$(error Requires VSPHERE_K8S_NODE from a deployed testbed to run integration-unit-test)
endif
ifndef KUBECONFIG
$(error Requires KUBECONFIG from a deployed testbed to run integration-unit-test)
endif
ifndef VSPHERE_INSECURE
$(error Requires VSPHERE_INSECURE from a deployed testbed to run integration-unit-test)
endif
go test $(TEST_FLAGS) -tags=integration-unit ./pkg/csi/service/cns ./pkg/syncer
go test $(TEST_FLAGS) -tags=integration-unit $(INTEGRATION_TEST_PKGS)

# The default test target.
.PHONY: test build-tests
Expand Down
89 changes: 82 additions & 7 deletions cmd/syncer/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,21 +17,96 @@ limitations under the License.
package main

import (
"context"
"flag"
"os"

"k8s.io/klog"
"sigs.k8s.io/vsphere-csi-driver/pkg/csi/service/logger"

metadatasyncer "sigs.k8s.io/vsphere-csi-driver/pkg/syncer"
"github.com/kubernetes-csi/csi-lib-utils/leaderelection"
cnstypes "github.com/vmware/govmomi/cns/types"

csitypes "sigs.k8s.io/vsphere-csi-driver/pkg/csi/types"
k8s "sigs.k8s.io/vsphere-csi-driver/pkg/kubernetes"
"sigs.k8s.io/vsphere-csi-driver/pkg/syncer"
"sigs.k8s.io/vsphere-csi-driver/pkg/syncer/cnsoperator/manager"
"sigs.k8s.io/vsphere-csi-driver/pkg/syncer/podlistener"
"sigs.k8s.io/vsphere-csi-driver/pkg/syncer/types"
)

var (
enableLeaderElection = flag.Bool("leader-election", false, "Enable leader election.")
)

// main is ignored when this package is built as a go plug-in.
// main for vsphere syncer
func main() {
klog.InitFlags(nil)
flag.Parse()
metadataSyncer := metadatasyncer.NewInformer()
if err := metadataSyncer.Init(); err != nil {
klog.Errorf("Error initializing Metadata Syncer")
// run will be executed if this instance is elected as the leader
// or if leader election is not enabled
var run func(ctx context.Context)
var err error

logType := logger.LogLevel(os.Getenv(logger.EnvLoggerLevel))
logger.SetLoggerLevel(logType)
ctx, log := logger.GetNewContextWithLogger()

clusterFlavor := cnstypes.CnsClusterFlavor(os.Getenv(csitypes.EnvClusterFlavor))
configInfo, err := types.InitConfigInfo(ctx)
if err != nil {
log.Errorf("failed to initialize the configInfo. Err: %+v", err)
os.Exit(1)
}

// Initialize PodListener for every instance of vsphere-syncer in the Supervisor
// Cluster, independent of whether leader election is enabled.
// PodListener should run on every node where csi controller can run.
if clusterFlavor == cnstypes.CnsClusterFlavorWorkload {
go func() {
if err := podlistener.InitPodListenerService(ctx); err != nil {
log.Errorf("Error initializing Pod Listener gRPC sever. Error: %+v", err)
os.Exit(1)
}
}()
}

// Initialize syncer components that are dependant on the outcome of leader election, if enabled.
run = initSyncerComponents(ctx, clusterFlavor, configInfo)

if !*enableLeaderElection {
run(context.TODO())
} else {
k8sClient, err := k8s.NewClient(ctx)
if err != nil {
log.Errorf("Creating Kubernetes client failed. Err: %v", err)
os.Exit(1)
}
lockName := "vsphere-syncer"
le := leaderelection.NewLeaderElection(k8sClient, lockName, run)

if err := le.Run(); err != nil {
log.Fatalf("Error initializing leader election: %v", err)
}
}
}

// initSyncerComponents initializes syncer components that are dependant on the leader election algorithm.
// This function is only called by the leader instance of vsphere-syncer, if enabled.
// TODO: Change name from initSyncerComponents to init<Name>Components where <Name> will be the name of this container
func initSyncerComponents(ctx context.Context, clusterFlavor cnstypes.CnsClusterFlavor, configInfo *types.ConfigInfo) func(ctx context.Context) {
return func(ctx context.Context) {
log := logger.GetLogger(ctx)
// Initialize CNS Operator for Supervisor clusters
if clusterFlavor == cnstypes.CnsClusterFlavorWorkload {
go func() {
if err := manager.InitCnsOperator(configInfo); err != nil {
log.Errorf("Error initializing Cns Operator. Error: %+v", err)
os.Exit(1)
}
}()
}
if err := syncer.InitMetadataSyncer(ctx, clusterFlavor, configInfo); err != nil {
log.Errorf("Error initializing Metadata Syncer. Error: %+v", err)
os.Exit(1)
}
}
}
8 changes: 3 additions & 5 deletions cmd/vsphere-csi/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,20 +21,18 @@ import (
"flag"

"github.com/rexray/gocsi"
"k8s.io/klog"

"sigs.k8s.io/vsphere-csi-driver/pkg/csi/provider"
"sigs.k8s.io/vsphere-csi-driver/pkg/csi/service"
csitypes "sigs.k8s.io/vsphere-csi-driver/pkg/csi/types"
)

// main is ignored when this package is built as a go plug-in.
func main() {
klog.InitFlags(nil)
flag.Parse()
gocsi.Run(
context.Background(),
service.Name,
"A CSI plugin for VMware vSphere storage",
csitypes.Name,
"A CSI plugin for vSphere Cloud Native Storage",
usage,
provider.New())
}
Expand Down
17 changes: 0 additions & 17 deletions example/example-pod.yaml

This file was deleted.

17 changes: 17 additions & 0 deletions example/vanilla-k8s-block-driver/example-pod.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
apiVersion: v1
kind: Pod
metadata:
name: example-vanilla-block-pod
spec:
containers:
- name: test-container
image: gcr.io/google_containers/busybox:1.24
command: ["/bin/sh", "-c", "echo 'hello' > /mnt/volume1/index.html && chmod o+rX /mnt /mnt/volume1/index.html && while true ; do sleep 2 ; done"]
volumeMounts:
- name: test-volume
mountPath: /mnt/volume1
restartPolicy: Never
volumes:
- name: test-volume
persistentVolumeClaim:
claimName: example-vanilla-block-pvc
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ metadata:
name: example-vanilla-block-pvc
spec:
accessModes:
- ReadWriteOnce
- ReadWriteOnce
resources:
requests:
storage: 5Gi
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ allowedTopologies:
- key: failure-domain.beta.kubernetes.io/region
values:
- k8s-region-eu
- k8s-region-us
- k8s-region-us
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ allowedTopologies:
- key: failure-domain.beta.kubernetes.io/region
values:
- k8s-region-us
- k8s-region-eu
- k8s-region-eu
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ allowedTopologies:
- k8s-zone-us-west
- key: failure-domain.beta.kubernetes.io/region
values:
- k8s-region-us
- k8s-region-us
12 changes: 12 additions & 0 deletions example/vanilla-k8s-block-driver/example-sc-volume-expansion.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
kind: StorageClass
apiVersion: storage.k8s.io/v1
metadata:
name: example-vanilla-block-sc
namespace: kube-system
annotations:
storageclass.kubernetes.io/is-default-class: "false"
provisioner: csi.vsphere.vmware.com
allowVolumeExpansion: true
parameters:
# DatastoreURL: "ds:///vmfs/volumes/vsan:52cdfa80721ff516-ea1e993113acfc77/" # Optional Parameter
# StoragePolicyName: "vSAN Default Storage Policy" # Optional Parameter
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ provisioner: csi.vsphere.vmware.com
parameters:
datastoreurl: "ds:///vmfs/volumes/vsan:52cdfa80721ff516-ea1e993113acfc77/" #Optional Parameter
storagepolicyname: "vSAN Default Storage Policy" #Optional Parameter
fstype: "ext4" #Optional Parameter
csi.storage.k8s.io/fstype: "ext4" #Optional Parameter
9 changes: 9 additions & 0 deletions example/vanilla-k8s-block-driver/vsphere.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
[Global]
cluster-id = "unique-kubernetes-cluster-id"

[VirtualCenter "1.2.3.4"]
insecure-flag = "true"
user = "vcenter username"
password = "vcenter password"
port = "443"
datacenters = "list of comma seperated datacenters where node VMs are present"
36 changes: 36 additions & 0 deletions example/vanilla-k8s-file-driver/example-csi-vsphere.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
[Global]
cluster-id = "unique-kubernetes-cluster-id"

# This config represents default values taken when net permissions are not mentioned
# Each Net Permission config section should have a unique identifier as a string.
# The character `#` is reserved to store default config
[NetPermissions "#"]
Ips = "*" # All Ips
Permissions = "READ_WRITE"
RootSquash = false

[NetPermissions "B"]
Ips = "10.20.20.0/24"
Permissions = "READ_ONLY"
RootSquash = true

# If one of the parameters is not mentioned, its default values are assumed.
# For example SquashRoot = false in this configuration
[NetPermissions "C"]
Ips = "10.30.30.0/24"
Permissions = "NO_ACCESS"

# Permissions will assume a default value of "READ_WRITE" in this configuration
[NetPermissions "D"]
Ips = "10.30.10.0/24"
RootSquash = true

[NetPermissions "E"]
Ips = "10.30.1.0/24"

[VirtualCenter "1.1.1.1"]
insecure-flag = "true"
user = "vcenter username"
password = "vcenter password"
port = "443"
datacenters = "list of comma seperated datacenters where node VMs are present"
Loading