This job view page is being replaced by Spyglass soon. Check out the new job view.
PRandyzhangx: fix: respect VnetResourceGroup in private link creation
ResultFAILURE
Tests 0 failed / 0 succeeded
Started2021-07-23 09:48
Elapsed4m3s
Revisionfee37f7fffd22321ab3bb65602b06f316aca446f
Refs 744

No Test Failures!


Error lines from build-log.txt

Activated service account credentials for: [pr-kubekins@kubernetes-jenkins-pull.iam.gserviceaccount.com]
+ WRAPPED_COMMAND_PID=31
+ wait 31
+ make verify
go test -v -race ./pkg/... ./test/utils/credentials
=== RUN   TestGetCloudProvider
E0723 09:50:05.740939   11284 azure_config.go:45] Failed to get cloud-config from secret: failed to get secret /: resource name may not be empty
--- PASS: TestGetCloudProvider (0.01s)
=== RUN   TestUpdateSubnetServiceEndpoints
=== RUN   TestUpdateSubnetServiceEndpoints/[fail]_no_subnet
=== RUN   TestUpdateSubnetServiceEndpoints/[success]_subnetPropertiesFormat_is_nil
=== RUN   TestUpdateSubnetServiceEndpoints/[success]_ServiceEndpoints_is_nil
=== RUN   TestUpdateSubnetServiceEndpoints/[success]_storageService_does_not_exists
=== RUN   TestUpdateSubnetServiceEndpoints/[success]_storageService_already_exists
=== RUN   TestUpdateSubnetServiceEndpoints/[fail]_SubnetsClient_is_nil
--- PASS: TestUpdateSubnetServiceEndpoints (0.00s)
    --- PASS: TestUpdateSubnetServiceEndpoints/[fail]_no_subnet (0.00s)
    --- PASS: TestUpdateSubnetServiceEndpoints/[success]_subnetPropertiesFormat_is_nil (0.00s)
    --- PASS: TestUpdateSubnetServiceEndpoints/[success]_ServiceEndpoints_is_nil (0.00s)
    --- PASS: TestUpdateSubnetServiceEndpoints/[success]_storageService_does_not_exists (0.00s)
    --- PASS: TestUpdateSubnetServiceEndpoints/[success]_storageService_already_exists (0.00s)
    --- PASS: TestUpdateSubnetServiceEndpoints/[fail]_SubnetsClient_is_nil (0.00s)
=== RUN   TestGetFileSvcClient
--- PASS: TestGetFileSvcClient (0.00s)
=== RUN   TestCreateFileShare
=== RUN   TestCreateFileShare/ShareOptions_empty
=== RUN   TestCreateFileShare/AccountName_invalid
--- PASS: TestCreateFileShare (0.00s)
... skipping 23 lines ...
--- PASS: TestIsCorruptedDir (0.00s)
=== RUN   TestNewDriver
--- PASS: TestNewDriver (0.00s)
=== RUN   TestGetFileURL
--- PASS: TestGetFileURL (0.00s)
=== RUN   TestGetAccountInfo
W0723 09:50:05.748957   11284 azurefile.go:492] parsing volumeID(uniqe-volumeid-nfs) return with error: error parsing volume id: "uniqe-volumeid-nfs", should at least contain two #
--- PASS: TestGetAccountInfo (0.00s)
=== RUN   TestCreateDisk
--- PASS: TestCreateDisk (4.43s)
=== RUN   TestGetFileShareQuota
--- PASS: TestGetFileShareQuota (0.00s)
=== RUN   TestRun
... skipping 120 lines ...
    --- PASS: TestCreateVolume/Valid_request (0.00s)
    --- PASS: TestCreateVolume/invalid_parameter (0.00s)
=== RUN   TestDeleteVolume
=== RUN   TestDeleteVolume/Volume_ID_missing
=== RUN   TestDeleteVolume/Controller_capability_missing
=== RUN   TestDeleteVolume/Invalid_volume_ID
E0723 09:50:10.212071   11284 controllerserver.go:453] GetFileShareInfo(vol_1) in DeleteVolume failed with error: error parsing volume id: "vol_1", should at least contain two #
=== RUN   TestDeleteVolume/Delete_file_share_returns_error
=== RUN   TestDeleteVolume/Valid_request
I0723 09:50:10.213040   11284 azurefile.go:674] remove tag(skip-matching) on account(f5713de20cde511e8ba4900) resourceGroup(vol_1)
W0723 09:50:10.213164   11284 controllerserver.go:484] RemoveStorageAccountTag(skip-matching) under rg(vol_1) account(f5713de20cde511e8ba4900) failed with Retriable: false, RetryAfter: 0s, HTTPStatusCode: 0, RawError: StorageAccountClient is nil
--- PASS: TestDeleteVolume (0.00s)
    --- PASS: TestDeleteVolume/Volume_ID_missing (0.00s)
    --- PASS: TestDeleteVolume/Controller_capability_missing (0.00s)
    --- PASS: TestDeleteVolume/Invalid_volume_ID (0.00s)
    --- PASS: TestDeleteVolume/Delete_file_share_returns_error (0.00s)
    --- PASS: TestDeleteVolume/Valid_request (0.00s)
=== RUN   TestControllerGetVolume
--- PASS: TestControllerGetVolume (0.00s)
=== RUN   TestControllerGetCapabilities
--- PASS: TestControllerGetCapabilities (0.00s)
=== RUN   TestValidateVolumeCapabilities
W0723 09:50:10.214078   11284 azurefile.go:492] parsing volumeID(vol_1) return with error: error parsing volume id: "vol_1", should at least contain two #
--- PASS: TestValidateVolumeCapabilities (0.00s)
=== RUN   TestControllerPublishVolume
W0723 09:50:10.215537   11284 azurefile.go:492] parsing volumeID(vol_1) return with error: error parsing volume id: "vol_1", should at least contain two #
--- PASS: TestControllerPublishVolume (0.00s)
=== RUN   TestControllerUnpublishVolume
--- PASS: TestControllerUnpublishVolume (0.00s)
=== RUN   TestCreateSnapshot
W0723 09:50:10.217234   11284 azurefile.go:492] parsing volumeID(vol_1) return with error: error parsing volume id: "vol_1", should at least contain two #
--- PASS: TestCreateSnapshot (0.00s)
=== RUN   TestDeleteSnapshot
W0723 09:50:10.217682   11284 azurefile.go:492] parsing volumeID(vol_1#) return with error: error parsing volume id: "vol_1#", should at least contain two #
--- PASS: TestDeleteSnapshot (0.00s)
=== RUN   TestControllerExpandVolume
=== RUN   TestControllerExpandVolume/Volume_ID_missing
=== RUN   TestControllerExpandVolume/Volume_Capacity_range_missing
=== RUN   TestControllerExpandVolume/Volume_capabilities_missing
=== RUN   TestControllerExpandVolume/Invalid_Volume_ID
... skipping 10 lines ...
    --- PASS: TestControllerExpandVolume/Volume_capabilities_missing (0.00s)
    --- PASS: TestControllerExpandVolume/Invalid_Volume_ID (0.00s)
    --- PASS: TestControllerExpandVolume/Disk_name_not_empty (0.00s)
    --- PASS: TestControllerExpandVolume/Resize_file_share_returns_error (0.00s)
    --- PASS: TestControllerExpandVolume/Valid_request (0.00s)
=== RUN   TestGetShareURL
W0723 09:50:10.221074   11284 azurefile.go:492] parsing volumeID(vol_1) return with error: error parsing volume id: "vol_1", should at least contain two #
--- PASS: TestGetShareURL (0.00s)
=== RUN   TestGetServiceURL
W0723 09:50:10.221559   11284 azurefile.go:492] parsing volumeID(vol_1) return with error: error parsing volume id: "vol_1", should at least contain two #
E0723 09:50:10.221779   11284 controllerserver.go:866] parse serviceURLTemplate error: parse "https://^f5713de20cde511e8ba4900.file.abc": invalid character "^" in host name
--- PASS: TestGetServiceURL (0.00s)
=== RUN   TestSnapshotExists
W0723 09:50:10.222089   11284 azurefile.go:492] parsing volumeID(vol_1) return with error: error parsing volume id: "vol_1", should at least contain two #
--- PASS: TestSnapshotExists (0.00s)
=== RUN   TestGetCapacity
--- PASS: TestGetCapacity (0.00s)
=== RUN   TestListVolumes
--- PASS: TestListVolumes (0.00s)
=== RUN   TestListSnapshots
... skipping 15 lines ...
--- PASS: TestGetPluginCapabilities (0.00s)
=== RUN   TestNodeGetInfo
--- PASS: TestNodeGetInfo (0.00s)
=== RUN   TestNodeGetCapabilities
--- PASS: TestNodeGetCapabilities (0.00s)
=== RUN   TestNodePublishVolume
E0723 09:50:10.226169   11284 nodeserver.go:432] MakeDir failed on target: /home/prow/go/src/sigs.k8s.io/azurefile-csi-driver/pkg/azurefile/azure.go (mkdir /home/prow/go/src/sigs.k8s.io/azurefile-csi-driver/pkg/azurefile/azure.go: not a directory)
--- PASS: TestNodePublishVolume (0.00s)
=== RUN   TestNodeUnpublishVolume
W0723 09:50:10.227254   11284 mount_helper_common.go:34] Warning: Unmount skipped because path does not exist: /home/prow/go/src/sigs.k8s.io/azurefile-csi-driver/pkg/azurefile/abc.go
--- PASS: TestNodeUnpublishVolume (0.00s)
=== RUN   TestNodeStageVolume
W0723 09:50:10.228118   11284 azurefile.go:492] parsing volumeID(vol_1) return with error: error parsing volume id: "vol_1", should at least contain two #
I0723 09:50:10.228798   11284 mount_linux.go:408] Disk "/home/prow/go/src/sigs.k8s.io/azurefile-csi-driver/pkg/azurefile/proxy-mount/test_disk" appears to be unformatted, attempting to format as type: "ext4" with options: [-F -m0 /home/prow/go/src/sigs.k8s.io/azurefile-csi-driver/pkg/azurefile/proxy-mount/test_disk]
E0723 09:50:10.228975   11284 mount_linux.go:414] format of disk "/home/prow/go/src/sigs.k8s.io/azurefile-csi-driver/pkg/azurefile/proxy-mount/test_disk" failed: type:("ext4") target:("/home/prow/go/src/sigs.k8s.io/azurefile-csi-driver/pkg/azurefile/source_test") options:("barrier=1,errors=remount-ro,loop,noatime,defaults") errcode:(formatting failed) output:() 
I0723 09:50:10.229436   11284 mount_linux.go:408] Disk "/home/prow/go/src/sigs.k8s.io/azurefile-csi-driver/pkg/azurefile/proxy-mount/test_disk" appears to be unformatted, attempting to format as type: "ext4" with options: [-F -m0 /home/prow/go/src/sigs.k8s.io/azurefile-csi-driver/pkg/azurefile/proxy-mount/test_disk]
I0723 09:50:10.229508   11284 mount_linux.go:418] Disk successfully formatted (mkfs): ext4 - /home/prow/go/src/sigs.k8s.io/azurefile-csi-driver/pkg/azurefile/proxy-mount/test_disk /home/prow/go/src/sigs.k8s.io/azurefile-csi-driver/pkg/azurefile/source_test
--- PASS: TestNodeStageVolume (0.00s)
=== RUN   TestNodeUnstageVolume
W0723 09:50:10.230352   11284 mount_helper_common.go:34] Warning: Unmount skipped because path does not exist: /home/prow/go/src/sigs.k8s.io/azurefile-csi-driver/pkg/azurefile/abc.go
W0723 09:50:10.230431   11284 mount_helper_common.go:34] Warning: Unmount skipped because path does not exist: /home/prow/go/src/sigs.k8s.io/azurefile-csi-driver/pkg/azurefile/proxy-mount
--- PASS: TestNodeUnstageVolume (0.00s)
=== RUN   TestNodeGetVolumeStats
--- PASS: TestNodeGetVolumeStats (0.01s)
=== RUN   TestEnsureMountPoint
W0723 09:50:10.238155   11284 nodeserver.go:423] ReadDir ./false_is_likely_target failed with open ./false_is_likely_target: no such file or directory, unmount this directory
E0723 09:50:10.238248   11284 nodeserver.go:432] MakeDir failed on target: ./azure.go (mkdir ./azure.go: not a directory)
--- PASS: TestEnsureMountPoint (0.00s)
=== RUN   TestMakeDir
--- PASS: TestMakeDir (0.00s)
=== RUN   TestNodeExpandVolume
--- PASS: TestNodeExpandVolume (0.00s)
=== RUN   TestSimpleLockEntry
... skipping 270 lines ...
-					vnetResourceGroup = az.VnetResourceGroup
-				}
 				// Get properties of the storageAccount
-				storageAccount, err := az.StorageAccountClient.GetProperties(ctx, resourceGroup, accountName)
+				storageAccount, err := az.StorageAccountClient.GetProperties(ctx, az.ResourceGroup, accountName)
 				if err != nil {
-					return "", "", fmt.Errorf("Failed to get the properties of storage account(%s), resourceGroup(%s), error: %v", accountName, resourceGroup, err)
+					return "", "", fmt.Errorf("Failed to get the properties of storage account(%s), resourceGroup(%s), error: %v", accountName, az.ResourceGroup, err)
 				}
 
 				// Create private endpoint
 				privateEndpointName := accountName + "-pvtendpoint"
-				if err := az.createPrivateEndpoint(ctx, accountName, storageAccount.ID, privateEndpointName, vnetResourceGroup); err != nil {
-					return "", "", fmt.Errorf("Failed to create private endpoint for storage account(%s), resourceGroup(%s), error: %v", accountName, vnetResourceGroup, err)
+				if err := az.createPrivateEndpoint(ctx, accountName, storageAccount.ID, privateEndpointName); err != nil {
+					return "", "", fmt.Errorf("Failed to create private endpoint for storage account(%s), resourceGroup(%s), error: %v", accountName, az.ResourceGroup, err)
 				}
 
 				// Create DNS zone
-				if err := az.createPrivateDNSZone(ctx, vnetResourceGroup); err != nil {
-					return "", "", fmt.Errorf("Failed to create private DNS zone(%s) in resourceGroup(%s), error: %v", PrivateDNSZoneName, vnetResourceGroup, err)
+				if err := az.createPrivateDNSZone(ctx); err != nil {
+					return "", "", fmt.Errorf("Failed to create private DNS zone(%s) in resourceGroup(%s), error: %v", PrivateDNSZoneName, az.ResourceGroup, err)
 				}
 
 				// Create virtual link to the zone private DNS zone
 				vNetLinkName := accountName + "-vnetlink"
-				if err := az.createVNetLink(ctx, vNetLinkName, vnetResourceGroup); err != nil {
-					return "", "", fmt.Errorf("Failed to create virtual link for vnet(%s) and DNS Zone(%s) in resourceGroup(%s), error: %v", az.VnetName, PrivateDNSZoneName, vnetResourceGroup, err)
+				if err := az.createVNetLink(ctx, vNetLinkName); err != nil {
+					return "", "", fmt.Errorf("Failed to create virtual link for vnet(%s) and DNS Zone(%s) in resourceGroup(%s), error: %v", az.VnetName, PrivateDNSZoneName, az.ResourceGroup, err)
 				}
 
 				// Create dns zone group
 				dnsZoneGroupName := accountName + "-dnszonegroup"
-				if err := az.createPrivateDNSZoneGroup(ctx, dnsZoneGroupName, privateEndpointName, vnetResourceGroup); err != nil {
-					return "", "", fmt.Errorf("Failed to create private DNS zone group - privateEndpoint(%s), vNetName(%s), resourceGroup(%s), error: %v", privateEndpointName, az.VnetName, vnetResourceGroup, err)
+				if err := az.createPrivateDNSZoneGroup(ctx, dnsZoneGroupName, privateEndpointName); err != nil {
+					return "", "", fmt.Errorf("Failed to create private DNS zone group - privateEndpoint(%s), vNetName(%s), resourceGroup(%s), error: %v", privateEndpointName, az.VnetName, az.ResourceGroup, err)
 				}
 			}
 		}
@@ -281,16 +277,17 @@ func (az *Cloud) EnsureStorageAccount(accountOptions *AccountOptions, genAccount
 	return accountName, accountKey, nil
 }
 
-func (az *Cloud) createPrivateEndpoint(ctx context.Context, accountName string, accountID *string, privateEndpointName, vnetResourceGroup string) error {
+func (az *Cloud) createPrivateEndpoint(ctx context.Context, accountName string, accountID *string, privateEndpointName string) error {
 	klog.V(2).Infof("Creating private endpoint(%s) for account (%s)", privateEndpointName, accountName)
-
-	subnet, _, err := az.getSubnet(az.VnetName, az.SubnetName)
-	if err != nil {
-		return err
+	subnet, rerr := az.SubnetsClient.Get(ctx, az.ResourceGroup, az.VnetName, az.SubnetName, "")
+	if rerr != nil {
+		return rerr.Error()
 	}
+
 	// Disable the private endpoint network policies before creating private endpoint
 	subnet.SubnetPropertiesFormat.PrivateEndpointNetworkPolicies = network.VirtualNetworkPrivateEndpointNetworkPoliciesDisabled
-	if rerr := az.SubnetsClient.CreateOrUpdate(ctx, vnetResourceGroup, az.VnetName, az.SubnetName, subnet); rerr != nil {
+	rerr = az.SubnetsClient.CreateOrUpdate(ctx, az.ResourceGroup, az.VnetName, az.SubnetName, subnet)
+	if rerr != nil {
 		return rerr.Error()
 	}
 
@@ -308,39 +305,44 @@ func (az *Cloud) createPrivateEndpoint(ctx context.Context, accountName string,
 		Location:                  &az.Location,
 		PrivateEndpointProperties: &network.PrivateEndpointProperties{Subnet: &subnet, PrivateLinkServiceConnections: &privateLinkServiceConnections},
 	}
-	return az.privateendpointclient.CreateOrUpdate(ctx, vnetResourceGroup, privateEndpointName, privateEndpoint, true)
+	if err := az.privateendpointclient.CreateOrUpdate(ctx, az.ResourceGroup, privateEndpointName, privateEndpoint, true); err != nil {
+		return err
+	}
+	return nil
 }
 
-func (az *Cloud) createPrivateDNSZone(ctx context.Context, vnetResourceGroup string) error {
-	klog.V(2).Infof("Creating private dns zone(%s) in resourceGroup (%s)", PrivateDNSZoneName, vnetResourceGroup)
+func (az *Cloud) createPrivateDNSZone(ctx context.Context) error {
+	klog.V(2).Infof("Creating private dns zone(%s) in resourceGroup (%s)", PrivateDNSZoneName, az.ResourceGroup)
 	location := LocationGlobal
 	privateDNSZone := privatedns.PrivateZone{Location: &location}
-	if err := az.privatednsclient.CreateOrUpdate(ctx, vnetResourceGroup, PrivateDNSZoneName, privateDNSZone, true); err != nil {
+	if err := az.privatednsclient.CreateOrUpdate(ctx, az.ResourceGroup, PrivateDNSZoneName, privateDNSZone, true); err != nil {
 		if strings.Contains(err.Error(), "exists already") {
-			klog.V(2).Infof("private dns zone(%s) in resourceGroup (%s) already exists", PrivateDNSZoneName, vnetResourceGroup)
+			klog.V(2).Infof("private dns zone(%s) in resourceGroup (%s) already exists", PrivateDNSZoneName, az.ResourceGroup)
 			return nil
 		}
-		return err
 	}
 	return nil
 }
 
-func (az *Cloud) createVNetLink(ctx context.Context, vNetLinkName, vnetResourceGroup string) error {
-	klog.V(2).Infof("Creating virtual link for vnet(%s) and DNS Zone(%s) in resourceGroup(%s)", vNetLinkName, PrivateDNSZoneName, vnetResourceGroup)
+func (az *Cloud) createVNetLink(ctx context.Context, vNetLinkName string) error {
+	klog.V(2).Infof("Creating virtual link for vnet(%s) and DNS Zone(%s) in resourceGroup(%s)", vNetLinkName, PrivateDNSZoneName, az.ResourceGroup)
 	location := LocationGlobal
-	vnetID := fmt.Sprintf("/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Network/virtualNetworks/%s", az.SubscriptionID, vnetResourceGroup, az.VnetName)
+	vnetID := fmt.Sprintf("/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Network/virtualNetworks/%s", az.SubscriptionID, az.ResourceGroup, az.VnetName)
 	parameters := privatedns.VirtualNetworkLink{
 		Location: &location,
... skipping 5 lines ...
+	if err := az.virtualNetworkLinksClient.CreateOrUpdate(ctx, az.ResourceGroup, PrivateDNSZoneName, vNetLinkName, parameters, false); err != nil {
+		return err
+	}
+	return nil
 }
 
-func (az *Cloud) createPrivateDNSZoneGroup(ctx context.Context, dnsZoneGroupName, privateEndpointName, vnetResourceGroup string) error {
-	klog.V(2).Infof("Creating private DNS zone group(%s) with privateEndpoint(%s), vNetName(%s), resourceGroup(%s)", dnsZoneGroupName, privateEndpointName, az.VnetName, vnetResourceGroup)
-	privateDNSZoneID := fmt.Sprintf("/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Network/privateDnsZones/%s", az.SubscriptionID, vnetResourceGroup, PrivateDNSZoneName)
+func (az *Cloud) createPrivateDNSZoneGroup(ctx context.Context, dnsZoneGroupName string, privateEndpointName string) error {
+	klog.V(2).Infof("Creating private DNS zone group(%s) with privateEndpoint(%s), vNetName(%s), resourceGroup(%s)", dnsZoneGroupName, privateEndpointName, az.VnetName, az.ResourceGroup)
+	privateDNSZoneID := fmt.Sprintf("/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Network/privateDnsZones/%s", az.SubscriptionID, az.ResourceGroup, PrivateDNSZoneName)
 	dnsZoneName := PrivateDNSZoneName
 	privateDNSZoneConfig := network.PrivateDNSZoneConfig{
 		Name: &dnsZoneName,
@@ -353,7 +355,10 @@ func (az *Cloud) createPrivateDNSZoneGroup(ctx context.Context, dnsZoneGroupName
... skipping 6 lines ...
+	}
+	return nil
 }
 
 // AddStorageAccountTags add tags to storage account

error
make: *** [Makefile:69: verify] Error 1
+ EXIT_VALUE=2
+ set +o xtrace