From 52585babaf0f047ba021d6e6fb5ed61f217ee5a4 Mon Sep 17 00:00:00 2001 From: Elijah Rodriguez-Beltran Date: Fri, 30 May 2025 21:29:17 +0000 Subject: [PATCH 01/51] Add hajiler to owners --- OWNERS | 1 + 1 file changed, 1 insertion(+) diff --git a/OWNERS b/OWNERS index 386d11011..7540388a0 100644 --- a/OWNERS +++ b/OWNERS @@ -9,6 +9,7 @@ reviewers: - tyuchn - tonyzhc - juliankatz + - hajiler approvers: - amacaskill - leiyiz From 72c74a385f5ce8d622a541a4006ae04c5529059e Mon Sep 17 00:00:00 2001 From: Engin Akdemir Date: Fri, 13 Jun 2025 23:08:17 +0000 Subject: [PATCH 02/51] Release 1.20 cut details for v1.20.0 --- README.md | 2 +- .../kubernetes/images/prow-stable-sidecar-rc-master/image.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index a87be0f7f..9f03e6257 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,7 @@ lifecycle of Google Compute Engine Persistent Disks. ## Project Status Status: GA -Latest stable image: `registry.k8s.io/cloud-provider-gcp/gcp-compute-persistent-disk-csi-driver:v1.17.2` +Latest stable image: `registry.k8s.io/cloud-provider-gcp/gcp-compute-persistent-disk-csi-driver:v1.20.0` ### Test Status diff --git a/deploy/kubernetes/images/prow-stable-sidecar-rc-master/image.yaml b/deploy/kubernetes/images/prow-stable-sidecar-rc-master/image.yaml index 5b01c9992..9d0b3f8a7 100644 --- a/deploy/kubernetes/images/prow-stable-sidecar-rc-master/image.yaml +++ b/deploy/kubernetes/images/prow-stable-sidecar-rc-master/image.yaml @@ -48,6 +48,6 @@ metadata: imageTag: name: registry.k8s.io/cloud-provider-gcp/gcp-compute-persistent-disk-csi-driver newName: gcr.io/k8s-staging-cloud-provider-gcp/gcp-compute-persistent-disk-csi-driver - newTag: "v1.17.12" + newTag: "v1.20.0" --- From a9a2d90593f36050b197c7576b2970e8420b99e9 Mon Sep 17 00:00:00 2001 From: ivanLeont Date: Tue, 17 Jun 2025 17:04:20 -0500 Subject: [PATCH 03/51] Added support for NVME Hyperdisks on Windows Nodes --- pkg/mount-manager/safe-mounter-v1_windows.go | 205 +++++++++++++++++ .../safe-mounter-v1beta_windows.go | 208 ++++++++++++++++++ pkg/resizefs/resizefs_windows.go | 11 + 3 files changed, 424 insertions(+) diff --git a/pkg/mount-manager/safe-mounter-v1_windows.go b/pkg/mount-manager/safe-mounter-v1_windows.go index 92c2b5791..65f6642b4 100644 --- a/pkg/mount-manager/safe-mounter-v1_windows.go +++ b/pkg/mount-manager/safe-mounter-v1_windows.go @@ -18,12 +18,16 @@ package mountmanager import ( "context" + "encoding/json" "errors" "fmt" + "io" + "net/http" "os" "path/filepath" "strconv" "strings" + "time" diskapi "github.com/kubernetes-csi/csi-proxy/client/api/disk/v1" diskclient "github.com/kubernetes-csi/csi-proxy/client/groups/disk/v1" @@ -38,6 +42,16 @@ import ( mount "k8s.io/mount-utils" ) +// GoogleCloudDisk represents a disk from Google Cloud metadata +type GoogleCloudDisk struct { + DeviceName string `json:"deviceName"` + Index int `json:"index"` + Interface string `json:"interface"` + Mode string `json:"mode"` + NvmeNamespaceIdentifier uint64 `json:"nvmeNamespaceIdentifier"` + Type string `json:"type"` +} + // CSIProxyMounterV1 is the mounter implementation that uses the v1 API type CSIProxyMounterV1 struct { FsClient *fsclient.Client @@ -182,6 +196,197 @@ func (mounter *CSIProxyMounterV1) Unmount(target string) error { } func (mounter *CSIProxyMounterV1) GetDiskNumber(deviceName string, partition string, volumeKey string) (string, error) { + // First, get Google Cloud metadata to find the nvmeNamespaceIdentifier for this device + googleDisks, err := mounter.getGoogleCloudDisks() + if err != nil { + klog.V(4).Infof("Failed to get Google Cloud metadata, falling back to legacy method: %v", err) + return mounter.getDiskNumberLegacy(deviceName) + } + + // Find the nvmeNamespaceIdentifier for the given deviceName + var targetNamespaceId uint64 + var diskInterface string + found := false + for _, disk := range googleDisks { + if disk.DeviceName == deviceName { + targetNamespaceId = disk.NvmeNamespaceIdentifier + diskInterface = disk.Interface + found = true + klog.V(4).Infof("Found target namespace ID %d for device %s with interface %s", targetNamespaceId, deviceName, diskInterface) + break + } + } + + if !found { + klog.V(4).Infof("Device %s not found in Google Cloud metadata, falling back to legacy method", deviceName) + return mounter.getDiskNumberLegacy(deviceName) + } + + // Check if device is NVME - if not, use legacy method + if diskInterface != "NVME" { + klog.V(4).Infof("Device %s is %s interface (not NVME), falling back to legacy method", deviceName, diskInterface) + return mounter.getDiskNumberLegacy(deviceName) + } + + // Get Windows disk information + listRequest := &diskapi.ListDiskIDsRequest{} + diskIDsResponse, err := mounter.DiskClient.ListDiskIDs(context.Background(), listRequest) + if err != nil { + return "", err + } + diskIDsMap := diskIDsResponse.GetDiskIDs() + + // Iterate through Windows disks and convert EUI to decimal for matching + for diskNum, diskInfo := range diskIDsMap { + klog.V(4).Infof("found disk number %d, disk info %v", diskNum, diskInfo) + + // Check if this disk has an EUI identifier + euiValue := mounter.extractEUIFromDiskInfo(diskInfo) + if euiValue == "" { + continue + } + + // Convert EUI hex to decimal + decimalValue, err := mounter.convertEUIToDecimal(euiValue) + if err != nil { + klog.V(4).Infof("Failed to convert EUI %s to decimal: %v", euiValue, err) + continue + } + + klog.V(4).Infof("Disk %d: EUI %s converts to decimal %d", diskNum, euiValue, decimalValue) + + // Check if this matches our target namespace identifier + if decimalValue == targetNamespaceId { + klog.V(4).Infof("Found matching disk: Windows disk %d matches Google namespace ID %d", diskNum, targetNamespaceId) + return strconv.FormatUint(uint64(diskNum), 10), nil + } + } + + // Final fallback: if NVME matching failed, try legacy method + klog.V(4).Infof("Could not find NVME match for device %s with namespace ID %d, falling back to legacy method", deviceName, targetNamespaceId) + return mounter.getDiskNumberLegacy(deviceName) +} + +// Helper function to extract EUI from disk info (v1 API format) +func (mounter *CSIProxyMounterV1) extractEUIFromDiskInfo(diskInfo *diskapi.DiskIDs) string { + klog.V(4).Infof("extractEUIFromDiskInfo called for disk with Page83=%s, SerialNumber=%s", diskInfo.Page83, diskInfo.SerialNumber) + + // Check if Page83 contains an EUI format + if diskInfo.Page83 != "" && strings.HasPrefix(diskInfo.Page83, "eui.") { + klog.V(4).Infof("Found EUI in Page83: %s", diskInfo.Page83) + return diskInfo.Page83 + } + + // For NVMe disks, check SerialNumber field and convert to EUI format + if diskInfo.SerialNumber != "" { + klog.V(4).Infof("Attempting to convert serial number %s to EUI", diskInfo.SerialNumber) + // Convert serial number format like "10CC_9636_B6E3_CE3B_0000_0000_0000_0000." to EUI format + eui := mounter.convertSerialToEUI(diskInfo.SerialNumber) + if eui != "" { + klog.V(4).Infof("Successfully converted serial number %s to EUI %s", diskInfo.SerialNumber, eui) + return eui + } else { + klog.V(4).Infof("Failed to convert serial number %s to EUI", diskInfo.SerialNumber) + } + } else { + klog.V(4).Infof("No serial number found for disk") + } + + klog.V(4).Infof("No EUI found for disk") + return "" +} + +// Helper function to convert serial number to EUI format +func (mounter *CSIProxyMounterV1) convertSerialToEUI(serialNumber string) string { + klog.V(4).Infof("convertSerialToEUI: input=%s", serialNumber) + + // Remove trailing period and underscores from serial number + // Format: "10CC_9636_B6E3_CE3B_0000_0000_0000_0000." -> "10CC9636B6E3CE3B0000000000000000" + cleaned := strings.TrimSuffix(serialNumber, ".") + cleaned = strings.ReplaceAll(cleaned, "_", "") + klog.V(4).Infof("convertSerialToEUI: cleaned=%s, length=%d", cleaned, len(cleaned)) + + // Validate that it's a valid hex string of expected length + if len(cleaned) != 32 { + klog.V(4).Infof("convertSerialToEUI: invalid length %d, expected 32", len(cleaned)) + return "" + } + + // Check if it's valid hex (just test parsing the first 16 chars to avoid overflow) + if _, err := strconv.ParseUint(cleaned[:16], 16, 64); err != nil { + klog.V(4).Infof("convertSerialToEUI: invalid hex in first 16 chars: %v", err) + return "" + } + + // Return in EUI format + result := "eui." + cleaned + klog.V(4).Infof("convertSerialToEUI: result=%s", result) + return result +} + +// Helper function to convert EUI hex to decimal +func (mounter *CSIProxyMounterV1) convertEUIToDecimal(euiValue string) (uint64, error) { + // Extract hex part from EUI (first 16 characters after "eui.") + if !strings.HasPrefix(euiValue, "eui.") { + return 0, fmt.Errorf("invalid EUI format: %s", euiValue) + } + + hexPart := strings.TrimPrefix(euiValue, "eui.") + if len(hexPart) < 16 { + return 0, fmt.Errorf("EUI hex part too short: %s", hexPart) + } + + // Take first 16 hex characters + hexPart = hexPart[:16] + + // Convert to decimal + decimalValue, err := strconv.ParseUint(hexPart, 16, 64) + if err != nil { + return 0, fmt.Errorf("failed to parse hex %s: %v", hexPart, err) + } + + return decimalValue, nil +} + +// Helper function to get Google Cloud metadata +func (mounter *CSIProxyMounterV1) getGoogleCloudDisks() ([]GoogleCloudDisk, error) { + client := &http.Client{ + Timeout: 10 * time.Second, + } + + req, err := http.NewRequest("GET", "http://metadata.google.internal/computeMetadata/v1/instance/disks/?recursive=true", nil) + if err != nil { + return nil, fmt.Errorf("failed to create request: %v", err) + } + + req.Header.Set("Metadata-Flavor", "Google") + + resp, err := client.Do(req) + if err != nil { + return nil, fmt.Errorf("failed to call metadata service: %v", err) + } + defer resp.Body.Close() + + if resp.StatusCode != http.StatusOK { + return nil, fmt.Errorf("metadata service returned status %d", resp.StatusCode) + } + + body, err := io.ReadAll(resp.Body) + if err != nil { + return nil, fmt.Errorf("failed to read response body: %v", err) + } + + var disks []GoogleCloudDisk + if err := json.Unmarshal(body, &disks); err != nil { + return nil, fmt.Errorf("failed to parse JSON response: %v", err) + } + + klog.V(4).Infof("Retrieved %d disks from Google Cloud metadata", len(disks)) + return disks, nil +} + +// Legacy method for backward compatibility +func (mounter *CSIProxyMounterV1) getDiskNumberLegacy(deviceName string) (string, error) { listRequest := &diskapi.ListDiskIDsRequest{} diskIDsResponse, err := mounter.DiskClient.ListDiskIDs(context.Background(), listRequest) if err != nil { diff --git a/pkg/mount-manager/safe-mounter-v1beta_windows.go b/pkg/mount-manager/safe-mounter-v1beta_windows.go index d765edc69..dbb82c649 100644 --- a/pkg/mount-manager/safe-mounter-v1beta_windows.go +++ b/pkg/mount-manager/safe-mounter-v1beta_windows.go @@ -18,12 +18,16 @@ package mountmanager import ( "context" + "encoding/json" "errors" "fmt" + "io" + "net/http" "os" "path/filepath" "strconv" "strings" + "time" diskapi "github.com/kubernetes-csi/csi-proxy/client/api/disk/v1beta2" diskclient "github.com/kubernetes-csi/csi-proxy/client/groups/disk/v1beta2" @@ -38,6 +42,16 @@ import ( mount "k8s.io/mount-utils" ) +// GoogleCloudDisk represents a disk from Google Cloud metadata +type GoogleCloudDiskBeta struct { + DeviceName string `json:"deviceName"` + Index int `json:"index"` + Interface string `json:"interface"` + Mode string `json:"mode"` + NvmeNamespaceIdentifier uint64 `json:"nvmeNamespaceIdentifier"` + Type string `json:"type"` +} + // CSIProxyMounterV1Beta is the mounter implementaiton that uses the v1beta API type CSIProxyMounterV1Beta struct { FsClient *fsclient.Client @@ -187,6 +201,200 @@ func (mounter *CSIProxyMounterV1Beta) Unmount(target string) error { } func (mounter *CSIProxyMounterV1Beta) GetDiskNumber(deviceName string, partition string, volumeKey string) (string, error) { + // First, get Google Cloud metadata to find the nvmeNamespaceIdentifier for this device + googleDisks, err := mounter.getGoogleCloudDisks() + if err != nil { + klog.V(4).Infof("Failed to get Google Cloud metadata, falling back to legacy method: %v", err) + return mounter.getDiskNumberLegacy(deviceName) + } + + // Find the nvmeNamespaceIdentifier for the given deviceName + var targetNamespaceId uint64 + found := false + for _, disk := range googleDisks { + if disk.DeviceName == deviceName { + targetNamespaceId = disk.NvmeNamespaceIdentifier + found = true + klog.V(4).Infof("Found target namespace ID %d for device %s", targetNamespaceId, deviceName) + break + } + } + + if !found { + klog.V(4).Infof("Device %s not found in Google Cloud metadata, falling back to legacy method", deviceName) + return mounter.getDiskNumberLegacy(deviceName) + } + + // Get Windows disk information + listRequest := &diskapi.ListDiskIDsRequest{} + diskIDsResponse, err := mounter.DiskClient.ListDiskIDs(context.Background(), listRequest) + if err != nil { + return "", err + } + diskIDsMap := diskIDsResponse.GetDiskIDs() + + // Iterate through Windows disks and convert EUI to decimal for matching + for diskNum, diskInfo := range diskIDsMap { + klog.V(4).Infof("found disk number %s, disk info %v", diskNum, diskInfo) + + // Check if this disk has an EUI identifier + euiValue := mounter.extractEUIFromDiskInfo(diskInfo) + if euiValue == "" { + continue + } + + // Convert EUI hex to decimal + decimalValue, err := mounter.convertEUIToDecimal(euiValue) + if err != nil { + klog.V(4).Infof("Failed to convert EUI %s to decimal: %v", euiValue, err) + continue + } + + klog.V(4).Infof("Disk %s: EUI %s converts to decimal %d", diskNum, euiValue, decimalValue) + + // Check if this matches our target namespace identifier + if decimalValue == targetNamespaceId { + klog.V(4).Infof("Found matching disk: Windows disk %s matches Google namespace ID %d", diskNum, targetNamespaceId) + return diskNum, nil + } + } + + // Final fallback: if NVME matching failed, try legacy method + klog.V(4).Infof("Could not find NVME match for device %s with namespace ID %d, falling back to legacy method", deviceName, targetNamespaceId) + return mounter.getDiskNumberLegacy(deviceName) +} + +// Helper function to extract EUI from disk info (v1beta API format) +func (mounter *CSIProxyMounterV1Beta) extractEUIFromDiskInfo(diskInfo *diskapi.DiskIDs) string { + klog.V(4).Infof("extractEUIFromDiskInfo (v1beta) called for disk with identifiers: %v", diskInfo.Identifiers) + + // In v1beta API, identifiers are stored in a map + if diskInfo.Identifiers != nil { + // Look for various EUI-related identifiers + for key, value := range diskInfo.Identifiers { + if strings.Contains(strings.ToLower(key), "eui") || strings.HasPrefix(value, "eui.") { + klog.V(4).Infof("Found EUI in identifier %s: %s", key, value) + return value + } + } + // Also check for common identifier names that might contain EUI + if uniqueId, exists := diskInfo.Identifiers["UniqueId"]; exists && strings.HasPrefix(uniqueId, "eui.") { + klog.V(4).Infof("Found EUI in UniqueId: %s", uniqueId) + return uniqueId + } + // For NVMe disks, check SerialNumber field and convert to EUI format + if serialNumber, exists := diskInfo.Identifiers["SerialNumber"]; exists { + klog.V(4).Infof("Attempting to convert serial number %s to EUI", serialNumber) + // Convert serial number format like "10CC_9636_B6E3_CE3B_0000_0000_0000_0000." to EUI format + eui := mounter.convertSerialToEUI(serialNumber) + if eui != "" { + klog.V(4).Infof("Successfully converted serial number %s to EUI %s", serialNumber, eui) + return eui + } else { + klog.V(4).Infof("Failed to convert serial number %s to EUI", serialNumber) + } + } else { + klog.V(4).Infof("No SerialNumber found in identifiers") + } + } else { + klog.V(4).Infof("No identifiers found for disk") + } + + klog.V(4).Infof("No EUI found for disk") + return "" +} + +// Helper function to convert serial number to EUI format +func (mounter *CSIProxyMounterV1Beta) convertSerialToEUI(serialNumber string) string { + klog.V(4).Infof("convertSerialToEUI (v1beta): input=%s", serialNumber) + + // Remove trailing period and underscores from serial number + // Format: "10CC_9636_B6E3_CE3B_0000_0000_0000_0000." -> "10CC9636B6E3CE3B0000000000000000" + cleaned := strings.TrimSuffix(serialNumber, ".") + cleaned = strings.ReplaceAll(cleaned, "_", "") + klog.V(4).Infof("convertSerialToEUI (v1beta): cleaned=%s, length=%d", cleaned, len(cleaned)) + + // Validate that it's a valid hex string of expected length + if len(cleaned) != 32 { + klog.V(4).Infof("convertSerialToEUI (v1beta): invalid length %d, expected 32", len(cleaned)) + return "" + } + + // Check if it's valid hex (just test parsing the first 16 chars to avoid overflow) + if _, err := strconv.ParseUint(cleaned[:16], 16, 64); err != nil { + klog.V(4).Infof("convertSerialToEUI (v1beta): invalid hex in first 16 chars: %v", err) + return "" + } + + // Return in EUI format + result := "eui." + cleaned + klog.V(4).Infof("convertSerialToEUI (v1beta): result=%s", result) + return result +} + +// Helper function to convert EUI hex to decimal +func (mounter *CSIProxyMounterV1Beta) convertEUIToDecimal(euiValue string) (uint64, error) { + // Extract hex part from EUI (first 16 characters after "eui.") + if !strings.HasPrefix(euiValue, "eui.") { + return 0, fmt.Errorf("invalid EUI format: %s", euiValue) + } + + hexPart := strings.TrimPrefix(euiValue, "eui.") + if len(hexPart) < 16 { + return 0, fmt.Errorf("EUI hex part too short: %s", hexPart) + } + + // Take first 16 hex characters + hexPart = hexPart[:16] + + // Convert to decimal + decimalValue, err := strconv.ParseUint(hexPart, 16, 64) + if err != nil { + return 0, fmt.Errorf("failed to parse hex %s: %v", hexPart, err) + } + + return decimalValue, nil +} + +// Helper function to get Google Cloud metadata +func (mounter *CSIProxyMounterV1Beta) getGoogleCloudDisks() ([]GoogleCloudDiskBeta, error) { + client := &http.Client{ + Timeout: 10 * time.Second, + } + + req, err := http.NewRequest("GET", "http://metadata.google.internal/computeMetadata/v1/instance/disks/?recursive=true", nil) + if err != nil { + return nil, fmt.Errorf("failed to create request: %v", err) + } + + req.Header.Set("Metadata-Flavor", "Google") + + resp, err := client.Do(req) + if err != nil { + return nil, fmt.Errorf("failed to call metadata service: %v", err) + } + defer resp.Body.Close() + + if resp.StatusCode != http.StatusOK { + return nil, fmt.Errorf("metadata service returned status %d", resp.StatusCode) + } + + body, err := io.ReadAll(resp.Body) + if err != nil { + return nil, fmt.Errorf("failed to read response body: %v", err) + } + + var disks []GoogleCloudDiskBeta + if err := json.Unmarshal(body, &disks); err != nil { + return nil, fmt.Errorf("failed to parse JSON response: %v", err) + } + + klog.V(4).Infof("Retrieved %d disks from Google Cloud metadata", len(disks)) + return disks, nil +} + +// Legacy method for backward compatibility +func (mounter *CSIProxyMounterV1Beta) getDiskNumberLegacy(deviceName string) (string, error) { id := "page83" listRequest := &diskapi.ListDiskIDsRequest{} diskIDsResponse, err := mounter.DiskClient.ListDiskIDs(context.Background(), listRequest) diff --git a/pkg/resizefs/resizefs_windows.go b/pkg/resizefs/resizefs_windows.go index a16438992..7817d8679 100644 --- a/pkg/resizefs/resizefs_windows.go +++ b/pkg/resizefs/resizefs_windows.go @@ -21,6 +21,7 @@ package resizefs import ( "context" "fmt" + "strings" volumeapiv1 "github.com/kubernetes-csi/csi-proxy/client/api/volume/v1" volumeapiv1beta1 "github.com/kubernetes-csi/csi-proxy/client/api/volume/v1beta1" @@ -72,6 +73,11 @@ func (resizefs *resizeFs) resizeV1(devicePath string, deviceMountPath string) (b } _, err = proxy.VolumeClient.ResizeVolume(context.Background(), request) if err != nil { + // Check if this is the Windows error indicating partition is already at correct size + if strings.Contains(err.Error(), "The size of the extent is less than the minimum of 1MB") { + klog.V(3).Infof("Partition is already at target size (extent difference < 1MB), treating as success: %v", err) + return false, nil // Return false to indicate no resize was needed, but no error + } return false, err } return true, nil @@ -97,6 +103,11 @@ func (resizefs *resizeFs) resizeV1Beta(devicePath string, deviceMountPath string } _, err = proxy.VolumeClient.ResizeVolume(context.Background(), request) if err != nil { + // Check if this is the Windows error indicating partition is already at correct size + if strings.Contains(err.Error(), "The size of the extent is less than the minimum of 1MB") { + klog.V(3).Infof("Partition is already at target size (extent difference < 1MB), treating as success: %v", err) + return false, nil // Return false to indicate no resize was needed, but no error + } return false, err } return true, nil From 6760775c1aa5ea6b7c23aa94179841e211f2bbac Mon Sep 17 00:00:00 2001 From: Sumanth Suresh Date: Wed, 25 Jun 2025 23:41:28 +0000 Subject: [PATCH 04/51] Remove check on snapshot create support for multi-writer HyperDisk-HA and let such validations occur at the PD control plane layer --- pkg/gce-pd-csi-driver/controller.go | 3 --- pkg/gce-pd-csi-driver/controller_test.go | 18 ------------------ 2 files changed, 21 deletions(-) diff --git a/pkg/gce-pd-csi-driver/controller.go b/pkg/gce-pd-csi-driver/controller.go index 24b18f761..f0523d435 100644 --- a/pkg/gce-pd-csi-driver/controller.go +++ b/pkg/gce-pd-csi-driver/controller.go @@ -1620,9 +1620,6 @@ func (gceCS *GCEControllerServer) CreateSnapshot(ctx context.Context, req *csi.C } return nil, common.LoggedError("CreateSnapshot, failed to getDisk: ", err) } - if common.IsHyperdisk(disk.GetPDType()) && disk.GetAccessMode() == common.GCEReadWriteManyAccessMode { - return nil, status.Errorf(codes.InvalidArgument, "Cannot create snapshot for disk type %s with access mode %s", common.DiskTypeHdHA, common.GCEReadWriteManyAccessMode) - } snapshotParams, err := common.ExtractAndDefaultSnapshotParameters(req.GetParameters(), gceCS.Driver.name, gceCS.Driver.extraTags) if err != nil { diff --git a/pkg/gce-pd-csi-driver/controller_test.go b/pkg/gce-pd-csi-driver/controller_test.go index ec2980dd9..92e7e2282 100644 --- a/pkg/gce-pd-csi-driver/controller_test.go +++ b/pkg/gce-pd-csi-driver/controller_test.go @@ -265,24 +265,6 @@ func TestCreateSnapshotArguments(t *testing.T) { ReadyToUse: false, }, }, - { - name: "fail to create snapshot for HdHA multi-writer", - req: &csi.CreateSnapshotRequest{ - Name: name, - SourceVolumeId: testRegionalID, - Parameters: map[string]string{common.ParameterKeyStorageLocations: " US-WEST2"}, - }, - seedDisks: []*gce.CloudDisk{ - gce.CloudDiskFromV1(&compute.Disk{ - Name: name, - SelfLink: fmt.Sprintf("https://www.googleapis.com/compute/v1/projects/project/regions/country-region/name/%s", name), - Type: common.DiskTypeHdHA, - AccessMode: common.GCEReadWriteManyAccessMode, - Region: "country-region", - }), - }, - expErrCode: codes.InvalidArgument, - }, } for _, tc := range testCases { From ff18b2a399f5a563812d82848b4c08c91c4eb1bf Mon Sep 17 00:00:00 2001 From: Elijah Rodriguez-Beltran Date: Mon, 30 Jun 2025 21:42:05 +0000 Subject: [PATCH 05/51] Add c4d to gen4 attach limit list --- pkg/gce-pd-csi-driver/node.go | 2 +- pkg/gce-pd-csi-driver/node_test.go | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/pkg/gce-pd-csi-driver/node.go b/pkg/gce-pd-csi-driver/node.go index 994547e0e..cb430355c 100644 --- a/pkg/gce-pd-csi-driver/node.go +++ b/pkg/gce-pd-csi-driver/node.go @@ -848,7 +848,7 @@ func (ns *GCENodeServer) GetVolumeLimits(ctx context.Context) (int64, error) { } // Process gen4 machine attach limits - gen4MachineTypesPrefix := []string{"c4a-", "c4-", "n4-"} + gen4MachineTypesPrefix := []string{"c4a-", "c4-", "n4-", "c4d-"} for _, gen4Prefix := range gen4MachineTypesPrefix { if strings.HasPrefix(machineType, gen4Prefix) { machineTypeSlice := strings.Split(machineType, "-") diff --git a/pkg/gce-pd-csi-driver/node_test.go b/pkg/gce-pd-csi-driver/node_test.go index 6e64b0ce5..4d2883ee8 100644 --- a/pkg/gce-pd-csi-driver/node_test.go +++ b/pkg/gce-pd-csi-driver/node_test.go @@ -340,6 +340,11 @@ func TestNodeGetVolumeLimits(t *testing.T) { machineType: "c4a-standard-32-lssd", expVolumeLimit: 49, }, + { + name: "c4d-standard-32", + machineType: "c4d-standard-32", + expVolumeLimit: 49, + }, } for _, tc := range testCases { From 302d4d704cb799574e999c900d5c601524571648 Mon Sep 17 00:00:00 2001 From: ivanLeont Date: Tue, 1 Jul 2025 13:31:13 -0500 Subject: [PATCH 06/51] Removed the skip for the specific resize error --- pkg/resizefs/resizefs_windows.go | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/pkg/resizefs/resizefs_windows.go b/pkg/resizefs/resizefs_windows.go index 7817d8679..a16438992 100644 --- a/pkg/resizefs/resizefs_windows.go +++ b/pkg/resizefs/resizefs_windows.go @@ -21,7 +21,6 @@ package resizefs import ( "context" "fmt" - "strings" volumeapiv1 "github.com/kubernetes-csi/csi-proxy/client/api/volume/v1" volumeapiv1beta1 "github.com/kubernetes-csi/csi-proxy/client/api/volume/v1beta1" @@ -73,11 +72,6 @@ func (resizefs *resizeFs) resizeV1(devicePath string, deviceMountPath string) (b } _, err = proxy.VolumeClient.ResizeVolume(context.Background(), request) if err != nil { - // Check if this is the Windows error indicating partition is already at correct size - if strings.Contains(err.Error(), "The size of the extent is less than the minimum of 1MB") { - klog.V(3).Infof("Partition is already at target size (extent difference < 1MB), treating as success: %v", err) - return false, nil // Return false to indicate no resize was needed, but no error - } return false, err } return true, nil @@ -103,11 +97,6 @@ func (resizefs *resizeFs) resizeV1Beta(devicePath string, deviceMountPath string } _, err = proxy.VolumeClient.ResizeVolume(context.Background(), request) if err != nil { - // Check if this is the Windows error indicating partition is already at correct size - if strings.Contains(err.Error(), "The size of the extent is less than the minimum of 1MB") { - klog.V(3).Infof("Partition is already at target size (extent difference < 1MB), treating as success: %v", err) - return false, nil // Return false to indicate no resize was needed, but no error - } return false, err } return true, nil From d1ae0892cae3131950c6cff4d5ccbdd7bfb48063 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Yavercovski?= Date: Tue, 8 Jul 2025 20:16:33 -0400 Subject: [PATCH 07/51] fix: update Hyperdisk attach limits to match GCP documentation for Gen4 machines MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Loïc Yavercovski --- pkg/common/constants.go | 43 ++++++++++++++++++++++++------ pkg/common/utils.go | 37 ++++++++++++++++++++----- pkg/gce-pd-csi-driver/node.go | 16 ++++++----- pkg/gce-pd-csi-driver/node_test.go | 11 +++++--- 4 files changed, 83 insertions(+), 24 deletions(-) diff --git a/pkg/common/constants.go b/pkg/common/constants.go index 46a6d57b2..ec218c133 100644 --- a/pkg/common/constants.go +++ b/pkg/common/constants.go @@ -65,15 +65,42 @@ const ( AttachLimitOverrideLabel = "gke-volume-attach-limit-override" ) -// doc https://cloud.google.com/compute/docs/disks/hyperdisks#max-total-disks-per-vm -var Gen4MachineHyperdiskAttachLimitMap = []struct { +// doc https://cloud.google.com/compute/docs/general-purpose-machines +// MachineHyperdiskLimit represents the mapping between max vCPUs and hyperdisk (balanced) attach limit +type MachineHyperdiskLimit struct { max int64 value int64 -}{ +} + +// C4 Machine Types - Hyperdisk Balanced Limits +var C4MachineHyperdiskAttachLimitMap = []MachineHyperdiskLimit{ + {max: 2, value: 7}, {max: 4, value: 15}, - {max: 8, value: 23}, - {max: 16, value: 31}, - {max: 32, value: 49}, - {max: 64, value: 63}, - {max: 1024, value: 127}, + {max: 24, value: 31}, + {max: 48, value: 63}, + {max: 96, value: 127}, +} + +// C4D Machine Types - Hyperdisk Balanced Limits +var C4DMachineHyperdiskAttachLimitMap = []MachineHyperdiskLimit{ + {max: 2, value: 3}, + {max: 4, value: 7}, + {max: 8, value: 15}, + {max: 96, value: 31}, + {max: 192, value: 63}, + {max: 384, value: 127}, +} + +// N4 Machine Types - Hyperdisk Balanced Limits +var N4MachineHyperdiskAttachLimitMap = []MachineHyperdiskLimit{ + {max: 8, value: 15}, + {max: 80, value: 31}, +} + +// C4A Machine Types - Hyperdisk Balanced Limits +var C4AMachineHyperdiskAttachLimitMap = []MachineHyperdiskLimit{ + {max: 2, value: 7}, + {max: 8, value: 15}, + {max: 48, value: 31}, + {max: 72, value: 63}, } diff --git a/pkg/common/utils.go b/pkg/common/utils.go index b15181b34..23ca1839d 100644 --- a/pkg/common/utils.go +++ b/pkg/common/utils.go @@ -762,14 +762,39 @@ func ShortString(s string) string { return string(short) } -// MapNumber is a function to map input cpu number to the Hyperdisk attach limit -func MapNumber(num int64) int64 { - for _, r := range Gen4MachineHyperdiskAttachLimitMap { - if num <= r.max { - return r.value +// GetHyperdiskAttachLimit returns the hyperdisk attach limit based on machine type prefix and vCPUs +func GetHyperdiskAttachLimit(machineTypePrefix string, vCPUs int64) int64 { + var limitMap []MachineHyperdiskLimit + + switch machineTypePrefix { + case "c4": + limitMap = C4MachineHyperdiskAttachLimitMap + case "c4d": + limitMap = C4DMachineHyperdiskAttachLimitMap + case "n4": + limitMap = N4MachineHyperdiskAttachLimitMap + case "c4a": + limitMap = C4AMachineHyperdiskAttachLimitMap + default: + // Fallback to the most conservative Gen4 map for unknown types + return MapNumber(vCPUs, C4DMachineHyperdiskAttachLimitMap) + } + + return MapNumber(vCPUs, limitMap) +} + +// mapNumber maps the vCPUs to the appropriate hyperdisk limit +func MapNumber(vCPUs int64, limitMap []MachineHyperdiskLimit) int64 { + for _, limit := range limitMap { + if vCPUs <= limit.max { + return limit.value } } - return 0 + // Return the last value if vCPUs exceeds all max values + if len(limitMap) > 0 { + return limitMap[len(limitMap)-1].value + } + return 15 } func DiskTypeLabelKey(diskType string) string { diff --git a/pkg/gce-pd-csi-driver/node.go b/pkg/gce-pd-csi-driver/node.go index cb430355c..c31be82c9 100644 --- a/pkg/gce-pd-csi-driver/node.go +++ b/pkg/gce-pd-csi-driver/node.go @@ -858,17 +858,19 @@ func (ns *GCENodeServer) GetVolumeLimits(ctx context.Context) (int64, error) { if err != nil { return volumeLimitBig, fmt.Errorf("invalid cpuString %s for machine type: %v", cpuString, machineType) } - return common.MapNumber(cpus), nil + // Extract the machine type prefix (e.g., "c4", "c4a", "n4") + prefix := strings.TrimSuffix(gen4Prefix, "-") + return common.GetHyperdiskAttachLimit(prefix, cpus), nil } else { return volumeLimitBig, fmt.Errorf("unconventional machine type: %v", machineType) } } - if strings.HasPrefix(machineType, "x4-") { - return x4HyperdiskLimit, nil - } - if strings.HasPrefix(machineType, "a4-") { - return a4HyperdiskLimit, nil - } + } + if strings.HasPrefix(machineType, "x4-") { + return x4HyperdiskLimit, nil + } + if strings.HasPrefix(machineType, "a4-") { + return a4HyperdiskLimit, nil } return volumeLimitBig, nil diff --git a/pkg/gce-pd-csi-driver/node_test.go b/pkg/gce-pd-csi-driver/node_test.go index 4d2883ee8..4f64b6102 100644 --- a/pkg/gce-pd-csi-driver/node_test.go +++ b/pkg/gce-pd-csi-driver/node_test.go @@ -278,6 +278,11 @@ func TestNodeGetVolumeLimits(t *testing.T) { machineType: "c4-standard-48", expVolumeLimit: 63, }, + { + name: "c4-standard-2", + machineType: "c4-standard-2", + expVolumeLimit: 7, + }, { name: "c4a-standard-4", machineType: "c4a-standard-4", @@ -302,7 +307,7 @@ func TestNodeGetVolumeLimits(t *testing.T) { { name: "n4-custom-8-12345-ext", machineType: "n4-custom-8-12345-ext", - expVolumeLimit: 23, + expVolumeLimit: 15, }, { name: "n4-custom-16-12345", @@ -338,12 +343,12 @@ func TestNodeGetVolumeLimits(t *testing.T) { { name: "c4a-standard-32-lssd", machineType: "c4a-standard-32-lssd", - expVolumeLimit: 49, + expVolumeLimit: 31, }, { name: "c4d-standard-32", machineType: "c4d-standard-32", - expVolumeLimit: 49, + expVolumeLimit: 31, }, } From d6e553af263397e914b95feef9955897cfe11158 Mon Sep 17 00:00:00 2001 From: Sneha Aradhey Date: Thu, 12 Jun 2025 18:16:48 +0000 Subject: [PATCH 08/51] dafult data cache enabled to false --- cmd/gce-pd-csi-driver/main.go | 13 +------ pkg/gce-pd-csi-driver/node.go | 2 +- pkg/gce-pd-csi-driver/utils.go | 14 ++++++++ pkg/gce-pd-csi-driver/utils_test.go | 53 +++++++++++++++++++++++++++++ 4 files changed, 69 insertions(+), 13 deletions(-) diff --git a/cmd/gce-pd-csi-driver/main.go b/cmd/gce-pd-csi-driver/main.go index fee76338a..07e883d92 100644 --- a/cmd/gce-pd-csi-driver/main.go +++ b/cmd/gce-pd-csi-driver/main.go @@ -270,7 +270,7 @@ func handle() { if err != nil { klog.Fatalf("Failed to set up metadata service: %v", err.Error()) } - isDataCacheEnabledNodePool, err := isDataCacheEnabledNodePool(ctx, *nodeName) + isDataCacheEnabledNodePool, err := driver.IsDataCacheEnabledNodePool(ctx, *nodeName, *enableDataCacheFlag) if err != nil { klog.Fatalf("Failed to get node info from API server: %v", err.Error()) } @@ -381,17 +381,6 @@ func urlFlag(target **url.URL, name string, usage string) { }) } -func isDataCacheEnabledNodePool(ctx context.Context, nodeName string) (bool, error) { - if !*enableDataCacheFlag { - return false, nil - } - if len(nodeName) > 0 && nodeName != common.TestNode { // disregard logic below when E2E testing. - dataCacheLSSDCount, err := driver.GetDataCacheCountFromNodeLabel(ctx, nodeName) - return dataCacheLSSDCount != 0, err - } - return true, nil -} - func fetchLssdsForRaiding(lssdCount int) ([]string, error) { allLssds, err := driver.FetchAllLssds() if err != nil { diff --git a/pkg/gce-pd-csi-driver/node.go b/pkg/gce-pd-csi-driver/node.go index c31be82c9..13ed97715 100644 --- a/pkg/gce-pd-csi-driver/node.go +++ b/pkg/gce-pd-csi-driver/node.go @@ -613,7 +613,7 @@ func (ns *GCENodeServer) NodeUnstageVolume(ctx context.Context, req *csi.NodeUns // The NodeUnstageVolume does not have any volume or publish context, we need to get the info from LVM locally // Check if cache group cache-{volumeID} exist in LVM - if ns.EnableDataCache { + if ns.EnableDataCache && ns.DataCacheEnabledNodePool { nodeId := ns.MetadataService.GetName() err := cleanupCache(volumeID, nodeId) if err != nil { diff --git a/pkg/gce-pd-csi-driver/utils.go b/pkg/gce-pd-csi-driver/utils.go index 9e64778b8..f8a4d0461 100644 --- a/pkg/gce-pd-csi-driver/utils.go +++ b/pkg/gce-pd-csi-driver/utils.go @@ -339,3 +339,17 @@ func containsZone(zones []string, zone string) bool { return false } + +func IsDataCacheEnabledNodePool(ctx context.Context, nodeName string, enableDataCacheFlag bool) (bool, error) { + if !enableDataCacheFlag { + return false, nil + } + if nodeName == common.TestNode { // disregard logic below when E2E testing. + return true, nil + } + if len(nodeName) > 0 { + dataCacheLSSDCount, err := GetDataCacheCountFromNodeLabel(ctx, nodeName) + return dataCacheLSSDCount != 0, err + } + return false, nil +} diff --git a/pkg/gce-pd-csi-driver/utils_test.go b/pkg/gce-pd-csi-driver/utils_test.go index f187cc9d8..263c0143f 100644 --- a/pkg/gce-pd-csi-driver/utils_test.go +++ b/pkg/gce-pd-csi-driver/utils_test.go @@ -18,8 +18,10 @@ limitations under the License. package gceGCEDriver import ( + "context" "fmt" "testing" + "time" csi "github.com/container-storage-interface/spec/lib/go/csi" "github.com/google/go-cmp/cmp" @@ -857,3 +859,54 @@ func TestGetHyperdiskAccessModeFromCapabilities(t *testing.T) { } } } + +func TestIsDataCacheEnabledNodePool(t *testing.T) { + for _, tc := range []struct { + name string + nodeName string + wantDataCacheEnabled bool + dataCacheFlag bool + wantErr bool + }{ + { + // Valid nod ename tries to fetch the data cache count from node labels resulting in an error + name: "node name is provided", + nodeName: "gke-node-some-name", + dataCacheFlag: true, + wantDataCacheEnabled: true, + wantErr: true, + }, + { + name: "no node name provided", + nodeName: "", + dataCacheFlag: true, + wantDataCacheEnabled: false, + }, + { + name: "test node", + nodeName: common.TestNode, + dataCacheFlag: true, + wantDataCacheEnabled: true, + }, + { + name: "node name provided but data cache feature disabled", + nodeName: "", + dataCacheFlag: false, + wantDataCacheEnabled: false, + }, + } { + t.Logf("Running test: %v", tc.name) + ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second) + defer cancel() + gotDataCacheEnabled, err := IsDataCacheEnabledNodePool(ctx, tc.nodeName, tc.dataCacheFlag) + if err != nil { + if !tc.wantErr { + t.Errorf("unexpected error, got %v", err) + } + continue + } + if gotDataCacheEnabled != tc.wantDataCacheEnabled { + t.Errorf("want %t, got %t", tc.wantDataCacheEnabled, gotDataCacheEnabled) + } + } +} From 6f42a4eb9bf2a0e5f9aeff0216f6ee014fe2decd Mon Sep 17 00:00:00 2001 From: davishaba Date: Tue, 29 Jul 2025 01:23:31 +0000 Subject: [PATCH 09/51] Add attach limits for C3 Baremetal and A4X + A4X-Max machine types --- pkg/gce-pd-csi-driver/node.go | 34 +++++++++++++--- pkg/gce-pd-csi-driver/node_test.go | 65 ++++++++++++++++++++++++++++++ 2 files changed, 93 insertions(+), 6 deletions(-) diff --git a/pkg/gce-pd-csi-driver/node.go b/pkg/gce-pd-csi-driver/node.go index 13ed97715..00f0b0859 100644 --- a/pkg/gce-pd-csi-driver/node.go +++ b/pkg/gce-pd-csi-driver/node.go @@ -113,11 +113,13 @@ const ( // doc https://cloud.google.com/compute/docs/memory-optimized-machines#x4_disks x4HyperdiskLimit int64 = 39 // doc https://cloud.google.com/compute/docs/accelerator-optimized-machines#a4-disks - a4HyperdiskLimit int64 = 127 - defaultLinuxFsType = "ext4" - defaultWindowsFsType = "ntfs" - fsTypeExt3 = "ext3" - fsTypeBtrfs = "btrfs" + a4HyperdiskLimit int64 = 127 + a4xMetalHyperdiskLimit int64 = 31 + c3MetalHyperdiskLimit int64 = 15 + defaultLinuxFsType = "ext4" + defaultWindowsFsType = "ntfs" + fsTypeExt3 = "ext3" + fsTypeBtrfs = "btrfs" readAheadKBMountFlagRegexPattern = "^read_ahead_kb=(.+)$" btrfsReclaimDataRegexPattern = "^btrfs-allocation-data-bg_reclaim_threshold=(\\d{1,2})$" // 0-99 are valid, incl. 00 @@ -847,7 +849,7 @@ func (ns *GCENodeServer) GetVolumeLimits(ctx context.Context) (int64, error) { } } - // Process gen4 machine attach limits + // Process gen4 machine attach limits which include vCPUs in the machine type gen4MachineTypesPrefix := []string{"c4a-", "c4-", "n4-", "c4d-"} for _, gen4Prefix := range gen4MachineTypesPrefix { if strings.HasPrefix(machineType, gen4Prefix) { @@ -866,12 +868,32 @@ func (ns *GCENodeServer) GetVolumeLimits(ctx context.Context) (int64, error) { } } } + // Process gen4 A4X machine attach limits, which have a -1g/-2g/-4g/metal suffix + if strings.HasPrefix(machineType, "a4x-") { + machineTypeSlice := strings.Split(machineType, "-") + if len(machineTypeSlice) < 3 { + return volumeLimitBig, fmt.Errorf("unconventional machine type: %v", machineType) + } + gpuString := machineTypeSlice[2] + if gpuString == "metal" { + return a4xMetalHyperdiskLimit, nil + } + gpuString = gpuString[0 : len(gpuString)-1] // Remove the 'g' suffix + gpus, err := strconv.ParseInt(gpuString, 10, 64) + if err != nil { + return volumeLimitBig, fmt.Errorf("invalid gpuString %s for machine type: %v", gpuString, machineType) + } + return common.GetHyperdiskAttachLimit("a4x", gpus), nil + } if strings.HasPrefix(machineType, "x4-") { return x4HyperdiskLimit, nil } if strings.HasPrefix(machineType, "a4-") { return a4HyperdiskLimit, nil } + if strings.HasPrefix(machineType, "c3-") && strings.HasSuffix(machineType, "-metal") { + return c3MetalHyperdiskLimit, nil + } return volumeLimitBig, nil } diff --git a/pkg/gce-pd-csi-driver/node_test.go b/pkg/gce-pd-csi-driver/node_test.go index 4f64b6102..c1591f63f 100644 --- a/pkg/gce-pd-csi-driver/node_test.go +++ b/pkg/gce-pd-csi-driver/node_test.go @@ -350,6 +350,71 @@ func TestNodeGetVolumeLimits(t *testing.T) { machineType: "c4d-standard-32", expVolumeLimit: 31, }, + { + name: "c3-highcpu-192-metal", + machineType: "c3-highcpu-192-metal", + expVolumeLimit: c3MetalHyperdiskLimit, + }, + { + name: "c3-standard-192-metal", + machineType: "c3-standard-192-metal", + expVolumeLimit: c3MetalHyperdiskLimit, + }, + { + name: "c3-highmem-192-metal", + machineType: "c3-highmem-192-metal", + expVolumeLimit: c3MetalHyperdiskLimit, + }, + { + name: "a4x-highgpu-1g", + machineType: "a4x-highgpu-1g", + expVolumeLimit: 63, + }, + { + name: "a4x-highgpu-2g", + machineType: "a4x-highgpu-2g", + expVolumeLimit: 127, + }, + { + name: "a4x-highgpu-2g-nolssd", + machineType: "a4x-highgpu-2g-nolssd", + expVolumeLimit: 127, + }, + { + name: "a4x-highgpu-4g", + machineType: "a4x-highgpu-4g", + expVolumeLimit: 127, + }, + { + name: "a4x-highgpu-8g", + machineType: "a4x-highgpu-8g", + expVolumeLimit: 127, + }, + { + name: "a4x-highgpu-metal", + machineType: "a4x-highgpu-metal", + expVolumeLimit: a4xMetalHyperdiskLimit, + }, + { + name: "a4x-max-metal", + machineType: "a4x-max-metal", + expVolumeLimit: a4xMetalHyperdiskLimit, + }, + { + name: "a4x-max-1g", + machineType: "a4x-max-1g", + expVolumeLimit: 63, + }, + { + name: "a4x-max-highgpu-2g", + machineType: "a4x-max-2g", + expVolumeLimit: 127, + }, + { + name: "a4x-max-4g", + machineType: "a4x-max-4g", + expVolumeLimit: 127, + }, } for _, tc := range testCases { From fc875927ec5a44f260d18ed28d2578219913ef25 Mon Sep 17 00:00:00 2001 From: davishaba Date: Tue, 29 Jul 2025 01:23:31 +0000 Subject: [PATCH 10/51] Add attach limits for C3 Baremetal and A4X + A4X-Max machine types --- pkg/common/constants.go | 6 ++++++ pkg/common/utils.go | 2 ++ 2 files changed, 8 insertions(+) diff --git a/pkg/common/constants.go b/pkg/common/constants.go index ec218c133..62d8a6bc9 100644 --- a/pkg/common/constants.go +++ b/pkg/common/constants.go @@ -104,3 +104,9 @@ var C4AMachineHyperdiskAttachLimitMap = []MachineHyperdiskLimit{ {max: 48, value: 31}, {max: 72, value: 63}, } + +// A4X Machine Types - Hyperdisk Balanced Limits. The max here is actually the GPU count (not CPU, like the others). +var A4XMachineHyperdiskAttachLimitMap = []MachineHyperdiskLimit{ + {max: 1, value: 63}, + {max: 2, value: 127}, +} diff --git a/pkg/common/utils.go b/pkg/common/utils.go index 23ca1839d..57323dcc3 100644 --- a/pkg/common/utils.go +++ b/pkg/common/utils.go @@ -775,6 +775,8 @@ func GetHyperdiskAttachLimit(machineTypePrefix string, vCPUs int64) int64 { limitMap = N4MachineHyperdiskAttachLimitMap case "c4a": limitMap = C4AMachineHyperdiskAttachLimitMap + case "a4x": + limitMap = A4XMachineHyperdiskAttachLimitMap default: // Fallback to the most conservative Gen4 map for unknown types return MapNumber(vCPUs, C4DMachineHyperdiskAttachLimitMap) From 0a5a8bddf4238311a9574a94d2e4a022d3e447a0 Mon Sep 17 00:00:00 2001 From: davishaba Date: Tue, 29 Jul 2025 01:23:31 +0000 Subject: [PATCH 11/51] Add attach limits for C3 Baremetal and A4X + A4X-Max machine types --- pkg/gce-pd-csi-driver/node_test.go | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/pkg/gce-pd-csi-driver/node_test.go b/pkg/gce-pd-csi-driver/node_test.go index c1591f63f..2ac1b9e2e 100644 --- a/pkg/gce-pd-csi-driver/node_test.go +++ b/pkg/gce-pd-csi-driver/node_test.go @@ -415,6 +415,16 @@ func TestNodeGetVolumeLimits(t *testing.T) { machineType: "a4x-max-4g", expVolumeLimit: 127, }, + { + name: "a4x-max-8g", // -8g does not exist, testing edge case + machineType: "a4x-max-8g", + expVolumeLimit: 127, + }, + { + name: "a4x-medgpu-nolssd", // does not exist, testing edge case + machineType: "a4x-medgpu-nolssd", + expVolumeLimit: volumeLimitBig, + }, } for _, tc := range testCases { From f7caaf4ec9edef30dbe56329e8c58d448bd57f30 Mon Sep 17 00:00:00 2001 From: carlory Date: Thu, 31 Jul 2025 15:05:37 +0800 Subject: [PATCH 12/51] fix ci --- test/k8s-integration/config/hdb-volumeattributesclass.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/k8s-integration/config/hdb-volumeattributesclass.yaml b/test/k8s-integration/config/hdb-volumeattributesclass.yaml index 73d5ff4f9..c5ea8a82f 100644 --- a/test/k8s-integration/config/hdb-volumeattributesclass.yaml +++ b/test/k8s-integration/config/hdb-volumeattributesclass.yaml @@ -1,4 +1,4 @@ -apiVersion: storage.k8s.io/v1beta1 +apiVersion: storage.k8s.io/v1 kind: VolumeAttributesClass metadata: name: csi-gcepd-hdb-vac From 1ee5505e1613abf9ce9e3c89415c074d6a49cf37 Mon Sep 17 00:00:00 2001 From: Engin Akdemir Date: Thu, 31 Jul 2025 19:56:54 +0000 Subject: [PATCH 13/51] Revert the image path change to what it was an increment patch version --- deploy/kubernetes/images/stable-master/image.yaml | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/deploy/kubernetes/images/stable-master/image.yaml b/deploy/kubernetes/images/stable-master/image.yaml index 592b248ff..0663677c3 100644 --- a/deploy/kubernetes/images/stable-master/image.yaml +++ b/deploy/kubernetes/images/stable-master/image.yaml @@ -44,9 +44,8 @@ metadata: name: imagetag-gcepd-driver imageTag: name: gke.gcr.io/gcp-compute-persistent-disk-csi-driver - # Don't change stable image without changing pdImagePlaceholder in - # test/k8s-integration/main.go - newName: us-central1-docker.pkg.dev/enginakdemir-gke-dev/csi-dev/gcp-compute-persistent-disk-csi-driver - newTag: "latest" + # pdImagePlaceholder in test/k8s-integration/main.go is updated automatically with the newTag + newName: registry.k8s.io/cloud-provider-gcp/gcp-compute-persistent-disk-csi-driver + newTag: "v1.17.3" --- From 3b30777f6346798a7e5e30379c9c9bbd29e65473 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 4 Aug 2025 11:24:00 +0000 Subject: [PATCH 14/51] Bump the golang-x group across 1 directory with 8 updates Bumps the golang-x group with 3 updates in the / directory: [golang.org/x/sys](https://github.com/golang/sys), [golang.org/x/time](https://github.com/golang/time) and [golang.org/x/crypto](https://github.com/golang/crypto). Updates `golang.org/x/sys` from 0.33.0 to 0.34.0 - [Commits](https://github.com/golang/sys/compare/v0.33.0...v0.34.0) Updates `golang.org/x/time` from 0.11.0 to 0.12.0 - [Commits](https://github.com/golang/time/compare/v0.11.0...v0.12.0) Updates `golang.org/x/crypto` from 0.38.0 to 0.40.0 - [Commits](https://github.com/golang/crypto/compare/v0.38.0...v0.40.0) Updates `golang.org/x/net` from 0.40.0 to 0.41.0 - [Commits](https://github.com/golang/net/compare/v0.40.0...v0.41.0) Updates `golang.org/x/sync` from 0.14.0 to 0.16.0 - [Commits](https://github.com/golang/sync/compare/v0.14.0...v0.16.0) Updates `golang.org/x/term` from 0.32.0 to 0.33.0 - [Commits](https://github.com/golang/term/compare/v0.32.0...v0.33.0) Updates `golang.org/x/text` from 0.25.0 to 0.27.0 - [Release notes](https://github.com/golang/text/releases) - [Commits](https://github.com/golang/text/compare/v0.25.0...v0.27.0) Updates `golang.org/x/tools` from 0.33.0 to 0.34.0 - [Release notes](https://github.com/golang/tools/releases) - [Commits](https://github.com/golang/tools/compare/v0.33.0...v0.34.0) --- updated-dependencies: - dependency-name: golang.org/x/sys dependency-version: 0.34.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: golang-x - dependency-name: golang.org/x/time dependency-version: 0.12.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: golang-x - dependency-name: golang.org/x/crypto dependency-version: 0.40.0 dependency-type: indirect update-type: version-update:semver-minor dependency-group: golang-x - dependency-name: golang.org/x/net dependency-version: 0.41.0 dependency-type: indirect update-type: version-update:semver-minor dependency-group: golang-x - dependency-name: golang.org/x/sync dependency-version: 0.16.0 dependency-type: indirect update-type: version-update:semver-minor dependency-group: golang-x - dependency-name: golang.org/x/term dependency-version: 0.33.0 dependency-type: indirect update-type: version-update:semver-minor dependency-group: golang-x - dependency-name: golang.org/x/text dependency-version: 0.27.0 dependency-type: indirect update-type: version-update:semver-minor dependency-group: golang-x - dependency-name: golang.org/x/tools dependency-version: 0.34.0 dependency-type: indirect update-type: version-update:semver-minor dependency-group: golang-x ... Signed-off-by: dependabot[bot] --- go.mod | 16 +- go.sum | 32 +- vendor/golang.org/x/net/http2/frame.go | 16 +- vendor/golang.org/x/net/trace/events.go | 2 +- vendor/golang.org/x/sys/unix/zerrors_linux.go | 25 +- .../x/sys/unix/zerrors_linux_386.go | 1 + .../x/sys/unix/zerrors_linux_amd64.go | 1 + .../x/sys/unix/zerrors_linux_arm.go | 1 + .../x/sys/unix/zerrors_linux_arm64.go | 1 + .../x/sys/unix/zerrors_linux_loong64.go | 1 + .../x/sys/unix/zerrors_linux_mips.go | 1 + .../x/sys/unix/zerrors_linux_mips64.go | 1 + .../x/sys/unix/zerrors_linux_mips64le.go | 1 + .../x/sys/unix/zerrors_linux_mipsle.go | 1 + .../x/sys/unix/zerrors_linux_ppc.go | 1 + .../x/sys/unix/zerrors_linux_ppc64.go | 1 + .../x/sys/unix/zerrors_linux_ppc64le.go | 1 + .../x/sys/unix/zerrors_linux_riscv64.go | 1 + .../x/sys/unix/zerrors_linux_s390x.go | 1 + .../x/sys/unix/zerrors_linux_sparc64.go | 1 + vendor/golang.org/x/sys/unix/ztypes_linux.go | 108 +++- .../golang.org/x/sys/unix/ztypes_linux_386.go | 16 + .../x/sys/unix/ztypes_linux_amd64.go | 16 + .../golang.org/x/sys/unix/ztypes_linux_arm.go | 16 + .../x/sys/unix/ztypes_linux_arm64.go | 16 + .../x/sys/unix/ztypes_linux_loong64.go | 16 + .../x/sys/unix/ztypes_linux_mips.go | 16 + .../x/sys/unix/ztypes_linux_mips64.go | 16 + .../x/sys/unix/ztypes_linux_mips64le.go | 16 + .../x/sys/unix/ztypes_linux_mipsle.go | 16 + .../golang.org/x/sys/unix/ztypes_linux_ppc.go | 16 + .../x/sys/unix/ztypes_linux_ppc64.go | 16 + .../x/sys/unix/ztypes_linux_ppc64le.go | 16 + .../x/sys/unix/ztypes_linux_riscv64.go | 16 + .../x/sys/unix/ztypes_linux_s390x.go | 16 + .../x/sys/unix/ztypes_linux_sparc64.go | 16 + vendor/golang.org/x/time/rate/sometimes.go | 4 +- .../{internal/astutil => go/ast}/edge/edge.go | 0 .../x/tools/go/ast/inspector/cursor.go | 502 ++++++++++++++++++ .../x/tools/go/ast/inspector/inspector.go | 48 +- .../x/tools/go/ast/inspector/walk.go | 2 +- vendor/modules.txt | 18 +- 42 files changed, 960 insertions(+), 68 deletions(-) rename vendor/golang.org/x/tools/{internal/astutil => go/ast}/edge/edge.go (100%) create mode 100644 vendor/golang.org/x/tools/go/ast/inspector/cursor.go diff --git a/go.mod b/go.mod index ffd749d1f..3178485e3 100644 --- a/go.mod +++ b/go.mod @@ -25,8 +25,8 @@ require ( go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.35.0 go.opentelemetry.io/otel/sdk v1.35.0 golang.org/x/oauth2 v0.30.0 - golang.org/x/sys v0.33.0 - golang.org/x/time v0.11.0 + golang.org/x/sys v0.34.0 + golang.org/x/time v0.12.0 google.golang.org/api v0.187.0 google.golang.org/genproto v0.0.0-20240624140628-dc46fd24d27d google.golang.org/grpc v1.71.0 @@ -98,12 +98,12 @@ require ( go.opentelemetry.io/otel/trace v1.35.0 // indirect go.opentelemetry.io/proto/otlp v1.5.0 // indirect go4.org v0.0.0-20201209231011-d4a079459e60 // indirect - golang.org/x/crypto v0.38.0 // indirect - golang.org/x/net v0.40.0 // indirect - golang.org/x/sync v0.14.0 // indirect - golang.org/x/term v0.32.0 // indirect - golang.org/x/text v0.25.0 // indirect - golang.org/x/tools v0.33.0 // indirect + golang.org/x/crypto v0.40.0 // indirect + golang.org/x/net v0.41.0 // indirect + golang.org/x/sync v0.16.0 // indirect + golang.org/x/term v0.33.0 // indirect + golang.org/x/text v0.27.0 // indirect + golang.org/x/tools v0.34.0 // indirect google.golang.org/genproto/googleapis/api v0.0.0-20250218202821-56aae31c358a // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20250218202821-56aae31c358a // indirect gopkg.in/evanphx/json-patch.v4 v4.12.0 // indirect diff --git a/go.sum b/go.sum index 29cbc5565..f5d00fa16 100644 --- a/go.sum +++ b/go.sum @@ -1695,8 +1695,8 @@ golang.org/x/crypto v0.23.0/go.mod h1:CKFgDieR+mRhux2Lsu27y0fO304Db0wZe70UKqHu0v golang.org/x/crypto v0.25.0/go.mod h1:T+wALwcMOSE0kXgUAnPAHqTLW+XHgcELELW8VaDgm/M= golang.org/x/crypto v0.26.0/go.mod h1:GY7jblb9wI+FOo5y8/S2oY4zWP07AkOJ4+jxCqdqn54= golang.org/x/crypto v0.28.0/go.mod h1:rmgy+3RHxRZMyY0jjAJShp2zgEdOqj2AO7U0pYmeQ7U= -golang.org/x/crypto v0.38.0 h1:jt+WWG8IZlBnVbomuhg2Mdq0+BBQaHbtqHEFEigjUV8= -golang.org/x/crypto v0.38.0/go.mod h1:MvrbAqul58NNYPKnOra203SB9vpuZW0e+RRZV+Ggqjw= +golang.org/x/crypto v0.40.0 h1:r4x+VvoG5Fm+eJcxMaY8CQM7Lb0l1lsmjGBQ6s8BfKM= +golang.org/x/crypto v0.40.0/go.mod h1:Qr1vMER5WyS2dfPHAlsOj01wgLbsyWtFn/aY+5+ZdxY= golang.org/x/exp v0.0.0-20180321215751-8460e604b9de/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190125153040-c74c464bbbf2/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= @@ -1848,8 +1848,8 @@ golang.org/x/net v0.25.0/go.mod h1:JkAGAh7GEvH74S6FOH42FLoXpXbE/aqXSrIQjXgsiwM= golang.org/x/net v0.27.0/go.mod h1:dDi0PyhWNoiUOrAS8uXv/vnScO4wnHQO4mj9fn/RytE= golang.org/x/net v0.28.0/go.mod h1:yqtgsTWOOnlGLG9GFRrK3++bGOUEkNBoHZc8MEDWPNg= golang.org/x/net v0.30.0/go.mod h1:2wGyMJ5iFasEhkwi13ChkO/t1ECNC4X4eBKkVFyYFlU= -golang.org/x/net v0.40.0 h1:79Xs7wF06Gbdcg4kdCCIQArK11Z1hr5POQ6+fIYHNuY= -golang.org/x/net v0.40.0/go.mod h1:y0hY0exeL2Pku80/zKK7tpntoX23cqL3Oa6njdgRtds= +golang.org/x/net v0.41.0 h1:vBTly1HeNPEn3wtREYfy4GZ/NECgw2Cnl+nK6Nz3uvw= +golang.org/x/net v0.41.0/go.mod h1:B/K4NNqkfmg07DQYrbwvSluqCJOOXwUjeb/5lOisjbA= golang.org/x/oauth2 v0.0.0-20180724155351-3d292e4d0cdc/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20181017192945-9dcd33a902f4/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= @@ -1889,8 +1889,8 @@ golang.org/x/sync v0.5.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= golang.org/x/sync v0.6.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= golang.org/x/sync v0.7.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= golang.org/x/sync v0.8.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= -golang.org/x/sync v0.14.0 h1:woo0S4Yywslg6hp4eUFjTVOyKt0RookbpAHG4c1HmhQ= -golang.org/x/sync v0.14.0/go.mod h1:1dzgHSNfp02xaA81J2MS99Qcpr2w7fw1gpm99rleRqA= +golang.org/x/sync v0.16.0 h1:ycBJEhp9p4vXvUZNszeOq0kGTPghopOL8q0fq3vstxw= +golang.org/x/sync v0.16.0/go.mod h1:1dzgHSNfp02xaA81J2MS99Qcpr2w7fw1gpm99rleRqA= golang.org/x/sys v0.0.0-20170830134202-bb24a47a89ea/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -2017,8 +2017,8 @@ golang.org/x/sys v0.22.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/sys v0.23.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/sys v0.24.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/sys v0.26.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= -golang.org/x/sys v0.33.0 h1:q3i8TbbEz+JRD9ywIRlyRAQbM0qF7hu24q3teo2hbuw= -golang.org/x/sys v0.33.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k= +golang.org/x/sys v0.34.0 h1:H5Y5sJ2L2JRdyv7ROF1he/lPdvFsd0mJHFw2ThKHxLA= +golang.org/x/sys v0.34.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k= golang.org/x/telemetry v0.0.0-20240228155512-f48c80bd79b2/go.mod h1:TeRTkGYfJXctD9OcfyVLyj2J3IxLnKwHJR8f4D8a3YE= golang.org/x/telemetry v0.0.0-20240521205824-bda55230c457/go.mod h1:pRgIJT+bRLFKnoM1ldnzKoxTIn14Yxz928LQRYYgIN0= golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw= @@ -2044,8 +2044,8 @@ golang.org/x/term v0.20.0/go.mod h1:8UkIAJTvZgivsXaD6/pH6U9ecQzZ45awqEOzuCvwpFY= golang.org/x/term v0.22.0/go.mod h1:F3qCibpT5AMpCRfhfT53vVJwhLtIVHhB9XDjfFvnMI4= golang.org/x/term v0.23.0/go.mod h1:DgV24QBUrK6jhZXl+20l6UWznPlwAHm1Q1mGHtydmSk= golang.org/x/term v0.25.0/go.mod h1:RPyXicDX+6vLxogjjRxjgD2TKtmAO6NZBsBRfrOLu7M= -golang.org/x/term v0.32.0 h1:DR4lr0TjUs3epypdhTOkMmuF5CDFJ/8pOnbzMZPQ7bg= -golang.org/x/term v0.32.0/go.mod h1:uZG1FhGx848Sqfsq4/DlJr3xGGsYMu/L5GW4abiaEPQ= +golang.org/x/term v0.33.0 h1:NuFncQrRcaRvVmgRkvM3j/F00gWIAlcmlB8ACEKmGIg= +golang.org/x/term v0.33.0/go.mod h1:s18+ql9tYWp1IfpV9DmCtQDDSRBUjKaw9M1eAv5UeF0= golang.org/x/text v0.0.0-20160726164857-2910a502d2bf/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -2071,8 +2071,8 @@ golang.org/x/text v0.15.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= golang.org/x/text v0.16.0/go.mod h1:GhwF1Be+LQoKShO3cGOHzqOgRrGaYc9AvblQOmPVHnI= golang.org/x/text v0.17.0/go.mod h1:BuEKDfySbSR4drPmRPG/7iBdf8hvFMuRexcpahXilzY= golang.org/x/text v0.19.0/go.mod h1:BuEKDfySbSR4drPmRPG/7iBdf8hvFMuRexcpahXilzY= -golang.org/x/text v0.25.0 h1:qVyWApTSYLk/drJRO5mDlNYskwQznZmkpV2c8q9zls4= -golang.org/x/text v0.25.0/go.mod h1:WEdwpYrmk1qmdHvhkSTNPm3app7v4rsT8F2UD6+VHIA= +golang.org/x/text v0.27.0 h1:4fGWRpyh641NLlecmyl4LOe6yDdfaYNrGb2zdfo4JV4= +golang.org/x/text v0.27.0/go.mod h1:1D28KMCvyooCX9hBiosv5Tz/+YLxj0j7XhWjpSUF7CU= golang.org/x/time v0.0.0-20180412165947-fbb02b2291d2/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= @@ -2080,8 +2080,8 @@ golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxb golang.org/x/time v0.0.0-20200416051211-89c76fbcd5d1/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20210220033141-f8bda1e9f3ba/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.7.0/go.mod h1:3BpzKBy/shNhVucY/MWOyx10tF3SFh9QdLuxbVysPQM= -golang.org/x/time v0.11.0 h1:/bpjEDfN9tkoN/ryeYHnv5hcMlc8ncjMcM4XBk5NWV0= -golang.org/x/time v0.11.0/go.mod h1:CDIdPxbZBQxdj6cxyCIdrNogrJKMJ7pr37NYpMcMDSg= +golang.org/x/time v0.12.0 h1:ScB/8o8olJvc+CQPWrK3fPZNfh7qgwCrY0zJmoEQLSE= +golang.org/x/time v0.12.0/go.mod h1:CDIdPxbZBQxdj6cxyCIdrNogrJKMJ7pr37NYpMcMDSg= golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20180525024113-a5b4c53f6e8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20180828015842-6cd1fcedba52/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= @@ -2211,8 +2211,8 @@ golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d/go.mod h1:aiJjzUbINMkxb golang.org/x/tools v0.23.0/go.mod h1:pnu6ufv6vQkll6szChhK3C3L/ruaIv5eBeztNG8wtsI= golang.org/x/tools v0.24.0/go.mod h1:YhNqVBIfWHdzvTLs0d8LCuMhkKUgSUKldakyV7W/WDQ= golang.org/x/tools v0.26.0/go.mod h1:TPVVj70c7JJ3WCazhD8OdXcZg/og+b9+tH/KxylGwH0= -golang.org/x/tools v0.33.0 h1:4qz2S3zmRxbGIhDIAgjxvFutSvH5EfnsYrRBj0UI0bc= -golang.org/x/tools v0.33.0/go.mod h1:CIJMaWEY88juyUfo7UbgPqbC8rU2OqfAV1h2Qp0oMYI= +golang.org/x/tools v0.34.0 h1:qIpSLOxeCYGg9TrcJokLBG4KFA6d795g0xkBkiESGlo= +golang.org/x/tools v0.34.0/go.mod h1:pAP9OwEaY1CAW3HOmg3hLZC5Z0CCmzjAF2UQMSqNARg= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= diff --git a/vendor/golang.org/x/net/http2/frame.go b/vendor/golang.org/x/net/http2/frame.go index 97bd8b06f..db3264da8 100644 --- a/vendor/golang.org/x/net/http2/frame.go +++ b/vendor/golang.org/x/net/http2/frame.go @@ -39,7 +39,7 @@ const ( FrameContinuation FrameType = 0x9 ) -var frameName = map[FrameType]string{ +var frameNames = [...]string{ FrameData: "DATA", FrameHeaders: "HEADERS", FramePriority: "PRIORITY", @@ -53,10 +53,10 @@ var frameName = map[FrameType]string{ } func (t FrameType) String() string { - if s, ok := frameName[t]; ok { - return s + if int(t) < len(frameNames) { + return frameNames[t] } - return fmt.Sprintf("UNKNOWN_FRAME_TYPE_%d", uint8(t)) + return fmt.Sprintf("UNKNOWN_FRAME_TYPE_%d", t) } // Flags is a bitmask of HTTP/2 flags. @@ -124,7 +124,7 @@ var flagName = map[FrameType]map[Flags]string{ // might be 0). type frameParser func(fc *frameCache, fh FrameHeader, countError func(string), payload []byte) (Frame, error) -var frameParsers = map[FrameType]frameParser{ +var frameParsers = [...]frameParser{ FrameData: parseDataFrame, FrameHeaders: parseHeadersFrame, FramePriority: parsePriorityFrame, @@ -138,8 +138,8 @@ var frameParsers = map[FrameType]frameParser{ } func typeFrameParser(t FrameType) frameParser { - if f := frameParsers[t]; f != nil { - return f + if int(t) < len(frameParsers) { + return frameParsers[t] } return parseUnknownFrame } @@ -509,7 +509,7 @@ func (fr *Framer) ReadFrame() (Frame, error) { } if fh.Length > fr.maxReadSize { if fh == invalidHTTP1LookingFrameHeader() { - return nil, fmt.Errorf("http2: failed reading the frame payload: %w, note that the frame header looked like an HTTP/1.1 header", err) + return nil, fmt.Errorf("http2: failed reading the frame payload: %w, note that the frame header looked like an HTTP/1.1 header", ErrFrameTooLarge) } return nil, ErrFrameTooLarge } diff --git a/vendor/golang.org/x/net/trace/events.go b/vendor/golang.org/x/net/trace/events.go index c646a6952..3aaffdd1f 100644 --- a/vendor/golang.org/x/net/trace/events.go +++ b/vendor/golang.org/x/net/trace/events.go @@ -508,7 +508,7 @@ const eventsHTML = ` {{$el.When}} {{$el.ElapsedTime}} - {{$el.Title}} + {{$el.Title}} {{if $.Expanded}} diff --git a/vendor/golang.org/x/sys/unix/zerrors_linux.go b/vendor/golang.org/x/sys/unix/zerrors_linux.go index 4f432bfe8..9e7a6c5a4 100644 --- a/vendor/golang.org/x/sys/unix/zerrors_linux.go +++ b/vendor/golang.org/x/sys/unix/zerrors_linux.go @@ -319,6 +319,7 @@ const ( AUDIT_INTEGRITY_POLICY_RULE = 0x70f AUDIT_INTEGRITY_RULE = 0x70d AUDIT_INTEGRITY_STATUS = 0x70a + AUDIT_INTEGRITY_USERSPACE = 0x710 AUDIT_IPC = 0x517 AUDIT_IPC_SET_PERM = 0x51f AUDIT_IPE_ACCESS = 0x58c @@ -843,9 +844,9 @@ const ( DM_UUID_FLAG = 0x4000 DM_UUID_LEN = 0x81 DM_VERSION = 0xc138fd00 - DM_VERSION_EXTRA = "-ioctl (2023-03-01)" + DM_VERSION_EXTRA = "-ioctl (2025-01-17)" DM_VERSION_MAJOR = 0x4 - DM_VERSION_MINOR = 0x30 + DM_VERSION_MINOR = 0x31 DM_VERSION_PATCHLEVEL = 0x0 DT_BLK = 0x6 DT_CHR = 0x2 @@ -941,6 +942,8 @@ const ( ETHER_FLOW = 0x12 ETHTOOL_BUSINFO_LEN = 0x20 ETHTOOL_EROMVERS_LEN = 0x20 + ETHTOOL_FAMILY_NAME = "ethtool" + ETHTOOL_FAMILY_VERSION = 0x1 ETHTOOL_FEC_AUTO = 0x2 ETHTOOL_FEC_BASER = 0x10 ETHTOOL_FEC_LLRS = 0x20 @@ -1203,6 +1206,9 @@ const ( FAN_DENY = 0x2 FAN_ENABLE_AUDIT = 0x40 FAN_EPIDFD = -0x2 + FAN_ERRNO_BITS = 0x8 + FAN_ERRNO_MASK = 0xff + FAN_ERRNO_SHIFT = 0x18 FAN_EVENT_INFO_TYPE_DFID = 0x3 FAN_EVENT_INFO_TYPE_DFID_NAME = 0x2 FAN_EVENT_INFO_TYPE_ERROR = 0x5 @@ -1210,6 +1216,7 @@ const ( FAN_EVENT_INFO_TYPE_NEW_DFID_NAME = 0xc FAN_EVENT_INFO_TYPE_OLD_DFID_NAME = 0xa FAN_EVENT_INFO_TYPE_PIDFD = 0x4 + FAN_EVENT_INFO_TYPE_RANGE = 0x6 FAN_EVENT_METADATA_LEN = 0x18 FAN_EVENT_ON_CHILD = 0x8000000 FAN_FS_ERROR = 0x8000 @@ -1240,6 +1247,7 @@ const ( FAN_OPEN_EXEC = 0x1000 FAN_OPEN_EXEC_PERM = 0x40000 FAN_OPEN_PERM = 0x10000 + FAN_PRE_ACCESS = 0x100000 FAN_Q_OVERFLOW = 0x4000 FAN_RENAME = 0x10000000 FAN_REPORT_DFID_NAME = 0xc00 @@ -2787,7 +2795,7 @@ const ( RTAX_UNSPEC = 0x0 RTAX_WINDOW = 0x3 RTA_ALIGNTO = 0x4 - RTA_MAX = 0x1e + RTA_MAX = 0x1f RTCF_DIRECTSRC = 0x4000000 RTCF_DOREDIRECT = 0x1000000 RTCF_LOG = 0x2000000 @@ -2864,10 +2872,12 @@ const ( RTM_DELACTION = 0x31 RTM_DELADDR = 0x15 RTM_DELADDRLABEL = 0x49 + RTM_DELANYCAST = 0x3d RTM_DELCHAIN = 0x65 RTM_DELLINK = 0x11 RTM_DELLINKPROP = 0x6d RTM_DELMDB = 0x55 + RTM_DELMULTICAST = 0x39 RTM_DELNEIGH = 0x1d RTM_DELNETCONF = 0x51 RTM_DELNEXTHOP = 0x69 @@ -2917,11 +2927,13 @@ const ( RTM_NEWACTION = 0x30 RTM_NEWADDR = 0x14 RTM_NEWADDRLABEL = 0x48 + RTM_NEWANYCAST = 0x3c RTM_NEWCACHEREPORT = 0x60 RTM_NEWCHAIN = 0x64 RTM_NEWLINK = 0x10 RTM_NEWLINKPROP = 0x6c RTM_NEWMDB = 0x54 + RTM_NEWMULTICAST = 0x38 RTM_NEWNDUSEROPT = 0x44 RTM_NEWNEIGH = 0x1c RTM_NEWNEIGHTBL = 0x40 @@ -2987,11 +2999,12 @@ const ( RUSAGE_THREAD = 0x1 RWF_APPEND = 0x10 RWF_ATOMIC = 0x40 + RWF_DONTCACHE = 0x80 RWF_DSYNC = 0x2 RWF_HIPRI = 0x1 RWF_NOAPPEND = 0x20 RWF_NOWAIT = 0x8 - RWF_SUPPORTED = 0x7f + RWF_SUPPORTED = 0xff RWF_SYNC = 0x4 RWF_WRITE_LIFE_NOT_SET = 0x0 SCHED_BATCH = 0x3 @@ -3271,6 +3284,7 @@ const ( STATX_BTIME = 0x800 STATX_CTIME = 0x80 STATX_DIOALIGN = 0x2000 + STATX_DIO_READ_ALIGN = 0x20000 STATX_GID = 0x10 STATX_INO = 0x100 STATX_MNT_ID = 0x1000 @@ -3322,7 +3336,7 @@ const ( TASKSTATS_GENL_NAME = "TASKSTATS" TASKSTATS_GENL_VERSION = 0x1 TASKSTATS_TYPE_MAX = 0x6 - TASKSTATS_VERSION = 0xe + TASKSTATS_VERSION = 0xf TCIFLUSH = 0x0 TCIOFF = 0x2 TCIOFLUSH = 0x2 @@ -3503,6 +3517,7 @@ const ( TP_STATUS_WRONG_FORMAT = 0x4 TRACEFS_MAGIC = 0x74726163 TS_COMM_LEN = 0x20 + UBI_IOCECNFO = 0xc01c6f06 UDF_SUPER_MAGIC = 0x15013346 UDP_CORK = 0x1 UDP_ENCAP = 0x64 diff --git a/vendor/golang.org/x/sys/unix/zerrors_linux_386.go b/vendor/golang.org/x/sys/unix/zerrors_linux_386.go index 75207613c..a8c421e29 100644 --- a/vendor/golang.org/x/sys/unix/zerrors_linux_386.go +++ b/vendor/golang.org/x/sys/unix/zerrors_linux_386.go @@ -372,6 +372,7 @@ const ( SO_RCVBUFFORCE = 0x21 SO_RCVLOWAT = 0x12 SO_RCVMARK = 0x4b + SO_RCVPRIORITY = 0x52 SO_RCVTIMEO = 0x14 SO_RCVTIMEO_NEW = 0x42 SO_RCVTIMEO_OLD = 0x14 diff --git a/vendor/golang.org/x/sys/unix/zerrors_linux_amd64.go b/vendor/golang.org/x/sys/unix/zerrors_linux_amd64.go index c68acda53..9a88d1813 100644 --- a/vendor/golang.org/x/sys/unix/zerrors_linux_amd64.go +++ b/vendor/golang.org/x/sys/unix/zerrors_linux_amd64.go @@ -373,6 +373,7 @@ const ( SO_RCVBUFFORCE = 0x21 SO_RCVLOWAT = 0x12 SO_RCVMARK = 0x4b + SO_RCVPRIORITY = 0x52 SO_RCVTIMEO = 0x14 SO_RCVTIMEO_NEW = 0x42 SO_RCVTIMEO_OLD = 0x14 diff --git a/vendor/golang.org/x/sys/unix/zerrors_linux_arm.go b/vendor/golang.org/x/sys/unix/zerrors_linux_arm.go index a8c607ab8..7cb6a867e 100644 --- a/vendor/golang.org/x/sys/unix/zerrors_linux_arm.go +++ b/vendor/golang.org/x/sys/unix/zerrors_linux_arm.go @@ -378,6 +378,7 @@ const ( SO_RCVBUFFORCE = 0x21 SO_RCVLOWAT = 0x12 SO_RCVMARK = 0x4b + SO_RCVPRIORITY = 0x52 SO_RCVTIMEO = 0x14 SO_RCVTIMEO_NEW = 0x42 SO_RCVTIMEO_OLD = 0x14 diff --git a/vendor/golang.org/x/sys/unix/zerrors_linux_arm64.go b/vendor/golang.org/x/sys/unix/zerrors_linux_arm64.go index 18563dd8d..d0ecd2c58 100644 --- a/vendor/golang.org/x/sys/unix/zerrors_linux_arm64.go +++ b/vendor/golang.org/x/sys/unix/zerrors_linux_arm64.go @@ -371,6 +371,7 @@ const ( SO_RCVBUFFORCE = 0x21 SO_RCVLOWAT = 0x12 SO_RCVMARK = 0x4b + SO_RCVPRIORITY = 0x52 SO_RCVTIMEO = 0x14 SO_RCVTIMEO_NEW = 0x42 SO_RCVTIMEO_OLD = 0x14 diff --git a/vendor/golang.org/x/sys/unix/zerrors_linux_loong64.go b/vendor/golang.org/x/sys/unix/zerrors_linux_loong64.go index 22912cdaa..7a2940ae0 100644 --- a/vendor/golang.org/x/sys/unix/zerrors_linux_loong64.go +++ b/vendor/golang.org/x/sys/unix/zerrors_linux_loong64.go @@ -365,6 +365,7 @@ const ( SO_RCVBUFFORCE = 0x21 SO_RCVLOWAT = 0x12 SO_RCVMARK = 0x4b + SO_RCVPRIORITY = 0x52 SO_RCVTIMEO = 0x14 SO_RCVTIMEO_NEW = 0x42 SO_RCVTIMEO_OLD = 0x14 diff --git a/vendor/golang.org/x/sys/unix/zerrors_linux_mips.go b/vendor/golang.org/x/sys/unix/zerrors_linux_mips.go index 29344eb37..d14ca8f2e 100644 --- a/vendor/golang.org/x/sys/unix/zerrors_linux_mips.go +++ b/vendor/golang.org/x/sys/unix/zerrors_linux_mips.go @@ -371,6 +371,7 @@ const ( SO_RCVBUFFORCE = 0x21 SO_RCVLOWAT = 0x1004 SO_RCVMARK = 0x4b + SO_RCVPRIORITY = 0x52 SO_RCVTIMEO = 0x1006 SO_RCVTIMEO_NEW = 0x42 SO_RCVTIMEO_OLD = 0x1006 diff --git a/vendor/golang.org/x/sys/unix/zerrors_linux_mips64.go b/vendor/golang.org/x/sys/unix/zerrors_linux_mips64.go index 20d51fb96..2da1bac1e 100644 --- a/vendor/golang.org/x/sys/unix/zerrors_linux_mips64.go +++ b/vendor/golang.org/x/sys/unix/zerrors_linux_mips64.go @@ -371,6 +371,7 @@ const ( SO_RCVBUFFORCE = 0x21 SO_RCVLOWAT = 0x1004 SO_RCVMARK = 0x4b + SO_RCVPRIORITY = 0x52 SO_RCVTIMEO = 0x1006 SO_RCVTIMEO_NEW = 0x42 SO_RCVTIMEO_OLD = 0x1006 diff --git a/vendor/golang.org/x/sys/unix/zerrors_linux_mips64le.go b/vendor/golang.org/x/sys/unix/zerrors_linux_mips64le.go index 321b60902..28727514b 100644 --- a/vendor/golang.org/x/sys/unix/zerrors_linux_mips64le.go +++ b/vendor/golang.org/x/sys/unix/zerrors_linux_mips64le.go @@ -371,6 +371,7 @@ const ( SO_RCVBUFFORCE = 0x21 SO_RCVLOWAT = 0x1004 SO_RCVMARK = 0x4b + SO_RCVPRIORITY = 0x52 SO_RCVTIMEO = 0x1006 SO_RCVTIMEO_NEW = 0x42 SO_RCVTIMEO_OLD = 0x1006 diff --git a/vendor/golang.org/x/sys/unix/zerrors_linux_mipsle.go b/vendor/golang.org/x/sys/unix/zerrors_linux_mipsle.go index 9bacdf1e2..7f287b54b 100644 --- a/vendor/golang.org/x/sys/unix/zerrors_linux_mipsle.go +++ b/vendor/golang.org/x/sys/unix/zerrors_linux_mipsle.go @@ -371,6 +371,7 @@ const ( SO_RCVBUFFORCE = 0x21 SO_RCVLOWAT = 0x1004 SO_RCVMARK = 0x4b + SO_RCVPRIORITY = 0x52 SO_RCVTIMEO = 0x1006 SO_RCVTIMEO_NEW = 0x42 SO_RCVTIMEO_OLD = 0x1006 diff --git a/vendor/golang.org/x/sys/unix/zerrors_linux_ppc.go b/vendor/golang.org/x/sys/unix/zerrors_linux_ppc.go index c22427261..7e5f9e6aa 100644 --- a/vendor/golang.org/x/sys/unix/zerrors_linux_ppc.go +++ b/vendor/golang.org/x/sys/unix/zerrors_linux_ppc.go @@ -426,6 +426,7 @@ const ( SO_RCVBUFFORCE = 0x21 SO_RCVLOWAT = 0x10 SO_RCVMARK = 0x4b + SO_RCVPRIORITY = 0x52 SO_RCVTIMEO = 0x12 SO_RCVTIMEO_NEW = 0x42 SO_RCVTIMEO_OLD = 0x12 diff --git a/vendor/golang.org/x/sys/unix/zerrors_linux_ppc64.go b/vendor/golang.org/x/sys/unix/zerrors_linux_ppc64.go index 6270c8ee1..37c87952f 100644 --- a/vendor/golang.org/x/sys/unix/zerrors_linux_ppc64.go +++ b/vendor/golang.org/x/sys/unix/zerrors_linux_ppc64.go @@ -430,6 +430,7 @@ const ( SO_RCVBUFFORCE = 0x21 SO_RCVLOWAT = 0x10 SO_RCVMARK = 0x4b + SO_RCVPRIORITY = 0x52 SO_RCVTIMEO = 0x12 SO_RCVTIMEO_NEW = 0x42 SO_RCVTIMEO_OLD = 0x12 diff --git a/vendor/golang.org/x/sys/unix/zerrors_linux_ppc64le.go b/vendor/golang.org/x/sys/unix/zerrors_linux_ppc64le.go index 9966c1941..522013361 100644 --- a/vendor/golang.org/x/sys/unix/zerrors_linux_ppc64le.go +++ b/vendor/golang.org/x/sys/unix/zerrors_linux_ppc64le.go @@ -430,6 +430,7 @@ const ( SO_RCVBUFFORCE = 0x21 SO_RCVLOWAT = 0x10 SO_RCVMARK = 0x4b + SO_RCVPRIORITY = 0x52 SO_RCVTIMEO = 0x12 SO_RCVTIMEO_NEW = 0x42 SO_RCVTIMEO_OLD = 0x12 diff --git a/vendor/golang.org/x/sys/unix/zerrors_linux_riscv64.go b/vendor/golang.org/x/sys/unix/zerrors_linux_riscv64.go index 848e5fcc4..4bfe2b5b6 100644 --- a/vendor/golang.org/x/sys/unix/zerrors_linux_riscv64.go +++ b/vendor/golang.org/x/sys/unix/zerrors_linux_riscv64.go @@ -362,6 +362,7 @@ const ( SO_RCVBUFFORCE = 0x21 SO_RCVLOWAT = 0x12 SO_RCVMARK = 0x4b + SO_RCVPRIORITY = 0x52 SO_RCVTIMEO = 0x14 SO_RCVTIMEO_NEW = 0x42 SO_RCVTIMEO_OLD = 0x14 diff --git a/vendor/golang.org/x/sys/unix/zerrors_linux_s390x.go b/vendor/golang.org/x/sys/unix/zerrors_linux_s390x.go index 669b2adb8..e3cffb869 100644 --- a/vendor/golang.org/x/sys/unix/zerrors_linux_s390x.go +++ b/vendor/golang.org/x/sys/unix/zerrors_linux_s390x.go @@ -434,6 +434,7 @@ const ( SO_RCVBUFFORCE = 0x21 SO_RCVLOWAT = 0x12 SO_RCVMARK = 0x4b + SO_RCVPRIORITY = 0x52 SO_RCVTIMEO = 0x14 SO_RCVTIMEO_NEW = 0x42 SO_RCVTIMEO_OLD = 0x14 diff --git a/vendor/golang.org/x/sys/unix/zerrors_linux_sparc64.go b/vendor/golang.org/x/sys/unix/zerrors_linux_sparc64.go index 4834e5751..c219c8db3 100644 --- a/vendor/golang.org/x/sys/unix/zerrors_linux_sparc64.go +++ b/vendor/golang.org/x/sys/unix/zerrors_linux_sparc64.go @@ -473,6 +473,7 @@ const ( SO_RCVBUFFORCE = 0x100b SO_RCVLOWAT = 0x800 SO_RCVMARK = 0x54 + SO_RCVPRIORITY = 0x5b SO_RCVTIMEO = 0x2000 SO_RCVTIMEO_NEW = 0x44 SO_RCVTIMEO_OLD = 0x2000 diff --git a/vendor/golang.org/x/sys/unix/ztypes_linux.go b/vendor/golang.org/x/sys/unix/ztypes_linux.go index a46abe647..8bcac2835 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_linux.go +++ b/vendor/golang.org/x/sys/unix/ztypes_linux.go @@ -114,7 +114,7 @@ type Statx_t struct { Atomic_write_unit_min uint32 Atomic_write_unit_max uint32 Atomic_write_segments_max uint32 - _ [1]uint32 + Dio_read_offset_align uint32 _ [9]uint64 } @@ -2226,8 +2226,11 @@ const ( NFT_PAYLOAD_LL_HEADER = 0x0 NFT_PAYLOAD_NETWORK_HEADER = 0x1 NFT_PAYLOAD_TRANSPORT_HEADER = 0x2 + NFT_PAYLOAD_INNER_HEADER = 0x3 + NFT_PAYLOAD_TUN_HEADER = 0x4 NFT_PAYLOAD_CSUM_NONE = 0x0 NFT_PAYLOAD_CSUM_INET = 0x1 + NFT_PAYLOAD_CSUM_SCTP = 0x2 NFT_PAYLOAD_L4CSUM_PSEUDOHDR = 0x1 NFTA_PAYLOAD_UNSPEC = 0x0 NFTA_PAYLOAD_DREG = 0x1 @@ -3802,7 +3805,16 @@ const ( ETHTOOL_MSG_PSE_GET = 0x24 ETHTOOL_MSG_PSE_SET = 0x25 ETHTOOL_MSG_RSS_GET = 0x26 - ETHTOOL_MSG_USER_MAX = 0x2d + ETHTOOL_MSG_PLCA_GET_CFG = 0x27 + ETHTOOL_MSG_PLCA_SET_CFG = 0x28 + ETHTOOL_MSG_PLCA_GET_STATUS = 0x29 + ETHTOOL_MSG_MM_GET = 0x2a + ETHTOOL_MSG_MM_SET = 0x2b + ETHTOOL_MSG_MODULE_FW_FLASH_ACT = 0x2c + ETHTOOL_MSG_PHY_GET = 0x2d + ETHTOOL_MSG_TSCONFIG_GET = 0x2e + ETHTOOL_MSG_TSCONFIG_SET = 0x2f + ETHTOOL_MSG_USER_MAX = 0x2f ETHTOOL_MSG_KERNEL_NONE = 0x0 ETHTOOL_MSG_STRSET_GET_REPLY = 0x1 ETHTOOL_MSG_LINKINFO_GET_REPLY = 0x2 @@ -3842,7 +3854,17 @@ const ( ETHTOOL_MSG_MODULE_NTF = 0x24 ETHTOOL_MSG_PSE_GET_REPLY = 0x25 ETHTOOL_MSG_RSS_GET_REPLY = 0x26 - ETHTOOL_MSG_KERNEL_MAX = 0x2e + ETHTOOL_MSG_PLCA_GET_CFG_REPLY = 0x27 + ETHTOOL_MSG_PLCA_GET_STATUS_REPLY = 0x28 + ETHTOOL_MSG_PLCA_NTF = 0x29 + ETHTOOL_MSG_MM_GET_REPLY = 0x2a + ETHTOOL_MSG_MM_NTF = 0x2b + ETHTOOL_MSG_MODULE_FW_FLASH_NTF = 0x2c + ETHTOOL_MSG_PHY_GET_REPLY = 0x2d + ETHTOOL_MSG_PHY_NTF = 0x2e + ETHTOOL_MSG_TSCONFIG_GET_REPLY = 0x2f + ETHTOOL_MSG_TSCONFIG_SET_REPLY = 0x30 + ETHTOOL_MSG_KERNEL_MAX = 0x30 ETHTOOL_FLAG_COMPACT_BITSETS = 0x1 ETHTOOL_FLAG_OMIT_REPLY = 0x2 ETHTOOL_FLAG_STATS = 0x4 @@ -3949,7 +3971,12 @@ const ( ETHTOOL_A_RINGS_TCP_DATA_SPLIT = 0xb ETHTOOL_A_RINGS_CQE_SIZE = 0xc ETHTOOL_A_RINGS_TX_PUSH = 0xd - ETHTOOL_A_RINGS_MAX = 0x10 + ETHTOOL_A_RINGS_RX_PUSH = 0xe + ETHTOOL_A_RINGS_TX_PUSH_BUF_LEN = 0xf + ETHTOOL_A_RINGS_TX_PUSH_BUF_LEN_MAX = 0x10 + ETHTOOL_A_RINGS_HDS_THRESH = 0x11 + ETHTOOL_A_RINGS_HDS_THRESH_MAX = 0x12 + ETHTOOL_A_RINGS_MAX = 0x12 ETHTOOL_A_CHANNELS_UNSPEC = 0x0 ETHTOOL_A_CHANNELS_HEADER = 0x1 ETHTOOL_A_CHANNELS_RX_MAX = 0x2 @@ -4015,7 +4042,9 @@ const ( ETHTOOL_A_TSINFO_TX_TYPES = 0x3 ETHTOOL_A_TSINFO_RX_FILTERS = 0x4 ETHTOOL_A_TSINFO_PHC_INDEX = 0x5 - ETHTOOL_A_TSINFO_MAX = 0x6 + ETHTOOL_A_TSINFO_STATS = 0x6 + ETHTOOL_A_TSINFO_HWTSTAMP_PROVIDER = 0x7 + ETHTOOL_A_TSINFO_MAX = 0x7 ETHTOOL_A_CABLE_TEST_UNSPEC = 0x0 ETHTOOL_A_CABLE_TEST_HEADER = 0x1 ETHTOOL_A_CABLE_TEST_MAX = 0x1 @@ -4613,6 +4642,7 @@ const ( NL80211_ATTR_AKM_SUITES = 0x4c NL80211_ATTR_AP_ISOLATE = 0x60 NL80211_ATTR_AP_SETTINGS_FLAGS = 0x135 + NL80211_ATTR_ASSOC_SPP_AMSDU = 0x14a NL80211_ATTR_AUTH_DATA = 0x9c NL80211_ATTR_AUTH_TYPE = 0x35 NL80211_ATTR_BANDS = 0xef @@ -4623,6 +4653,7 @@ const ( NL80211_ATTR_BSS_BASIC_RATES = 0x24 NL80211_ATTR_BSS = 0x2f NL80211_ATTR_BSS_CTS_PROT = 0x1c + NL80211_ATTR_BSS_DUMP_INCLUDE_USE_DATA = 0x147 NL80211_ATTR_BSS_HT_OPMODE = 0x6d NL80211_ATTR_BSSID = 0xf5 NL80211_ATTR_BSS_SELECT = 0xe3 @@ -4682,6 +4713,7 @@ const ( NL80211_ATTR_DTIM_PERIOD = 0xd NL80211_ATTR_DURATION = 0x57 NL80211_ATTR_EHT_CAPABILITY = 0x136 + NL80211_ATTR_EMA_RNR_ELEMS = 0x145 NL80211_ATTR_EML_CAPABILITY = 0x13d NL80211_ATTR_EXT_CAPA = 0xa9 NL80211_ATTR_EXT_CAPA_MASK = 0xaa @@ -4717,6 +4749,7 @@ const ( NL80211_ATTR_HIDDEN_SSID = 0x7e NL80211_ATTR_HT_CAPABILITY = 0x1f NL80211_ATTR_HT_CAPABILITY_MASK = 0x94 + NL80211_ATTR_HW_TIMESTAMP_ENABLED = 0x144 NL80211_ATTR_IE_ASSOC_RESP = 0x80 NL80211_ATTR_IE = 0x2a NL80211_ATTR_IE_PROBE_RESP = 0x7f @@ -4747,9 +4780,10 @@ const ( NL80211_ATTR_MAC_HINT = 0xc8 NL80211_ATTR_MAC_MASK = 0xd7 NL80211_ATTR_MAX_AP_ASSOC_STA = 0xca - NL80211_ATTR_MAX = 0x14d + NL80211_ATTR_MAX = 0x150 NL80211_ATTR_MAX_CRIT_PROT_DURATION = 0xb4 NL80211_ATTR_MAX_CSA_COUNTERS = 0xce + NL80211_ATTR_MAX_HW_TIMESTAMP_PEERS = 0x143 NL80211_ATTR_MAX_MATCH_SETS = 0x85 NL80211_ATTR_MAX_NUM_AKM_SUITES = 0x13c NL80211_ATTR_MAX_NUM_PMKIDS = 0x56 @@ -4774,9 +4808,12 @@ const ( NL80211_ATTR_MGMT_SUBTYPE = 0x29 NL80211_ATTR_MLD_ADDR = 0x13a NL80211_ATTR_MLD_CAPA_AND_OPS = 0x13e + NL80211_ATTR_MLO_LINK_DISABLED = 0x146 NL80211_ATTR_MLO_LINK_ID = 0x139 NL80211_ATTR_MLO_LINKS = 0x138 NL80211_ATTR_MLO_SUPPORT = 0x13b + NL80211_ATTR_MLO_TTLM_DLINK = 0x148 + NL80211_ATTR_MLO_TTLM_ULINK = 0x149 NL80211_ATTR_MNTR_FLAGS = 0x17 NL80211_ATTR_MPATH_INFO = 0x1b NL80211_ATTR_MPATH_NEXT_HOP = 0x1a @@ -4809,12 +4846,14 @@ const ( NL80211_ATTR_PORT_AUTHORIZED = 0x103 NL80211_ATTR_POWER_RULE_MAX_ANT_GAIN = 0x5 NL80211_ATTR_POWER_RULE_MAX_EIRP = 0x6 + NL80211_ATTR_POWER_RULE_PSD = 0x8 NL80211_ATTR_PREV_BSSID = 0x4f NL80211_ATTR_PRIVACY = 0x46 NL80211_ATTR_PROBE_RESP = 0x91 NL80211_ATTR_PROBE_RESP_OFFLOAD = 0x90 NL80211_ATTR_PROTOCOL_FEATURES = 0xad NL80211_ATTR_PS_STATE = 0x5d + NL80211_ATTR_PUNCT_BITMAP = 0x142 NL80211_ATTR_QOS_MAP = 0xc7 NL80211_ATTR_RADAR_BACKGROUND = 0x134 NL80211_ATTR_RADAR_EVENT = 0xa8 @@ -4943,7 +4982,9 @@ const ( NL80211_ATTR_WIPHY_FREQ = 0x26 NL80211_ATTR_WIPHY_FREQ_HINT = 0xc9 NL80211_ATTR_WIPHY_FREQ_OFFSET = 0x122 + NL80211_ATTR_WIPHY_INTERFACE_COMBINATIONS = 0x14c NL80211_ATTR_WIPHY_NAME = 0x2 + NL80211_ATTR_WIPHY_RADIOS = 0x14b NL80211_ATTR_WIPHY_RETRY_LONG = 0x3e NL80211_ATTR_WIPHY_RETRY_SHORT = 0x3d NL80211_ATTR_WIPHY_RTS_THRESHOLD = 0x40 @@ -4978,6 +5019,8 @@ const ( NL80211_BAND_ATTR_IFTYPE_DATA = 0x9 NL80211_BAND_ATTR_MAX = 0xd NL80211_BAND_ATTR_RATES = 0x2 + NL80211_BAND_ATTR_S1G_CAPA = 0xd + NL80211_BAND_ATTR_S1G_MCS_NSS_SET = 0xc NL80211_BAND_ATTR_VHT_CAPA = 0x8 NL80211_BAND_ATTR_VHT_MCS_SET = 0x7 NL80211_BAND_IFTYPE_ATTR_EHT_CAP_MAC = 0x8 @@ -5001,6 +5044,10 @@ const ( NL80211_BSS_BEACON_INTERVAL = 0x4 NL80211_BSS_BEACON_TSF = 0xd NL80211_BSS_BSSID = 0x1 + NL80211_BSS_CANNOT_USE_6GHZ_PWR_MISMATCH = 0x2 + NL80211_BSS_CANNOT_USE_NSTR_NONPRIMARY = 0x1 + NL80211_BSS_CANNOT_USE_REASONS = 0x18 + NL80211_BSS_CANNOT_USE_UHB_PWR_MISMATCH = 0x2 NL80211_BSS_CAPABILITY = 0x5 NL80211_BSS_CHAIN_SIGNAL = 0x13 NL80211_BSS_CHAN_WIDTH_10 = 0x1 @@ -5032,6 +5079,9 @@ const ( NL80211_BSS_STATUS = 0x9 NL80211_BSS_STATUS_IBSS_JOINED = 0x2 NL80211_BSS_TSF = 0x3 + NL80211_BSS_USE_FOR = 0x17 + NL80211_BSS_USE_FOR_MLD_LINK = 0x2 + NL80211_BSS_USE_FOR_NORMAL = 0x1 NL80211_CHAN_HT20 = 0x1 NL80211_CHAN_HT40MINUS = 0x2 NL80211_CHAN_HT40PLUS = 0x3 @@ -5117,7 +5167,8 @@ const ( NL80211_CMD_LEAVE_IBSS = 0x2c NL80211_CMD_LEAVE_MESH = 0x45 NL80211_CMD_LEAVE_OCB = 0x6d - NL80211_CMD_MAX = 0x9b + NL80211_CMD_LINKS_REMOVED = 0x9a + NL80211_CMD_MAX = 0x9d NL80211_CMD_MICHAEL_MIC_FAILURE = 0x29 NL80211_CMD_MODIFY_LINK_STA = 0x97 NL80211_CMD_NAN_MATCH = 0x78 @@ -5161,6 +5212,7 @@ const ( NL80211_CMD_SET_COALESCE = 0x65 NL80211_CMD_SET_CQM = 0x3f NL80211_CMD_SET_FILS_AAD = 0x92 + NL80211_CMD_SET_HW_TIMESTAMP = 0x99 NL80211_CMD_SET_INTERFACE = 0x6 NL80211_CMD_SET_KEY = 0xa NL80211_CMD_SET_MAC_ACL = 0x5d @@ -5180,6 +5232,7 @@ const ( NL80211_CMD_SET_SAR_SPECS = 0x8c NL80211_CMD_SET_STATION = 0x12 NL80211_CMD_SET_TID_CONFIG = 0x89 + NL80211_CMD_SET_TID_TO_LINK_MAPPING = 0x9b NL80211_CMD_SET_TX_BITRATE_MASK = 0x39 NL80211_CMD_SET_WDS_PEER = 0x42 NL80211_CMD_SET_WIPHY = 0x2 @@ -5247,6 +5300,7 @@ const ( NL80211_EXT_FEATURE_AIRTIME_FAIRNESS = 0x21 NL80211_EXT_FEATURE_AP_PMKSA_CACHING = 0x22 NL80211_EXT_FEATURE_AQL = 0x28 + NL80211_EXT_FEATURE_AUTH_AND_DEAUTH_RANDOM_TA = 0x40 NL80211_EXT_FEATURE_BEACON_PROTECTION_CLIENT = 0x2e NL80211_EXT_FEATURE_BEACON_PROTECTION = 0x29 NL80211_EXT_FEATURE_BEACON_RATE_HE = 0x36 @@ -5262,6 +5316,7 @@ const ( NL80211_EXT_FEATURE_CQM_RSSI_LIST = 0xd NL80211_EXT_FEATURE_DATA_ACK_SIGNAL_SUPPORT = 0x1b NL80211_EXT_FEATURE_DEL_IBSS_STA = 0x2c + NL80211_EXT_FEATURE_DFS_CONCURRENT = 0x43 NL80211_EXT_FEATURE_DFS_OFFLOAD = 0x19 NL80211_EXT_FEATURE_ENABLE_FTM_RESPONDER = 0x20 NL80211_EXT_FEATURE_EXT_KEY_ID = 0x24 @@ -5281,9 +5336,12 @@ const ( NL80211_EXT_FEATURE_OCE_PROBE_REQ_DEFERRAL_SUPPRESSION = 0x14 NL80211_EXT_FEATURE_OCE_PROBE_REQ_HIGH_TX_RATE = 0x13 NL80211_EXT_FEATURE_OPERATING_CHANNEL_VALIDATION = 0x31 + NL80211_EXT_FEATURE_OWE_OFFLOAD_AP = 0x42 + NL80211_EXT_FEATURE_OWE_OFFLOAD = 0x41 NL80211_EXT_FEATURE_POWERED_ADDR_CHANGE = 0x3d NL80211_EXT_FEATURE_PROTECTED_TWT = 0x2b NL80211_EXT_FEATURE_PROT_RANGE_NEGO_AND_MEASURE = 0x39 + NL80211_EXT_FEATURE_PUNCT = 0x3e NL80211_EXT_FEATURE_RADAR_BACKGROUND = 0x3c NL80211_EXT_FEATURE_RRM = 0x1 NL80211_EXT_FEATURE_SAE_OFFLOAD_AP = 0x33 @@ -5295,8 +5353,10 @@ const ( NL80211_EXT_FEATURE_SCHED_SCAN_BAND_SPECIFIC_RSSI_THOLD = 0x23 NL80211_EXT_FEATURE_SCHED_SCAN_RELATIVE_RSSI = 0xc NL80211_EXT_FEATURE_SECURE_LTF = 0x37 + NL80211_EXT_FEATURE_SECURE_NAN = 0x3f NL80211_EXT_FEATURE_SECURE_RTT = 0x38 NL80211_EXT_FEATURE_SET_SCAN_DWELL = 0x5 + NL80211_EXT_FEATURE_SPP_AMSDU_SUPPORT = 0x44 NL80211_EXT_FEATURE_STA_TX_PWR = 0x25 NL80211_EXT_FEATURE_TXQS = 0x1c NL80211_EXT_FEATURE_UNSOL_BCAST_PROBE_RESP = 0x35 @@ -5343,7 +5403,10 @@ const ( NL80211_FREQUENCY_ATTR_2MHZ = 0x16 NL80211_FREQUENCY_ATTR_4MHZ = 0x17 NL80211_FREQUENCY_ATTR_8MHZ = 0x18 + NL80211_FREQUENCY_ATTR_ALLOW_6GHZ_VLP_AP = 0x21 + NL80211_FREQUENCY_ATTR_CAN_MONITOR = 0x20 NL80211_FREQUENCY_ATTR_DFS_CAC_TIME = 0xd + NL80211_FREQUENCY_ATTR_DFS_CONCURRENT = 0x1d NL80211_FREQUENCY_ATTR_DFS_STATE = 0x7 NL80211_FREQUENCY_ATTR_DFS_TIME = 0x8 NL80211_FREQUENCY_ATTR_DISABLED = 0x2 @@ -5357,6 +5420,8 @@ const ( NL80211_FREQUENCY_ATTR_NO_160MHZ = 0xc NL80211_FREQUENCY_ATTR_NO_20MHZ = 0x10 NL80211_FREQUENCY_ATTR_NO_320MHZ = 0x1a + NL80211_FREQUENCY_ATTR_NO_6GHZ_AFC_CLIENT = 0x1f + NL80211_FREQUENCY_ATTR_NO_6GHZ_VLP_CLIENT = 0x1e NL80211_FREQUENCY_ATTR_NO_80MHZ = 0xb NL80211_FREQUENCY_ATTR_NO_EHT = 0x1b NL80211_FREQUENCY_ATTR_NO_HE = 0x13 @@ -5364,8 +5429,11 @@ const ( NL80211_FREQUENCY_ATTR_NO_HT40_PLUS = 0xa NL80211_FREQUENCY_ATTR_NO_IBSS = 0x3 NL80211_FREQUENCY_ATTR_NO_IR = 0x3 + NL80211_FREQUENCY_ATTR_NO_UHB_AFC_CLIENT = 0x1f + NL80211_FREQUENCY_ATTR_NO_UHB_VLP_CLIENT = 0x1e NL80211_FREQUENCY_ATTR_OFFSET = 0x14 NL80211_FREQUENCY_ATTR_PASSIVE_SCAN = 0x3 + NL80211_FREQUENCY_ATTR_PSD = 0x1c NL80211_FREQUENCY_ATTR_RADAR = 0x5 NL80211_FREQUENCY_ATTR_WMM = 0x12 NL80211_FTM_RESP_ATTR_CIVICLOC = 0x3 @@ -5430,6 +5498,7 @@ const ( NL80211_IFTYPE_STATION = 0x2 NL80211_IFTYPE_UNSPECIFIED = 0x0 NL80211_IFTYPE_WDS = 0x5 + NL80211_KCK_EXT_LEN_32 = 0x20 NL80211_KCK_EXT_LEN = 0x18 NL80211_KCK_LEN = 0x10 NL80211_KEK_EXT_LEN = 0x20 @@ -5458,6 +5527,7 @@ const ( NL80211_MAX_SUPP_HT_RATES = 0x4d NL80211_MAX_SUPP_RATES = 0x20 NL80211_MAX_SUPP_REG_RULES = 0x80 + NL80211_MAX_SUPP_SELECTORS = 0x80 NL80211_MBSSID_CONFIG_ATTR_EMA = 0x5 NL80211_MBSSID_CONFIG_ATTR_INDEX = 0x3 NL80211_MBSSID_CONFIG_ATTR_MAX = 0x5 @@ -5703,11 +5773,16 @@ const ( NL80211_RADAR_PRE_CAC_EXPIRED = 0x4 NL80211_RATE_INFO_10_MHZ_WIDTH = 0xb NL80211_RATE_INFO_160_MHZ_WIDTH = 0xa + NL80211_RATE_INFO_16_MHZ_WIDTH = 0x1d + NL80211_RATE_INFO_1_MHZ_WIDTH = 0x19 + NL80211_RATE_INFO_2_MHZ_WIDTH = 0x1a NL80211_RATE_INFO_320_MHZ_WIDTH = 0x12 NL80211_RATE_INFO_40_MHZ_WIDTH = 0x3 + NL80211_RATE_INFO_4_MHZ_WIDTH = 0x1b NL80211_RATE_INFO_5_MHZ_WIDTH = 0xc NL80211_RATE_INFO_80_MHZ_WIDTH = 0x8 NL80211_RATE_INFO_80P80_MHZ_WIDTH = 0x9 + NL80211_RATE_INFO_8_MHZ_WIDTH = 0x1c NL80211_RATE_INFO_BITRATE32 = 0x5 NL80211_RATE_INFO_BITRATE = 0x1 NL80211_RATE_INFO_EHT_GI_0_8 = 0x0 @@ -5753,6 +5828,8 @@ const ( NL80211_RATE_INFO_HE_RU_ALLOC = 0x11 NL80211_RATE_INFO_MAX = 0x1d NL80211_RATE_INFO_MCS = 0x2 + NL80211_RATE_INFO_S1G_MCS = 0x17 + NL80211_RATE_INFO_S1G_NSS = 0x18 NL80211_RATE_INFO_SHORT_GI = 0x4 NL80211_RATE_INFO_VHT_MCS = 0x6 NL80211_RATE_INFO_VHT_NSS = 0x7 @@ -5770,14 +5847,19 @@ const ( NL80211_REKEY_DATA_KEK = 0x1 NL80211_REKEY_DATA_REPLAY_CTR = 0x3 NL80211_REPLAY_CTR_LEN = 0x8 + NL80211_RRF_ALLOW_6GHZ_VLP_AP = 0x1000000 NL80211_RRF_AUTO_BW = 0x800 NL80211_RRF_DFS = 0x10 + NL80211_RRF_DFS_CONCURRENT = 0x200000 NL80211_RRF_GO_CONCURRENT = 0x1000 NL80211_RRF_IR_CONCURRENT = 0x1000 NL80211_RRF_NO_160MHZ = 0x10000 NL80211_RRF_NO_320MHZ = 0x40000 + NL80211_RRF_NO_6GHZ_AFC_CLIENT = 0x800000 + NL80211_RRF_NO_6GHZ_VLP_CLIENT = 0x400000 NL80211_RRF_NO_80MHZ = 0x8000 NL80211_RRF_NO_CCK = 0x2 + NL80211_RRF_NO_EHT = 0x80000 NL80211_RRF_NO_HE = 0x20000 NL80211_RRF_NO_HT40 = 0x6000 NL80211_RRF_NO_HT40MINUS = 0x2000 @@ -5788,7 +5870,10 @@ const ( NL80211_RRF_NO_IR = 0x80 NL80211_RRF_NO_OFDM = 0x1 NL80211_RRF_NO_OUTDOOR = 0x8 + NL80211_RRF_NO_UHB_AFC_CLIENT = 0x800000 + NL80211_RRF_NO_UHB_VLP_CLIENT = 0x400000 NL80211_RRF_PASSIVE_SCAN = 0x80 + NL80211_RRF_PSD = 0x100000 NL80211_RRF_PTMP_ONLY = 0x40 NL80211_RRF_PTP_ONLY = 0x20 NL80211_RXMGMT_FLAG_ANSWERED = 0x1 @@ -5849,6 +5934,7 @@ const ( NL80211_STA_FLAG_MAX_OLD_API = 0x6 NL80211_STA_FLAG_MFP = 0x4 NL80211_STA_FLAG_SHORT_PREAMBLE = 0x2 + NL80211_STA_FLAG_SPP_AMSDU = 0x8 NL80211_STA_FLAG_TDLS_PEER = 0x6 NL80211_STA_FLAG_WME = 0x3 NL80211_STA_INFO_ACK_SIGNAL_AVG = 0x23 @@ -6007,6 +6093,13 @@ const ( NL80211_VHT_CAPABILITY_LEN = 0xc NL80211_VHT_NSS_MAX = 0x8 NL80211_WIPHY_NAME_MAXLEN = 0x40 + NL80211_WIPHY_RADIO_ATTR_FREQ_RANGE = 0x2 + NL80211_WIPHY_RADIO_ATTR_INDEX = 0x1 + NL80211_WIPHY_RADIO_ATTR_INTERFACE_COMBINATION = 0x3 + NL80211_WIPHY_RADIO_ATTR_MAX = 0x4 + NL80211_WIPHY_RADIO_FREQ_ATTR_END = 0x2 + NL80211_WIPHY_RADIO_FREQ_ATTR_MAX = 0x2 + NL80211_WIPHY_RADIO_FREQ_ATTR_START = 0x1 NL80211_WMMR_AIFSN = 0x3 NL80211_WMMR_CW_MAX = 0x2 NL80211_WMMR_CW_MIN = 0x1 @@ -6038,6 +6131,7 @@ const ( NL80211_WOWLAN_TRIG_PKT_PATTERN = 0x4 NL80211_WOWLAN_TRIG_RFKILL_RELEASE = 0x9 NL80211_WOWLAN_TRIG_TCP_CONNECTION = 0xe + NL80211_WOWLAN_TRIG_UNPROTECTED_DEAUTH_DISASSOC = 0x14 NL80211_WOWLAN_TRIG_WAKEUP_PKT_80211 = 0xa NL80211_WOWLAN_TRIG_WAKEUP_PKT_80211_LEN = 0xb NL80211_WOWLAN_TRIG_WAKEUP_PKT_8023 = 0xc diff --git a/vendor/golang.org/x/sys/unix/ztypes_linux_386.go b/vendor/golang.org/x/sys/unix/ztypes_linux_386.go index fd402da43..62db85f6c 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_linux_386.go +++ b/vendor/golang.org/x/sys/unix/ztypes_linux_386.go @@ -285,10 +285,16 @@ type Taskstats struct { _ [4]byte Cpu_count uint64 Cpu_delay_total uint64 + Cpu_delay_max uint64 + Cpu_delay_min uint64 Blkio_count uint64 Blkio_delay_total uint64 + Blkio_delay_max uint64 + Blkio_delay_min uint64 Swapin_count uint64 Swapin_delay_total uint64 + Swapin_delay_max uint64 + Swapin_delay_min uint64 Cpu_run_real_total uint64 Cpu_run_virtual_total uint64 Ac_comm [32]int8 @@ -324,11 +330,17 @@ type Taskstats struct { Cpu_scaled_run_real_total uint64 Freepages_count uint64 Freepages_delay_total uint64 + Freepages_delay_max uint64 + Freepages_delay_min uint64 Thrashing_count uint64 Thrashing_delay_total uint64 + Thrashing_delay_max uint64 + Thrashing_delay_min uint64 Ac_btime64 uint64 Compact_count uint64 Compact_delay_total uint64 + Compact_delay_max uint64 + Compact_delay_min uint64 Ac_tgid uint32 _ [4]byte Ac_tgetime uint64 @@ -336,8 +348,12 @@ type Taskstats struct { Ac_exe_inode uint64 Wpcopy_count uint64 Wpcopy_delay_total uint64 + Wpcopy_delay_max uint64 + Wpcopy_delay_min uint64 Irq_count uint64 Irq_delay_total uint64 + Irq_delay_max uint64 + Irq_delay_min uint64 } type cpuMask uint32 diff --git a/vendor/golang.org/x/sys/unix/ztypes_linux_amd64.go b/vendor/golang.org/x/sys/unix/ztypes_linux_amd64.go index eb7a5e186..7d89d648d 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_linux_amd64.go +++ b/vendor/golang.org/x/sys/unix/ztypes_linux_amd64.go @@ -300,10 +300,16 @@ type Taskstats struct { Ac_nice uint8 Cpu_count uint64 Cpu_delay_total uint64 + Cpu_delay_max uint64 + Cpu_delay_min uint64 Blkio_count uint64 Blkio_delay_total uint64 + Blkio_delay_max uint64 + Blkio_delay_min uint64 Swapin_count uint64 Swapin_delay_total uint64 + Swapin_delay_max uint64 + Swapin_delay_min uint64 Cpu_run_real_total uint64 Cpu_run_virtual_total uint64 Ac_comm [32]int8 @@ -338,19 +344,29 @@ type Taskstats struct { Cpu_scaled_run_real_total uint64 Freepages_count uint64 Freepages_delay_total uint64 + Freepages_delay_max uint64 + Freepages_delay_min uint64 Thrashing_count uint64 Thrashing_delay_total uint64 + Thrashing_delay_max uint64 + Thrashing_delay_min uint64 Ac_btime64 uint64 Compact_count uint64 Compact_delay_total uint64 + Compact_delay_max uint64 + Compact_delay_min uint64 Ac_tgid uint32 Ac_tgetime uint64 Ac_exe_dev uint64 Ac_exe_inode uint64 Wpcopy_count uint64 Wpcopy_delay_total uint64 + Wpcopy_delay_max uint64 + Wpcopy_delay_min uint64 Irq_count uint64 Irq_delay_total uint64 + Irq_delay_max uint64 + Irq_delay_min uint64 } type cpuMask uint64 diff --git a/vendor/golang.org/x/sys/unix/ztypes_linux_arm.go b/vendor/golang.org/x/sys/unix/ztypes_linux_arm.go index d78ac108b..9c0b39eec 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_linux_arm.go +++ b/vendor/golang.org/x/sys/unix/ztypes_linux_arm.go @@ -276,10 +276,16 @@ type Taskstats struct { _ [4]byte Cpu_count uint64 Cpu_delay_total uint64 + Cpu_delay_max uint64 + Cpu_delay_min uint64 Blkio_count uint64 Blkio_delay_total uint64 + Blkio_delay_max uint64 + Blkio_delay_min uint64 Swapin_count uint64 Swapin_delay_total uint64 + Swapin_delay_max uint64 + Swapin_delay_min uint64 Cpu_run_real_total uint64 Cpu_run_virtual_total uint64 Ac_comm [32]uint8 @@ -315,11 +321,17 @@ type Taskstats struct { Cpu_scaled_run_real_total uint64 Freepages_count uint64 Freepages_delay_total uint64 + Freepages_delay_max uint64 + Freepages_delay_min uint64 Thrashing_count uint64 Thrashing_delay_total uint64 + Thrashing_delay_max uint64 + Thrashing_delay_min uint64 Ac_btime64 uint64 Compact_count uint64 Compact_delay_total uint64 + Compact_delay_max uint64 + Compact_delay_min uint64 Ac_tgid uint32 _ [4]byte Ac_tgetime uint64 @@ -327,8 +339,12 @@ type Taskstats struct { Ac_exe_inode uint64 Wpcopy_count uint64 Wpcopy_delay_total uint64 + Wpcopy_delay_max uint64 + Wpcopy_delay_min uint64 Irq_count uint64 Irq_delay_total uint64 + Irq_delay_max uint64 + Irq_delay_min uint64 } type cpuMask uint32 diff --git a/vendor/golang.org/x/sys/unix/ztypes_linux_arm64.go b/vendor/golang.org/x/sys/unix/ztypes_linux_arm64.go index cd06d47f1..de9c7ff36 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_linux_arm64.go +++ b/vendor/golang.org/x/sys/unix/ztypes_linux_arm64.go @@ -279,10 +279,16 @@ type Taskstats struct { Ac_nice uint8 Cpu_count uint64 Cpu_delay_total uint64 + Cpu_delay_max uint64 + Cpu_delay_min uint64 Blkio_count uint64 Blkio_delay_total uint64 + Blkio_delay_max uint64 + Blkio_delay_min uint64 Swapin_count uint64 Swapin_delay_total uint64 + Swapin_delay_max uint64 + Swapin_delay_min uint64 Cpu_run_real_total uint64 Cpu_run_virtual_total uint64 Ac_comm [32]int8 @@ -317,19 +323,29 @@ type Taskstats struct { Cpu_scaled_run_real_total uint64 Freepages_count uint64 Freepages_delay_total uint64 + Freepages_delay_max uint64 + Freepages_delay_min uint64 Thrashing_count uint64 Thrashing_delay_total uint64 + Thrashing_delay_max uint64 + Thrashing_delay_min uint64 Ac_btime64 uint64 Compact_count uint64 Compact_delay_total uint64 + Compact_delay_max uint64 + Compact_delay_min uint64 Ac_tgid uint32 Ac_tgetime uint64 Ac_exe_dev uint64 Ac_exe_inode uint64 Wpcopy_count uint64 Wpcopy_delay_total uint64 + Wpcopy_delay_max uint64 + Wpcopy_delay_min uint64 Irq_count uint64 Irq_delay_total uint64 + Irq_delay_max uint64 + Irq_delay_min uint64 } type cpuMask uint64 diff --git a/vendor/golang.org/x/sys/unix/ztypes_linux_loong64.go b/vendor/golang.org/x/sys/unix/ztypes_linux_loong64.go index 2f28fe26c..2336bd2bf 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_linux_loong64.go +++ b/vendor/golang.org/x/sys/unix/ztypes_linux_loong64.go @@ -280,10 +280,16 @@ type Taskstats struct { Ac_nice uint8 Cpu_count uint64 Cpu_delay_total uint64 + Cpu_delay_max uint64 + Cpu_delay_min uint64 Blkio_count uint64 Blkio_delay_total uint64 + Blkio_delay_max uint64 + Blkio_delay_min uint64 Swapin_count uint64 Swapin_delay_total uint64 + Swapin_delay_max uint64 + Swapin_delay_min uint64 Cpu_run_real_total uint64 Cpu_run_virtual_total uint64 Ac_comm [32]int8 @@ -318,19 +324,29 @@ type Taskstats struct { Cpu_scaled_run_real_total uint64 Freepages_count uint64 Freepages_delay_total uint64 + Freepages_delay_max uint64 + Freepages_delay_min uint64 Thrashing_count uint64 Thrashing_delay_total uint64 + Thrashing_delay_max uint64 + Thrashing_delay_min uint64 Ac_btime64 uint64 Compact_count uint64 Compact_delay_total uint64 + Compact_delay_max uint64 + Compact_delay_min uint64 Ac_tgid uint32 Ac_tgetime uint64 Ac_exe_dev uint64 Ac_exe_inode uint64 Wpcopy_count uint64 Wpcopy_delay_total uint64 + Wpcopy_delay_max uint64 + Wpcopy_delay_min uint64 Irq_count uint64 Irq_delay_total uint64 + Irq_delay_max uint64 + Irq_delay_min uint64 } type cpuMask uint64 diff --git a/vendor/golang.org/x/sys/unix/ztypes_linux_mips.go b/vendor/golang.org/x/sys/unix/ztypes_linux_mips.go index 71d6cac2f..4711f0be1 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_linux_mips.go +++ b/vendor/golang.org/x/sys/unix/ztypes_linux_mips.go @@ -281,10 +281,16 @@ type Taskstats struct { _ [4]byte Cpu_count uint64 Cpu_delay_total uint64 + Cpu_delay_max uint64 + Cpu_delay_min uint64 Blkio_count uint64 Blkio_delay_total uint64 + Blkio_delay_max uint64 + Blkio_delay_min uint64 Swapin_count uint64 Swapin_delay_total uint64 + Swapin_delay_max uint64 + Swapin_delay_min uint64 Cpu_run_real_total uint64 Cpu_run_virtual_total uint64 Ac_comm [32]int8 @@ -320,11 +326,17 @@ type Taskstats struct { Cpu_scaled_run_real_total uint64 Freepages_count uint64 Freepages_delay_total uint64 + Freepages_delay_max uint64 + Freepages_delay_min uint64 Thrashing_count uint64 Thrashing_delay_total uint64 + Thrashing_delay_max uint64 + Thrashing_delay_min uint64 Ac_btime64 uint64 Compact_count uint64 Compact_delay_total uint64 + Compact_delay_max uint64 + Compact_delay_min uint64 Ac_tgid uint32 _ [4]byte Ac_tgetime uint64 @@ -332,8 +344,12 @@ type Taskstats struct { Ac_exe_inode uint64 Wpcopy_count uint64 Wpcopy_delay_total uint64 + Wpcopy_delay_max uint64 + Wpcopy_delay_min uint64 Irq_count uint64 Irq_delay_total uint64 + Irq_delay_max uint64 + Irq_delay_min uint64 } type cpuMask uint32 diff --git a/vendor/golang.org/x/sys/unix/ztypes_linux_mips64.go b/vendor/golang.org/x/sys/unix/ztypes_linux_mips64.go index 8596d4535..ab99a34b9 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_linux_mips64.go +++ b/vendor/golang.org/x/sys/unix/ztypes_linux_mips64.go @@ -282,10 +282,16 @@ type Taskstats struct { Ac_nice uint8 Cpu_count uint64 Cpu_delay_total uint64 + Cpu_delay_max uint64 + Cpu_delay_min uint64 Blkio_count uint64 Blkio_delay_total uint64 + Blkio_delay_max uint64 + Blkio_delay_min uint64 Swapin_count uint64 Swapin_delay_total uint64 + Swapin_delay_max uint64 + Swapin_delay_min uint64 Cpu_run_real_total uint64 Cpu_run_virtual_total uint64 Ac_comm [32]int8 @@ -320,19 +326,29 @@ type Taskstats struct { Cpu_scaled_run_real_total uint64 Freepages_count uint64 Freepages_delay_total uint64 + Freepages_delay_max uint64 + Freepages_delay_min uint64 Thrashing_count uint64 Thrashing_delay_total uint64 + Thrashing_delay_max uint64 + Thrashing_delay_min uint64 Ac_btime64 uint64 Compact_count uint64 Compact_delay_total uint64 + Compact_delay_max uint64 + Compact_delay_min uint64 Ac_tgid uint32 Ac_tgetime uint64 Ac_exe_dev uint64 Ac_exe_inode uint64 Wpcopy_count uint64 Wpcopy_delay_total uint64 + Wpcopy_delay_max uint64 + Wpcopy_delay_min uint64 Irq_count uint64 Irq_delay_total uint64 + Irq_delay_max uint64 + Irq_delay_min uint64 } type cpuMask uint64 diff --git a/vendor/golang.org/x/sys/unix/ztypes_linux_mips64le.go b/vendor/golang.org/x/sys/unix/ztypes_linux_mips64le.go index cd60ea186..04c9866e3 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_linux_mips64le.go +++ b/vendor/golang.org/x/sys/unix/ztypes_linux_mips64le.go @@ -282,10 +282,16 @@ type Taskstats struct { Ac_nice uint8 Cpu_count uint64 Cpu_delay_total uint64 + Cpu_delay_max uint64 + Cpu_delay_min uint64 Blkio_count uint64 Blkio_delay_total uint64 + Blkio_delay_max uint64 + Blkio_delay_min uint64 Swapin_count uint64 Swapin_delay_total uint64 + Swapin_delay_max uint64 + Swapin_delay_min uint64 Cpu_run_real_total uint64 Cpu_run_virtual_total uint64 Ac_comm [32]int8 @@ -320,19 +326,29 @@ type Taskstats struct { Cpu_scaled_run_real_total uint64 Freepages_count uint64 Freepages_delay_total uint64 + Freepages_delay_max uint64 + Freepages_delay_min uint64 Thrashing_count uint64 Thrashing_delay_total uint64 + Thrashing_delay_max uint64 + Thrashing_delay_min uint64 Ac_btime64 uint64 Compact_count uint64 Compact_delay_total uint64 + Compact_delay_max uint64 + Compact_delay_min uint64 Ac_tgid uint32 Ac_tgetime uint64 Ac_exe_dev uint64 Ac_exe_inode uint64 Wpcopy_count uint64 Wpcopy_delay_total uint64 + Wpcopy_delay_max uint64 + Wpcopy_delay_min uint64 Irq_count uint64 Irq_delay_total uint64 + Irq_delay_max uint64 + Irq_delay_min uint64 } type cpuMask uint64 diff --git a/vendor/golang.org/x/sys/unix/ztypes_linux_mipsle.go b/vendor/golang.org/x/sys/unix/ztypes_linux_mipsle.go index b0ae420c4..60aa69f61 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_linux_mipsle.go +++ b/vendor/golang.org/x/sys/unix/ztypes_linux_mipsle.go @@ -281,10 +281,16 @@ type Taskstats struct { _ [4]byte Cpu_count uint64 Cpu_delay_total uint64 + Cpu_delay_max uint64 + Cpu_delay_min uint64 Blkio_count uint64 Blkio_delay_total uint64 + Blkio_delay_max uint64 + Blkio_delay_min uint64 Swapin_count uint64 Swapin_delay_total uint64 + Swapin_delay_max uint64 + Swapin_delay_min uint64 Cpu_run_real_total uint64 Cpu_run_virtual_total uint64 Ac_comm [32]int8 @@ -320,11 +326,17 @@ type Taskstats struct { Cpu_scaled_run_real_total uint64 Freepages_count uint64 Freepages_delay_total uint64 + Freepages_delay_max uint64 + Freepages_delay_min uint64 Thrashing_count uint64 Thrashing_delay_total uint64 + Thrashing_delay_max uint64 + Thrashing_delay_min uint64 Ac_btime64 uint64 Compact_count uint64 Compact_delay_total uint64 + Compact_delay_max uint64 + Compact_delay_min uint64 Ac_tgid uint32 _ [4]byte Ac_tgetime uint64 @@ -332,8 +344,12 @@ type Taskstats struct { Ac_exe_inode uint64 Wpcopy_count uint64 Wpcopy_delay_total uint64 + Wpcopy_delay_max uint64 + Wpcopy_delay_min uint64 Irq_count uint64 Irq_delay_total uint64 + Irq_delay_max uint64 + Irq_delay_min uint64 } type cpuMask uint32 diff --git a/vendor/golang.org/x/sys/unix/ztypes_linux_ppc.go b/vendor/golang.org/x/sys/unix/ztypes_linux_ppc.go index 835972875..cb4fad785 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_linux_ppc.go +++ b/vendor/golang.org/x/sys/unix/ztypes_linux_ppc.go @@ -288,10 +288,16 @@ type Taskstats struct { _ [4]byte Cpu_count uint64 Cpu_delay_total uint64 + Cpu_delay_max uint64 + Cpu_delay_min uint64 Blkio_count uint64 Blkio_delay_total uint64 + Blkio_delay_max uint64 + Blkio_delay_min uint64 Swapin_count uint64 Swapin_delay_total uint64 + Swapin_delay_max uint64 + Swapin_delay_min uint64 Cpu_run_real_total uint64 Cpu_run_virtual_total uint64 Ac_comm [32]uint8 @@ -327,11 +333,17 @@ type Taskstats struct { Cpu_scaled_run_real_total uint64 Freepages_count uint64 Freepages_delay_total uint64 + Freepages_delay_max uint64 + Freepages_delay_min uint64 Thrashing_count uint64 Thrashing_delay_total uint64 + Thrashing_delay_max uint64 + Thrashing_delay_min uint64 Ac_btime64 uint64 Compact_count uint64 Compact_delay_total uint64 + Compact_delay_max uint64 + Compact_delay_min uint64 Ac_tgid uint32 _ [4]byte Ac_tgetime uint64 @@ -339,8 +351,12 @@ type Taskstats struct { Ac_exe_inode uint64 Wpcopy_count uint64 Wpcopy_delay_total uint64 + Wpcopy_delay_max uint64 + Wpcopy_delay_min uint64 Irq_count uint64 Irq_delay_total uint64 + Irq_delay_max uint64 + Irq_delay_min uint64 } type cpuMask uint32 diff --git a/vendor/golang.org/x/sys/unix/ztypes_linux_ppc64.go b/vendor/golang.org/x/sys/unix/ztypes_linux_ppc64.go index 69eb6a5c6..60272cfce 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_linux_ppc64.go +++ b/vendor/golang.org/x/sys/unix/ztypes_linux_ppc64.go @@ -289,10 +289,16 @@ type Taskstats struct { Ac_nice uint8 Cpu_count uint64 Cpu_delay_total uint64 + Cpu_delay_max uint64 + Cpu_delay_min uint64 Blkio_count uint64 Blkio_delay_total uint64 + Blkio_delay_max uint64 + Blkio_delay_min uint64 Swapin_count uint64 Swapin_delay_total uint64 + Swapin_delay_max uint64 + Swapin_delay_min uint64 Cpu_run_real_total uint64 Cpu_run_virtual_total uint64 Ac_comm [32]uint8 @@ -327,19 +333,29 @@ type Taskstats struct { Cpu_scaled_run_real_total uint64 Freepages_count uint64 Freepages_delay_total uint64 + Freepages_delay_max uint64 + Freepages_delay_min uint64 Thrashing_count uint64 Thrashing_delay_total uint64 + Thrashing_delay_max uint64 + Thrashing_delay_min uint64 Ac_btime64 uint64 Compact_count uint64 Compact_delay_total uint64 + Compact_delay_max uint64 + Compact_delay_min uint64 Ac_tgid uint32 Ac_tgetime uint64 Ac_exe_dev uint64 Ac_exe_inode uint64 Wpcopy_count uint64 Wpcopy_delay_total uint64 + Wpcopy_delay_max uint64 + Wpcopy_delay_min uint64 Irq_count uint64 Irq_delay_total uint64 + Irq_delay_max uint64 + Irq_delay_min uint64 } type cpuMask uint64 diff --git a/vendor/golang.org/x/sys/unix/ztypes_linux_ppc64le.go b/vendor/golang.org/x/sys/unix/ztypes_linux_ppc64le.go index 5f583cb62..3f5b91bc0 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_linux_ppc64le.go +++ b/vendor/golang.org/x/sys/unix/ztypes_linux_ppc64le.go @@ -289,10 +289,16 @@ type Taskstats struct { Ac_nice uint8 Cpu_count uint64 Cpu_delay_total uint64 + Cpu_delay_max uint64 + Cpu_delay_min uint64 Blkio_count uint64 Blkio_delay_total uint64 + Blkio_delay_max uint64 + Blkio_delay_min uint64 Swapin_count uint64 Swapin_delay_total uint64 + Swapin_delay_max uint64 + Swapin_delay_min uint64 Cpu_run_real_total uint64 Cpu_run_virtual_total uint64 Ac_comm [32]uint8 @@ -327,19 +333,29 @@ type Taskstats struct { Cpu_scaled_run_real_total uint64 Freepages_count uint64 Freepages_delay_total uint64 + Freepages_delay_max uint64 + Freepages_delay_min uint64 Thrashing_count uint64 Thrashing_delay_total uint64 + Thrashing_delay_max uint64 + Thrashing_delay_min uint64 Ac_btime64 uint64 Compact_count uint64 Compact_delay_total uint64 + Compact_delay_max uint64 + Compact_delay_min uint64 Ac_tgid uint32 Ac_tgetime uint64 Ac_exe_dev uint64 Ac_exe_inode uint64 Wpcopy_count uint64 Wpcopy_delay_total uint64 + Wpcopy_delay_max uint64 + Wpcopy_delay_min uint64 Irq_count uint64 Irq_delay_total uint64 + Irq_delay_max uint64 + Irq_delay_min uint64 } type cpuMask uint64 diff --git a/vendor/golang.org/x/sys/unix/ztypes_linux_riscv64.go b/vendor/golang.org/x/sys/unix/ztypes_linux_riscv64.go index ad05b51a6..51550f15a 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_linux_riscv64.go +++ b/vendor/golang.org/x/sys/unix/ztypes_linux_riscv64.go @@ -307,10 +307,16 @@ type Taskstats struct { Ac_nice uint8 Cpu_count uint64 Cpu_delay_total uint64 + Cpu_delay_max uint64 + Cpu_delay_min uint64 Blkio_count uint64 Blkio_delay_total uint64 + Blkio_delay_max uint64 + Blkio_delay_min uint64 Swapin_count uint64 Swapin_delay_total uint64 + Swapin_delay_max uint64 + Swapin_delay_min uint64 Cpu_run_real_total uint64 Cpu_run_virtual_total uint64 Ac_comm [32]uint8 @@ -345,19 +351,29 @@ type Taskstats struct { Cpu_scaled_run_real_total uint64 Freepages_count uint64 Freepages_delay_total uint64 + Freepages_delay_max uint64 + Freepages_delay_min uint64 Thrashing_count uint64 Thrashing_delay_total uint64 + Thrashing_delay_max uint64 + Thrashing_delay_min uint64 Ac_btime64 uint64 Compact_count uint64 Compact_delay_total uint64 + Compact_delay_max uint64 + Compact_delay_min uint64 Ac_tgid uint32 Ac_tgetime uint64 Ac_exe_dev uint64 Ac_exe_inode uint64 Wpcopy_count uint64 Wpcopy_delay_total uint64 + Wpcopy_delay_max uint64 + Wpcopy_delay_min uint64 Irq_count uint64 Irq_delay_total uint64 + Irq_delay_max uint64 + Irq_delay_min uint64 } type cpuMask uint64 diff --git a/vendor/golang.org/x/sys/unix/ztypes_linux_s390x.go b/vendor/golang.org/x/sys/unix/ztypes_linux_s390x.go index cf3ce9003..3239e50e0 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_linux_s390x.go +++ b/vendor/golang.org/x/sys/unix/ztypes_linux_s390x.go @@ -302,10 +302,16 @@ type Taskstats struct { Ac_nice uint8 Cpu_count uint64 Cpu_delay_total uint64 + Cpu_delay_max uint64 + Cpu_delay_min uint64 Blkio_count uint64 Blkio_delay_total uint64 + Blkio_delay_max uint64 + Blkio_delay_min uint64 Swapin_count uint64 Swapin_delay_total uint64 + Swapin_delay_max uint64 + Swapin_delay_min uint64 Cpu_run_real_total uint64 Cpu_run_virtual_total uint64 Ac_comm [32]int8 @@ -340,19 +346,29 @@ type Taskstats struct { Cpu_scaled_run_real_total uint64 Freepages_count uint64 Freepages_delay_total uint64 + Freepages_delay_max uint64 + Freepages_delay_min uint64 Thrashing_count uint64 Thrashing_delay_total uint64 + Thrashing_delay_max uint64 + Thrashing_delay_min uint64 Ac_btime64 uint64 Compact_count uint64 Compact_delay_total uint64 + Compact_delay_max uint64 + Compact_delay_min uint64 Ac_tgid uint32 Ac_tgetime uint64 Ac_exe_dev uint64 Ac_exe_inode uint64 Wpcopy_count uint64 Wpcopy_delay_total uint64 + Wpcopy_delay_max uint64 + Wpcopy_delay_min uint64 Irq_count uint64 Irq_delay_total uint64 + Irq_delay_max uint64 + Irq_delay_min uint64 } type cpuMask uint64 diff --git a/vendor/golang.org/x/sys/unix/ztypes_linux_sparc64.go b/vendor/golang.org/x/sys/unix/ztypes_linux_sparc64.go index 590b56739..faf200278 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_linux_sparc64.go +++ b/vendor/golang.org/x/sys/unix/ztypes_linux_sparc64.go @@ -284,10 +284,16 @@ type Taskstats struct { Ac_nice uint8 Cpu_count uint64 Cpu_delay_total uint64 + Cpu_delay_max uint64 + Cpu_delay_min uint64 Blkio_count uint64 Blkio_delay_total uint64 + Blkio_delay_max uint64 + Blkio_delay_min uint64 Swapin_count uint64 Swapin_delay_total uint64 + Swapin_delay_max uint64 + Swapin_delay_min uint64 Cpu_run_real_total uint64 Cpu_run_virtual_total uint64 Ac_comm [32]int8 @@ -322,19 +328,29 @@ type Taskstats struct { Cpu_scaled_run_real_total uint64 Freepages_count uint64 Freepages_delay_total uint64 + Freepages_delay_max uint64 + Freepages_delay_min uint64 Thrashing_count uint64 Thrashing_delay_total uint64 + Thrashing_delay_max uint64 + Thrashing_delay_min uint64 Ac_btime64 uint64 Compact_count uint64 Compact_delay_total uint64 + Compact_delay_max uint64 + Compact_delay_min uint64 Ac_tgid uint32 Ac_tgetime uint64 Ac_exe_dev uint64 Ac_exe_inode uint64 Wpcopy_count uint64 Wpcopy_delay_total uint64 + Wpcopy_delay_max uint64 + Wpcopy_delay_min uint64 Irq_count uint64 Irq_delay_total uint64 + Irq_delay_max uint64 + Irq_delay_min uint64 } type cpuMask uint64 diff --git a/vendor/golang.org/x/time/rate/sometimes.go b/vendor/golang.org/x/time/rate/sometimes.go index 6ba99ddb6..9b8393269 100644 --- a/vendor/golang.org/x/time/rate/sometimes.go +++ b/vendor/golang.org/x/time/rate/sometimes.go @@ -61,7 +61,9 @@ func (s *Sometimes) Do(f func()) { (s.Every > 0 && s.count%s.Every == 0) || (s.Interval > 0 && time.Since(s.last) >= s.Interval) { f() - s.last = time.Now() + if s.Interval > 0 { + s.last = time.Now() + } } s.count++ } diff --git a/vendor/golang.org/x/tools/internal/astutil/edge/edge.go b/vendor/golang.org/x/tools/go/ast/edge/edge.go similarity index 100% rename from vendor/golang.org/x/tools/internal/astutil/edge/edge.go rename to vendor/golang.org/x/tools/go/ast/edge/edge.go diff --git a/vendor/golang.org/x/tools/go/ast/inspector/cursor.go b/vendor/golang.org/x/tools/go/ast/inspector/cursor.go new file mode 100644 index 000000000..31c8d2f24 --- /dev/null +++ b/vendor/golang.org/x/tools/go/ast/inspector/cursor.go @@ -0,0 +1,502 @@ +// Copyright 2025 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package inspector + +import ( + "fmt" + "go/ast" + "go/token" + "iter" + "reflect" + + "golang.org/x/tools/go/ast/edge" +) + +// A Cursor represents an [ast.Node]. It is immutable. +// +// Two Cursors compare equal if they represent the same node. +// +// Call [Inspector.Root] to obtain a valid cursor for the virtual root +// node of the traversal. +// +// Use the following methods to navigate efficiently around the tree: +// - for ancestors, use [Cursor.Parent] and [Cursor.Enclosing]; +// - for children, use [Cursor.Child], [Cursor.Children], +// [Cursor.FirstChild], and [Cursor.LastChild]; +// - for siblings, use [Cursor.PrevSibling] and [Cursor.NextSibling]; +// - for descendants, use [Cursor.FindByPos], [Cursor.FindNode], +// [Cursor.Inspect], and [Cursor.Preorder]. +// +// Use the [Cursor.ChildAt] and [Cursor.ParentEdge] methods for +// information about the edges in a tree: which field (and slice +// element) of the parent node holds the child. +type Cursor struct { + in *Inspector + index int32 // index of push node; -1 for virtual root node +} + +// Root returns a cursor for the virtual root node, +// whose children are the files provided to [New]. +// +// Its [Cursor.Node] and [Cursor.Stack] methods return nil. +func (in *Inspector) Root() Cursor { + return Cursor{in, -1} +} + +// At returns the cursor at the specified index in the traversal, +// which must have been obtained from [Cursor.Index] on a Cursor +// belonging to the same Inspector (see [Cursor.Inspector]). +func (in *Inspector) At(index int32) Cursor { + if index < 0 { + panic("negative index") + } + if int(index) >= len(in.events) { + panic("index out of range for this inspector") + } + if in.events[index].index < index { + panic("invalid index") // (a push, not a pop) + } + return Cursor{in, index} +} + +// Inspector returns the cursor's Inspector. +func (c Cursor) Inspector() *Inspector { return c.in } + +// Index returns the index of this cursor position within the package. +// +// Clients should not assume anything about the numeric Index value +// except that it increases monotonically throughout the traversal. +// It is provided for use with [At]. +// +// Index must not be called on the Root node. +func (c Cursor) Index() int32 { + if c.index < 0 { + panic("Index called on Root node") + } + return c.index +} + +// Node returns the node at the current cursor position, +// or nil for the cursor returned by [Inspector.Root]. +func (c Cursor) Node() ast.Node { + if c.index < 0 { + return nil + } + return c.in.events[c.index].node +} + +// String returns information about the cursor's node, if any. +func (c Cursor) String() string { + if c.in == nil { + return "(invalid)" + } + if c.index < 0 { + return "(root)" + } + return reflect.TypeOf(c.Node()).String() +} + +// indices return the [start, end) half-open interval of event indices. +func (c Cursor) indices() (int32, int32) { + if c.index < 0 { + return 0, int32(len(c.in.events)) // root: all events + } else { + return c.index, c.in.events[c.index].index + 1 // just one subtree + } +} + +// Preorder returns an iterator over the nodes of the subtree +// represented by c in depth-first order. Each node in the sequence is +// represented by a Cursor that allows access to the Node, but may +// also be used to start a new traversal, or to obtain the stack of +// nodes enclosing the cursor. +// +// The traversal sequence is determined by [ast.Inspect]. The types +// argument, if non-empty, enables type-based filtering of events. The +// function f if is called only for nodes whose type matches an +// element of the types slice. +// +// If you need control over descent into subtrees, +// or need both pre- and post-order notifications, use [Cursor.Inspect] +func (c Cursor) Preorder(types ...ast.Node) iter.Seq[Cursor] { + mask := maskOf(types) + + return func(yield func(Cursor) bool) { + events := c.in.events + + for i, limit := c.indices(); i < limit; { + ev := events[i] + if ev.index > i { // push? + if ev.typ&mask != 0 && !yield(Cursor{c.in, i}) { + break + } + pop := ev.index + if events[pop].typ&mask == 0 { + // Subtree does not contain types: skip. + i = pop + 1 + continue + } + } + i++ + } + } +} + +// Inspect visits the nodes of the subtree represented by c in +// depth-first order. It calls f(n) for each node n before it +// visits n's children. If f returns true, Inspect invokes f +// recursively for each of the non-nil children of the node. +// +// Each node is represented by a Cursor that allows access to the +// Node, but may also be used to start a new traversal, or to obtain +// the stack of nodes enclosing the cursor. +// +// The complete traversal sequence is determined by [ast.Inspect]. +// The types argument, if non-empty, enables type-based filtering of +// events. The function f if is called only for nodes whose type +// matches an element of the types slice. +func (c Cursor) Inspect(types []ast.Node, f func(c Cursor) (descend bool)) { + mask := maskOf(types) + events := c.in.events + for i, limit := c.indices(); i < limit; { + ev := events[i] + if ev.index > i { + // push + pop := ev.index + if ev.typ&mask != 0 && !f(Cursor{c.in, i}) || + events[pop].typ&mask == 0 { + // The user opted not to descend, or the + // subtree does not contain types: + // skip past the pop. + i = pop + 1 + continue + } + } + i++ + } +} + +// Enclosing returns an iterator over the nodes enclosing the current +// current node, starting with the Cursor itself. +// +// Enclosing must not be called on the Root node (whose [Cursor.Node] returns nil). +// +// The types argument, if non-empty, enables type-based filtering of +// events: the sequence includes only enclosing nodes whose type +// matches an element of the types slice. +func (c Cursor) Enclosing(types ...ast.Node) iter.Seq[Cursor] { + if c.index < 0 { + panic("Cursor.Enclosing called on Root node") + } + + mask := maskOf(types) + + return func(yield func(Cursor) bool) { + events := c.in.events + for i := c.index; i >= 0; i = events[i].parent { + if events[i].typ&mask != 0 && !yield(Cursor{c.in, i}) { + break + } + } + } +} + +// Parent returns the parent of the current node. +// +// Parent must not be called on the Root node (whose [Cursor.Node] returns nil). +func (c Cursor) Parent() Cursor { + if c.index < 0 { + panic("Cursor.Parent called on Root node") + } + + return Cursor{c.in, c.in.events[c.index].parent} +} + +// ParentEdge returns the identity of the field in the parent node +// that holds this cursor's node, and if it is a list, the index within it. +// +// For example, f(x, y) is a CallExpr whose three children are Idents. +// f has edge kind [edge.CallExpr_Fun] and index -1. +// x and y have kind [edge.CallExpr_Args] and indices 0 and 1, respectively. +// +// If called on a child of the Root node, it returns ([edge.Invalid], -1). +// +// ParentEdge must not be called on the Root node (whose [Cursor.Node] returns nil). +func (c Cursor) ParentEdge() (edge.Kind, int) { + if c.index < 0 { + panic("Cursor.ParentEdge called on Root node") + } + events := c.in.events + pop := events[c.index].index + return unpackEdgeKindAndIndex(events[pop].parent) +} + +// ChildAt returns the cursor for the child of the +// current node identified by its edge and index. +// The index must be -1 if the edge.Kind is not a slice. +// The indicated child node must exist. +// +// ChildAt must not be called on the Root node (whose [Cursor.Node] returns nil). +// +// Invariant: c.Parent().ChildAt(c.ParentEdge()) == c. +func (c Cursor) ChildAt(k edge.Kind, idx int) Cursor { + target := packEdgeKindAndIndex(k, idx) + + // Unfortunately there's no shortcut to looping. + events := c.in.events + i := c.index + 1 + for { + pop := events[i].index + if pop < i { + break + } + if events[pop].parent == target { + return Cursor{c.in, i} + } + i = pop + 1 + } + panic(fmt.Sprintf("ChildAt(%v, %d): no such child of %v", k, idx, c)) +} + +// Child returns the cursor for n, which must be a direct child of c's Node. +// +// Child must not be called on the Root node (whose [Cursor.Node] returns nil). +func (c Cursor) Child(n ast.Node) Cursor { + if c.index < 0 { + panic("Cursor.Child called on Root node") + } + + if false { + // reference implementation + for child := range c.Children() { + if child.Node() == n { + return child + } + } + + } else { + // optimized implementation + events := c.in.events + for i := c.index + 1; events[i].index > i; i = events[i].index + 1 { + if events[i].node == n { + return Cursor{c.in, i} + } + } + } + panic(fmt.Sprintf("Child(%T): not a child of %v", n, c)) +} + +// NextSibling returns the cursor for the next sibling node in the same list +// (for example, of files, decls, specs, statements, fields, or expressions) as +// the current node. It returns (zero, false) if the node is the last node in +// the list, or is not part of a list. +// +// NextSibling must not be called on the Root node. +// +// See note at [Cursor.Children]. +func (c Cursor) NextSibling() (Cursor, bool) { + if c.index < 0 { + panic("Cursor.NextSibling called on Root node") + } + + events := c.in.events + i := events[c.index].index + 1 // after corresponding pop + if i < int32(len(events)) { + if events[i].index > i { // push? + return Cursor{c.in, i}, true + } + } + return Cursor{}, false +} + +// PrevSibling returns the cursor for the previous sibling node in the +// same list (for example, of files, decls, specs, statements, fields, +// or expressions) as the current node. It returns zero if the node is +// the first node in the list, or is not part of a list. +// +// It must not be called on the Root node. +// +// See note at [Cursor.Children]. +func (c Cursor) PrevSibling() (Cursor, bool) { + if c.index < 0 { + panic("Cursor.PrevSibling called on Root node") + } + + events := c.in.events + i := c.index - 1 + if i >= 0 { + if j := events[i].index; j < i { // pop? + return Cursor{c.in, j}, true + } + } + return Cursor{}, false +} + +// FirstChild returns the first direct child of the current node, +// or zero if it has no children. +func (c Cursor) FirstChild() (Cursor, bool) { + events := c.in.events + i := c.index + 1 // i=0 if c is root + if i < int32(len(events)) && events[i].index > i { // push? + return Cursor{c.in, i}, true + } + return Cursor{}, false +} + +// LastChild returns the last direct child of the current node, +// or zero if it has no children. +func (c Cursor) LastChild() (Cursor, bool) { + events := c.in.events + if c.index < 0 { // root? + if len(events) > 0 { + // return push of final event (a pop) + return Cursor{c.in, events[len(events)-1].index}, true + } + } else { + j := events[c.index].index - 1 // before corresponding pop + // Inv: j == c.index if c has no children + // or j is last child's pop. + if j > c.index { // c has children + return Cursor{c.in, events[j].index}, true + } + } + return Cursor{}, false +} + +// Children returns an iterator over the direct children of the +// current node, if any. +// +// When using Children, NextChild, and PrevChild, bear in mind that a +// Node's children may come from different fields, some of which may +// be lists of nodes without a distinguished intervening container +// such as [ast.BlockStmt]. +// +// For example, [ast.CaseClause] has a field List of expressions and a +// field Body of statements, so the children of a CaseClause are a mix +// of expressions and statements. Other nodes that have "uncontained" +// list fields include: +// +// - [ast.ValueSpec] (Names, Values) +// - [ast.CompositeLit] (Type, Elts) +// - [ast.IndexListExpr] (X, Indices) +// - [ast.CallExpr] (Fun, Args) +// - [ast.AssignStmt] (Lhs, Rhs) +// +// So, do not assume that the previous sibling of an ast.Stmt is also +// an ast.Stmt, or if it is, that they are executed sequentially, +// unless you have established that, say, its parent is a BlockStmt +// or its [Cursor.ParentEdge] is [edge.BlockStmt_List]. +// For example, given "for S1; ; S2 {}", the predecessor of S2 is S1, +// even though they are not executed in sequence. +func (c Cursor) Children() iter.Seq[Cursor] { + return func(yield func(Cursor) bool) { + c, ok := c.FirstChild() + for ok && yield(c) { + c, ok = c.NextSibling() + } + } +} + +// Contains reports whether c contains or is equal to c2. +// +// Both Cursors must belong to the same [Inspector]; +// neither may be its Root node. +func (c Cursor) Contains(c2 Cursor) bool { + if c.in != c2.in { + panic("different inspectors") + } + events := c.in.events + return c.index <= c2.index && events[c2.index].index <= events[c.index].index +} + +// FindNode returns the cursor for node n if it belongs to the subtree +// rooted at c. It returns zero if n is not found. +func (c Cursor) FindNode(n ast.Node) (Cursor, bool) { + + // FindNode is equivalent to this code, + // but more convenient and 15-20% faster: + if false { + for candidate := range c.Preorder(n) { + if candidate.Node() == n { + return candidate, true + } + } + return Cursor{}, false + } + + // TODO(adonovan): opt: should we assume Node.Pos is accurate + // and combine type-based filtering with position filtering + // like FindByPos? + + mask := maskOf([]ast.Node{n}) + events := c.in.events + + for i, limit := c.indices(); i < limit; i++ { + ev := events[i] + if ev.index > i { // push? + if ev.typ&mask != 0 && ev.node == n { + return Cursor{c.in, i}, true + } + pop := ev.index + if events[pop].typ&mask == 0 { + // Subtree does not contain type of n: skip. + i = pop + } + } + } + return Cursor{}, false +} + +// FindByPos returns the cursor for the innermost node n in the tree +// rooted at c such that n.Pos() <= start && end <= n.End(). +// (For an *ast.File, it uses the bounds n.FileStart-n.FileEnd.) +// +// It returns zero if none is found. +// Precondition: start <= end. +// +// See also [astutil.PathEnclosingInterval], which +// tolerates adjoining whitespace. +func (c Cursor) FindByPos(start, end token.Pos) (Cursor, bool) { + if end < start { + panic("end < start") + } + events := c.in.events + + // This algorithm could be implemented using c.Inspect, + // but it is about 2.5x slower. + + best := int32(-1) // push index of latest (=innermost) node containing range + for i, limit := c.indices(); i < limit; i++ { + ev := events[i] + if ev.index > i { // push? + n := ev.node + var nodeEnd token.Pos + if file, ok := n.(*ast.File); ok { + nodeEnd = file.FileEnd + // Note: files may be out of Pos order. + if file.FileStart > start { + i = ev.index // disjoint, after; skip to next file + continue + } + } else { + nodeEnd = n.End() + if n.Pos() > start { + break // disjoint, after; stop + } + } + // Inv: node.{Pos,FileStart} <= start + if end <= nodeEnd { + // node fully contains target range + best = i + } else if nodeEnd < start { + i = ev.index // disjoint, before; skip forward + } + } + } + if best >= 0 { + return Cursor{c.in, best}, true + } + return Cursor{}, false +} diff --git a/vendor/golang.org/x/tools/go/ast/inspector/inspector.go b/vendor/golang.org/x/tools/go/ast/inspector/inspector.go index 674490a65..bc44b2c8e 100644 --- a/vendor/golang.org/x/tools/go/ast/inspector/inspector.go +++ b/vendor/golang.org/x/tools/go/ast/inspector/inspector.go @@ -13,10 +13,19 @@ // This representation is sometimes called a "balanced parenthesis tree." // // Experiments suggest the inspector's traversals are about 2.5x faster -// than ast.Inspect, but it may take around 5 traversals for this +// than [ast.Inspect], but it may take around 5 traversals for this // benefit to amortize the inspector's construction cost. // If efficiency is the primary concern, do not use Inspector for // one-off traversals. +// +// The [Cursor] type provides a more flexible API for efficient +// navigation of syntax trees in all four "cardinal directions". For +// example, traversals may be nested, so you can find each node of +// type A and then search within it for nodes of type B. Or you can +// traverse from a node to its immediate neighbors: its parent, its +// previous and next sibling, or its first and last child. We +// recommend using methods of Cursor in preference to Inspector where +// possible. package inspector // There are four orthogonal features in a traversal: @@ -37,9 +46,8 @@ package inspector import ( "go/ast" - _ "unsafe" - "golang.org/x/tools/internal/astutil/edge" + "golang.org/x/tools/go/ast/edge" ) // An Inspector provides methods for inspecting @@ -48,18 +56,12 @@ type Inspector struct { events []event } -//go:linkname events golang.org/x/tools/go/ast/inspector.events -func events(in *Inspector) []event { return in.events } - -//go:linkname packEdgeKindAndIndex golang.org/x/tools/go/ast/inspector.packEdgeKindAndIndex func packEdgeKindAndIndex(ek edge.Kind, index int) int32 { return int32(uint32(index+1)<<7 | uint32(ek)) } // unpackEdgeKindAndIndex unpacks the edge kind and edge index (within // an []ast.Node slice) from the parent field of a pop event. -// -//go:linkname unpackEdgeKindAndIndex golang.org/x/tools/go/ast/inspector.unpackEdgeKindAndIndex func unpackEdgeKindAndIndex(x int32) (edge.Kind, int) { // The "parent" field of a pop node holds the // edge Kind in the lower 7 bits and the index+1 @@ -88,10 +90,15 @@ type event struct { // depth-first order. It calls f(n) for each node n before it visits // n's children. // -// The complete traversal sequence is determined by ast.Inspect. +// The complete traversal sequence is determined by [ast.Inspect]. // The types argument, if non-empty, enables type-based filtering of // events. The function f is called only for nodes whose type // matches an element of the types slice. +// +// The [Cursor.Preorder] method provides a richer alternative interface. +// Example: +// +// for c := range in.Root().Preorder(types) { ... } func (in *Inspector) Preorder(types []ast.Node, f func(ast.Node)) { // Because it avoids postorder calls to f, and the pruning // check, Preorder is almost twice as fast as Nodes. The two @@ -131,10 +138,18 @@ func (in *Inspector) Preorder(types []ast.Node, f func(ast.Node)) { // of the non-nil children of the node, followed by a call of // f(n, false). // -// The complete traversal sequence is determined by ast.Inspect. +// The complete traversal sequence is determined by [ast.Inspect]. // The types argument, if non-empty, enables type-based filtering of // events. The function f if is called only for nodes whose type // matches an element of the types slice. +// +// The [Cursor.Inspect] method provides a richer alternative interface. +// Example: +// +// in.Root().Inspect(types, func(c Cursor) bool { +// ... +// return true +// } func (in *Inspector) Nodes(types []ast.Node, f func(n ast.Node, push bool) (proceed bool)) { mask := maskOf(types) for i := int32(0); i < int32(len(in.events)); { @@ -168,6 +183,15 @@ func (in *Inspector) Nodes(types []ast.Node, f func(n ast.Node, push bool) (proc // supplies each call to f an additional argument, the current // traversal stack. The stack's first element is the outermost node, // an *ast.File; its last is the innermost, n. +// +// The [Cursor.Inspect] method provides a richer alternative interface. +// Example: +// +// in.Root().Inspect(types, func(c Cursor) bool { +// stack := slices.Collect(c.Enclosing()) +// ... +// return true +// }) func (in *Inspector) WithStack(types []ast.Node, f func(n ast.Node, push bool, stack []ast.Node) (proceed bool)) { mask := maskOf(types) var stack []ast.Node @@ -233,7 +257,7 @@ type visitor struct { type item struct { index int32 // index of current node's push event parentIndex int32 // index of parent node's push event - typAccum uint64 // accumulated type bits of current node's descendents + typAccum uint64 // accumulated type bits of current node's descendants edgeKindAndIndex int32 // edge.Kind and index, bit packed } diff --git a/vendor/golang.org/x/tools/go/ast/inspector/walk.go b/vendor/golang.org/x/tools/go/ast/inspector/walk.go index 5a42174a0..5f1c93c8a 100644 --- a/vendor/golang.org/x/tools/go/ast/inspector/walk.go +++ b/vendor/golang.org/x/tools/go/ast/inspector/walk.go @@ -13,7 +13,7 @@ import ( "fmt" "go/ast" - "golang.org/x/tools/internal/astutil/edge" + "golang.org/x/tools/go/ast/edge" ) func walkList[N ast.Node](v *visitor, ek edge.Kind, list []N) { diff --git a/vendor/modules.txt b/vendor/modules.txt index c918abfc2..9d471f116 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -383,7 +383,7 @@ go.opentelemetry.io/proto/otlp/trace/v1 # go4.org v0.0.0-20201209231011-d4a079459e60 ## explicit; go 1.13 go4.org/bytereplacer -# golang.org/x/crypto v0.38.0 +# golang.org/x/crypto v0.40.0 ## explicit; go 1.23.0 golang.org/x/crypto/chacha20 golang.org/x/crypto/chacha20poly1305 @@ -392,7 +392,7 @@ golang.org/x/crypto/cryptobyte/asn1 golang.org/x/crypto/hkdf golang.org/x/crypto/internal/alias golang.org/x/crypto/internal/poly1305 -# golang.org/x/net v0.40.0 +# golang.org/x/net v0.41.0 ## explicit; go 1.23.0 golang.org/x/net/html golang.org/x/net/html/atom @@ -416,20 +416,20 @@ golang.org/x/oauth2/google/internal/stsexchange golang.org/x/oauth2/internal golang.org/x/oauth2/jws golang.org/x/oauth2/jwt -# golang.org/x/sync v0.14.0 +# golang.org/x/sync v0.16.0 ## explicit; go 1.23.0 golang.org/x/sync/semaphore -# golang.org/x/sys v0.33.0 +# golang.org/x/sys v0.34.0 ## explicit; go 1.23.0 golang.org/x/sys/cpu golang.org/x/sys/plan9 golang.org/x/sys/unix golang.org/x/sys/windows golang.org/x/sys/windows/registry -# golang.org/x/term v0.32.0 +# golang.org/x/term v0.33.0 ## explicit; go 1.23.0 golang.org/x/term -# golang.org/x/text v0.25.0 +# golang.org/x/text v0.27.0 ## explicit; go 1.23.0 golang.org/x/text/encoding golang.org/x/text/encoding/charmap @@ -451,14 +451,14 @@ golang.org/x/text/secure/bidirule golang.org/x/text/transform golang.org/x/text/unicode/bidi golang.org/x/text/unicode/norm -# golang.org/x/time v0.11.0 +# golang.org/x/time v0.12.0 ## explicit; go 1.23.0 golang.org/x/time/rate -# golang.org/x/tools v0.33.0 +# golang.org/x/tools v0.34.0 ## explicit; go 1.23.0 golang.org/x/tools/cover +golang.org/x/tools/go/ast/edge golang.org/x/tools/go/ast/inspector -golang.org/x/tools/internal/astutil/edge # google.golang.org/api v0.187.0 ## explicit; go 1.20 google.golang.org/api/cloudresourcemanager/v1 From 6b7e63f6e6319d8ffada727d4b69c8557d501e8b Mon Sep 17 00:00:00 2001 From: Prachi Pendse Date: Wed, 6 Aug 2025 10:12:46 -0700 Subject: [PATCH 15/51] Replace Get operations with polling and skip VAC tests during integration test --- cmd/gce-pd-csi-driver/main.go | 4 +- pkg/gce-cloud-provider/compute/gce-compute.go | 41 ++++++++++++------- test/k8s-integration/main.go | 4 ++ 3 files changed, 33 insertions(+), 16 deletions(-) diff --git a/cmd/gce-pd-csi-driver/main.go b/cmd/gce-pd-csi-driver/main.go index 07e883d92..ff4ab9522 100644 --- a/cmd/gce-pd-csi-driver/main.go +++ b/cmd/gce-pd-csi-driver/main.go @@ -57,10 +57,10 @@ var ( attachDiskBackoffJitter = flag.Float64("attach-disk-backoff-jitter", 0.0, "Jitter for attachDisk backoff") attachDiskBackoffSteps = flag.Int("attach-disk-backoff-steps", 24, "Steps for attachDisk backoff") attachDiskBackoffCap = flag.Duration("attach-disk-backoff-cap", 0, "Cap for attachDisk backoff") - waitForOpBackoffDuration = flag.Duration("wait-op-backoff-duration", 3*time.Second, "Duration for wait for operation backoff") + waitForOpBackoffDuration = flag.Duration("wait-op-backoff-duration", 2*time.Minute, "Duration for wait for operation backoff") waitForOpBackoffFactor = flag.Float64("wait-op-backoff-factor", 0.0, "Factor for wait for operation backoff") waitForOpBackoffJitter = flag.Float64("wait-op-backoff-jitter", 0.0, "Jitter for wait for operation backoff") - waitForOpBackoffSteps = flag.Int("wait-op-backoff-steps", 100, "Steps for wait for operation backoff") + waitForOpBackoffSteps = flag.Int("wait-op-backoff-steps", 3, "Steps for wait for operation backoff") waitForOpBackoffCap = flag.Duration("wait-op-backoff-cap", 0, "Cap for wait for operation backoff") enableDeviceInUseCheck = flag.Bool("enable-device-in-use-check-on-node-unstage", true, "If set to true, block NodeUnstageVolume requests until the specified device is not in use") diff --git a/pkg/gce-cloud-provider/compute/gce-compute.go b/pkg/gce-cloud-provider/compute/gce-compute.go index b03777ccb..494da28c0 100644 --- a/pkg/gce-cloud-provider/compute/gce-compute.go +++ b/pkg/gce-cloud-provider/compute/gce-compute.go @@ -76,12 +76,12 @@ var AttachDiskBackoff = wait.Backoff{ Cap: 0} // WaitForOpBackoff is backoff used to wait for Global, Regional or Zonal operation to complete. -// Default values are similar to Poll every 3 seconds with 5 minute timeout. +// Default values are similar to Poll every 2 minutes with 6 minute timeout. var WaitForOpBackoff = wait.Backoff{ - Duration: 3 * time.Second, + Duration: 2 * time.Minute, Factor: 0.0, Jitter: 0.0, - Steps: 100, + Steps: 3, Cap: 0} // Custom error type to propagate error messages up to clients. @@ -1064,39 +1064,52 @@ func (cloud *CloudProvider) getRegionalDiskTypeURI(project string, region, diskT } func (cloud *CloudProvider) waitForZonalOp(ctx context.Context, project, opName string, zone string) error { - // The v1 API can query for v1, alpha, or beta operations. return wait.ExponentialBackoff(WaitForOpBackoff, func() (bool, error) { - pollOp, err := cloud.service.ZoneOperations.Get(project, zone, opName).Context(ctx).Do() + waitOp, err := cloud.service.ZoneOperations.Wait(project, zone, opName).Context(ctx).Do() + // In case of service unavailable do not propogate the error so ExponentialBackoff will retry + if err != nil && waitOp.HttpErrorStatusCode == 503 { + klog.Errorf("WaitForZonalOp(op: %s, zone: %#v, err: %v) failed to poll the operation", opName, zone, err) + return false, nil + } if err != nil { - klog.Errorf("WaitForOp(op: %s, zone: %#v) failed to poll the operation", opName, zone) + klog.Errorf("WaitForZonalOp(op: %s, zone: %#v, err: %v) failed to poll the operation", opName, zone, err) return false, err } - done, err := opIsDone(pollOp) + done, err := opIsDone(waitOp) return done, err }) } func (cloud *CloudProvider) waitForRegionalOp(ctx context.Context, project, opName string, region string) error { - // The v1 API can query for v1, alpha, or beta operations. return wait.ExponentialBackoff(WaitForOpBackoff, func() (bool, error) { - pollOp, err := cloud.service.RegionOperations.Get(project, region, opName).Context(ctx).Do() + waitOp, err := cloud.service.RegionOperations.Wait(project, region, opName).Context(ctx).Do() + // In case of service unavailable do not propogate the error so ExponentialBackoff will retry + if err != nil && waitOp.HttpErrorStatusCode == 503 { + klog.Errorf("WaitForRegionalOp(op: %s, region: %#v, err: %v) failed to poll the operation", opName, region, err) + return false, nil + } if err != nil { - klog.Errorf("WaitForOp(op: %s, region: %#v) failed to poll the operation", opName, region) + klog.Errorf("WaitForRegionalOp(op: %s, region: %#v, err: %v) failed to poll the operation", opName, region, err) return false, err } - done, err := opIsDone(pollOp) + done, err := opIsDone(waitOp) return done, err }) } func (cloud *CloudProvider) waitForGlobalOp(ctx context.Context, project, opName string) error { return wait.ExponentialBackoff(WaitForOpBackoff, func() (bool, error) { - pollOp, err := cloud.service.GlobalOperations.Get(project, opName).Context(ctx).Do() + waitOp, err := cloud.service.GlobalOperations.Wait(project, opName).Context(ctx).Do() + // In case of service unavailable do not propogate the error so ExponentialBackoff will retry + if err != nil && waitOp.HttpErrorStatusCode == 503 { + klog.Errorf("WaitForGlobalOp(op: %s, err: %v) failed to poll the operation", opName, err) + return false, nil + } if err != nil { - klog.Errorf("waitForGlobalOp(op: %s) failed to poll the operation", opName) + klog.Errorf("waitForGlobalOp(op: %s, err: %v) failed to poll the operation", opName, err) return false, err } - done, err := opIsDone(pollOp) + done, err := opIsDone(waitOp) return done, err }) } diff --git a/test/k8s-integration/main.go b/test/k8s-integration/main.go index b84727503..80205785f 100644 --- a/test/k8s-integration/main.go +++ b/test/k8s-integration/main.go @@ -639,6 +639,8 @@ func generateGCETestSkip(testParams *testParameters) string { skipString := "\\[Disruptive\\]|\\[Serial\\]" // Skip mount options test until we fix the invalid mount options for xfs. skipString = skipString + "|csi-gcepd-sc-xfs.*provisioning.should.provision.storage.with.mount.options" + // Skip VolumeAttributesClass tests while it's a beta feature. + skipString = skipString + "|\\[Feature:VolumeAttributesClass\\]" v := apimachineryversion.MustParseSemantic(testParams.clusterVersion) @@ -745,6 +747,8 @@ func generateGKETestSkip(testParams *testParameters) string { // Skip mount options test until we fix the invalid mount options for xfs. skipString = skipString + "|csi-gcepd-sc-xfs.*provisioning.should.provision.storage.with.mount.options" + // Skip VolumeAttributesClass tests while it's a beta feature. + skipString = skipString + "|\\[Feature:VolumeAttributesClass\\]" // Skip rwop test when node version is less than 1.32. Test was added only // in 1.32 and above, see tags in From ecb1237476ac58b659c3847d2ea5ac6aa7fbb5ef Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 11 Aug 2025 19:29:06 +0000 Subject: [PATCH 16/51] Bump the k8s-dependencies group across 1 directory with 6 updates Bumps the k8s-dependencies group with 4 updates in the / directory: [k8s.io/api](https://github.com/kubernetes/api), [k8s.io/cloud-provider](https://github.com/kubernetes/cloud-provider), [k8s.io/mount-utils](https://github.com/kubernetes/mount-utils) and [sigs.k8s.io/yaml](https://github.com/kubernetes-sigs/yaml). Updates `k8s.io/api` from 0.33.1 to 0.33.2 - [Commits](https://github.com/kubernetes/api/compare/v0.33.1...v0.33.2) Updates `k8s.io/apimachinery` from 0.33.1 to 0.33.2 - [Commits](https://github.com/kubernetes/apimachinery/compare/v0.33.1...v0.33.2) Updates `k8s.io/cloud-provider` from 0.33.1 to 0.33.2 - [Commits](https://github.com/kubernetes/cloud-provider/compare/v0.33.1...v0.33.2) Updates `k8s.io/component-base` from 0.33.1 to 0.33.2 - [Commits](https://github.com/kubernetes/component-base/compare/v0.33.1...v0.33.2) Updates `k8s.io/mount-utils` from 0.33.1 to 0.33.2 - [Commits](https://github.com/kubernetes/mount-utils/compare/v0.33.1...v0.33.2) Updates `sigs.k8s.io/yaml` from 1.4.0 to 1.5.0 - [Release notes](https://github.com/kubernetes-sigs/yaml/releases) - [Changelog](https://github.com/kubernetes-sigs/yaml/blob/master/RELEASE.md) - [Commits](https://github.com/kubernetes-sigs/yaml/compare/v1.4.0...v1.5.0) --- updated-dependencies: - dependency-name: k8s.io/api dependency-version: 0.33.2 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: k8s-dependencies - dependency-name: k8s.io/apimachinery dependency-version: 0.33.2 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: k8s-dependencies - dependency-name: k8s.io/cloud-provider dependency-version: 0.33.2 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: k8s-dependencies - dependency-name: k8s.io/component-base dependency-version: 0.33.2 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: k8s-dependencies - dependency-name: k8s.io/mount-utils dependency-version: 0.33.2 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: k8s-dependencies - dependency-name: sigs.k8s.io/yaml dependency-version: 1.5.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: k8s-dependencies ... Signed-off-by: dependabot[bot] --- go.mod | 13 +- go.sum | 27 ++- vendor/go.yaml.in/yaml/v2/.travis.yml | 17 ++ .../goyaml.v2 => go.yaml.in/yaml/v2}/LICENSE | 0 .../yaml/v2}/LICENSE.libyaml | 0 .../goyaml.v2 => go.yaml.in/yaml/v2}/NOTICE | 0 vendor/go.yaml.in/yaml/v2/README.md | 131 ++++++++++++ .../goyaml.v2 => go.yaml.in/yaml/v2}/apic.go | 0 .../yaml/v2}/decode.go | 0 .../yaml/v2}/emitterc.go | 0 .../yaml/v2}/encode.go | 0 .../yaml/v2}/parserc.go | 0 .../yaml/v2}/readerc.go | 0 .../yaml/v2}/resolve.go | 0 .../yaml/v2}/scannerc.go | 0 .../yaml/v2}/sorter.go | 0 .../yaml/v2}/writerc.go | 0 .../goyaml.v2 => go.yaml.in/yaml/v2}/yaml.go | 2 +- .../goyaml.v2 => go.yaml.in/yaml/v2}/yamlh.go | 0 .../yaml/v2}/yamlprivateh.go | 0 vendor/modules.txt | 17 +- vendor/sigs.k8s.io/yaml/.travis.yml | 12 -- vendor/sigs.k8s.io/yaml/goyaml.v2/OWNERS | 24 --- vendor/sigs.k8s.io/yaml/goyaml.v2/README.md | 200 ++++++------------ .../yaml/goyaml.v2/yaml_aliases.go | 85 ++++++++ vendor/sigs.k8s.io/yaml/yaml.go | 11 +- vendor/sigs.k8s.io/yaml/yaml_go110.go | 31 --- 27 files changed, 340 insertions(+), 230 deletions(-) create mode 100644 vendor/go.yaml.in/yaml/v2/.travis.yml rename vendor/{sigs.k8s.io/yaml/goyaml.v2 => go.yaml.in/yaml/v2}/LICENSE (100%) rename vendor/{sigs.k8s.io/yaml/goyaml.v2 => go.yaml.in/yaml/v2}/LICENSE.libyaml (100%) rename vendor/{sigs.k8s.io/yaml/goyaml.v2 => go.yaml.in/yaml/v2}/NOTICE (100%) create mode 100644 vendor/go.yaml.in/yaml/v2/README.md rename vendor/{sigs.k8s.io/yaml/goyaml.v2 => go.yaml.in/yaml/v2}/apic.go (100%) rename vendor/{sigs.k8s.io/yaml/goyaml.v2 => go.yaml.in/yaml/v2}/decode.go (100%) rename vendor/{sigs.k8s.io/yaml/goyaml.v2 => go.yaml.in/yaml/v2}/emitterc.go (100%) rename vendor/{sigs.k8s.io/yaml/goyaml.v2 => go.yaml.in/yaml/v2}/encode.go (100%) rename vendor/{sigs.k8s.io/yaml/goyaml.v2 => go.yaml.in/yaml/v2}/parserc.go (100%) rename vendor/{sigs.k8s.io/yaml/goyaml.v2 => go.yaml.in/yaml/v2}/readerc.go (100%) rename vendor/{sigs.k8s.io/yaml/goyaml.v2 => go.yaml.in/yaml/v2}/resolve.go (100%) rename vendor/{sigs.k8s.io/yaml/goyaml.v2 => go.yaml.in/yaml/v2}/scannerc.go (100%) rename vendor/{sigs.k8s.io/yaml/goyaml.v2 => go.yaml.in/yaml/v2}/sorter.go (100%) rename vendor/{sigs.k8s.io/yaml/goyaml.v2 => go.yaml.in/yaml/v2}/writerc.go (100%) rename vendor/{sigs.k8s.io/yaml/goyaml.v2 => go.yaml.in/yaml/v2}/yaml.go (99%) rename vendor/{sigs.k8s.io/yaml/goyaml.v2 => go.yaml.in/yaml/v2}/yamlh.go (100%) rename vendor/{sigs.k8s.io/yaml/goyaml.v2 => go.yaml.in/yaml/v2}/yamlprivateh.go (100%) delete mode 100644 vendor/sigs.k8s.io/yaml/.travis.yml delete mode 100644 vendor/sigs.k8s.io/yaml/goyaml.v2/OWNERS create mode 100644 vendor/sigs.k8s.io/yaml/goyaml.v2/yaml_aliases.go delete mode 100644 vendor/sigs.k8s.io/yaml/yaml_go110.go diff --git a/go.mod b/go.mod index 3178485e3..cfd43c34a 100644 --- a/go.mod +++ b/go.mod @@ -32,16 +32,16 @@ require ( google.golang.org/grpc v1.71.0 google.golang.org/protobuf v1.36.6 gopkg.in/gcfg.v1 v1.2.3 - k8s.io/api v0.33.1 - k8s.io/apimachinery v0.33.1 + k8s.io/api v0.33.3 + k8s.io/apimachinery v0.33.3 k8s.io/client-go v11.0.1-0.20190805182717-6502b5e7b1b5+incompatible - k8s.io/cloud-provider v0.33.1 - k8s.io/component-base v0.33.1 + k8s.io/cloud-provider v0.33.3 + k8s.io/component-base v0.33.3 k8s.io/klog/v2 v2.130.1 - k8s.io/mount-utils v0.33.1 + k8s.io/mount-utils v0.33.3 k8s.io/utils v0.0.0-20241104100929-3ea5e8cea738 sigs.k8s.io/boskos v0.0.0-20220711194915-6cb8a6fb2dd1 - sigs.k8s.io/yaml v1.4.0 + sigs.k8s.io/yaml v1.6.0 ) require ( @@ -97,6 +97,7 @@ require ( go.opentelemetry.io/otel/metric v1.35.0 // indirect go.opentelemetry.io/otel/trace v1.35.0 // indirect go.opentelemetry.io/proto/otlp v1.5.0 // indirect + go.yaml.in/yaml/v2 v2.4.2 // indirect go4.org v0.0.0-20201209231011-d4a079459e60 // indirect golang.org/x/crypto v0.40.0 // indirect golang.org/x/net v0.41.0 // indirect diff --git a/go.sum b/go.sum index f5d00fa16..79f66885a 100644 --- a/go.sum +++ b/go.sum @@ -1640,6 +1640,10 @@ go.uber.org/zap v1.13.0/go.mod h1:zwrFLgMcdUuIBviXEYEH1YKNaOBnKXsx2IPda5bBwHM= go.uber.org/zap v1.14.1/go.mod h1:Mb2vm2krFEG5DV0W9qcHBYFtp/Wku1cvYaqPsS/WYfc= go.uber.org/zap v1.15.0/go.mod h1:Mb2vm2krFEG5DV0W9qcHBYFtp/Wku1cvYaqPsS/WYfc= go.uber.org/zap v1.17.0/go.mod h1:MXVU+bhUf/A7Xi2HNOnopQOrmycQ5Ih87HtOu4q5SSo= +go.yaml.in/yaml/v2 v2.4.2 h1:DzmwEr2rDGHl7lsFgAHxmNz/1NlQ7xLIrlN2h5d1eGI= +go.yaml.in/yaml/v2 v2.4.2/go.mod h1:081UH+NErpNdqlCXm3TtEran0rJZGxAYx9hb/ELlsPU= +go.yaml.in/yaml/v3 v3.0.3 h1:bXOww4E/J3f66rav3pX3m8w6jDE4knZjGOw8b5Y6iNE= +go.yaml.in/yaml/v3 v3.0.3/go.mod h1:tBHosrYAkRZjRAOREWbDnBXUf08JOwYq++0QNwQiWzI= go4.org v0.0.0-20201209231011-d4a079459e60 h1:iqAGo78tVOJXELHQFRjR6TMwItrvXH4hrGJ32I/NFF8= go4.org v0.0.0-20201209231011-d4a079459e60/go.mod h1:CIiUVy99QCPfoE13bO4EZaz5GZMZXMSBGhxRdsvzbkg= gocloud.dev v0.19.0/go.mod h1:SmKwiR8YwIMMJvQBKLsC3fHNyMwXLw3PMDO+VVteJMI= @@ -2489,8 +2493,8 @@ k8s.io/api v0.17.4/go.mod h1:5qxx6vjmwUVG2nHQTKGlLts8Tbok8PzHl4vHtVFuZCA= k8s.io/api v0.17.6/go.mod h1:1jKVwkj0UZ4huak/yRt3MFfU5wc32+B41SkNN5HhyFg= k8s.io/api v0.21.1/go.mod h1:FstGROTmsSHBarKc8bylzXih8BLNYTiS3TZcsoEDg2s= k8s.io/api v0.32.2/go.mod h1:hKlhk4x1sJyYnHENsrdCWw31FEmCijNGPJO5WzHiJ6Y= -k8s.io/api v0.33.1 h1:tA6Cf3bHnLIrUK4IqEgb2v++/GYUtqiu9sRVk3iBXyw= -k8s.io/api v0.33.1/go.mod h1:87esjTn9DRSRTD4fWMXamiXxJhpOIREjWOSjsW1kEHw= +k8s.io/api v0.33.3 h1:SRd5t//hhkI1buzxb288fy2xvjubstenEKL9K51KBI8= +k8s.io/api v0.33.3/go.mod h1:01Y/iLUjNBM3TAvypct7DIj0M0NIZc+PzAHCIo0CYGE= k8s.io/apiextensions-apiserver v0.0.0-20190918201827-3de75813f604/go.mod h1:7H8sjDlWQu89yWB3FhZfsLyRCRLuoXoCoY5qtwW1q6I= k8s.io/apiextensions-apiserver v0.16.4/go.mod h1:HYQwjujEkXmQNhap2C9YDdIVOSskGZ3et0Mvjcyjbto= k8s.io/apiextensions-apiserver v0.17.2/go.mod h1:4KdMpjkEjjDI2pPfBA15OscyNldHWdBCfsWMDWAmSTs= @@ -2513,8 +2517,8 @@ k8s.io/apimachinery v0.17.6/go.mod h1:Lg8zZ5iC/O8UjCqW6DNhcQG2m4TdjF9kwG3891OWbb k8s.io/apimachinery v0.18.5/go.mod h1:OaXp26zu/5J7p0f92ASynJa1pZo06YlV9fG7BoWbCko= k8s.io/apimachinery v0.21.1/go.mod h1:jbreFvJo3ov9rj7eWT7+sYiRx+qZuCYXwWT1bcDswPY= k8s.io/apimachinery v0.32.2/go.mod h1:GpHVgxoKlTxClKcteaeuF1Ul/lDVb74KpZcxcmLDElE= -k8s.io/apimachinery v0.33.1 h1:mzqXWV8tW9Rw4VeW9rEkqvnxj59k1ezDUl20tFK/oM4= -k8s.io/apimachinery v0.33.1/go.mod h1:BHW0YOu7n22fFv/JkYOEfkUYNRN0fj0BlvMFWA7b+SM= +k8s.io/apimachinery v0.33.3 h1:4ZSrmNa0c/ZpZJhAgRdcsFcZOw1PQU1bALVQ0B3I5LA= +k8s.io/apimachinery v0.33.3/go.mod h1:BHW0YOu7n22fFv/JkYOEfkUYNRN0fj0BlvMFWA7b+SM= k8s.io/apiserver v0.0.0-20190918200908-1e17798da8c1/go.mod h1:4FuDU+iKPjdsdQSN3GsEKZLB/feQsj1y9dhhBDVV2Ns= k8s.io/apiserver v0.16.4/go.mod h1:kbLJOak655g6W7C+muqu1F76u9wnEycfKMqbVaXIdAc= k8s.io/apiserver v0.17.0/go.mod h1:ABM+9x/prjINN6iiffRVNCBR2Wk7uY4z+EtEGZD48cg= @@ -2528,8 +2532,8 @@ k8s.io/client-go v0.32.2 h1:4dYCD4Nz+9RApM2b/3BtVvBHw54QjMFUl1OLcJG5yOA= k8s.io/client-go v0.32.2/go.mod h1:fpZ4oJXclZ3r2nDOv+Ux3XcJutfrwjKTCHz2H3sww94= k8s.io/cloud-provider v0.17.0/go.mod h1:Ze4c3w2C0bRsjkBUoHpFi+qWe3ob1wI2/7cUn+YQIDE= k8s.io/cloud-provider v0.17.4/go.mod h1:XEjKDzfD+b9MTLXQFlDGkk6Ho8SGMpaU8Uugx/KNK9U= -k8s.io/cloud-provider v0.33.1 h1:nOmby9fIKCBJr9fNKXpLK5IBbS1snX82+JIxfxGvhI8= -k8s.io/cloud-provider v0.33.1/go.mod h1:2lvWqPsvBOzbtGWjGfVDX/ttpvSeI9ZdB8d4TbYnt9s= +k8s.io/cloud-provider v0.33.3 h1:HzpZh0W0MJoLkMGYrMjkHbwcGFIZxitgMf4utAwfPEY= +k8s.io/cloud-provider v0.33.3/go.mod h1:KcXaoYCJtTTiP+8IIEHcJDpvg0QzW67+FGWpgkOteDU= k8s.io/code-generator v0.0.0-20190612205613-18da4a14b22b/go.mod h1:G8bQwmHm2eafm5bgtX67XDZQ8CWKSGu9DekI+yN4Y5I= k8s.io/code-generator v0.0.0-20190831074504-732c9ca86353/go.mod h1:V5BD6M4CyaN5m+VthcclXWsVcT1Hu+glwa1bi3MIsyE= k8s.io/code-generator v0.16.4/go.mod h1:mJUgkl06XV4kstAnLHAIzJPVCOzVR+ZcfPIv4fUsFCY= @@ -2546,8 +2550,8 @@ k8s.io/component-base v0.17.2/go.mod h1:zMPW3g5aH7cHJpKYQ/ZsGMcgbsA/VyhEugF3QT1a k8s.io/component-base v0.17.4/go.mod h1:5BRqHMbbQPm2kKu35v3G+CpVq4K0RJKC7TRioF0I9lE= k8s.io/component-base v0.17.6/go.mod h1:jgRLWl0B0rOzFNtxQ9E4BphPmDqoMafujdau6AdG2Xo= k8s.io/component-base v0.21.1/go.mod h1:NgzFZ2qu4m1juby4TnrmpR8adRk6ka62YdH5DkIIyKA= -k8s.io/component-base v0.33.1 h1:EoJ0xA+wr77T+G8p6T3l4efT2oNwbqBVKR71E0tBIaI= -k8s.io/component-base v0.33.1/go.mod h1:guT/w/6piyPfTgq7gfvgetyXMIh10zuXA6cRRm3rDuY= +k8s.io/component-base v0.33.3 h1:mlAuyJqyPlKZM7FyaoM/LcunZaaY353RXiOd2+B5tGA= +k8s.io/component-base v0.33.3/go.mod h1:ktBVsBzkI3imDuxYXmVxZ2zxJnYTZ4HAsVj9iF09qp4= k8s.io/csi-translation-lib v0.17.0/go.mod h1:HEF7MEz7pOLJCnxabi45IPkhSsE/KmxPQksuCrHKWls= k8s.io/csi-translation-lib v0.17.4/go.mod h1:CsxmjwxEI0tTNMzffIAcgR9lX4wOh6AKHdxQrT7L0oo= k8s.io/gengo v0.0.0-20190116091435-f8a0810f38af/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8IAqLxYwwyPxAX1Pzy0ii0= @@ -2591,8 +2595,8 @@ k8s.io/kubernetes v1.14.7/go.mod h1:ocZa8+6APFNC2tX1DZASIbocyYT5jHzqFVsY5aoB7Jk= k8s.io/legacy-cloud-providers v0.17.0/go.mod h1:DdzaepJ3RtRy+e5YhNtrCYwlgyK87j/5+Yfp0L9Syp8= k8s.io/legacy-cloud-providers v0.17.4/go.mod h1:FikRNoD64ECjkxO36gkDgJeiQWwyZTuBkhu+yxOc1Js= k8s.io/metrics v0.17.2/go.mod h1:3TkNHET4ROd+NfzNxkjoVfQ0Ob4iZnaHmSEA4vYpwLw= -k8s.io/mount-utils v0.33.1 h1:hodPhfyoK+gG0SgnYwx1iPrlnpaESZiJ9GFzF5V/imE= -k8s.io/mount-utils v0.33.1/go.mod h1:1JR4rKymg8B8bCPo618hpSAdrpO6XLh0Acqok/xVwPE= +k8s.io/mount-utils v0.33.3 h1:Q1jsnqdS4LdtJSYSXgiQv/XNrRHQncLk3gMYjKNSZrE= +k8s.io/mount-utils v0.33.3/go.mod h1:1JR4rKymg8B8bCPo618hpSAdrpO6XLh0Acqok/xVwPE= k8s.io/test-infra v0.0.0-20181019233642-2e10a0bbe9b3/go.mod h1:2NzXB13Ji0nqpyublHeiPC4FZwU0TknfvyaaNfl/BTA= k8s.io/test-infra v0.0.0-20191212060232-70b0b49fe247/go.mod h1:d8SKryJBXAwfCFVL4wieRez47J2NOOAb9d029sWLseQ= k8s.io/test-infra v0.0.0-20200407001919-bc7f71ef65b8/go.mod h1:/WpJWcaDvuykB322WXP4kJbX8IpalOzuPxA62GpwkJk= @@ -2678,8 +2682,9 @@ sigs.k8s.io/testing_frameworks v0.1.1/go.mod h1:VVBKrHmJ6Ekkfz284YKhQePcdycOzNH9 sigs.k8s.io/yaml v1.1.0/go.mod h1:UJmg0vDUVViEyp3mgSv9WPwZCDxu4rQW1olrI1uml+o= sigs.k8s.io/yaml v1.2.0/go.mod h1:yfXDCHCao9+ENCvLSE62v9VSji2MKu5jeNfTrofGhJc= sigs.k8s.io/yaml v1.3.0/go.mod h1:GeOyir5tyXNByN85N/dRIT9es5UQNerPYEKK56eTBm8= -sigs.k8s.io/yaml v1.4.0 h1:Mk1wCc2gy/F0THH0TAp1QYyJNzRm2KCLy3o5ASXVI5E= sigs.k8s.io/yaml v1.4.0/go.mod h1:Ejl7/uTz7PSA4eKMyQCUTnhZYNmLIl+5c2lQPGR2BPY= +sigs.k8s.io/yaml v1.6.0 h1:G8fkbMSAFqgEFgh4b1wmtzDnioxFCUgTZhlbj5P9QYs= +sigs.k8s.io/yaml v1.6.0/go.mod h1:796bPqUfzR/0jLAl6XjHl3Ck7MiyVv8dbTdyT3/pMf4= sourcegraph.com/sqs/pbtypes v0.0.0-20180604144634-d3ebe8f20ae4/go.mod h1:ketZ/q3QxT9HOBeFhu6RdvsftgpsbFHBF5Cas6cDKZ0= sourcegraph.com/sqs/pbtypes v1.0.0/go.mod h1:3AciMUv4qUuRHRHhOG4TZOB+72GdPVz5k+c648qsFS4= vbom.ml/util v0.0.0-20160121211510-db5cfe13f5cc/go.mod h1:so/NYdZXCz+E3ZpW0uAoCj6uzU2+8OWDFv/HxUSs7kI= diff --git a/vendor/go.yaml.in/yaml/v2/.travis.yml b/vendor/go.yaml.in/yaml/v2/.travis.yml new file mode 100644 index 000000000..7348c50c0 --- /dev/null +++ b/vendor/go.yaml.in/yaml/v2/.travis.yml @@ -0,0 +1,17 @@ +language: go + +go: + - "1.4.x" + - "1.5.x" + - "1.6.x" + - "1.7.x" + - "1.8.x" + - "1.9.x" + - "1.10.x" + - "1.11.x" + - "1.12.x" + - "1.13.x" + - "1.14.x" + - "tip" + +go_import_path: gopkg.in/yaml.v2 diff --git a/vendor/sigs.k8s.io/yaml/goyaml.v2/LICENSE b/vendor/go.yaml.in/yaml/v2/LICENSE similarity index 100% rename from vendor/sigs.k8s.io/yaml/goyaml.v2/LICENSE rename to vendor/go.yaml.in/yaml/v2/LICENSE diff --git a/vendor/sigs.k8s.io/yaml/goyaml.v2/LICENSE.libyaml b/vendor/go.yaml.in/yaml/v2/LICENSE.libyaml similarity index 100% rename from vendor/sigs.k8s.io/yaml/goyaml.v2/LICENSE.libyaml rename to vendor/go.yaml.in/yaml/v2/LICENSE.libyaml diff --git a/vendor/sigs.k8s.io/yaml/goyaml.v2/NOTICE b/vendor/go.yaml.in/yaml/v2/NOTICE similarity index 100% rename from vendor/sigs.k8s.io/yaml/goyaml.v2/NOTICE rename to vendor/go.yaml.in/yaml/v2/NOTICE diff --git a/vendor/go.yaml.in/yaml/v2/README.md b/vendor/go.yaml.in/yaml/v2/README.md new file mode 100644 index 000000000..c9388da42 --- /dev/null +++ b/vendor/go.yaml.in/yaml/v2/README.md @@ -0,0 +1,131 @@ +# YAML support for the Go language + +Introduction +------------ + +The yaml package enables Go programs to comfortably encode and decode YAML +values. It was developed within [Canonical](https://www.canonical.com) as +part of the [juju](https://juju.ubuntu.com) project, and is based on a +pure Go port of the well-known [libyaml](http://pyyaml.org/wiki/LibYAML) +C library to parse and generate YAML data quickly and reliably. + +Compatibility +------------- + +The yaml package supports most of YAML 1.1 and 1.2, including support for +anchors, tags, map merging, etc. Multi-document unmarshalling is not yet +implemented, and base-60 floats from YAML 1.1 are purposefully not +supported since they're a poor design and are gone in YAML 1.2. + +Installation and usage +---------------------- + +The import path for the package is *go.yaml.in/yaml/v2*. + +To install it, run: + + go get go.yaml.in/yaml/v2 + +API documentation +----------------- + +See: + +API stability +------------- + +The package API for yaml v2 will remain stable as described in [gopkg.in](https://gopkg.in). + + +License +------- + +The yaml package is licensed under the Apache License 2.0. Please see the LICENSE file for details. + + +Example +------- + +```Go +package main + +import ( + "fmt" + "log" + + "go.yaml.in/yaml/v2" +) + +var data = ` +a: Easy! +b: + c: 2 + d: [3, 4] +` + +// Note: struct fields must be public in order for unmarshal to +// correctly populate the data. +type T struct { + A string + B struct { + RenamedC int `yaml:"c"` + D []int `yaml:",flow"` + } +} + +func main() { + t := T{} + + err := yaml.Unmarshal([]byte(data), &t) + if err != nil { + log.Fatalf("error: %v", err) + } + fmt.Printf("--- t:\n%v\n\n", t) + + d, err := yaml.Marshal(&t) + if err != nil { + log.Fatalf("error: %v", err) + } + fmt.Printf("--- t dump:\n%s\n\n", string(d)) + + m := make(map[interface{}]interface{}) + + err = yaml.Unmarshal([]byte(data), &m) + if err != nil { + log.Fatalf("error: %v", err) + } + fmt.Printf("--- m:\n%v\n\n", m) + + d, err = yaml.Marshal(&m) + if err != nil { + log.Fatalf("error: %v", err) + } + fmt.Printf("--- m dump:\n%s\n\n", string(d)) +} +``` + +This example will generate the following output: + +``` +--- t: +{Easy! {2 [3 4]}} + +--- t dump: +a: Easy! +b: + c: 2 + d: [3, 4] + + +--- m: +map[a:Easy! b:map[c:2 d:[3 4]]] + +--- m dump: +a: Easy! +b: + c: 2 + d: + - 3 + - 4 +``` + diff --git a/vendor/sigs.k8s.io/yaml/goyaml.v2/apic.go b/vendor/go.yaml.in/yaml/v2/apic.go similarity index 100% rename from vendor/sigs.k8s.io/yaml/goyaml.v2/apic.go rename to vendor/go.yaml.in/yaml/v2/apic.go diff --git a/vendor/sigs.k8s.io/yaml/goyaml.v2/decode.go b/vendor/go.yaml.in/yaml/v2/decode.go similarity index 100% rename from vendor/sigs.k8s.io/yaml/goyaml.v2/decode.go rename to vendor/go.yaml.in/yaml/v2/decode.go diff --git a/vendor/sigs.k8s.io/yaml/goyaml.v2/emitterc.go b/vendor/go.yaml.in/yaml/v2/emitterc.go similarity index 100% rename from vendor/sigs.k8s.io/yaml/goyaml.v2/emitterc.go rename to vendor/go.yaml.in/yaml/v2/emitterc.go diff --git a/vendor/sigs.k8s.io/yaml/goyaml.v2/encode.go b/vendor/go.yaml.in/yaml/v2/encode.go similarity index 100% rename from vendor/sigs.k8s.io/yaml/goyaml.v2/encode.go rename to vendor/go.yaml.in/yaml/v2/encode.go diff --git a/vendor/sigs.k8s.io/yaml/goyaml.v2/parserc.go b/vendor/go.yaml.in/yaml/v2/parserc.go similarity index 100% rename from vendor/sigs.k8s.io/yaml/goyaml.v2/parserc.go rename to vendor/go.yaml.in/yaml/v2/parserc.go diff --git a/vendor/sigs.k8s.io/yaml/goyaml.v2/readerc.go b/vendor/go.yaml.in/yaml/v2/readerc.go similarity index 100% rename from vendor/sigs.k8s.io/yaml/goyaml.v2/readerc.go rename to vendor/go.yaml.in/yaml/v2/readerc.go diff --git a/vendor/sigs.k8s.io/yaml/goyaml.v2/resolve.go b/vendor/go.yaml.in/yaml/v2/resolve.go similarity index 100% rename from vendor/sigs.k8s.io/yaml/goyaml.v2/resolve.go rename to vendor/go.yaml.in/yaml/v2/resolve.go diff --git a/vendor/sigs.k8s.io/yaml/goyaml.v2/scannerc.go b/vendor/go.yaml.in/yaml/v2/scannerc.go similarity index 100% rename from vendor/sigs.k8s.io/yaml/goyaml.v2/scannerc.go rename to vendor/go.yaml.in/yaml/v2/scannerc.go diff --git a/vendor/sigs.k8s.io/yaml/goyaml.v2/sorter.go b/vendor/go.yaml.in/yaml/v2/sorter.go similarity index 100% rename from vendor/sigs.k8s.io/yaml/goyaml.v2/sorter.go rename to vendor/go.yaml.in/yaml/v2/sorter.go diff --git a/vendor/sigs.k8s.io/yaml/goyaml.v2/writerc.go b/vendor/go.yaml.in/yaml/v2/writerc.go similarity index 100% rename from vendor/sigs.k8s.io/yaml/goyaml.v2/writerc.go rename to vendor/go.yaml.in/yaml/v2/writerc.go diff --git a/vendor/sigs.k8s.io/yaml/goyaml.v2/yaml.go b/vendor/go.yaml.in/yaml/v2/yaml.go similarity index 99% rename from vendor/sigs.k8s.io/yaml/goyaml.v2/yaml.go rename to vendor/go.yaml.in/yaml/v2/yaml.go index 30813884c..5248e1263 100644 --- a/vendor/sigs.k8s.io/yaml/goyaml.v2/yaml.go +++ b/vendor/go.yaml.in/yaml/v2/yaml.go @@ -2,7 +2,7 @@ // // Source code and other details for the project are available at GitHub: // -// https://github.com/go-yaml/yaml +// https://github.com/yaml/go-yaml // package yaml diff --git a/vendor/sigs.k8s.io/yaml/goyaml.v2/yamlh.go b/vendor/go.yaml.in/yaml/v2/yamlh.go similarity index 100% rename from vendor/sigs.k8s.io/yaml/goyaml.v2/yamlh.go rename to vendor/go.yaml.in/yaml/v2/yamlh.go diff --git a/vendor/sigs.k8s.io/yaml/goyaml.v2/yamlprivateh.go b/vendor/go.yaml.in/yaml/v2/yamlprivateh.go similarity index 100% rename from vendor/sigs.k8s.io/yaml/goyaml.v2/yamlprivateh.go rename to vendor/go.yaml.in/yaml/v2/yamlprivateh.go diff --git a/vendor/modules.txt b/vendor/modules.txt index 9d471f116..9a4084a40 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -380,6 +380,9 @@ go.opentelemetry.io/proto/otlp/collector/trace/v1 go.opentelemetry.io/proto/otlp/common/v1 go.opentelemetry.io/proto/otlp/resource/v1 go.opentelemetry.io/proto/otlp/trace/v1 +# go.yaml.in/yaml/v2 v2.4.2 +## explicit; go 1.15 +go.yaml.in/yaml/v2 # go4.org v0.0.0-20201209231011-d4a079459e60 ## explicit; go 1.13 go4.org/bytereplacer @@ -641,7 +644,7 @@ gopkg.in/yaml.v2 # gopkg.in/yaml.v3 v3.0.1 ## explicit gopkg.in/yaml.v3 -# k8s.io/api v0.33.1 +# k8s.io/api v0.33.3 ## explicit; go 1.24.0 k8s.io/api/admissionregistration/v1 k8s.io/api/admissionregistration/v1alpha1 @@ -699,7 +702,7 @@ k8s.io/api/storage/v1 k8s.io/api/storage/v1alpha1 k8s.io/api/storage/v1beta1 k8s.io/api/storagemigration/v1alpha1 -# k8s.io/apimachinery v0.33.1 +# k8s.io/apimachinery v0.33.3 ## explicit; go 1.24.0 k8s.io/apimachinery/pkg/api/equality k8s.io/apimachinery/pkg/api/errors @@ -1024,11 +1027,11 @@ k8s.io/client-go/util/homedir k8s.io/client-go/util/keyutil k8s.io/client-go/util/watchlist k8s.io/client-go/util/workqueue -# k8s.io/cloud-provider v0.33.1 +# k8s.io/cloud-provider v0.33.3 ## explicit; go 1.24.0 k8s.io/cloud-provider/volume k8s.io/cloud-provider/volume/helpers -# k8s.io/component-base v0.33.1 +# k8s.io/component-base v0.33.3 ## explicit; go 1.24.0 k8s.io/component-base/metrics k8s.io/component-base/metrics/prometheusextension @@ -1053,7 +1056,7 @@ k8s.io/kube-openapi/pkg/schemaconv k8s.io/kube-openapi/pkg/spec3 k8s.io/kube-openapi/pkg/util/proto k8s.io/kube-openapi/pkg/validation/spec -# k8s.io/mount-utils v0.33.1 +# k8s.io/mount-utils v0.33.3 ## explicit; go 1.24.0 k8s.io/mount-utils # k8s.io/test-infra v0.0.0-20210730160938-8ad9b8c53bd8 @@ -1098,8 +1101,8 @@ sigs.k8s.io/structured-merge-diff/v4/merge sigs.k8s.io/structured-merge-diff/v4/schema sigs.k8s.io/structured-merge-diff/v4/typed sigs.k8s.io/structured-merge-diff/v4/value -# sigs.k8s.io/yaml v1.4.0 -## explicit; go 1.12 +# sigs.k8s.io/yaml v1.6.0 +## explicit; go 1.22 sigs.k8s.io/yaml sigs.k8s.io/yaml/goyaml.v2 # k8s.io/client-go => k8s.io/client-go v0.32.2 diff --git a/vendor/sigs.k8s.io/yaml/.travis.yml b/vendor/sigs.k8s.io/yaml/.travis.yml deleted file mode 100644 index 54ed8f9cb..000000000 --- a/vendor/sigs.k8s.io/yaml/.travis.yml +++ /dev/null @@ -1,12 +0,0 @@ -language: go -arch: arm64 -dist: focal -go: 1.15.x -script: - - diff -u <(echo -n) <(gofmt -d *.go) - - diff -u <(echo -n) <(golint $(go list -e ./...) | grep -v YAMLToJSON) - - GO111MODULE=on go vet . - - GO111MODULE=on go test -v -race ./... - - git diff --exit-code -install: - - GO111MODULE=off go get golang.org/x/lint/golint diff --git a/vendor/sigs.k8s.io/yaml/goyaml.v2/OWNERS b/vendor/sigs.k8s.io/yaml/goyaml.v2/OWNERS deleted file mode 100644 index 73be0a3a9..000000000 --- a/vendor/sigs.k8s.io/yaml/goyaml.v2/OWNERS +++ /dev/null @@ -1,24 +0,0 @@ -# See the OWNERS docs at https://go.k8s.io/owners - -approvers: -- dims -- jpbetz -- smarterclayton -- deads2k -- sttts -- liggitt -- natasha41575 -- knverey -reviewers: -- dims -- thockin -- jpbetz -- smarterclayton -- deads2k -- derekwaynecarr -- mikedanese -- liggitt -- sttts -- tallclair -labels: -- sig/api-machinery diff --git a/vendor/sigs.k8s.io/yaml/goyaml.v2/README.md b/vendor/sigs.k8s.io/yaml/goyaml.v2/README.md index 53f4139dc..9a8f1e678 100644 --- a/vendor/sigs.k8s.io/yaml/goyaml.v2/README.md +++ b/vendor/sigs.k8s.io/yaml/goyaml.v2/README.md @@ -1,143 +1,71 @@ -# go-yaml fork +# goyaml.v2 -This package is a fork of the go-yaml library and is intended solely for consumption -by kubernetes projects. In this fork, we plan to support only critical changes required for -kubernetes, such as small bug fixes and regressions. Larger, general-purpose feature requests -should be made in the upstream go-yaml library, and we will reject such changes in this fork -unless we are pulling them from upstream. +This package provides type and function aliases for the `go.yaml.in/yaml/v2` package (which is compatible with `gopkg.in/yaml.v2`). -This fork is based on v2.4.0: https://github.com/go-yaml/yaml/releases/tag/v2.4.0 +## Purpose -# YAML support for the Go language - -Introduction ------------- - -The yaml package enables Go programs to comfortably encode and decode YAML -values. It was developed within [Canonical](https://www.canonical.com) as -part of the [juju](https://juju.ubuntu.com) project, and is based on a -pure Go port of the well-known [libyaml](http://pyyaml.org/wiki/LibYAML) -C library to parse and generate YAML data quickly and reliably. - -Compatibility -------------- - -The yaml package supports most of YAML 1.1 and 1.2, including support for -anchors, tags, map merging, etc. Multi-document unmarshalling is not yet -implemented, and base-60 floats from YAML 1.1 are purposefully not -supported since they're a poor design and are gone in YAML 1.2. - -Installation and usage ----------------------- - -The import path for the package is *gopkg.in/yaml.v2*. - -To install it, run: - - go get gopkg.in/yaml.v2 - -API documentation ------------------ - -If opened in a browser, the import path itself leads to the API documentation: - - * [https://gopkg.in/yaml.v2](https://gopkg.in/yaml.v2) - -API stability -------------- - -The package API for yaml v2 will remain stable as described in [gopkg.in](https://gopkg.in). - - -License -------- - -The yaml package is licensed under the Apache License 2.0. Please see the LICENSE file for details. - - -Example -------- - -```Go -package main - -import ( - "fmt" - "log" - - "gopkg.in/yaml.v2" -) - -var data = ` -a: Easy! -b: - c: 2 - d: [3, 4] -` - -// Note: struct fields must be public in order for unmarshal to -// correctly populate the data. -type T struct { - A string - B struct { - RenamedC int `yaml:"c"` - D []int `yaml:",flow"` - } -} - -func main() { - t := T{} - - err := yaml.Unmarshal([]byte(data), &t) - if err != nil { - log.Fatalf("error: %v", err) - } - fmt.Printf("--- t:\n%v\n\n", t) - - d, err := yaml.Marshal(&t) - if err != nil { - log.Fatalf("error: %v", err) - } - fmt.Printf("--- t dump:\n%s\n\n", string(d)) - - m := make(map[interface{}]interface{}) - - err = yaml.Unmarshal([]byte(data), &m) - if err != nil { - log.Fatalf("error: %v", err) - } - fmt.Printf("--- m:\n%v\n\n", m) - - d, err = yaml.Marshal(&m) - if err != nil { - log.Fatalf("error: %v", err) - } - fmt.Printf("--- m dump:\n%s\n\n", string(d)) -} -``` +The purpose of this package is to: -This example will generate the following output: +1. Provide a transition path for users migrating from the sigs.k8s.io/yaml package to direct usage of go.yaml.in/yaml/v2 +2. Maintain compatibility with existing code while encouraging migration to the upstream package +3. Reduce maintenance overhead by delegating to the upstream implementation +## Usage + +Instead of importing this package directly, you should migrate to using `go.yaml.in/yaml/v2` directly: + +```go +// Old way +import "sigs.k8s.io/yaml/goyaml.v2" + +// Recommended way +import "go.yaml.in/yaml/v2" ``` ---- t: -{Easy! {2 [3 4]}} - ---- t dump: -a: Easy! -b: - c: 2 - d: [3, 4] - - ---- m: -map[a:Easy! b:map[c:2 d:[3 4]]] - ---- m dump: -a: Easy! -b: - c: 2 - d: - - 3 - - 4 -``` +## Available Types and Functions + +All public types and functions from `go.yaml.in/yaml/v2` are available through this package: + +### Types + +- `MapSlice` - Encodes and decodes as a YAML map with preserved key order +- `MapItem` - An item in a MapSlice +- `Unmarshaler` - Interface for custom unmarshaling behavior +- `Marshaler` - Interface for custom marshaling behavior +- `IsZeroer` - Interface to check if an object is zero +- `Decoder` - Reads and decodes YAML values from an input stream +- `Encoder` - Writes YAML values to an output stream +- `TypeError` - Error returned by Unmarshal for decoding issues + +### Functions + +- `Unmarshal` - Decodes YAML data into a Go value +- `UnmarshalStrict` - Like Unmarshal but errors on unknown fields +- `Marshal` - Serializes a Go value into YAML +- `NewDecoder` - Creates a new Decoder +- `NewEncoder` - Creates a new Encoder +- `FutureLineWrap` - Controls line wrapping behavior + +## Migration Guide + +To migrate from this package to `go.yaml.in/yaml/v2`: + +1. Update your import statements: + ```go + // From + import "sigs.k8s.io/yaml/goyaml.v2" + + // To + import "go.yaml.in/yaml/v2" + ``` + +2. No code changes should be necessary as the API is identical + +3. Update your go.mod file to include the dependency: + ``` + require go.yaml.in/yaml/v2 v2.4.2 + ``` + +## Deprecation Notice + +All types and functions in this package are marked as deprecated. You should migrate to using `go.yaml.in/yaml/v2` directly. diff --git a/vendor/sigs.k8s.io/yaml/goyaml.v2/yaml_aliases.go b/vendor/sigs.k8s.io/yaml/goyaml.v2/yaml_aliases.go new file mode 100644 index 000000000..8c82bc2cb --- /dev/null +++ b/vendor/sigs.k8s.io/yaml/goyaml.v2/yaml_aliases.go @@ -0,0 +1,85 @@ +/* +Copyright 2025 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package yaml + +import ( + gopkg_yaml "go.yaml.in/yaml/v2" +) + +// Type aliases for public types from go.yaml.in/yaml/v2 +type ( + // MapSlice encodes and decodes as a YAML map. + // The order of keys is preserved when encoding and decoding. + // Deprecated: Use go.yaml.in/yaml/v2.MapSlice directly. + MapSlice = gopkg_yaml.MapSlice + + // MapItem is an item in a MapSlice. + // Deprecated: Use go.yaml.in/yaml/v2.MapItem directly. + MapItem = gopkg_yaml.MapItem + + // Unmarshaler is implemented by types to customize their behavior when being unmarshaled from a YAML document. + // Deprecated: Use go.yaml.in/yaml/v2.Unmarshaler directly. + Unmarshaler = gopkg_yaml.Unmarshaler + + // Marshaler is implemented by types to customize their behavior when being marshaled into a YAML document. + // Deprecated: Use go.yaml.in/yaml/v2.Marshaler directly. + Marshaler = gopkg_yaml.Marshaler + + // IsZeroer is used to check whether an object is zero to determine whether it should be omitted when + // marshaling with the omitempty flag. One notable implementation is time.Time. + // Deprecated: Use go.yaml.in/yaml/v2.IsZeroer directly. + IsZeroer = gopkg_yaml.IsZeroer + + // Decoder reads and decodes YAML values from an input stream. + // Deprecated: Use go.yaml.in/yaml/v2.Decoder directly. + Decoder = gopkg_yaml.Decoder + + // Encoder writes YAML values to an output stream. + // Deprecated: Use go.yaml.in/yaml/v2.Encoder directly. + Encoder = gopkg_yaml.Encoder + + // TypeError is returned by Unmarshal when one or more fields in the YAML document cannot be properly decoded. + // Deprecated: Use go.yaml.in/yaml/v2.TypeError directly. + TypeError = gopkg_yaml.TypeError +) + +// Function aliases for public functions from go.yaml.in/yaml/v2 +var ( + // Unmarshal decodes the first document found within the in byte slice and assigns decoded values into the out value. + // Deprecated: Use go.yaml.in/yaml/v2.Unmarshal directly. + Unmarshal = gopkg_yaml.Unmarshal + + // UnmarshalStrict is like Unmarshal except that any fields that are found in the data that do not have corresponding struct members will result in an error. + // Deprecated: Use go.yaml.in/yaml/v2.UnmarshalStrict directly. + UnmarshalStrict = gopkg_yaml.UnmarshalStrict + + // Marshal serializes the value provided into a YAML document. + // Deprecated: Use go.yaml.in/yaml/v2.Marshal directly. + Marshal = gopkg_yaml.Marshal + + // NewDecoder returns a new decoder that reads from r. + // Deprecated: Use go.yaml.in/yaml/v2.NewDecoder directly. + NewDecoder = gopkg_yaml.NewDecoder + + // NewEncoder returns a new encoder that writes to w. + // Deprecated: Use go.yaml.in/yaml/v2.NewEncoder directly. + NewEncoder = gopkg_yaml.NewEncoder + + // FutureLineWrap globally disables line wrapping when encoding long strings. + // Deprecated: Use go.yaml.in/yaml/v2.FutureLineWrap directly. + FutureLineWrap = gopkg_yaml.FutureLineWrap +) diff --git a/vendor/sigs.k8s.io/yaml/yaml.go b/vendor/sigs.k8s.io/yaml/yaml.go index fc10246bd..aa01acd45 100644 --- a/vendor/sigs.k8s.io/yaml/yaml.go +++ b/vendor/sigs.k8s.io/yaml/yaml.go @@ -24,7 +24,7 @@ import ( "reflect" "strconv" - "sigs.k8s.io/yaml/goyaml.v2" + "go.yaml.in/yaml/v2" ) // Marshal marshals obj into JSON using stdlib json.Marshal, and then converts JSON to YAML using JSONToYAML (see that method for more reference) @@ -92,7 +92,7 @@ func jsonUnmarshal(reader io.Reader, obj interface{}, opts ...JSONOpt) error { d = opt(d) } if err := d.Decode(&obj); err != nil { - return fmt.Errorf("while decoding JSON: %v", err) + return fmt.Errorf("while decoding JSON: %w", err) } return nil } @@ -417,3 +417,10 @@ func jsonToYAMLValue(j interface{}) interface{} { } return j } + +// DisallowUnknownFields configures the JSON decoder to error out if unknown +// fields come along, instead of dropping them by default. +func DisallowUnknownFields(d *json.Decoder) *json.Decoder { + d.DisallowUnknownFields() + return d +} diff --git a/vendor/sigs.k8s.io/yaml/yaml_go110.go b/vendor/sigs.k8s.io/yaml/yaml_go110.go deleted file mode 100644 index 94abc1719..000000000 --- a/vendor/sigs.k8s.io/yaml/yaml_go110.go +++ /dev/null @@ -1,31 +0,0 @@ -// This file contains changes that are only compatible with go 1.10 and onwards. - -//go:build go1.10 -// +build go1.10 - -/* -Copyright 2021 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package yaml - -import "encoding/json" - -// DisallowUnknownFields configures the JSON decoder to error out if unknown -// fields come along, instead of dropping them by default. -func DisallowUnknownFields(d *json.Decoder) *json.Decoder { - d.DisallowUnknownFields() - return d -} From 4063949ca4f96b56a6ece8ea4256fe3b3e26c734 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 11 Aug 2025 19:29:13 +0000 Subject: [PATCH 17/51] Bump golang from 1.24.3 to 1.24.6 Bumps golang from 1.24.3 to 1.24.6. --- updated-dependencies: - dependency-name: golang dependency-version: 1.24.6 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- Dockerfile | 2 +- Dockerfile.Windows | 2 +- Dockerfile.debug | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index 2c506b57b..8d6c0f9a0 100644 --- a/Dockerfile +++ b/Dockerfile @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -FROM --platform=$BUILDPLATFORM golang:1.24.3 AS builder +FROM --platform=$BUILDPLATFORM golang:1.24.6 AS builder ARG STAGINGVERSION ARG TARGETPLATFORM diff --git a/Dockerfile.Windows b/Dockerfile.Windows index 24cff45b3..9b21ae862 100644 --- a/Dockerfile.Windows +++ b/Dockerfile.Windows @@ -13,7 +13,7 @@ # limitations under the License. ARG BASE_IMAGE -FROM --platform=$BUILDPLATFORM golang:1.24.3 AS builder +FROM --platform=$BUILDPLATFORM golang:1.24.6 AS builder ARG TARGETPLATFORM ARG STAGINGVERSION diff --git a/Dockerfile.debug b/Dockerfile.debug index ca2812248..843a7f152 100644 --- a/Dockerfile.debug +++ b/Dockerfile.debug @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -FROM golang:1.24.3 as builder +FROM golang:1.24.6 as builder WORKDIR /go/src/sigs.k8s.io/gcp-compute-persistent-disk-csi-driver ADD . . From 6ab87581da157722f0010b84a3bc769f46fc3b66 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 11 Aug 2025 22:36:10 +0000 Subject: [PATCH 18/51] Bump the golang-x group with 6 updates Bumps the golang-x group with 6 updates: | Package | From | To | | --- | --- | --- | | [golang.org/x/sys](https://github.com/golang/sys) | `0.34.0` | `0.35.0` | | [golang.org/x/crypto](https://github.com/golang/crypto) | `0.40.0` | `0.41.0` | | [golang.org/x/net](https://github.com/golang/net) | `0.41.0` | `0.42.0` | | [golang.org/x/term](https://github.com/golang/term) | `0.33.0` | `0.34.0` | | [golang.org/x/text](https://github.com/golang/text) | `0.27.0` | `0.28.0` | | [golang.org/x/tools](https://github.com/golang/tools) | `0.34.0` | `0.35.0` | Updates `golang.org/x/sys` from 0.34.0 to 0.35.0 - [Commits](https://github.com/golang/sys/compare/v0.34.0...v0.35.0) Updates `golang.org/x/crypto` from 0.40.0 to 0.41.0 - [Commits](https://github.com/golang/crypto/compare/v0.40.0...v0.41.0) Updates `golang.org/x/net` from 0.41.0 to 0.42.0 - [Commits](https://github.com/golang/net/compare/v0.41.0...v0.42.0) Updates `golang.org/x/term` from 0.33.0 to 0.34.0 - [Commits](https://github.com/golang/term/compare/v0.33.0...v0.34.0) Updates `golang.org/x/text` from 0.27.0 to 0.28.0 - [Release notes](https://github.com/golang/text/releases) - [Commits](https://github.com/golang/text/compare/v0.27.0...v0.28.0) Updates `golang.org/x/tools` from 0.34.0 to 0.35.0 - [Release notes](https://github.com/golang/tools/releases) - [Commits](https://github.com/golang/tools/compare/v0.34.0...v0.35.0) --- updated-dependencies: - dependency-name: golang.org/x/sys dependency-version: 0.35.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: golang-x - dependency-name: golang.org/x/crypto dependency-version: 0.41.0 dependency-type: indirect update-type: version-update:semver-minor dependency-group: golang-x - dependency-name: golang.org/x/net dependency-version: 0.42.0 dependency-type: indirect update-type: version-update:semver-minor dependency-group: golang-x - dependency-name: golang.org/x/term dependency-version: 0.34.0 dependency-type: indirect update-type: version-update:semver-minor dependency-group: golang-x - dependency-name: golang.org/x/text dependency-version: 0.28.0 dependency-type: indirect update-type: version-update:semver-minor dependency-group: golang-x - dependency-name: golang.org/x/tools dependency-version: 0.35.0 dependency-type: indirect update-type: version-update:semver-minor dependency-group: golang-x ... Signed-off-by: dependabot[bot] --- go.mod | 12 ++-- go.sum | 24 ++++---- vendor/golang.org/x/sys/unix/mkerrors.sh | 3 + .../golang.org/x/sys/unix/syscall_darwin.go | 56 +------------------ vendor/golang.org/x/sys/unix/zerrors_linux.go | 44 ++++++++++----- .../x/sys/unix/zerrors_linux_386.go | 2 + .../x/sys/unix/zerrors_linux_amd64.go | 2 + .../x/sys/unix/zerrors_linux_arm.go | 2 + .../x/sys/unix/zerrors_linux_arm64.go | 2 + .../x/sys/unix/zerrors_linux_loong64.go | 2 + .../x/sys/unix/zerrors_linux_mips.go | 2 + .../x/sys/unix/zerrors_linux_mips64.go | 2 + .../x/sys/unix/zerrors_linux_mips64le.go | 2 + .../x/sys/unix/zerrors_linux_mipsle.go | 2 + .../x/sys/unix/zerrors_linux_ppc.go | 2 + .../x/sys/unix/zerrors_linux_ppc64.go | 2 + .../x/sys/unix/zerrors_linux_ppc64le.go | 2 + .../x/sys/unix/zerrors_linux_riscv64.go | 2 + .../x/sys/unix/zerrors_linux_s390x.go | 2 + .../x/sys/unix/zerrors_linux_sparc64.go | 2 + .../x/sys/unix/zsysnum_linux_386.go | 1 + .../x/sys/unix/zsysnum_linux_amd64.go | 1 + .../x/sys/unix/zsysnum_linux_arm.go | 1 + .../x/sys/unix/zsysnum_linux_arm64.go | 1 + .../x/sys/unix/zsysnum_linux_loong64.go | 1 + .../x/sys/unix/zsysnum_linux_mips.go | 1 + .../x/sys/unix/zsysnum_linux_mips64.go | 1 + .../x/sys/unix/zsysnum_linux_mips64le.go | 1 + .../x/sys/unix/zsysnum_linux_mipsle.go | 1 + .../x/sys/unix/zsysnum_linux_ppc.go | 1 + .../x/sys/unix/zsysnum_linux_ppc64.go | 1 + .../x/sys/unix/zsysnum_linux_ppc64le.go | 1 + .../x/sys/unix/zsysnum_linux_riscv64.go | 1 + .../x/sys/unix/zsysnum_linux_s390x.go | 1 + .../x/sys/unix/zsysnum_linux_sparc64.go | 1 + vendor/golang.org/x/sys/unix/ztypes_linux.go | 37 +++++++++--- .../golang.org/x/sys/unix/ztypes_linux_386.go | 30 +++++----- .../x/sys/unix/ztypes_linux_amd64.go | 28 +++++----- .../golang.org/x/sys/unix/ztypes_linux_arm.go | 32 +++++------ .../x/sys/unix/ztypes_linux_arm64.go | 28 +++++----- .../x/sys/unix/ztypes_linux_loong64.go | 28 +++++----- .../x/sys/unix/ztypes_linux_mips.go | 30 +++++----- .../x/sys/unix/ztypes_linux_mips64.go | 28 +++++----- .../x/sys/unix/ztypes_linux_mips64le.go | 28 +++++----- .../x/sys/unix/ztypes_linux_mipsle.go | 30 +++++----- .../golang.org/x/sys/unix/ztypes_linux_ppc.go | 32 +++++------ .../x/sys/unix/ztypes_linux_ppc64.go | 28 +++++----- .../x/sys/unix/ztypes_linux_ppc64le.go | 28 +++++----- .../x/sys/unix/ztypes_linux_riscv64.go | 28 +++++----- .../x/sys/unix/ztypes_linux_s390x.go | 28 +++++----- .../x/sys/unix/ztypes_linux_sparc64.go | 28 +++++----- vendor/golang.org/x/term/term_windows.go | 4 +- vendor/golang.org/x/term/terminal.go | 9 ++- .../x/tools/go/ast/inspector/typeof.go | 1 - vendor/modules.txt | 12 ++-- 55 files changed, 359 insertions(+), 322 deletions(-) diff --git a/go.mod b/go.mod index cfd43c34a..9f2230a5d 100644 --- a/go.mod +++ b/go.mod @@ -25,7 +25,7 @@ require ( go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.35.0 go.opentelemetry.io/otel/sdk v1.35.0 golang.org/x/oauth2 v0.30.0 - golang.org/x/sys v0.34.0 + golang.org/x/sys v0.35.0 golang.org/x/time v0.12.0 google.golang.org/api v0.187.0 google.golang.org/genproto v0.0.0-20240624140628-dc46fd24d27d @@ -99,12 +99,12 @@ require ( go.opentelemetry.io/proto/otlp v1.5.0 // indirect go.yaml.in/yaml/v2 v2.4.2 // indirect go4.org v0.0.0-20201209231011-d4a079459e60 // indirect - golang.org/x/crypto v0.40.0 // indirect - golang.org/x/net v0.41.0 // indirect + golang.org/x/crypto v0.41.0 // indirect + golang.org/x/net v0.42.0 // indirect golang.org/x/sync v0.16.0 // indirect - golang.org/x/term v0.33.0 // indirect - golang.org/x/text v0.27.0 // indirect - golang.org/x/tools v0.34.0 // indirect + golang.org/x/term v0.34.0 // indirect + golang.org/x/text v0.28.0 // indirect + golang.org/x/tools v0.35.0 // indirect google.golang.org/genproto/googleapis/api v0.0.0-20250218202821-56aae31c358a // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20250218202821-56aae31c358a // indirect gopkg.in/evanphx/json-patch.v4 v4.12.0 // indirect diff --git a/go.sum b/go.sum index 79f66885a..0f0f5c955 100644 --- a/go.sum +++ b/go.sum @@ -1699,8 +1699,8 @@ golang.org/x/crypto v0.23.0/go.mod h1:CKFgDieR+mRhux2Lsu27y0fO304Db0wZe70UKqHu0v golang.org/x/crypto v0.25.0/go.mod h1:T+wALwcMOSE0kXgUAnPAHqTLW+XHgcELELW8VaDgm/M= golang.org/x/crypto v0.26.0/go.mod h1:GY7jblb9wI+FOo5y8/S2oY4zWP07AkOJ4+jxCqdqn54= golang.org/x/crypto v0.28.0/go.mod h1:rmgy+3RHxRZMyY0jjAJShp2zgEdOqj2AO7U0pYmeQ7U= -golang.org/x/crypto v0.40.0 h1:r4x+VvoG5Fm+eJcxMaY8CQM7Lb0l1lsmjGBQ6s8BfKM= -golang.org/x/crypto v0.40.0/go.mod h1:Qr1vMER5WyS2dfPHAlsOj01wgLbsyWtFn/aY+5+ZdxY= +golang.org/x/crypto v0.41.0 h1:WKYxWedPGCTVVl5+WHSSrOBT0O8lx32+zxmHxijgXp4= +golang.org/x/crypto v0.41.0/go.mod h1:pO5AFd7FA68rFak7rOAGVuygIISepHftHnr8dr6+sUc= golang.org/x/exp v0.0.0-20180321215751-8460e604b9de/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190125153040-c74c464bbbf2/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= @@ -1852,8 +1852,8 @@ golang.org/x/net v0.25.0/go.mod h1:JkAGAh7GEvH74S6FOH42FLoXpXbE/aqXSrIQjXgsiwM= golang.org/x/net v0.27.0/go.mod h1:dDi0PyhWNoiUOrAS8uXv/vnScO4wnHQO4mj9fn/RytE= golang.org/x/net v0.28.0/go.mod h1:yqtgsTWOOnlGLG9GFRrK3++bGOUEkNBoHZc8MEDWPNg= golang.org/x/net v0.30.0/go.mod h1:2wGyMJ5iFasEhkwi13ChkO/t1ECNC4X4eBKkVFyYFlU= -golang.org/x/net v0.41.0 h1:vBTly1HeNPEn3wtREYfy4GZ/NECgw2Cnl+nK6Nz3uvw= -golang.org/x/net v0.41.0/go.mod h1:B/K4NNqkfmg07DQYrbwvSluqCJOOXwUjeb/5lOisjbA= +golang.org/x/net v0.42.0 h1:jzkYrhi3YQWD6MLBJcsklgQsoAcw89EcZbJw8Z614hs= +golang.org/x/net v0.42.0/go.mod h1:FF1RA5d3u7nAYA4z2TkclSCKh68eSXtiFwcWQpPXdt8= golang.org/x/oauth2 v0.0.0-20180724155351-3d292e4d0cdc/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20181017192945-9dcd33a902f4/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= @@ -2021,8 +2021,8 @@ golang.org/x/sys v0.22.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/sys v0.23.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/sys v0.24.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/sys v0.26.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= -golang.org/x/sys v0.34.0 h1:H5Y5sJ2L2JRdyv7ROF1he/lPdvFsd0mJHFw2ThKHxLA= -golang.org/x/sys v0.34.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k= +golang.org/x/sys v0.35.0 h1:vz1N37gP5bs89s7He8XuIYXpyY0+QlsKmzipCbUtyxI= +golang.org/x/sys v0.35.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k= golang.org/x/telemetry v0.0.0-20240228155512-f48c80bd79b2/go.mod h1:TeRTkGYfJXctD9OcfyVLyj2J3IxLnKwHJR8f4D8a3YE= golang.org/x/telemetry v0.0.0-20240521205824-bda55230c457/go.mod h1:pRgIJT+bRLFKnoM1ldnzKoxTIn14Yxz928LQRYYgIN0= golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw= @@ -2048,8 +2048,8 @@ golang.org/x/term v0.20.0/go.mod h1:8UkIAJTvZgivsXaD6/pH6U9ecQzZ45awqEOzuCvwpFY= golang.org/x/term v0.22.0/go.mod h1:F3qCibpT5AMpCRfhfT53vVJwhLtIVHhB9XDjfFvnMI4= golang.org/x/term v0.23.0/go.mod h1:DgV24QBUrK6jhZXl+20l6UWznPlwAHm1Q1mGHtydmSk= golang.org/x/term v0.25.0/go.mod h1:RPyXicDX+6vLxogjjRxjgD2TKtmAO6NZBsBRfrOLu7M= -golang.org/x/term v0.33.0 h1:NuFncQrRcaRvVmgRkvM3j/F00gWIAlcmlB8ACEKmGIg= -golang.org/x/term v0.33.0/go.mod h1:s18+ql9tYWp1IfpV9DmCtQDDSRBUjKaw9M1eAv5UeF0= +golang.org/x/term v0.34.0 h1:O/2T7POpk0ZZ7MAzMeWFSg6S5IpWd/RXDlM9hgM3DR4= +golang.org/x/term v0.34.0/go.mod h1:5jC53AEywhIVebHgPVeg0mj8OD3VO9OzclacVrqpaAw= golang.org/x/text v0.0.0-20160726164857-2910a502d2bf/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -2075,8 +2075,8 @@ golang.org/x/text v0.15.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= golang.org/x/text v0.16.0/go.mod h1:GhwF1Be+LQoKShO3cGOHzqOgRrGaYc9AvblQOmPVHnI= golang.org/x/text v0.17.0/go.mod h1:BuEKDfySbSR4drPmRPG/7iBdf8hvFMuRexcpahXilzY= golang.org/x/text v0.19.0/go.mod h1:BuEKDfySbSR4drPmRPG/7iBdf8hvFMuRexcpahXilzY= -golang.org/x/text v0.27.0 h1:4fGWRpyh641NLlecmyl4LOe6yDdfaYNrGb2zdfo4JV4= -golang.org/x/text v0.27.0/go.mod h1:1D28KMCvyooCX9hBiosv5Tz/+YLxj0j7XhWjpSUF7CU= +golang.org/x/text v0.28.0 h1:rhazDwis8INMIwQ4tpjLDzUhx6RlXqZNPEM0huQojng= +golang.org/x/text v0.28.0/go.mod h1:U8nCwOR8jO/marOQ0QbDiOngZVEBB7MAiitBuMjXiNU= golang.org/x/time v0.0.0-20180412165947-fbb02b2291d2/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= @@ -2215,8 +2215,8 @@ golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d/go.mod h1:aiJjzUbINMkxb golang.org/x/tools v0.23.0/go.mod h1:pnu6ufv6vQkll6szChhK3C3L/ruaIv5eBeztNG8wtsI= golang.org/x/tools v0.24.0/go.mod h1:YhNqVBIfWHdzvTLs0d8LCuMhkKUgSUKldakyV7W/WDQ= golang.org/x/tools v0.26.0/go.mod h1:TPVVj70c7JJ3WCazhD8OdXcZg/og+b9+tH/KxylGwH0= -golang.org/x/tools v0.34.0 h1:qIpSLOxeCYGg9TrcJokLBG4KFA6d795g0xkBkiESGlo= -golang.org/x/tools v0.34.0/go.mod h1:pAP9OwEaY1CAW3HOmg3hLZC5Z0CCmzjAF2UQMSqNARg= +golang.org/x/tools v0.35.0 h1:mBffYraMEf7aa0sB+NuKnuCy8qI/9Bughn8dC2Gu5r0= +golang.org/x/tools v0.35.0/go.mod h1:NKdj5HkL/73byiZSJjqJgKn3ep7KjFkBOkR/Hps3VPw= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= diff --git a/vendor/golang.org/x/sys/unix/mkerrors.sh b/vendor/golang.org/x/sys/unix/mkerrors.sh index 6ab02b6c3..d1c8b2640 100644 --- a/vendor/golang.org/x/sys/unix/mkerrors.sh +++ b/vendor/golang.org/x/sys/unix/mkerrors.sh @@ -349,6 +349,9 @@ struct ltchars { #define _HIDIOCGRAWPHYS HIDIOCGRAWPHYS(_HIDIOCGRAWPHYS_LEN) #define _HIDIOCGRAWUNIQ HIDIOCGRAWUNIQ(_HIDIOCGRAWUNIQ_LEN) +// Renamed in v6.16, commit c6d732c38f93 ("net: ethtool: remove duplicate defines for family info") +#define ETHTOOL_FAMILY_NAME ETHTOOL_GENL_NAME +#define ETHTOOL_FAMILY_VERSION ETHTOOL_GENL_VERSION ' includes_NetBSD=' diff --git a/vendor/golang.org/x/sys/unix/syscall_darwin.go b/vendor/golang.org/x/sys/unix/syscall_darwin.go index 798f61ad3..7838ca5db 100644 --- a/vendor/golang.org/x/sys/unix/syscall_darwin.go +++ b/vendor/golang.org/x/sys/unix/syscall_darwin.go @@ -602,14 +602,9 @@ func Connectx(fd int, srcIf uint32, srcAddr, dstAddr Sockaddr, associd SaeAssocI return } -// sys connectx(fd int, endpoints *SaEndpoints, associd SaeAssocID, flags uint32, iov []Iovec, n *uintptr, connid *SaeConnID) (err error) const minIovec = 8 func Readv(fd int, iovs [][]byte) (n int, err error) { - if !darwinKernelVersionMin(11, 0, 0) { - return 0, ENOSYS - } - iovecs := make([]Iovec, 0, minIovec) iovecs = appendBytes(iovecs, iovs) n, err = readv(fd, iovecs) @@ -618,9 +613,6 @@ func Readv(fd int, iovs [][]byte) (n int, err error) { } func Preadv(fd int, iovs [][]byte, offset int64) (n int, err error) { - if !darwinKernelVersionMin(11, 0, 0) { - return 0, ENOSYS - } iovecs := make([]Iovec, 0, minIovec) iovecs = appendBytes(iovecs, iovs) n, err = preadv(fd, iovecs, offset) @@ -629,10 +621,6 @@ func Preadv(fd int, iovs [][]byte, offset int64) (n int, err error) { } func Writev(fd int, iovs [][]byte) (n int, err error) { - if !darwinKernelVersionMin(11, 0, 0) { - return 0, ENOSYS - } - iovecs := make([]Iovec, 0, minIovec) iovecs = appendBytes(iovecs, iovs) if raceenabled { @@ -644,10 +632,6 @@ func Writev(fd int, iovs [][]byte) (n int, err error) { } func Pwritev(fd int, iovs [][]byte, offset int64) (n int, err error) { - if !darwinKernelVersionMin(11, 0, 0) { - return 0, ENOSYS - } - iovecs := make([]Iovec, 0, minIovec) iovecs = appendBytes(iovecs, iovs) if raceenabled { @@ -707,45 +691,7 @@ func readvRacedetect(iovecs []Iovec, n int, err error) { } } -func darwinMajorMinPatch() (maj, min, patch int, err error) { - var un Utsname - err = Uname(&un) - if err != nil { - return - } - - var mmp [3]int - c := 0 -Loop: - for _, b := range un.Release[:] { - switch { - case b >= '0' && b <= '9': - mmp[c] = 10*mmp[c] + int(b-'0') - case b == '.': - c++ - if c > 2 { - return 0, 0, 0, ENOTSUP - } - case b == 0: - break Loop - default: - return 0, 0, 0, ENOTSUP - } - } - if c != 2 { - return 0, 0, 0, ENOTSUP - } - return mmp[0], mmp[1], mmp[2], nil -} - -func darwinKernelVersionMin(maj, min, patch int) bool { - actualMaj, actualMin, actualPatch, err := darwinMajorMinPatch() - if err != nil { - return false - } - return actualMaj > maj || actualMaj == maj && (actualMin > min || actualMin == min && actualPatch >= patch) -} - +//sys connectx(fd int, endpoints *SaEndpoints, associd SaeAssocID, flags uint32, iov []Iovec, n *uintptr, connid *SaeConnID) (err error) //sys sendfile(infd int, outfd int, offset int64, len *int64, hdtr unsafe.Pointer, flags int) (err error) //sys shmat(id int, addr uintptr, flag int) (ret uintptr, err error) diff --git a/vendor/golang.org/x/sys/unix/zerrors_linux.go b/vendor/golang.org/x/sys/unix/zerrors_linux.go index 9e7a6c5a4..b6db27d93 100644 --- a/vendor/golang.org/x/sys/unix/zerrors_linux.go +++ b/vendor/golang.org/x/sys/unix/zerrors_linux.go @@ -328,6 +328,8 @@ const ( AUDIT_KERNEL = 0x7d0 AUDIT_KERNEL_OTHER = 0x524 AUDIT_KERN_MODULE = 0x532 + AUDIT_LANDLOCK_ACCESS = 0x58f + AUDIT_LANDLOCK_DOMAIN = 0x590 AUDIT_LAST_FEATURE = 0x1 AUDIT_LAST_KERN_ANOM_MSG = 0x707 AUDIT_LAST_USER_MSG = 0x4af @@ -492,6 +494,7 @@ const ( BPF_F_BEFORE = 0x8 BPF_F_ID = 0x20 BPF_F_NETFILTER_IP_DEFRAG = 0x1 + BPF_F_PREORDER = 0x40 BPF_F_QUERY_EFFECTIVE = 0x1 BPF_F_REDIRECT_FLAGS = 0x19 BPF_F_REPLACE = 0x4 @@ -528,6 +531,7 @@ const ( BPF_LDX = 0x1 BPF_LEN = 0x80 BPF_LL_OFF = -0x200000 + BPF_LOAD_ACQ = 0x100 BPF_LSH = 0x60 BPF_MAJOR_VERSION = 0x1 BPF_MAXINSNS = 0x1000 @@ -555,6 +559,7 @@ const ( BPF_RET = 0x6 BPF_RSH = 0x70 BPF_ST = 0x2 + BPF_STORE_REL = 0x110 BPF_STX = 0x3 BPF_SUB = 0x10 BPF_TAG_SIZE = 0x8 @@ -844,9 +849,9 @@ const ( DM_UUID_FLAG = 0x4000 DM_UUID_LEN = 0x81 DM_VERSION = 0xc138fd00 - DM_VERSION_EXTRA = "-ioctl (2025-01-17)" + DM_VERSION_EXTRA = "-ioctl (2025-04-28)" DM_VERSION_MAJOR = 0x4 - DM_VERSION_MINOR = 0x31 + DM_VERSION_MINOR = 0x32 DM_VERSION_PATCHLEVEL = 0x0 DT_BLK = 0x6 DT_CHR = 0x2 @@ -937,9 +942,6 @@ const ( EPOLL_CTL_MOD = 0x3 EPOLL_IOC_TYPE = 0x8a EROFS_SUPER_MAGIC_V1 = 0xe0f5e1e2 - ESP_V4_FLOW = 0xa - ESP_V6_FLOW = 0xc - ETHER_FLOW = 0x12 ETHTOOL_BUSINFO_LEN = 0x20 ETHTOOL_EROMVERS_LEN = 0x20 ETHTOOL_FAMILY_NAME = "ethtool" @@ -1213,6 +1215,7 @@ const ( FAN_EVENT_INFO_TYPE_DFID_NAME = 0x2 FAN_EVENT_INFO_TYPE_ERROR = 0x5 FAN_EVENT_INFO_TYPE_FID = 0x1 + FAN_EVENT_INFO_TYPE_MNT = 0x7 FAN_EVENT_INFO_TYPE_NEW_DFID_NAME = 0xc FAN_EVENT_INFO_TYPE_OLD_DFID_NAME = 0xa FAN_EVENT_INFO_TYPE_PIDFD = 0x4 @@ -1231,9 +1234,12 @@ const ( FAN_MARK_IGNORED_SURV_MODIFY = 0x40 FAN_MARK_IGNORE_SURV = 0x440 FAN_MARK_INODE = 0x0 + FAN_MARK_MNTNS = 0x110 FAN_MARK_MOUNT = 0x10 FAN_MARK_ONLYDIR = 0x8 FAN_MARK_REMOVE = 0x2 + FAN_MNT_ATTACH = 0x1000000 + FAN_MNT_DETACH = 0x2000000 FAN_MODIFY = 0x2 FAN_MOVE = 0xc0 FAN_MOVED_FROM = 0x40 @@ -1255,6 +1261,7 @@ const ( FAN_REPORT_DIR_FID = 0x400 FAN_REPORT_FD_ERROR = 0x2000 FAN_REPORT_FID = 0x200 + FAN_REPORT_MNT = 0x4000 FAN_REPORT_NAME = 0x800 FAN_REPORT_PIDFD = 0x80 FAN_REPORT_TARGET_FID = 0x1000 @@ -1274,6 +1281,7 @@ const ( FIB_RULE_PERMANENT = 0x1 FIB_RULE_UNRESOLVED = 0x4 FIDEDUPERANGE = 0xc0189436 + FSCRYPT_ADD_KEY_FLAG_HW_WRAPPED = 0x1 FSCRYPT_KEY_DESCRIPTOR_SIZE = 0x8 FSCRYPT_KEY_DESC_PREFIX = "fscrypt:" FSCRYPT_KEY_DESC_PREFIX_SIZE = 0x8 @@ -1582,7 +1590,6 @@ const ( IPV6_DONTFRAG = 0x3e IPV6_DROP_MEMBERSHIP = 0x15 IPV6_DSTOPTS = 0x3b - IPV6_FLOW = 0x11 IPV6_FREEBIND = 0x4e IPV6_HDRINCL = 0x24 IPV6_HOPLIMIT = 0x34 @@ -1633,7 +1640,6 @@ const ( IPV6_TRANSPARENT = 0x4b IPV6_UNICAST_HOPS = 0x10 IPV6_UNICAST_IF = 0x4c - IPV6_USER_FLOW = 0xe IPV6_V6ONLY = 0x1a IPV6_VERSION = 0x60 IPV6_VERSION_MASK = 0xf0 @@ -1695,7 +1701,6 @@ const ( IP_TTL = 0x2 IP_UNBLOCK_SOURCE = 0x25 IP_UNICAST_IF = 0x32 - IP_USER_FLOW = 0xd IP_XFRM_POLICY = 0x11 ISOFS_SUPER_MAGIC = 0x9660 ISTRIP = 0x20 @@ -1817,7 +1822,11 @@ const ( LANDLOCK_ACCESS_FS_WRITE_FILE = 0x2 LANDLOCK_ACCESS_NET_BIND_TCP = 0x1 LANDLOCK_ACCESS_NET_CONNECT_TCP = 0x2 + LANDLOCK_CREATE_RULESET_ERRATA = 0x2 LANDLOCK_CREATE_RULESET_VERSION = 0x1 + LANDLOCK_RESTRICT_SELF_LOG_NEW_EXEC_ON = 0x2 + LANDLOCK_RESTRICT_SELF_LOG_SAME_EXEC_OFF = 0x1 + LANDLOCK_RESTRICT_SELF_LOG_SUBDOMAINS_OFF = 0x4 LANDLOCK_SCOPE_ABSTRACT_UNIX_SOCKET = 0x1 LANDLOCK_SCOPE_SIGNAL = 0x2 LINUX_REBOOT_CMD_CAD_OFF = 0x0 @@ -2493,6 +2502,10 @@ const ( PR_FP_EXC_UND = 0x40000 PR_FP_MODE_FR = 0x1 PR_FP_MODE_FRE = 0x2 + PR_FUTEX_HASH = 0x4e + PR_FUTEX_HASH_GET_IMMUTABLE = 0x3 + PR_FUTEX_HASH_GET_SLOTS = 0x2 + PR_FUTEX_HASH_SET_SLOTS = 0x1 PR_GET_AUXV = 0x41555856 PR_GET_CHILD_SUBREAPER = 0x25 PR_GET_DUMPABLE = 0x3 @@ -2652,6 +2665,10 @@ const ( PR_TAGGED_ADDR_ENABLE = 0x1 PR_TASK_PERF_EVENTS_DISABLE = 0x1f PR_TASK_PERF_EVENTS_ENABLE = 0x20 + PR_TIMER_CREATE_RESTORE_IDS = 0x4d + PR_TIMER_CREATE_RESTORE_IDS_GET = 0x2 + PR_TIMER_CREATE_RESTORE_IDS_OFF = 0x0 + PR_TIMER_CREATE_RESTORE_IDS_ON = 0x1 PR_TIMING_STATISTICAL = 0x0 PR_TIMING_TIMESTAMP = 0x1 PR_TSC_ENABLE = 0x1 @@ -2732,6 +2749,7 @@ const ( PTRACE_SETREGSET = 0x4205 PTRACE_SETSIGINFO = 0x4203 PTRACE_SETSIGMASK = 0x420b + PTRACE_SET_SYSCALL_INFO = 0x4212 PTRACE_SET_SYSCALL_USER_DISPATCH_CONFIG = 0x4210 PTRACE_SINGLESTEP = 0x9 PTRACE_SYSCALL = 0x18 @@ -2982,6 +3000,7 @@ const ( RTPROT_NTK = 0xf RTPROT_OPENR = 0x63 RTPROT_OSPF = 0xbc + RTPROT_OVN = 0x54 RTPROT_RA = 0x9 RTPROT_REDIRECT = 0x1 RTPROT_RIP = 0xbd @@ -3336,7 +3355,7 @@ const ( TASKSTATS_GENL_NAME = "TASKSTATS" TASKSTATS_GENL_VERSION = 0x1 TASKSTATS_TYPE_MAX = 0x6 - TASKSTATS_VERSION = 0xf + TASKSTATS_VERSION = 0x10 TCIFLUSH = 0x0 TCIOFF = 0x2 TCIOFLUSH = 0x2 @@ -3406,8 +3425,6 @@ const ( TCP_TX_DELAY = 0x25 TCP_ULP = 0x1f TCP_USER_TIMEOUT = 0x12 - TCP_V4_FLOW = 0x1 - TCP_V6_FLOW = 0x5 TCP_WINDOW_CLAMP = 0xa TCP_ZEROCOPY_RECEIVE = 0x23 TFD_TIMER_ABSTIME = 0x1 @@ -3530,8 +3547,6 @@ const ( UDP_NO_CHECK6_RX = 0x66 UDP_NO_CHECK6_TX = 0x65 UDP_SEGMENT = 0x67 - UDP_V4_FLOW = 0x2 - UDP_V6_FLOW = 0x6 UMOUNT_NOFOLLOW = 0x8 USBDEVICE_SUPER_MAGIC = 0x9fa2 UTIME_NOW = 0x3fffffff @@ -3574,7 +3589,7 @@ const ( WDIOS_TEMPPANIC = 0x4 WDIOS_UNKNOWN = -0x1 WEXITED = 0x4 - WGALLOWEDIP_A_MAX = 0x3 + WGALLOWEDIP_A_MAX = 0x4 WGDEVICE_A_MAX = 0x8 WGPEER_A_MAX = 0xa WG_CMD_MAX = 0x1 @@ -3688,6 +3703,7 @@ const ( XDP_SHARED_UMEM = 0x1 XDP_STATISTICS = 0x7 XDP_TXMD_FLAGS_CHECKSUM = 0x2 + XDP_TXMD_FLAGS_LAUNCH_TIME = 0x4 XDP_TXMD_FLAGS_TIMESTAMP = 0x1 XDP_TX_METADATA = 0x2 XDP_TX_RING = 0x3 diff --git a/vendor/golang.org/x/sys/unix/zerrors_linux_386.go b/vendor/golang.org/x/sys/unix/zerrors_linux_386.go index a8c421e29..1c37f9fbc 100644 --- a/vendor/golang.org/x/sys/unix/zerrors_linux_386.go +++ b/vendor/golang.org/x/sys/unix/zerrors_linux_386.go @@ -68,6 +68,7 @@ const ( CS8 = 0x30 CSIZE = 0x30 CSTOPB = 0x40 + DM_MPATH_PROBE_PATHS = 0xfd12 ECCGETLAYOUT = 0x81484d11 ECCGETSTATS = 0x80104d12 ECHOCTL = 0x200 @@ -360,6 +361,7 @@ const ( SO_OOBINLINE = 0xa SO_PASSCRED = 0x10 SO_PASSPIDFD = 0x4c + SO_PASSRIGHTS = 0x53 SO_PASSSEC = 0x22 SO_PEEK_OFF = 0x2a SO_PEERCRED = 0x11 diff --git a/vendor/golang.org/x/sys/unix/zerrors_linux_amd64.go b/vendor/golang.org/x/sys/unix/zerrors_linux_amd64.go index 9a88d1813..6f54d34ae 100644 --- a/vendor/golang.org/x/sys/unix/zerrors_linux_amd64.go +++ b/vendor/golang.org/x/sys/unix/zerrors_linux_amd64.go @@ -68,6 +68,7 @@ const ( CS8 = 0x30 CSIZE = 0x30 CSTOPB = 0x40 + DM_MPATH_PROBE_PATHS = 0xfd12 ECCGETLAYOUT = 0x81484d11 ECCGETSTATS = 0x80104d12 ECHOCTL = 0x200 @@ -361,6 +362,7 @@ const ( SO_OOBINLINE = 0xa SO_PASSCRED = 0x10 SO_PASSPIDFD = 0x4c + SO_PASSRIGHTS = 0x53 SO_PASSSEC = 0x22 SO_PEEK_OFF = 0x2a SO_PEERCRED = 0x11 diff --git a/vendor/golang.org/x/sys/unix/zerrors_linux_arm.go b/vendor/golang.org/x/sys/unix/zerrors_linux_arm.go index 7cb6a867e..783ec5c12 100644 --- a/vendor/golang.org/x/sys/unix/zerrors_linux_arm.go +++ b/vendor/golang.org/x/sys/unix/zerrors_linux_arm.go @@ -68,6 +68,7 @@ const ( CS8 = 0x30 CSIZE = 0x30 CSTOPB = 0x40 + DM_MPATH_PROBE_PATHS = 0xfd12 ECCGETLAYOUT = 0x81484d11 ECCGETSTATS = 0x80104d12 ECHOCTL = 0x200 @@ -366,6 +367,7 @@ const ( SO_OOBINLINE = 0xa SO_PASSCRED = 0x10 SO_PASSPIDFD = 0x4c + SO_PASSRIGHTS = 0x53 SO_PASSSEC = 0x22 SO_PEEK_OFF = 0x2a SO_PEERCRED = 0x11 diff --git a/vendor/golang.org/x/sys/unix/zerrors_linux_arm64.go b/vendor/golang.org/x/sys/unix/zerrors_linux_arm64.go index d0ecd2c58..ca83d3ba1 100644 --- a/vendor/golang.org/x/sys/unix/zerrors_linux_arm64.go +++ b/vendor/golang.org/x/sys/unix/zerrors_linux_arm64.go @@ -68,6 +68,7 @@ const ( CS8 = 0x30 CSIZE = 0x30 CSTOPB = 0x40 + DM_MPATH_PROBE_PATHS = 0xfd12 ECCGETLAYOUT = 0x81484d11 ECCGETSTATS = 0x80104d12 ECHOCTL = 0x200 @@ -359,6 +360,7 @@ const ( SO_OOBINLINE = 0xa SO_PASSCRED = 0x10 SO_PASSPIDFD = 0x4c + SO_PASSRIGHTS = 0x53 SO_PASSSEC = 0x22 SO_PEEK_OFF = 0x2a SO_PEERCRED = 0x11 diff --git a/vendor/golang.org/x/sys/unix/zerrors_linux_loong64.go b/vendor/golang.org/x/sys/unix/zerrors_linux_loong64.go index 7a2940ae0..607e611c0 100644 --- a/vendor/golang.org/x/sys/unix/zerrors_linux_loong64.go +++ b/vendor/golang.org/x/sys/unix/zerrors_linux_loong64.go @@ -68,6 +68,7 @@ const ( CS8 = 0x30 CSIZE = 0x30 CSTOPB = 0x40 + DM_MPATH_PROBE_PATHS = 0xfd12 ECCGETLAYOUT = 0x81484d11 ECCGETSTATS = 0x80104d12 ECHOCTL = 0x200 @@ -353,6 +354,7 @@ const ( SO_OOBINLINE = 0xa SO_PASSCRED = 0x10 SO_PASSPIDFD = 0x4c + SO_PASSRIGHTS = 0x53 SO_PASSSEC = 0x22 SO_PEEK_OFF = 0x2a SO_PEERCRED = 0x11 diff --git a/vendor/golang.org/x/sys/unix/zerrors_linux_mips.go b/vendor/golang.org/x/sys/unix/zerrors_linux_mips.go index d14ca8f2e..b9cb5bd3c 100644 --- a/vendor/golang.org/x/sys/unix/zerrors_linux_mips.go +++ b/vendor/golang.org/x/sys/unix/zerrors_linux_mips.go @@ -68,6 +68,7 @@ const ( CS8 = 0x30 CSIZE = 0x30 CSTOPB = 0x40 + DM_MPATH_PROBE_PATHS = 0x2000fd12 ECCGETLAYOUT = 0x41484d11 ECCGETSTATS = 0x40104d12 ECHOCTL = 0x200 @@ -359,6 +360,7 @@ const ( SO_OOBINLINE = 0x100 SO_PASSCRED = 0x11 SO_PASSPIDFD = 0x4c + SO_PASSRIGHTS = 0x53 SO_PASSSEC = 0x22 SO_PEEK_OFF = 0x2a SO_PEERCRED = 0x12 diff --git a/vendor/golang.org/x/sys/unix/zerrors_linux_mips64.go b/vendor/golang.org/x/sys/unix/zerrors_linux_mips64.go index 2da1bac1e..65b078a63 100644 --- a/vendor/golang.org/x/sys/unix/zerrors_linux_mips64.go +++ b/vendor/golang.org/x/sys/unix/zerrors_linux_mips64.go @@ -68,6 +68,7 @@ const ( CS8 = 0x30 CSIZE = 0x30 CSTOPB = 0x40 + DM_MPATH_PROBE_PATHS = 0x2000fd12 ECCGETLAYOUT = 0x41484d11 ECCGETSTATS = 0x40104d12 ECHOCTL = 0x200 @@ -359,6 +360,7 @@ const ( SO_OOBINLINE = 0x100 SO_PASSCRED = 0x11 SO_PASSPIDFD = 0x4c + SO_PASSRIGHTS = 0x53 SO_PASSSEC = 0x22 SO_PEEK_OFF = 0x2a SO_PEERCRED = 0x12 diff --git a/vendor/golang.org/x/sys/unix/zerrors_linux_mips64le.go b/vendor/golang.org/x/sys/unix/zerrors_linux_mips64le.go index 28727514b..5298a3033 100644 --- a/vendor/golang.org/x/sys/unix/zerrors_linux_mips64le.go +++ b/vendor/golang.org/x/sys/unix/zerrors_linux_mips64le.go @@ -68,6 +68,7 @@ const ( CS8 = 0x30 CSIZE = 0x30 CSTOPB = 0x40 + DM_MPATH_PROBE_PATHS = 0x2000fd12 ECCGETLAYOUT = 0x41484d11 ECCGETSTATS = 0x40104d12 ECHOCTL = 0x200 @@ -359,6 +360,7 @@ const ( SO_OOBINLINE = 0x100 SO_PASSCRED = 0x11 SO_PASSPIDFD = 0x4c + SO_PASSRIGHTS = 0x53 SO_PASSSEC = 0x22 SO_PEEK_OFF = 0x2a SO_PEERCRED = 0x12 diff --git a/vendor/golang.org/x/sys/unix/zerrors_linux_mipsle.go b/vendor/golang.org/x/sys/unix/zerrors_linux_mipsle.go index 7f287b54b..7bc557c87 100644 --- a/vendor/golang.org/x/sys/unix/zerrors_linux_mipsle.go +++ b/vendor/golang.org/x/sys/unix/zerrors_linux_mipsle.go @@ -68,6 +68,7 @@ const ( CS8 = 0x30 CSIZE = 0x30 CSTOPB = 0x40 + DM_MPATH_PROBE_PATHS = 0x2000fd12 ECCGETLAYOUT = 0x41484d11 ECCGETSTATS = 0x40104d12 ECHOCTL = 0x200 @@ -359,6 +360,7 @@ const ( SO_OOBINLINE = 0x100 SO_PASSCRED = 0x11 SO_PASSPIDFD = 0x4c + SO_PASSRIGHTS = 0x53 SO_PASSSEC = 0x22 SO_PEEK_OFF = 0x2a SO_PEERCRED = 0x12 diff --git a/vendor/golang.org/x/sys/unix/zerrors_linux_ppc.go b/vendor/golang.org/x/sys/unix/zerrors_linux_ppc.go index 7e5f9e6aa..152399bb0 100644 --- a/vendor/golang.org/x/sys/unix/zerrors_linux_ppc.go +++ b/vendor/golang.org/x/sys/unix/zerrors_linux_ppc.go @@ -68,6 +68,7 @@ const ( CS8 = 0x300 CSIZE = 0x300 CSTOPB = 0x400 + DM_MPATH_PROBE_PATHS = 0x2000fd12 ECCGETLAYOUT = 0x41484d11 ECCGETSTATS = 0x40104d12 ECHOCTL = 0x40 @@ -414,6 +415,7 @@ const ( SO_OOBINLINE = 0xa SO_PASSCRED = 0x14 SO_PASSPIDFD = 0x4c + SO_PASSRIGHTS = 0x53 SO_PASSSEC = 0x22 SO_PEEK_OFF = 0x2a SO_PEERCRED = 0x15 diff --git a/vendor/golang.org/x/sys/unix/zerrors_linux_ppc64.go b/vendor/golang.org/x/sys/unix/zerrors_linux_ppc64.go index 37c87952f..1a1ce2409 100644 --- a/vendor/golang.org/x/sys/unix/zerrors_linux_ppc64.go +++ b/vendor/golang.org/x/sys/unix/zerrors_linux_ppc64.go @@ -68,6 +68,7 @@ const ( CS8 = 0x300 CSIZE = 0x300 CSTOPB = 0x400 + DM_MPATH_PROBE_PATHS = 0x2000fd12 ECCGETLAYOUT = 0x41484d11 ECCGETSTATS = 0x40104d12 ECHOCTL = 0x40 @@ -418,6 +419,7 @@ const ( SO_OOBINLINE = 0xa SO_PASSCRED = 0x14 SO_PASSPIDFD = 0x4c + SO_PASSRIGHTS = 0x53 SO_PASSSEC = 0x22 SO_PEEK_OFF = 0x2a SO_PEERCRED = 0x15 diff --git a/vendor/golang.org/x/sys/unix/zerrors_linux_ppc64le.go b/vendor/golang.org/x/sys/unix/zerrors_linux_ppc64le.go index 522013361..4231a1fb5 100644 --- a/vendor/golang.org/x/sys/unix/zerrors_linux_ppc64le.go +++ b/vendor/golang.org/x/sys/unix/zerrors_linux_ppc64le.go @@ -68,6 +68,7 @@ const ( CS8 = 0x300 CSIZE = 0x300 CSTOPB = 0x400 + DM_MPATH_PROBE_PATHS = 0x2000fd12 ECCGETLAYOUT = 0x41484d11 ECCGETSTATS = 0x40104d12 ECHOCTL = 0x40 @@ -418,6 +419,7 @@ const ( SO_OOBINLINE = 0xa SO_PASSCRED = 0x14 SO_PASSPIDFD = 0x4c + SO_PASSRIGHTS = 0x53 SO_PASSSEC = 0x22 SO_PEEK_OFF = 0x2a SO_PEERCRED = 0x15 diff --git a/vendor/golang.org/x/sys/unix/zerrors_linux_riscv64.go b/vendor/golang.org/x/sys/unix/zerrors_linux_riscv64.go index 4bfe2b5b6..21c0e9526 100644 --- a/vendor/golang.org/x/sys/unix/zerrors_linux_riscv64.go +++ b/vendor/golang.org/x/sys/unix/zerrors_linux_riscv64.go @@ -68,6 +68,7 @@ const ( CS8 = 0x30 CSIZE = 0x30 CSTOPB = 0x40 + DM_MPATH_PROBE_PATHS = 0xfd12 ECCGETLAYOUT = 0x81484d11 ECCGETSTATS = 0x80104d12 ECHOCTL = 0x200 @@ -350,6 +351,7 @@ const ( SO_OOBINLINE = 0xa SO_PASSCRED = 0x10 SO_PASSPIDFD = 0x4c + SO_PASSRIGHTS = 0x53 SO_PASSSEC = 0x22 SO_PEEK_OFF = 0x2a SO_PEERCRED = 0x11 diff --git a/vendor/golang.org/x/sys/unix/zerrors_linux_s390x.go b/vendor/golang.org/x/sys/unix/zerrors_linux_s390x.go index e3cffb869..f00d1cd7c 100644 --- a/vendor/golang.org/x/sys/unix/zerrors_linux_s390x.go +++ b/vendor/golang.org/x/sys/unix/zerrors_linux_s390x.go @@ -68,6 +68,7 @@ const ( CS8 = 0x30 CSIZE = 0x30 CSTOPB = 0x40 + DM_MPATH_PROBE_PATHS = 0xfd12 ECCGETLAYOUT = 0x81484d11 ECCGETSTATS = 0x80104d12 ECHOCTL = 0x200 @@ -422,6 +423,7 @@ const ( SO_OOBINLINE = 0xa SO_PASSCRED = 0x10 SO_PASSPIDFD = 0x4c + SO_PASSRIGHTS = 0x53 SO_PASSSEC = 0x22 SO_PEEK_OFF = 0x2a SO_PEERCRED = 0x11 diff --git a/vendor/golang.org/x/sys/unix/zerrors_linux_sparc64.go b/vendor/golang.org/x/sys/unix/zerrors_linux_sparc64.go index c219c8db3..bc8d539e6 100644 --- a/vendor/golang.org/x/sys/unix/zerrors_linux_sparc64.go +++ b/vendor/golang.org/x/sys/unix/zerrors_linux_sparc64.go @@ -71,6 +71,7 @@ const ( CS8 = 0x30 CSIZE = 0x30 CSTOPB = 0x40 + DM_MPATH_PROBE_PATHS = 0x2000fd12 ECCGETLAYOUT = 0x41484d11 ECCGETSTATS = 0x40104d12 ECHOCTL = 0x200 @@ -461,6 +462,7 @@ const ( SO_OOBINLINE = 0x100 SO_PASSCRED = 0x2 SO_PASSPIDFD = 0x55 + SO_PASSRIGHTS = 0x5c SO_PASSSEC = 0x1f SO_PEEK_OFF = 0x26 SO_PEERCRED = 0x40 diff --git a/vendor/golang.org/x/sys/unix/zsysnum_linux_386.go b/vendor/golang.org/x/sys/unix/zsysnum_linux_386.go index c79aaff30..aca56ee49 100644 --- a/vendor/golang.org/x/sys/unix/zsysnum_linux_386.go +++ b/vendor/golang.org/x/sys/unix/zsysnum_linux_386.go @@ -462,4 +462,5 @@ const ( SYS_GETXATTRAT = 464 SYS_LISTXATTRAT = 465 SYS_REMOVEXATTRAT = 466 + SYS_OPEN_TREE_ATTR = 467 ) diff --git a/vendor/golang.org/x/sys/unix/zsysnum_linux_amd64.go b/vendor/golang.org/x/sys/unix/zsysnum_linux_amd64.go index 5eb450695..2ea1ef58c 100644 --- a/vendor/golang.org/x/sys/unix/zsysnum_linux_amd64.go +++ b/vendor/golang.org/x/sys/unix/zsysnum_linux_amd64.go @@ -385,4 +385,5 @@ const ( SYS_GETXATTRAT = 464 SYS_LISTXATTRAT = 465 SYS_REMOVEXATTRAT = 466 + SYS_OPEN_TREE_ATTR = 467 ) diff --git a/vendor/golang.org/x/sys/unix/zsysnum_linux_arm.go b/vendor/golang.org/x/sys/unix/zsysnum_linux_arm.go index 05e502974..d22c8af31 100644 --- a/vendor/golang.org/x/sys/unix/zsysnum_linux_arm.go +++ b/vendor/golang.org/x/sys/unix/zsysnum_linux_arm.go @@ -426,4 +426,5 @@ const ( SYS_GETXATTRAT = 464 SYS_LISTXATTRAT = 465 SYS_REMOVEXATTRAT = 466 + SYS_OPEN_TREE_ATTR = 467 ) diff --git a/vendor/golang.org/x/sys/unix/zsysnum_linux_arm64.go b/vendor/golang.org/x/sys/unix/zsysnum_linux_arm64.go index 38c53ec51..5ee264ae9 100644 --- a/vendor/golang.org/x/sys/unix/zsysnum_linux_arm64.go +++ b/vendor/golang.org/x/sys/unix/zsysnum_linux_arm64.go @@ -329,4 +329,5 @@ const ( SYS_GETXATTRAT = 464 SYS_LISTXATTRAT = 465 SYS_REMOVEXATTRAT = 466 + SYS_OPEN_TREE_ATTR = 467 ) diff --git a/vendor/golang.org/x/sys/unix/zsysnum_linux_loong64.go b/vendor/golang.org/x/sys/unix/zsysnum_linux_loong64.go index 31d2e71a1..f9f03ebf5 100644 --- a/vendor/golang.org/x/sys/unix/zsysnum_linux_loong64.go +++ b/vendor/golang.org/x/sys/unix/zsysnum_linux_loong64.go @@ -325,4 +325,5 @@ const ( SYS_GETXATTRAT = 464 SYS_LISTXATTRAT = 465 SYS_REMOVEXATTRAT = 466 + SYS_OPEN_TREE_ATTR = 467 ) diff --git a/vendor/golang.org/x/sys/unix/zsysnum_linux_mips.go b/vendor/golang.org/x/sys/unix/zsysnum_linux_mips.go index f4184a336..87c2118e8 100644 --- a/vendor/golang.org/x/sys/unix/zsysnum_linux_mips.go +++ b/vendor/golang.org/x/sys/unix/zsysnum_linux_mips.go @@ -446,4 +446,5 @@ const ( SYS_GETXATTRAT = 4464 SYS_LISTXATTRAT = 4465 SYS_REMOVEXATTRAT = 4466 + SYS_OPEN_TREE_ATTR = 4467 ) diff --git a/vendor/golang.org/x/sys/unix/zsysnum_linux_mips64.go b/vendor/golang.org/x/sys/unix/zsysnum_linux_mips64.go index 05b996227..391ad102f 100644 --- a/vendor/golang.org/x/sys/unix/zsysnum_linux_mips64.go +++ b/vendor/golang.org/x/sys/unix/zsysnum_linux_mips64.go @@ -376,4 +376,5 @@ const ( SYS_GETXATTRAT = 5464 SYS_LISTXATTRAT = 5465 SYS_REMOVEXATTRAT = 5466 + SYS_OPEN_TREE_ATTR = 5467 ) diff --git a/vendor/golang.org/x/sys/unix/zsysnum_linux_mips64le.go b/vendor/golang.org/x/sys/unix/zsysnum_linux_mips64le.go index 43a256e9e..565615775 100644 --- a/vendor/golang.org/x/sys/unix/zsysnum_linux_mips64le.go +++ b/vendor/golang.org/x/sys/unix/zsysnum_linux_mips64le.go @@ -376,4 +376,5 @@ const ( SYS_GETXATTRAT = 5464 SYS_LISTXATTRAT = 5465 SYS_REMOVEXATTRAT = 5466 + SYS_OPEN_TREE_ATTR = 5467 ) diff --git a/vendor/golang.org/x/sys/unix/zsysnum_linux_mipsle.go b/vendor/golang.org/x/sys/unix/zsysnum_linux_mipsle.go index eea5ddfc2..0482b52e3 100644 --- a/vendor/golang.org/x/sys/unix/zsysnum_linux_mipsle.go +++ b/vendor/golang.org/x/sys/unix/zsysnum_linux_mipsle.go @@ -446,4 +446,5 @@ const ( SYS_GETXATTRAT = 4464 SYS_LISTXATTRAT = 4465 SYS_REMOVEXATTRAT = 4466 + SYS_OPEN_TREE_ATTR = 4467 ) diff --git a/vendor/golang.org/x/sys/unix/zsysnum_linux_ppc.go b/vendor/golang.org/x/sys/unix/zsysnum_linux_ppc.go index 0d777bfbb..71806f08f 100644 --- a/vendor/golang.org/x/sys/unix/zsysnum_linux_ppc.go +++ b/vendor/golang.org/x/sys/unix/zsysnum_linux_ppc.go @@ -453,4 +453,5 @@ const ( SYS_GETXATTRAT = 464 SYS_LISTXATTRAT = 465 SYS_REMOVEXATTRAT = 466 + SYS_OPEN_TREE_ATTR = 467 ) diff --git a/vendor/golang.org/x/sys/unix/zsysnum_linux_ppc64.go b/vendor/golang.org/x/sys/unix/zsysnum_linux_ppc64.go index b44636502..e35a71058 100644 --- a/vendor/golang.org/x/sys/unix/zsysnum_linux_ppc64.go +++ b/vendor/golang.org/x/sys/unix/zsysnum_linux_ppc64.go @@ -425,4 +425,5 @@ const ( SYS_GETXATTRAT = 464 SYS_LISTXATTRAT = 465 SYS_REMOVEXATTRAT = 466 + SYS_OPEN_TREE_ATTR = 467 ) diff --git a/vendor/golang.org/x/sys/unix/zsysnum_linux_ppc64le.go b/vendor/golang.org/x/sys/unix/zsysnum_linux_ppc64le.go index 0c7d21c18..2aea47670 100644 --- a/vendor/golang.org/x/sys/unix/zsysnum_linux_ppc64le.go +++ b/vendor/golang.org/x/sys/unix/zsysnum_linux_ppc64le.go @@ -425,4 +425,5 @@ const ( SYS_GETXATTRAT = 464 SYS_LISTXATTRAT = 465 SYS_REMOVEXATTRAT = 466 + SYS_OPEN_TREE_ATTR = 467 ) diff --git a/vendor/golang.org/x/sys/unix/zsysnum_linux_riscv64.go b/vendor/golang.org/x/sys/unix/zsysnum_linux_riscv64.go index 840539169..6c9bb4e56 100644 --- a/vendor/golang.org/x/sys/unix/zsysnum_linux_riscv64.go +++ b/vendor/golang.org/x/sys/unix/zsysnum_linux_riscv64.go @@ -330,4 +330,5 @@ const ( SYS_GETXATTRAT = 464 SYS_LISTXATTRAT = 465 SYS_REMOVEXATTRAT = 466 + SYS_OPEN_TREE_ATTR = 467 ) diff --git a/vendor/golang.org/x/sys/unix/zsysnum_linux_s390x.go b/vendor/golang.org/x/sys/unix/zsysnum_linux_s390x.go index fcf1b790d..680bc9915 100644 --- a/vendor/golang.org/x/sys/unix/zsysnum_linux_s390x.go +++ b/vendor/golang.org/x/sys/unix/zsysnum_linux_s390x.go @@ -391,4 +391,5 @@ const ( SYS_GETXATTRAT = 464 SYS_LISTXATTRAT = 465 SYS_REMOVEXATTRAT = 466 + SYS_OPEN_TREE_ATTR = 467 ) diff --git a/vendor/golang.org/x/sys/unix/zsysnum_linux_sparc64.go b/vendor/golang.org/x/sys/unix/zsysnum_linux_sparc64.go index 52d15b5f9..620f27105 100644 --- a/vendor/golang.org/x/sys/unix/zsysnum_linux_sparc64.go +++ b/vendor/golang.org/x/sys/unix/zsysnum_linux_sparc64.go @@ -404,4 +404,5 @@ const ( SYS_GETXATTRAT = 464 SYS_LISTXATTRAT = 465 SYS_REMOVEXATTRAT = 466 + SYS_OPEN_TREE_ATTR = 467 ) diff --git a/vendor/golang.org/x/sys/unix/ztypes_linux.go b/vendor/golang.org/x/sys/unix/ztypes_linux.go index 8bcac2835..cd236443f 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_linux.go +++ b/vendor/golang.org/x/sys/unix/ztypes_linux.go @@ -115,7 +115,9 @@ type Statx_t struct { Atomic_write_unit_max uint32 Atomic_write_segments_max uint32 Dio_read_offset_align uint32 - _ [9]uint64 + Atomic_write_unit_max_opt uint32 + _ [1]uint32 + _ [8]uint64 } type Fsid struct { @@ -199,7 +201,8 @@ type FscryptAddKeyArg struct { Key_spec FscryptKeySpecifier Raw_size uint32 Key_id uint32 - _ [8]uint32 + Flags uint32 + _ [7]uint32 } type FscryptRemoveKeyArg struct { @@ -2317,6 +2320,11 @@ const ( NFT_CT_AVGPKT = 0x10 NFT_CT_ZONE = 0x11 NFT_CT_EVENTMASK = 0x12 + NFT_CT_SRC_IP = 0x13 + NFT_CT_DST_IP = 0x14 + NFT_CT_SRC_IP6 = 0x15 + NFT_CT_DST_IP6 = 0x16 + NFT_CT_ID = 0x17 NFTA_CT_UNSPEC = 0x0 NFTA_CT_DREG = 0x1 NFTA_CT_KEY = 0x2 @@ -2597,8 +2605,8 @@ const ( SOF_TIMESTAMPING_BIND_PHC = 0x8000 SOF_TIMESTAMPING_OPT_ID_TCP = 0x10000 - SOF_TIMESTAMPING_LAST = 0x20000 - SOF_TIMESTAMPING_MASK = 0x3ffff + SOF_TIMESTAMPING_LAST = 0x40000 + SOF_TIMESTAMPING_MASK = 0x7ffff SCM_TSTAMP_SND = 0x0 SCM_TSTAMP_SCHED = 0x1 @@ -4044,7 +4052,7 @@ const ( ETHTOOL_A_TSINFO_PHC_INDEX = 0x5 ETHTOOL_A_TSINFO_STATS = 0x6 ETHTOOL_A_TSINFO_HWTSTAMP_PROVIDER = 0x7 - ETHTOOL_A_TSINFO_MAX = 0x7 + ETHTOOL_A_TSINFO_MAX = 0x9 ETHTOOL_A_CABLE_TEST_UNSPEC = 0x0 ETHTOOL_A_CABLE_TEST_HEADER = 0x1 ETHTOOL_A_CABLE_TEST_MAX = 0x1 @@ -4130,6 +4138,19 @@ const ( ETHTOOL_A_TUNNEL_INFO_MAX = 0x2 ) +const ( + TCP_V4_FLOW = 0x1 + UDP_V4_FLOW = 0x2 + TCP_V6_FLOW = 0x5 + UDP_V6_FLOW = 0x6 + ESP_V4_FLOW = 0xa + ESP_V6_FLOW = 0xc + IP_USER_FLOW = 0xd + IPV6_USER_FLOW = 0xe + IPV6_FLOW = 0x11 + ETHER_FLOW = 0x12 +) + const SPEED_UNKNOWN = -0x1 type EthtoolDrvinfo struct { @@ -4780,7 +4801,7 @@ const ( NL80211_ATTR_MAC_HINT = 0xc8 NL80211_ATTR_MAC_MASK = 0xd7 NL80211_ATTR_MAX_AP_ASSOC_STA = 0xca - NL80211_ATTR_MAX = 0x150 + NL80211_ATTR_MAX = 0x151 NL80211_ATTR_MAX_CRIT_PROT_DURATION = 0xb4 NL80211_ATTR_MAX_CSA_COUNTERS = 0xce NL80211_ATTR_MAX_HW_TIMESTAMP_PEERS = 0x143 @@ -5414,7 +5435,7 @@ const ( NL80211_FREQUENCY_ATTR_GO_CONCURRENT = 0xf NL80211_FREQUENCY_ATTR_INDOOR_ONLY = 0xe NL80211_FREQUENCY_ATTR_IR_CONCURRENT = 0xf - NL80211_FREQUENCY_ATTR_MAX = 0x21 + NL80211_FREQUENCY_ATTR_MAX = 0x22 NL80211_FREQUENCY_ATTR_MAX_TX_POWER = 0x6 NL80211_FREQUENCY_ATTR_NO_10MHZ = 0x11 NL80211_FREQUENCY_ATTR_NO_160MHZ = 0xc @@ -5530,7 +5551,7 @@ const ( NL80211_MAX_SUPP_SELECTORS = 0x80 NL80211_MBSSID_CONFIG_ATTR_EMA = 0x5 NL80211_MBSSID_CONFIG_ATTR_INDEX = 0x3 - NL80211_MBSSID_CONFIG_ATTR_MAX = 0x5 + NL80211_MBSSID_CONFIG_ATTR_MAX = 0x6 NL80211_MBSSID_CONFIG_ATTR_MAX_EMA_PROFILE_PERIODICITY = 0x2 NL80211_MBSSID_CONFIG_ATTR_MAX_INTERFACES = 0x1 NL80211_MBSSID_CONFIG_ATTR_TX_IFINDEX = 0x4 diff --git a/vendor/golang.org/x/sys/unix/ztypes_linux_386.go b/vendor/golang.org/x/sys/unix/ztypes_linux_386.go index 62db85f6c..485f2d3a1 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_linux_386.go +++ b/vendor/golang.org/x/sys/unix/ztypes_linux_386.go @@ -282,19 +282,13 @@ type Taskstats struct { Ac_exitcode uint32 Ac_flag uint8 Ac_nice uint8 - _ [4]byte + _ [6]byte Cpu_count uint64 Cpu_delay_total uint64 - Cpu_delay_max uint64 - Cpu_delay_min uint64 Blkio_count uint64 Blkio_delay_total uint64 - Blkio_delay_max uint64 - Blkio_delay_min uint64 Swapin_count uint64 Swapin_delay_total uint64 - Swapin_delay_max uint64 - Swapin_delay_min uint64 Cpu_run_real_total uint64 Cpu_run_virtual_total uint64 Ac_comm [32]int8 @@ -330,17 +324,11 @@ type Taskstats struct { Cpu_scaled_run_real_total uint64 Freepages_count uint64 Freepages_delay_total uint64 - Freepages_delay_max uint64 - Freepages_delay_min uint64 Thrashing_count uint64 Thrashing_delay_total uint64 - Thrashing_delay_max uint64 - Thrashing_delay_min uint64 Ac_btime64 uint64 Compact_count uint64 Compact_delay_total uint64 - Compact_delay_max uint64 - Compact_delay_min uint64 Ac_tgid uint32 _ [4]byte Ac_tgetime uint64 @@ -348,10 +336,22 @@ type Taskstats struct { Ac_exe_inode uint64 Wpcopy_count uint64 Wpcopy_delay_total uint64 - Wpcopy_delay_max uint64 - Wpcopy_delay_min uint64 Irq_count uint64 Irq_delay_total uint64 + Cpu_delay_max uint64 + Cpu_delay_min uint64 + Blkio_delay_max uint64 + Blkio_delay_min uint64 + Swapin_delay_max uint64 + Swapin_delay_min uint64 + Freepages_delay_max uint64 + Freepages_delay_min uint64 + Thrashing_delay_max uint64 + Thrashing_delay_min uint64 + Compact_delay_max uint64 + Compact_delay_min uint64 + Wpcopy_delay_max uint64 + Wpcopy_delay_min uint64 Irq_delay_max uint64 Irq_delay_min uint64 } diff --git a/vendor/golang.org/x/sys/unix/ztypes_linux_amd64.go b/vendor/golang.org/x/sys/unix/ztypes_linux_amd64.go index 7d89d648d..ecbd1ad8b 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_linux_amd64.go +++ b/vendor/golang.org/x/sys/unix/ztypes_linux_amd64.go @@ -300,16 +300,10 @@ type Taskstats struct { Ac_nice uint8 Cpu_count uint64 Cpu_delay_total uint64 - Cpu_delay_max uint64 - Cpu_delay_min uint64 Blkio_count uint64 Blkio_delay_total uint64 - Blkio_delay_max uint64 - Blkio_delay_min uint64 Swapin_count uint64 Swapin_delay_total uint64 - Swapin_delay_max uint64 - Swapin_delay_min uint64 Cpu_run_real_total uint64 Cpu_run_virtual_total uint64 Ac_comm [32]int8 @@ -344,27 +338,33 @@ type Taskstats struct { Cpu_scaled_run_real_total uint64 Freepages_count uint64 Freepages_delay_total uint64 - Freepages_delay_max uint64 - Freepages_delay_min uint64 Thrashing_count uint64 Thrashing_delay_total uint64 - Thrashing_delay_max uint64 - Thrashing_delay_min uint64 Ac_btime64 uint64 Compact_count uint64 Compact_delay_total uint64 - Compact_delay_max uint64 - Compact_delay_min uint64 Ac_tgid uint32 Ac_tgetime uint64 Ac_exe_dev uint64 Ac_exe_inode uint64 Wpcopy_count uint64 Wpcopy_delay_total uint64 - Wpcopy_delay_max uint64 - Wpcopy_delay_min uint64 Irq_count uint64 Irq_delay_total uint64 + Cpu_delay_max uint64 + Cpu_delay_min uint64 + Blkio_delay_max uint64 + Blkio_delay_min uint64 + Swapin_delay_max uint64 + Swapin_delay_min uint64 + Freepages_delay_max uint64 + Freepages_delay_min uint64 + Thrashing_delay_max uint64 + Thrashing_delay_min uint64 + Compact_delay_max uint64 + Compact_delay_min uint64 + Wpcopy_delay_max uint64 + Wpcopy_delay_min uint64 Irq_delay_max uint64 Irq_delay_min uint64 } diff --git a/vendor/golang.org/x/sys/unix/ztypes_linux_arm.go b/vendor/golang.org/x/sys/unix/ztypes_linux_arm.go index 9c0b39eec..02f0463a4 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_linux_arm.go +++ b/vendor/golang.org/x/sys/unix/ztypes_linux_arm.go @@ -91,7 +91,7 @@ type Stat_t struct { Gid uint32 Rdev uint64 _ uint16 - _ [4]byte + _ [6]byte Size int64 Blksize int32 _ [4]byte @@ -273,19 +273,13 @@ type Taskstats struct { Ac_exitcode uint32 Ac_flag uint8 Ac_nice uint8 - _ [4]byte + _ [6]byte Cpu_count uint64 Cpu_delay_total uint64 - Cpu_delay_max uint64 - Cpu_delay_min uint64 Blkio_count uint64 Blkio_delay_total uint64 - Blkio_delay_max uint64 - Blkio_delay_min uint64 Swapin_count uint64 Swapin_delay_total uint64 - Swapin_delay_max uint64 - Swapin_delay_min uint64 Cpu_run_real_total uint64 Cpu_run_virtual_total uint64 Ac_comm [32]uint8 @@ -321,17 +315,11 @@ type Taskstats struct { Cpu_scaled_run_real_total uint64 Freepages_count uint64 Freepages_delay_total uint64 - Freepages_delay_max uint64 - Freepages_delay_min uint64 Thrashing_count uint64 Thrashing_delay_total uint64 - Thrashing_delay_max uint64 - Thrashing_delay_min uint64 Ac_btime64 uint64 Compact_count uint64 Compact_delay_total uint64 - Compact_delay_max uint64 - Compact_delay_min uint64 Ac_tgid uint32 _ [4]byte Ac_tgetime uint64 @@ -339,10 +327,22 @@ type Taskstats struct { Ac_exe_inode uint64 Wpcopy_count uint64 Wpcopy_delay_total uint64 - Wpcopy_delay_max uint64 - Wpcopy_delay_min uint64 Irq_count uint64 Irq_delay_total uint64 + Cpu_delay_max uint64 + Cpu_delay_min uint64 + Blkio_delay_max uint64 + Blkio_delay_min uint64 + Swapin_delay_max uint64 + Swapin_delay_min uint64 + Freepages_delay_max uint64 + Freepages_delay_min uint64 + Thrashing_delay_max uint64 + Thrashing_delay_min uint64 + Compact_delay_max uint64 + Compact_delay_min uint64 + Wpcopy_delay_max uint64 + Wpcopy_delay_min uint64 Irq_delay_max uint64 Irq_delay_min uint64 } diff --git a/vendor/golang.org/x/sys/unix/ztypes_linux_arm64.go b/vendor/golang.org/x/sys/unix/ztypes_linux_arm64.go index de9c7ff36..6f4d400d2 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_linux_arm64.go +++ b/vendor/golang.org/x/sys/unix/ztypes_linux_arm64.go @@ -279,16 +279,10 @@ type Taskstats struct { Ac_nice uint8 Cpu_count uint64 Cpu_delay_total uint64 - Cpu_delay_max uint64 - Cpu_delay_min uint64 Blkio_count uint64 Blkio_delay_total uint64 - Blkio_delay_max uint64 - Blkio_delay_min uint64 Swapin_count uint64 Swapin_delay_total uint64 - Swapin_delay_max uint64 - Swapin_delay_min uint64 Cpu_run_real_total uint64 Cpu_run_virtual_total uint64 Ac_comm [32]int8 @@ -323,27 +317,33 @@ type Taskstats struct { Cpu_scaled_run_real_total uint64 Freepages_count uint64 Freepages_delay_total uint64 - Freepages_delay_max uint64 - Freepages_delay_min uint64 Thrashing_count uint64 Thrashing_delay_total uint64 - Thrashing_delay_max uint64 - Thrashing_delay_min uint64 Ac_btime64 uint64 Compact_count uint64 Compact_delay_total uint64 - Compact_delay_max uint64 - Compact_delay_min uint64 Ac_tgid uint32 Ac_tgetime uint64 Ac_exe_dev uint64 Ac_exe_inode uint64 Wpcopy_count uint64 Wpcopy_delay_total uint64 - Wpcopy_delay_max uint64 - Wpcopy_delay_min uint64 Irq_count uint64 Irq_delay_total uint64 + Cpu_delay_max uint64 + Cpu_delay_min uint64 + Blkio_delay_max uint64 + Blkio_delay_min uint64 + Swapin_delay_max uint64 + Swapin_delay_min uint64 + Freepages_delay_max uint64 + Freepages_delay_min uint64 + Thrashing_delay_max uint64 + Thrashing_delay_min uint64 + Compact_delay_max uint64 + Compact_delay_min uint64 + Wpcopy_delay_max uint64 + Wpcopy_delay_min uint64 Irq_delay_max uint64 Irq_delay_min uint64 } diff --git a/vendor/golang.org/x/sys/unix/ztypes_linux_loong64.go b/vendor/golang.org/x/sys/unix/ztypes_linux_loong64.go index 2336bd2bf..cd532cfa5 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_linux_loong64.go +++ b/vendor/golang.org/x/sys/unix/ztypes_linux_loong64.go @@ -280,16 +280,10 @@ type Taskstats struct { Ac_nice uint8 Cpu_count uint64 Cpu_delay_total uint64 - Cpu_delay_max uint64 - Cpu_delay_min uint64 Blkio_count uint64 Blkio_delay_total uint64 - Blkio_delay_max uint64 - Blkio_delay_min uint64 Swapin_count uint64 Swapin_delay_total uint64 - Swapin_delay_max uint64 - Swapin_delay_min uint64 Cpu_run_real_total uint64 Cpu_run_virtual_total uint64 Ac_comm [32]int8 @@ -324,27 +318,33 @@ type Taskstats struct { Cpu_scaled_run_real_total uint64 Freepages_count uint64 Freepages_delay_total uint64 - Freepages_delay_max uint64 - Freepages_delay_min uint64 Thrashing_count uint64 Thrashing_delay_total uint64 - Thrashing_delay_max uint64 - Thrashing_delay_min uint64 Ac_btime64 uint64 Compact_count uint64 Compact_delay_total uint64 - Compact_delay_max uint64 - Compact_delay_min uint64 Ac_tgid uint32 Ac_tgetime uint64 Ac_exe_dev uint64 Ac_exe_inode uint64 Wpcopy_count uint64 Wpcopy_delay_total uint64 - Wpcopy_delay_max uint64 - Wpcopy_delay_min uint64 Irq_count uint64 Irq_delay_total uint64 + Cpu_delay_max uint64 + Cpu_delay_min uint64 + Blkio_delay_max uint64 + Blkio_delay_min uint64 + Swapin_delay_max uint64 + Swapin_delay_min uint64 + Freepages_delay_max uint64 + Freepages_delay_min uint64 + Thrashing_delay_max uint64 + Thrashing_delay_min uint64 + Compact_delay_max uint64 + Compact_delay_min uint64 + Wpcopy_delay_max uint64 + Wpcopy_delay_min uint64 Irq_delay_max uint64 Irq_delay_min uint64 } diff --git a/vendor/golang.org/x/sys/unix/ztypes_linux_mips.go b/vendor/golang.org/x/sys/unix/ztypes_linux_mips.go index 4711f0be1..413362085 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_linux_mips.go +++ b/vendor/golang.org/x/sys/unix/ztypes_linux_mips.go @@ -278,19 +278,13 @@ type Taskstats struct { Ac_exitcode uint32 Ac_flag uint8 Ac_nice uint8 - _ [4]byte + _ [6]byte Cpu_count uint64 Cpu_delay_total uint64 - Cpu_delay_max uint64 - Cpu_delay_min uint64 Blkio_count uint64 Blkio_delay_total uint64 - Blkio_delay_max uint64 - Blkio_delay_min uint64 Swapin_count uint64 Swapin_delay_total uint64 - Swapin_delay_max uint64 - Swapin_delay_min uint64 Cpu_run_real_total uint64 Cpu_run_virtual_total uint64 Ac_comm [32]int8 @@ -326,17 +320,11 @@ type Taskstats struct { Cpu_scaled_run_real_total uint64 Freepages_count uint64 Freepages_delay_total uint64 - Freepages_delay_max uint64 - Freepages_delay_min uint64 Thrashing_count uint64 Thrashing_delay_total uint64 - Thrashing_delay_max uint64 - Thrashing_delay_min uint64 Ac_btime64 uint64 Compact_count uint64 Compact_delay_total uint64 - Compact_delay_max uint64 - Compact_delay_min uint64 Ac_tgid uint32 _ [4]byte Ac_tgetime uint64 @@ -344,10 +332,22 @@ type Taskstats struct { Ac_exe_inode uint64 Wpcopy_count uint64 Wpcopy_delay_total uint64 - Wpcopy_delay_max uint64 - Wpcopy_delay_min uint64 Irq_count uint64 Irq_delay_total uint64 + Cpu_delay_max uint64 + Cpu_delay_min uint64 + Blkio_delay_max uint64 + Blkio_delay_min uint64 + Swapin_delay_max uint64 + Swapin_delay_min uint64 + Freepages_delay_max uint64 + Freepages_delay_min uint64 + Thrashing_delay_max uint64 + Thrashing_delay_min uint64 + Compact_delay_max uint64 + Compact_delay_min uint64 + Wpcopy_delay_max uint64 + Wpcopy_delay_min uint64 Irq_delay_max uint64 Irq_delay_min uint64 } diff --git a/vendor/golang.org/x/sys/unix/ztypes_linux_mips64.go b/vendor/golang.org/x/sys/unix/ztypes_linux_mips64.go index ab99a34b9..eaa37eb71 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_linux_mips64.go +++ b/vendor/golang.org/x/sys/unix/ztypes_linux_mips64.go @@ -282,16 +282,10 @@ type Taskstats struct { Ac_nice uint8 Cpu_count uint64 Cpu_delay_total uint64 - Cpu_delay_max uint64 - Cpu_delay_min uint64 Blkio_count uint64 Blkio_delay_total uint64 - Blkio_delay_max uint64 - Blkio_delay_min uint64 Swapin_count uint64 Swapin_delay_total uint64 - Swapin_delay_max uint64 - Swapin_delay_min uint64 Cpu_run_real_total uint64 Cpu_run_virtual_total uint64 Ac_comm [32]int8 @@ -326,27 +320,33 @@ type Taskstats struct { Cpu_scaled_run_real_total uint64 Freepages_count uint64 Freepages_delay_total uint64 - Freepages_delay_max uint64 - Freepages_delay_min uint64 Thrashing_count uint64 Thrashing_delay_total uint64 - Thrashing_delay_max uint64 - Thrashing_delay_min uint64 Ac_btime64 uint64 Compact_count uint64 Compact_delay_total uint64 - Compact_delay_max uint64 - Compact_delay_min uint64 Ac_tgid uint32 Ac_tgetime uint64 Ac_exe_dev uint64 Ac_exe_inode uint64 Wpcopy_count uint64 Wpcopy_delay_total uint64 - Wpcopy_delay_max uint64 - Wpcopy_delay_min uint64 Irq_count uint64 Irq_delay_total uint64 + Cpu_delay_max uint64 + Cpu_delay_min uint64 + Blkio_delay_max uint64 + Blkio_delay_min uint64 + Swapin_delay_max uint64 + Swapin_delay_min uint64 + Freepages_delay_max uint64 + Freepages_delay_min uint64 + Thrashing_delay_max uint64 + Thrashing_delay_min uint64 + Compact_delay_max uint64 + Compact_delay_min uint64 + Wpcopy_delay_max uint64 + Wpcopy_delay_min uint64 Irq_delay_max uint64 Irq_delay_min uint64 } diff --git a/vendor/golang.org/x/sys/unix/ztypes_linux_mips64le.go b/vendor/golang.org/x/sys/unix/ztypes_linux_mips64le.go index 04c9866e3..98ae6a1e4 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_linux_mips64le.go +++ b/vendor/golang.org/x/sys/unix/ztypes_linux_mips64le.go @@ -282,16 +282,10 @@ type Taskstats struct { Ac_nice uint8 Cpu_count uint64 Cpu_delay_total uint64 - Cpu_delay_max uint64 - Cpu_delay_min uint64 Blkio_count uint64 Blkio_delay_total uint64 - Blkio_delay_max uint64 - Blkio_delay_min uint64 Swapin_count uint64 Swapin_delay_total uint64 - Swapin_delay_max uint64 - Swapin_delay_min uint64 Cpu_run_real_total uint64 Cpu_run_virtual_total uint64 Ac_comm [32]int8 @@ -326,27 +320,33 @@ type Taskstats struct { Cpu_scaled_run_real_total uint64 Freepages_count uint64 Freepages_delay_total uint64 - Freepages_delay_max uint64 - Freepages_delay_min uint64 Thrashing_count uint64 Thrashing_delay_total uint64 - Thrashing_delay_max uint64 - Thrashing_delay_min uint64 Ac_btime64 uint64 Compact_count uint64 Compact_delay_total uint64 - Compact_delay_max uint64 - Compact_delay_min uint64 Ac_tgid uint32 Ac_tgetime uint64 Ac_exe_dev uint64 Ac_exe_inode uint64 Wpcopy_count uint64 Wpcopy_delay_total uint64 - Wpcopy_delay_max uint64 - Wpcopy_delay_min uint64 Irq_count uint64 Irq_delay_total uint64 + Cpu_delay_max uint64 + Cpu_delay_min uint64 + Blkio_delay_max uint64 + Blkio_delay_min uint64 + Swapin_delay_max uint64 + Swapin_delay_min uint64 + Freepages_delay_max uint64 + Freepages_delay_min uint64 + Thrashing_delay_max uint64 + Thrashing_delay_min uint64 + Compact_delay_max uint64 + Compact_delay_min uint64 + Wpcopy_delay_max uint64 + Wpcopy_delay_min uint64 Irq_delay_max uint64 Irq_delay_min uint64 } diff --git a/vendor/golang.org/x/sys/unix/ztypes_linux_mipsle.go b/vendor/golang.org/x/sys/unix/ztypes_linux_mipsle.go index 60aa69f61..cae196159 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_linux_mipsle.go +++ b/vendor/golang.org/x/sys/unix/ztypes_linux_mipsle.go @@ -278,19 +278,13 @@ type Taskstats struct { Ac_exitcode uint32 Ac_flag uint8 Ac_nice uint8 - _ [4]byte + _ [6]byte Cpu_count uint64 Cpu_delay_total uint64 - Cpu_delay_max uint64 - Cpu_delay_min uint64 Blkio_count uint64 Blkio_delay_total uint64 - Blkio_delay_max uint64 - Blkio_delay_min uint64 Swapin_count uint64 Swapin_delay_total uint64 - Swapin_delay_max uint64 - Swapin_delay_min uint64 Cpu_run_real_total uint64 Cpu_run_virtual_total uint64 Ac_comm [32]int8 @@ -326,17 +320,11 @@ type Taskstats struct { Cpu_scaled_run_real_total uint64 Freepages_count uint64 Freepages_delay_total uint64 - Freepages_delay_max uint64 - Freepages_delay_min uint64 Thrashing_count uint64 Thrashing_delay_total uint64 - Thrashing_delay_max uint64 - Thrashing_delay_min uint64 Ac_btime64 uint64 Compact_count uint64 Compact_delay_total uint64 - Compact_delay_max uint64 - Compact_delay_min uint64 Ac_tgid uint32 _ [4]byte Ac_tgetime uint64 @@ -344,10 +332,22 @@ type Taskstats struct { Ac_exe_inode uint64 Wpcopy_count uint64 Wpcopy_delay_total uint64 - Wpcopy_delay_max uint64 - Wpcopy_delay_min uint64 Irq_count uint64 Irq_delay_total uint64 + Cpu_delay_max uint64 + Cpu_delay_min uint64 + Blkio_delay_max uint64 + Blkio_delay_min uint64 + Swapin_delay_max uint64 + Swapin_delay_min uint64 + Freepages_delay_max uint64 + Freepages_delay_min uint64 + Thrashing_delay_max uint64 + Thrashing_delay_min uint64 + Compact_delay_max uint64 + Compact_delay_min uint64 + Wpcopy_delay_max uint64 + Wpcopy_delay_min uint64 Irq_delay_max uint64 Irq_delay_min uint64 } diff --git a/vendor/golang.org/x/sys/unix/ztypes_linux_ppc.go b/vendor/golang.org/x/sys/unix/ztypes_linux_ppc.go index cb4fad785..6ce3b4e02 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_linux_ppc.go +++ b/vendor/golang.org/x/sys/unix/ztypes_linux_ppc.go @@ -90,7 +90,7 @@ type Stat_t struct { Gid uint32 Rdev uint64 _ uint16 - _ [4]byte + _ [6]byte Size int64 Blksize int32 _ [4]byte @@ -285,19 +285,13 @@ type Taskstats struct { Ac_exitcode uint32 Ac_flag uint8 Ac_nice uint8 - _ [4]byte + _ [6]byte Cpu_count uint64 Cpu_delay_total uint64 - Cpu_delay_max uint64 - Cpu_delay_min uint64 Blkio_count uint64 Blkio_delay_total uint64 - Blkio_delay_max uint64 - Blkio_delay_min uint64 Swapin_count uint64 Swapin_delay_total uint64 - Swapin_delay_max uint64 - Swapin_delay_min uint64 Cpu_run_real_total uint64 Cpu_run_virtual_total uint64 Ac_comm [32]uint8 @@ -333,17 +327,11 @@ type Taskstats struct { Cpu_scaled_run_real_total uint64 Freepages_count uint64 Freepages_delay_total uint64 - Freepages_delay_max uint64 - Freepages_delay_min uint64 Thrashing_count uint64 Thrashing_delay_total uint64 - Thrashing_delay_max uint64 - Thrashing_delay_min uint64 Ac_btime64 uint64 Compact_count uint64 Compact_delay_total uint64 - Compact_delay_max uint64 - Compact_delay_min uint64 Ac_tgid uint32 _ [4]byte Ac_tgetime uint64 @@ -351,10 +339,22 @@ type Taskstats struct { Ac_exe_inode uint64 Wpcopy_count uint64 Wpcopy_delay_total uint64 - Wpcopy_delay_max uint64 - Wpcopy_delay_min uint64 Irq_count uint64 Irq_delay_total uint64 + Cpu_delay_max uint64 + Cpu_delay_min uint64 + Blkio_delay_max uint64 + Blkio_delay_min uint64 + Swapin_delay_max uint64 + Swapin_delay_min uint64 + Freepages_delay_max uint64 + Freepages_delay_min uint64 + Thrashing_delay_max uint64 + Thrashing_delay_min uint64 + Compact_delay_max uint64 + Compact_delay_min uint64 + Wpcopy_delay_max uint64 + Wpcopy_delay_min uint64 Irq_delay_max uint64 Irq_delay_min uint64 } diff --git a/vendor/golang.org/x/sys/unix/ztypes_linux_ppc64.go b/vendor/golang.org/x/sys/unix/ztypes_linux_ppc64.go index 60272cfce..c7429c6a1 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_linux_ppc64.go +++ b/vendor/golang.org/x/sys/unix/ztypes_linux_ppc64.go @@ -289,16 +289,10 @@ type Taskstats struct { Ac_nice uint8 Cpu_count uint64 Cpu_delay_total uint64 - Cpu_delay_max uint64 - Cpu_delay_min uint64 Blkio_count uint64 Blkio_delay_total uint64 - Blkio_delay_max uint64 - Blkio_delay_min uint64 Swapin_count uint64 Swapin_delay_total uint64 - Swapin_delay_max uint64 - Swapin_delay_min uint64 Cpu_run_real_total uint64 Cpu_run_virtual_total uint64 Ac_comm [32]uint8 @@ -333,27 +327,33 @@ type Taskstats struct { Cpu_scaled_run_real_total uint64 Freepages_count uint64 Freepages_delay_total uint64 - Freepages_delay_max uint64 - Freepages_delay_min uint64 Thrashing_count uint64 Thrashing_delay_total uint64 - Thrashing_delay_max uint64 - Thrashing_delay_min uint64 Ac_btime64 uint64 Compact_count uint64 Compact_delay_total uint64 - Compact_delay_max uint64 - Compact_delay_min uint64 Ac_tgid uint32 Ac_tgetime uint64 Ac_exe_dev uint64 Ac_exe_inode uint64 Wpcopy_count uint64 Wpcopy_delay_total uint64 - Wpcopy_delay_max uint64 - Wpcopy_delay_min uint64 Irq_count uint64 Irq_delay_total uint64 + Cpu_delay_max uint64 + Cpu_delay_min uint64 + Blkio_delay_max uint64 + Blkio_delay_min uint64 + Swapin_delay_max uint64 + Swapin_delay_min uint64 + Freepages_delay_max uint64 + Freepages_delay_min uint64 + Thrashing_delay_max uint64 + Thrashing_delay_min uint64 + Compact_delay_max uint64 + Compact_delay_min uint64 + Wpcopy_delay_max uint64 + Wpcopy_delay_min uint64 Irq_delay_max uint64 Irq_delay_min uint64 } diff --git a/vendor/golang.org/x/sys/unix/ztypes_linux_ppc64le.go b/vendor/golang.org/x/sys/unix/ztypes_linux_ppc64le.go index 3f5b91bc0..4bf4baf4c 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_linux_ppc64le.go +++ b/vendor/golang.org/x/sys/unix/ztypes_linux_ppc64le.go @@ -289,16 +289,10 @@ type Taskstats struct { Ac_nice uint8 Cpu_count uint64 Cpu_delay_total uint64 - Cpu_delay_max uint64 - Cpu_delay_min uint64 Blkio_count uint64 Blkio_delay_total uint64 - Blkio_delay_max uint64 - Blkio_delay_min uint64 Swapin_count uint64 Swapin_delay_total uint64 - Swapin_delay_max uint64 - Swapin_delay_min uint64 Cpu_run_real_total uint64 Cpu_run_virtual_total uint64 Ac_comm [32]uint8 @@ -333,27 +327,33 @@ type Taskstats struct { Cpu_scaled_run_real_total uint64 Freepages_count uint64 Freepages_delay_total uint64 - Freepages_delay_max uint64 - Freepages_delay_min uint64 Thrashing_count uint64 Thrashing_delay_total uint64 - Thrashing_delay_max uint64 - Thrashing_delay_min uint64 Ac_btime64 uint64 Compact_count uint64 Compact_delay_total uint64 - Compact_delay_max uint64 - Compact_delay_min uint64 Ac_tgid uint32 Ac_tgetime uint64 Ac_exe_dev uint64 Ac_exe_inode uint64 Wpcopy_count uint64 Wpcopy_delay_total uint64 - Wpcopy_delay_max uint64 - Wpcopy_delay_min uint64 Irq_count uint64 Irq_delay_total uint64 + Cpu_delay_max uint64 + Cpu_delay_min uint64 + Blkio_delay_max uint64 + Blkio_delay_min uint64 + Swapin_delay_max uint64 + Swapin_delay_min uint64 + Freepages_delay_max uint64 + Freepages_delay_min uint64 + Thrashing_delay_max uint64 + Thrashing_delay_min uint64 + Compact_delay_max uint64 + Compact_delay_min uint64 + Wpcopy_delay_max uint64 + Wpcopy_delay_min uint64 Irq_delay_max uint64 Irq_delay_min uint64 } diff --git a/vendor/golang.org/x/sys/unix/ztypes_linux_riscv64.go b/vendor/golang.org/x/sys/unix/ztypes_linux_riscv64.go index 51550f15a..e9709d70a 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_linux_riscv64.go +++ b/vendor/golang.org/x/sys/unix/ztypes_linux_riscv64.go @@ -307,16 +307,10 @@ type Taskstats struct { Ac_nice uint8 Cpu_count uint64 Cpu_delay_total uint64 - Cpu_delay_max uint64 - Cpu_delay_min uint64 Blkio_count uint64 Blkio_delay_total uint64 - Blkio_delay_max uint64 - Blkio_delay_min uint64 Swapin_count uint64 Swapin_delay_total uint64 - Swapin_delay_max uint64 - Swapin_delay_min uint64 Cpu_run_real_total uint64 Cpu_run_virtual_total uint64 Ac_comm [32]uint8 @@ -351,27 +345,33 @@ type Taskstats struct { Cpu_scaled_run_real_total uint64 Freepages_count uint64 Freepages_delay_total uint64 - Freepages_delay_max uint64 - Freepages_delay_min uint64 Thrashing_count uint64 Thrashing_delay_total uint64 - Thrashing_delay_max uint64 - Thrashing_delay_min uint64 Ac_btime64 uint64 Compact_count uint64 Compact_delay_total uint64 - Compact_delay_max uint64 - Compact_delay_min uint64 Ac_tgid uint32 Ac_tgetime uint64 Ac_exe_dev uint64 Ac_exe_inode uint64 Wpcopy_count uint64 Wpcopy_delay_total uint64 - Wpcopy_delay_max uint64 - Wpcopy_delay_min uint64 Irq_count uint64 Irq_delay_total uint64 + Cpu_delay_max uint64 + Cpu_delay_min uint64 + Blkio_delay_max uint64 + Blkio_delay_min uint64 + Swapin_delay_max uint64 + Swapin_delay_min uint64 + Freepages_delay_max uint64 + Freepages_delay_min uint64 + Thrashing_delay_max uint64 + Thrashing_delay_min uint64 + Compact_delay_max uint64 + Compact_delay_min uint64 + Wpcopy_delay_max uint64 + Wpcopy_delay_min uint64 Irq_delay_max uint64 Irq_delay_min uint64 } diff --git a/vendor/golang.org/x/sys/unix/ztypes_linux_s390x.go b/vendor/golang.org/x/sys/unix/ztypes_linux_s390x.go index 3239e50e0..fb44268ca 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_linux_s390x.go +++ b/vendor/golang.org/x/sys/unix/ztypes_linux_s390x.go @@ -302,16 +302,10 @@ type Taskstats struct { Ac_nice uint8 Cpu_count uint64 Cpu_delay_total uint64 - Cpu_delay_max uint64 - Cpu_delay_min uint64 Blkio_count uint64 Blkio_delay_total uint64 - Blkio_delay_max uint64 - Blkio_delay_min uint64 Swapin_count uint64 Swapin_delay_total uint64 - Swapin_delay_max uint64 - Swapin_delay_min uint64 Cpu_run_real_total uint64 Cpu_run_virtual_total uint64 Ac_comm [32]int8 @@ -346,27 +340,33 @@ type Taskstats struct { Cpu_scaled_run_real_total uint64 Freepages_count uint64 Freepages_delay_total uint64 - Freepages_delay_max uint64 - Freepages_delay_min uint64 Thrashing_count uint64 Thrashing_delay_total uint64 - Thrashing_delay_max uint64 - Thrashing_delay_min uint64 Ac_btime64 uint64 Compact_count uint64 Compact_delay_total uint64 - Compact_delay_max uint64 - Compact_delay_min uint64 Ac_tgid uint32 Ac_tgetime uint64 Ac_exe_dev uint64 Ac_exe_inode uint64 Wpcopy_count uint64 Wpcopy_delay_total uint64 - Wpcopy_delay_max uint64 - Wpcopy_delay_min uint64 Irq_count uint64 Irq_delay_total uint64 + Cpu_delay_max uint64 + Cpu_delay_min uint64 + Blkio_delay_max uint64 + Blkio_delay_min uint64 + Swapin_delay_max uint64 + Swapin_delay_min uint64 + Freepages_delay_max uint64 + Freepages_delay_min uint64 + Thrashing_delay_max uint64 + Thrashing_delay_min uint64 + Compact_delay_max uint64 + Compact_delay_min uint64 + Wpcopy_delay_max uint64 + Wpcopy_delay_min uint64 Irq_delay_max uint64 Irq_delay_min uint64 } diff --git a/vendor/golang.org/x/sys/unix/ztypes_linux_sparc64.go b/vendor/golang.org/x/sys/unix/ztypes_linux_sparc64.go index faf200278..9c38265c7 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_linux_sparc64.go +++ b/vendor/golang.org/x/sys/unix/ztypes_linux_sparc64.go @@ -284,16 +284,10 @@ type Taskstats struct { Ac_nice uint8 Cpu_count uint64 Cpu_delay_total uint64 - Cpu_delay_max uint64 - Cpu_delay_min uint64 Blkio_count uint64 Blkio_delay_total uint64 - Blkio_delay_max uint64 - Blkio_delay_min uint64 Swapin_count uint64 Swapin_delay_total uint64 - Swapin_delay_max uint64 - Swapin_delay_min uint64 Cpu_run_real_total uint64 Cpu_run_virtual_total uint64 Ac_comm [32]int8 @@ -328,27 +322,33 @@ type Taskstats struct { Cpu_scaled_run_real_total uint64 Freepages_count uint64 Freepages_delay_total uint64 - Freepages_delay_max uint64 - Freepages_delay_min uint64 Thrashing_count uint64 Thrashing_delay_total uint64 - Thrashing_delay_max uint64 - Thrashing_delay_min uint64 Ac_btime64 uint64 Compact_count uint64 Compact_delay_total uint64 - Compact_delay_max uint64 - Compact_delay_min uint64 Ac_tgid uint32 Ac_tgetime uint64 Ac_exe_dev uint64 Ac_exe_inode uint64 Wpcopy_count uint64 Wpcopy_delay_total uint64 - Wpcopy_delay_max uint64 - Wpcopy_delay_min uint64 Irq_count uint64 Irq_delay_total uint64 + Cpu_delay_max uint64 + Cpu_delay_min uint64 + Blkio_delay_max uint64 + Blkio_delay_min uint64 + Swapin_delay_max uint64 + Swapin_delay_min uint64 + Freepages_delay_max uint64 + Freepages_delay_min uint64 + Thrashing_delay_max uint64 + Thrashing_delay_min uint64 + Compact_delay_max uint64 + Compact_delay_min uint64 + Wpcopy_delay_max uint64 + Wpcopy_delay_min uint64 Irq_delay_max uint64 Irq_delay_min uint64 } diff --git a/vendor/golang.org/x/term/term_windows.go b/vendor/golang.org/x/term/term_windows.go index df6bf948e..0ddd81c02 100644 --- a/vendor/golang.org/x/term/term_windows.go +++ b/vendor/golang.org/x/term/term_windows.go @@ -20,12 +20,14 @@ func isTerminal(fd int) bool { return err == nil } +// This is intended to be used on a console input handle. +// See https://learn.microsoft.com/en-us/windows/console/setconsolemode func makeRaw(fd int) (*State, error) { var st uint32 if err := windows.GetConsoleMode(windows.Handle(fd), &st); err != nil { return nil, err } - raw := st &^ (windows.ENABLE_ECHO_INPUT | windows.ENABLE_PROCESSED_INPUT | windows.ENABLE_LINE_INPUT | windows.ENABLE_PROCESSED_OUTPUT) + raw := st &^ (windows.ENABLE_ECHO_INPUT | windows.ENABLE_PROCESSED_INPUT | windows.ENABLE_LINE_INPUT) raw |= windows.ENABLE_VIRTUAL_TERMINAL_INPUT if err := windows.SetConsoleMode(windows.Handle(fd), raw); err != nil { return nil, err diff --git a/vendor/golang.org/x/term/terminal.go b/vendor/golang.org/x/term/terminal.go index 13e9a64ad..bddb2e2ae 100644 --- a/vendor/golang.org/x/term/terminal.go +++ b/vendor/golang.org/x/term/terminal.go @@ -146,6 +146,7 @@ const ( keyCtrlD = 4 keyCtrlU = 21 keyEnter = '\r' + keyLF = '\n' keyEscape = 27 keyBackspace = 127 keyUnknown = 0xd800 /* UTF-16 surrogate area */ + iota @@ -497,7 +498,7 @@ func (t *Terminal) historyAdd(entry string) { // handleKey processes the given key and, optionally, returns a line of text // that the user has entered. func (t *Terminal) handleKey(key rune) (line string, ok bool) { - if t.pasteActive && key != keyEnter { + if t.pasteActive && key != keyEnter && key != keyLF { t.addKeyToLine(key) return } @@ -567,7 +568,7 @@ func (t *Terminal) handleKey(key rune) (line string, ok bool) { t.setLine(runes, len(runes)) } } - case keyEnter: + case keyEnter, keyLF: t.moveCursorToPos(len(t.line)) t.queue([]rune("\r\n")) line = string(t.line) @@ -812,6 +813,10 @@ func (t *Terminal) readLine() (line string, err error) { if !t.pasteActive { lineIsPasted = false } + // If we have CR, consume LF if present (CRLF sequence) to avoid returning an extra empty line. + if key == keyEnter && len(rest) > 0 && rest[0] == keyLF { + rest = rest[1:] + } line, lineOk = t.handleKey(key) } if len(rest) > 0 { diff --git a/vendor/golang.org/x/tools/go/ast/inspector/typeof.go b/vendor/golang.org/x/tools/go/ast/inspector/typeof.go index e936c67c9..be0f990a2 100644 --- a/vendor/golang.org/x/tools/go/ast/inspector/typeof.go +++ b/vendor/golang.org/x/tools/go/ast/inspector/typeof.go @@ -217,7 +217,6 @@ func typeOf(n ast.Node) uint64 { return 0 } -//go:linkname maskOf golang.org/x/tools/go/ast/inspector.maskOf func maskOf(nodes []ast.Node) uint64 { if len(nodes) == 0 { return math.MaxUint64 // match all node types diff --git a/vendor/modules.txt b/vendor/modules.txt index 9a4084a40..082ee98c2 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -386,7 +386,7 @@ go.yaml.in/yaml/v2 # go4.org v0.0.0-20201209231011-d4a079459e60 ## explicit; go 1.13 go4.org/bytereplacer -# golang.org/x/crypto v0.40.0 +# golang.org/x/crypto v0.41.0 ## explicit; go 1.23.0 golang.org/x/crypto/chacha20 golang.org/x/crypto/chacha20poly1305 @@ -395,7 +395,7 @@ golang.org/x/crypto/cryptobyte/asn1 golang.org/x/crypto/hkdf golang.org/x/crypto/internal/alias golang.org/x/crypto/internal/poly1305 -# golang.org/x/net v0.41.0 +# golang.org/x/net v0.42.0 ## explicit; go 1.23.0 golang.org/x/net/html golang.org/x/net/html/atom @@ -422,17 +422,17 @@ golang.org/x/oauth2/jwt # golang.org/x/sync v0.16.0 ## explicit; go 1.23.0 golang.org/x/sync/semaphore -# golang.org/x/sys v0.34.0 +# golang.org/x/sys v0.35.0 ## explicit; go 1.23.0 golang.org/x/sys/cpu golang.org/x/sys/plan9 golang.org/x/sys/unix golang.org/x/sys/windows golang.org/x/sys/windows/registry -# golang.org/x/term v0.33.0 +# golang.org/x/term v0.34.0 ## explicit; go 1.23.0 golang.org/x/term -# golang.org/x/text v0.27.0 +# golang.org/x/text v0.28.0 ## explicit; go 1.23.0 golang.org/x/text/encoding golang.org/x/text/encoding/charmap @@ -457,7 +457,7 @@ golang.org/x/text/unicode/norm # golang.org/x/time v0.12.0 ## explicit; go 1.23.0 golang.org/x/time/rate -# golang.org/x/tools v0.34.0 +# golang.org/x/tools v0.35.0 ## explicit; go 1.23.0 golang.org/x/tools/cover golang.org/x/tools/go/ast/edge From 26c608fd031b78ca802bb87b6dfa593b7880130f Mon Sep 17 00:00:00 2001 From: Engin Akdemir Date: Tue, 23 Sep 2025 17:32:44 +0000 Subject: [PATCH 19/51] Fix partial cache tail latency by correcting the cache chunk size calculation Undo temporary chunk size changes Fix temporary variable name change --- pkg/gce-pd-csi-driver/cache.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/pkg/gce-pd-csi-driver/cache.go b/pkg/gce-pd-csi-driver/cache.go index b2ccd5e70..229845dc2 100644 --- a/pkg/gce-pd-csi-driver/cache.go +++ b/pkg/gce-pd-csi-driver/cache.go @@ -576,6 +576,7 @@ func isCachingSetup(mainLvName string) (error, bool) { func fetchChunkSizeKiB(cacheSize string) (string, error) { var chunkSize float64 + cacheSize = strings.TrimSuffix(cacheSize, "GiB") cacheSizeInt, err := strconv.ParseInt(cacheSize, 10, 64) if err != nil { return "0", err @@ -691,10 +692,8 @@ func addRaidedLSSDToVg(vgName, lssdPath string) error { func fetchPvSizeGiB() (string, error) { args := []string{ - "--select", - "-o", + "-o", "pv_name,pv_size", "--noheadings", - "pv_size", "--units=b", } // RAIDed device is always registered with its /dev/md127 equivalent in VG so cannot check it directly based on the RAIDed LSSD path which could be /dev/md/csi-driver-data-cache From b585ad7b656f4c0b702c41fbba81ffa8157f35a8 Mon Sep 17 00:00:00 2001 From: Engin Akdemir Date: Tue, 23 Sep 2025 18:15:13 +0000 Subject: [PATCH 20/51] Add unit test to fetchChucnkSizeKiB Update existing unit test to have suffix GiB Add comment to clarify cache size is always in GiB --- pkg/gce-pd-csi-driver/cache.go | 1 + pkg/gce-pd-csi-driver/cache_test.go | 13 +++++++++---- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/pkg/gce-pd-csi-driver/cache.go b/pkg/gce-pd-csi-driver/cache.go index 229845dc2..d5d0ea498 100644 --- a/pkg/gce-pd-csi-driver/cache.go +++ b/pkg/gce-pd-csi-driver/cache.go @@ -573,6 +573,7 @@ func isCachingSetup(mainLvName string) (error, bool) { return nil, false } +// cacheSize is always in GiB func fetchChunkSizeKiB(cacheSize string) (string, error) { var chunkSize float64 diff --git a/pkg/gce-pd-csi-driver/cache_test.go b/pkg/gce-pd-csi-driver/cache_test.go index 340c924a1..1b219f20e 100644 --- a/pkg/gce-pd-csi-driver/cache_test.go +++ b/pkg/gce-pd-csi-driver/cache_test.go @@ -13,24 +13,29 @@ func TestFetchChunkSizeKiB(t *testing.T) { }{ { name: "chunk size is in the allowed range", - cacheSize: "500", + cacheSize: "500GiB", expChunkSize: "512KiB", //range defined in fetchChunkSizeKiB }, { name: "chunk size is set to the range ceil", - cacheSize: "30000000", + cacheSize: "30000000GiB", expChunkSize: "1048576KiB", //range defined in fetchChunkSizeKiB - max 1GiB }, { name: "chunk size is set to the allowed range floor", - cacheSize: "100", + cacheSize: "100GiB", expChunkSize: "160KiB", //range defined in fetchChunkSizeKiB - min 160 KiB }, { name: "cacheSize set to KiB also sets the chunk size to range floor", - cacheSize: "1", + cacheSize: "1GiB", expChunkSize: "160KiB", //range defined in fetchChunkSizeKiB - min 160 KiB }, + { + name: "chunk size with GiB string parses correctly", + cacheSize: "375GiB", + expChunkSize: "384KiB", + }, { name: "invalid cacheSize", cacheSize: "fdfsdKi", From 571542b6ec0cf09d17ee0b6fc9adeced5b6c067a Mon Sep 17 00:00:00 2001 From: Jordan Pittier Date: Thu, 26 Jun 2025 10:15:19 +0200 Subject: [PATCH 21/51] pkg/common/utils.go: update regionalLocationFmt for Europe with 10+ regions GCP now offers more than 10 regions in Europe. Update the regex accordingly. --- pkg/common/utils.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/common/utils.go b/pkg/common/utils.go index 57323dcc3..4417e680f 100644 --- a/pkg/common/utils.go +++ b/pkg/common/utils.go @@ -71,7 +71,7 @@ const ( // Example: us multiRegionalLocationFmt = "^[a-z]+$" // Example: us-east1 - regionalLocationFmt = "^[a-z]+-[a-z]+[0-9]$" + regionalLocationFmt = "^[a-z]+-[a-z]+[0-9]+$" // Full or partial URL of the machine type resource, in the format: // zones/zone/machineTypes/machine-type From 23c22b00a0ad9a97673bf0cf872ea86fc2d9ed76 Mon Sep 17 00:00:00 2001 From: Jordan Pittier Date: Thu, 26 Jun 2025 16:48:00 +0200 Subject: [PATCH 22/51] Add unit test --- pkg/common/utils.go | 2 +- pkg/common/utils_test.go | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/pkg/common/utils.go b/pkg/common/utils.go index 4417e680f..81e9f9993 100644 --- a/pkg/common/utils.go +++ b/pkg/common/utils.go @@ -71,7 +71,7 @@ const ( // Example: us multiRegionalLocationFmt = "^[a-z]+$" // Example: us-east1 - regionalLocationFmt = "^[a-z]+-[a-z]+[0-9]+$" + regionalLocationFmt = "^[a-z]+-[a-z]+[0-9]{1,2}$" // Full or partial URL of the machine type resource, in the format: // zones/zone/machineTypes/machine-type diff --git a/pkg/common/utils_test.go b/pkg/common/utils_test.go index 1d4cef0e3..84fb46370 100644 --- a/pkg/common/utils_test.go +++ b/pkg/common/utils_test.go @@ -804,10 +804,16 @@ func TestSnapshotStorageLocations(t *testing.T) { []string{"us-east1"}, false, }, + { + "valid region in large continent", + "europe-west12", + []string{"europe-west12"}, + false, + }, { // Zones are not valid bucket/snapshot locations. "single zone", - "us-east1a", + "us-east1-a", []string{}, true, }, From e8d43fb5dc4e5472d504b24dea746aff6b22adbf Mon Sep 17 00:00:00 2001 From: chrisThePattyEater Date: Fri, 27 Jun 2025 02:31:09 +0000 Subject: [PATCH 23/51] Added filtering for incorrect slo boosting logs --- pkg/gce-cloud-provider/compute/gce.go | 16 +++++++ pkg/gce-cloud-provider/compute/gce_test.go | 54 ++++++++++++++++++++++ pkg/gce-pd-csi-driver/controller.go | 10 ++++ 3 files changed, 80 insertions(+) diff --git a/pkg/gce-cloud-provider/compute/gce.go b/pkg/gce-cloud-provider/compute/gce.go index bde9b64f0..fae0c1bdc 100644 --- a/pkg/gce-cloud-provider/compute/gce.go +++ b/pkg/gce-cloud-provider/compute/gce.go @@ -21,6 +21,7 @@ import ( "net/http" "net/url" "os" + "regexp" "runtime" "sync" "time" @@ -77,6 +78,11 @@ const ( gcpTagsRequestTokenBucketSize = 8 ) +var ( + ssAlreadyExistsRegex = regexp.MustCompile("The resource [^']+ already exists") + gcpViolationRegex = regexp.MustCompile("violates constraint constraints/gcp.") +) + // ResourceType indicates the type of a compute resource. type ResourceType string @@ -441,3 +447,13 @@ func IsGCENotFoundError(err error) bool { func IsGCEInvalidError(err error) bool { return IsGCEError(err, "invalid") } + +// IsSnapshotAlreadyExistsError checks if the error is a snapshot already exists error. +func IsSnapshotAlreadyExistsError(err error) bool { + return ssAlreadyExistsRegex.MatchString(err.Error()) +} + +// IsGCPOrgViolationError checks if the error is a GCP organization policy violation error. +func IsGCPOrgViolationError(err error) bool { + return gcpViolationRegex.MatchString(err.Error()) +} diff --git a/pkg/gce-cloud-provider/compute/gce_test.go b/pkg/gce-cloud-provider/compute/gce_test.go index 94bb4fd9f..f7f2e0e6e 100644 --- a/pkg/gce-cloud-provider/compute/gce_test.go +++ b/pkg/gce-cloud-provider/compute/gce_test.go @@ -101,6 +101,60 @@ func TestIsGCEError(t *testing.T) { } } +func TestErrorIsGCPViolationRegex(t *testing.T) { + testCases := []struct { + name string + inputErr error + expectedResult bool + }{ + { + name: "is gcp org violation error", + inputErr: errors.New("Your api request violates constraint constraints/gcp.resourceLocations"), + expectedResult: true, + }, + { + name: "is not gcp org violation error", + inputErr: errors.New("Some incorrect error message"), + expectedResult: false, + }, + } + + for _, tc := range testCases { + t.Logf("Running test: %v", tc.name) + result := IsGCPOrgViolationError(tc.inputErr) + if tc.expectedResult != result { + t.Fatalf("Got '%t', expected '%t'", result, tc.expectedResult) + } + } +} + +func TestErrorIsSnapshotExistsError(t *testing.T) { + testCases := []struct { + name string + inputErr error + expectedResult bool + }{ + { + name: "is ss error", + inputErr: errors.New("The resource projects/dcme-pre-opt-mdp-rmp-00/global/snapshots/snapshot-3c208602-d815-40ae-a61e-3259e3bd29ca already exists, alreadyExists"), + expectedResult: true, + }, + { + name: "is not ss already exists error", + inputErr: errors.New("Some incorrect error message"), + expectedResult: false, + }, + } + + for _, tc := range testCases { + t.Logf("Running test: %v", tc.name) + result := IsSnapshotAlreadyExistsError(tc.inputErr) + if tc.expectedResult != result { + t.Fatalf("Got '%t', expected '%t'", result, tc.expectedResult) + } + } +} + func TestGetComputeVersion(t *testing.T) { testCases := []struct { name string diff --git a/pkg/gce-pd-csi-driver/controller.go b/pkg/gce-pd-csi-driver/controller.go index f0523d435..f77d0982b 100644 --- a/pkg/gce-pd-csi-driver/controller.go +++ b/pkg/gce-pd-csi-driver/controller.go @@ -1668,6 +1668,16 @@ func (gceCS *GCEControllerServer) createPDSnapshot(ctx context.Context, project if gce.IsGCEError(err, "notFound") { return nil, status.Errorf(codes.NotFound, "Could not find volume with ID %v: %v", volKey.String(), err.Error()) } + + // Identified as incorrect error handling + if gce.IsSnapshotAlreadyExistsError(err) { + return nil, status.Errorf(codes.AlreadyExists, "Snapshot already exists: %v", err.Error()) + } + + // Identified as incorrect error handling + if gce.IsGCPOrgViolationError(err) { + return nil, status.Errorf(codes.FailedPrecondition, "Violates GCP org policy: %v", err.Error()) + } return nil, common.LoggedError("Failed to create snapshot: ", err) } } From 7ed2e9e9ddc2e00ad2c3ae3ebaac4000d6f129b0 Mon Sep 17 00:00:00 2001 From: dannawang Date: Tue, 15 Jul 2025 22:24:39 +0000 Subject: [PATCH 24/51] Update org policy violation check --- pkg/gce-cloud-provider/compute/gce.go | 15 ++++++++++++--- pkg/gce-cloud-provider/compute/gce_test.go | 20 +++++++++++++++----- 2 files changed, 27 insertions(+), 8 deletions(-) diff --git a/pkg/gce-cloud-provider/compute/gce.go b/pkg/gce-cloud-provider/compute/gce.go index fae0c1bdc..e9c4d0920 100644 --- a/pkg/gce-cloud-provider/compute/gce.go +++ b/pkg/gce-cloud-provider/compute/gce.go @@ -79,8 +79,9 @@ const ( ) var ( - ssAlreadyExistsRegex = regexp.MustCompile("The resource [^']+ already exists") - gcpViolationRegex = regexp.MustCompile("violates constraint constraints/gcp.") + ssAlreadyExistsRegex = regexp.MustCompile("The resource [^']+ already exists") + gcpErrorCodeRegex = regexp.MustCompile(`Error (\d+)`) + orgPolicyConstraintErrorCodes = []string{"400", "412"} ) // ResourceType indicates the type of a compute resource. @@ -455,5 +456,13 @@ func IsSnapshotAlreadyExistsError(err error) bool { // IsGCPOrgViolationError checks if the error is a GCP organization policy violation error. func IsGCPOrgViolationError(err error) bool { - return gcpViolationRegex.MatchString(err.Error()) + matches := gcpErrorCodeRegex.FindStringSubmatch(err.Error()) + if len(matches) > 1 { + errorCode := matches[1] + if slices.Contains(orgPolicyConstraintErrorCodes, errorCode) { + return true + } + } + + return false } diff --git a/pkg/gce-cloud-provider/compute/gce_test.go b/pkg/gce-cloud-provider/compute/gce_test.go index f7f2e0e6e..3cd25addb 100644 --- a/pkg/gce-cloud-provider/compute/gce_test.go +++ b/pkg/gce-cloud-provider/compute/gce_test.go @@ -108,10 +108,20 @@ func TestErrorIsGCPViolationRegex(t *testing.T) { expectedResult bool }{ { - name: "is gcp org violation error", - inputErr: errors.New("Your api request violates constraint constraints/gcp.resourceLocations"), + name: "is gcp org violation error, error code 400", + inputErr: errors.New("Failed to scale up: googleapi: Error 400: 'us-central1' violates constraint '`constraints/gcp.resourceLocations`' on the resource 'projects/test-project/locations/us-central1/clusters/test-cluster/nodePools/test-node-pool'"), expectedResult: true, }, + { + name: "is gcp org violation error, error code 412", + inputErr: errors.New("createSnapshot for content [snapcontent-xyz]: error occurred in createSnapshotWrapper: failed to take snapshot of the volume projects/test-project/regions/europe-west3/disks/pvc-test: \"rpc error: code = Internal desc = Failed to create snapshot: googleapi: Error 412: Location EU violates constraint constraints/gcp.resourceLocations on the resource projects/test-project/global/snapshots/snapshot-xyz., conditionNotMet\""), + expectedResult: true, + }, + { + name: "is not gcp org violation, error doesn't match", + inputErr: errors.New("createSnapshot for content [snapcontent-xyz]: error occurred in createSnapshotWrapper: failed to take snapshot of the volume projects/test-project/regions/europe-west3/disks/pvc-test: \"rpc error: code = Internal desc = Failed to create snapshot: googleapi: Error 500: Location EU violates constraint constraints/gcp.resourceLocations on the resource projects/test-project/global/snapshots/snapshot-xyz., conditionNotMet\""), + expectedResult: false, + }, { name: "is not gcp org violation error", inputErr: errors.New("Some incorrect error message"), @@ -135,12 +145,12 @@ func TestErrorIsSnapshotExistsError(t *testing.T) { expectedResult bool }{ { - name: "is ss error", - inputErr: errors.New("The resource projects/dcme-pre-opt-mdp-rmp-00/global/snapshots/snapshot-3c208602-d815-40ae-a61e-3259e3bd29ca already exists, alreadyExists"), + name: "is snapshot already exists error", + inputErr: errors.New("The resource projects/test-project/global/snapshots/snapshot-xyz already exists, alreadyExists"), expectedResult: true, }, { - name: "is not ss already exists error", + name: "is not snapshot already exists error", inputErr: errors.New("Some incorrect error message"), expectedResult: false, }, From 701707d1749d5eef4dd29e6be57bdbd9b257dea1 Mon Sep 17 00:00:00 2001 From: juliankatz Date: Tue, 20 May 2025 17:28:24 -0700 Subject: [PATCH 25/51] Cache devices and their symlinks in node driver, periodically noting changes and printing the full list. example: periodic symlink cache read: /dev/disk/by-id/google-persistent-disk-0 -> /dev/sda; /dev/disk/by-id/google-pvc-f5418f78-dc07-4d69-9487-6c4a7232dd67 -> /dev/sdb; /dev/disk/by-id/scsi-0Google_PersistentDisk_persistent-disk-0 -> /dev/sda; /dev/disk/by-id/scsi-0Google_PersistentDisk_pvc-f5418f78-dc07-4d69-9487-6c4a7232dd67 -> /dev/sdb --- cmd/gce-pd-csi-driver/main.go | 5 +- pkg/gce-pd-csi-driver/cache.go | 9 +- pkg/linkcache/cache.go | 173 +++++++++++++++++++++++++++++++++ 3 files changed, 183 insertions(+), 4 deletions(-) create mode 100644 pkg/linkcache/cache.go diff --git a/cmd/gce-pd-csi-driver/main.go b/cmd/gce-pd-csi-driver/main.go index ff4ab9522..c4f1be981 100644 --- a/cmd/gce-pd-csi-driver/main.go +++ b/cmd/gce-pd-csi-driver/main.go @@ -34,6 +34,7 @@ import ( gce "sigs.k8s.io/gcp-compute-persistent-disk-csi-driver/pkg/gce-cloud-provider/compute" metadataservice "sigs.k8s.io/gcp-compute-persistent-disk-csi-driver/pkg/gce-cloud-provider/metadata" driver "sigs.k8s.io/gcp-compute-persistent-disk-csi-driver/pkg/gce-pd-csi-driver" + "sigs.k8s.io/gcp-compute-persistent-disk-csi-driver/pkg/linkcache" "sigs.k8s.io/gcp-compute-persistent-disk-csi-driver/pkg/metrics" mountmanager "sigs.k8s.io/gcp-compute-persistent-disk-csi-driver/pkg/mount-manager" ) @@ -297,9 +298,11 @@ func handle() { if err := setupDataCache(ctx, *nodeName, nodeServer.MetadataService.GetName()); err != nil { klog.Errorf("Data Cache setup failed: %v", err) } - go driver.StartWatcher(*nodeName) + go driver.StartWatcher(ctx, *nodeName) } } + + go linkcache.NewListingCache(1*time.Minute, "/dev/disk/by-id/").Run(ctx) } err = gceDriver.SetupGCEDriver(driverName, version, extraVolumeLabels, extraTags, identityServer, controllerServer, nodeServer) diff --git a/pkg/gce-pd-csi-driver/cache.go b/pkg/gce-pd-csi-driver/cache.go index d5d0ea498..971ca8f1d 100644 --- a/pkg/gce-pd-csi-driver/cache.go +++ b/pkg/gce-pd-csi-driver/cache.go @@ -617,7 +617,7 @@ func InitializeDataCacheNode(nodeId string) error { return nil } -func StartWatcher(nodeName string) { +func StartWatcher(ctx context.Context, nodeName string) { dirToWatch := "/dev/" watcher, err := fsnotify.NewWatcher() if err != nil { @@ -632,7 +632,7 @@ func StartWatcher(nodeName string) { } errorCh := make(chan error, 1) // Handle the error received from the watcher goroutine - go watchDiskDetaches(watcher, nodeName, errorCh) + go watchDiskDetaches(ctx, watcher, nodeName, errorCh) select { case err := <-errorCh: @@ -640,9 +640,12 @@ func StartWatcher(nodeName string) { } } -func watchDiskDetaches(watcher *fsnotify.Watcher, nodeName string, errorCh chan error) error { +func watchDiskDetaches(ctx context.Context, watcher *fsnotify.Watcher, nodeName string, errorCh chan error) error { for { select { + case <-ctx.Done(): + klog.Infof("Context done, stopping watcher") + return nil // watch for errors case err := <-watcher.Errors: errorCh <- fmt.Errorf("disk update event errored: %v", err) diff --git a/pkg/linkcache/cache.go b/pkg/linkcache/cache.go new file mode 100644 index 000000000..ee8e70b73 --- /dev/null +++ b/pkg/linkcache/cache.go @@ -0,0 +1,173 @@ +package linkcache + +import ( + "context" + "fmt" + "os" + "path/filepath" + "regexp" + "strings" + "time" + + "k8s.io/klog/v2" +) + +var partitionNameRegex = regexp.MustCompile(`-part[0-9]+$`) + +// ListingCache polls the filesystem at the specified directory once per +// periodand checks each non-directory entry for a symlink. The results are +// cached. Changes to the cache are logged, as well as the full contents of the +// cache. The cache's Run() method is expected to be called in a goroutine. +// Its cancellation is controlled via the context argument. +type ListingCache struct { + period time.Duration + dir string + links *linkCache +} + +func NewListingCache(period time.Duration, dir string) *ListingCache { + return &ListingCache{ + period: period, + dir: dir, + links: newLinkCache(), + } +} + +// Run starts the cache's background loop. The filesystem is listed and the +// cache updated according to the frequency specified by the period. It will run +// until the context is cancelled. +func (l *ListingCache) Run(ctx context.Context) { + // Start the loop that runs every minute + ticker := time.NewTicker(l.period) + defer ticker.Stop() + + // Initial list and update so we don't wait for the first tick. + err := l.listAndUpdate() + if err != nil { + klog.Warningf("Error listing and updating symlinks: %v", err) + } + + for { + select { + case <-ctx.Done(): + klog.Infof("Context done, stopping watcher") + return + case <-ticker.C: + err := l.listAndUpdate() + if err != nil { + klog.Warningf("Error listing and updating symlinks: %v", err) + continue + } + + klog.Infof("periodic symlink cache read: %s", l.links.String()) + } + } +} + +func (l *ListingCache) listAndUpdate() error { + visited := make(map[string]struct{}) + + entries, err := os.ReadDir(l.dir) + if err != nil { + return fmt.Errorf("failed to read directory %s: %w", l.dir, err) + } + + var errs []error + for _, entry := range entries { + if entry.IsDir() { + continue + } + + // TODO(juliankatz): To have certainty this works for all edge cases, we + // need to test this with a manually partitioned disk. + if partitionNameRegex.MatchString(entry.Name()) { + continue + } + + diskByIdPath := filepath.Join(l.dir, entry.Name()) + + // Add the device to the map regardless of successful symlink eval. + // Otherwise, a broken symlink will lead us to remove it from the cache. + visited[diskByIdPath] = struct{}{} + + realFSPath, err := filepath.EvalSymlinks(diskByIdPath) + if err != nil { + errs = append(errs, fmt.Errorf("failed to evaluate symlink for %s: %w", diskByIdPath, err)) + l.links.BrokenSymlink(diskByIdPath) + continue + } + + l.links.AddOrUpdateDevice(diskByIdPath, realFSPath) + } + + for _, id := range l.links.DeviceIDs() { + if _, found := visited[id]; !found { + l.links.RemoveDevice(id) + } + } + + if len(errs) > 0 { + return fmt.Errorf("failed to evaluate symlinks for %d devices: %v", len(errs), errs) + } + return nil +} + +// linkCache is a structure that maintains a cache of symlinks between +// /dev/disk/by-id and /dev/sd* paths. It provides methods to add/update, +// retrieve, and remove device symlinks from the cache. +type linkCache struct { + devices map[string]linkCacheEntry +} + +type linkCacheEntry struct { + path string + // If true, the symlink is known to be broken. + brokenSymlink bool +} + +func newLinkCache() *linkCache { + return &linkCache{ + devices: make(map[string]linkCacheEntry), + } +} + +func (d *linkCache) AddOrUpdateDevice(symlink, realPath string) { + prevEntry, exists := d.devices[symlink] + if !exists || prevEntry.path != realPath { + klog.Infof("Symlink updated for link %s, previous value: %s, new value: %s", symlink, prevEntry.path, realPath) + } + d.devices[symlink] = linkCacheEntry{path: realPath, brokenSymlink: false} +} + +// BrokenSymlink marks a symlink as broken. If the symlink is not in the cache, +// it is ignored. +func (d *linkCache) BrokenSymlink(symlink string) { + if entry, ok := d.devices[symlink]; ok { + entry.brokenSymlink = true + d.devices[symlink] = entry + } +} + +func (d *linkCache) RemoveDevice(symlink string) { + delete(d.devices, symlink) +} + +func (d *linkCache) DeviceIDs() []string { + ids := make([]string, 0, len(d.devices)) + for id := range d.devices { + ids = append(ids, id) + } + return ids +} + +func (d *linkCache) String() string { + var sb strings.Builder + for symlink, entry := range d.devices { + if entry.brokenSymlink { + sb.WriteString(fmt.Sprintf("%s -> broken symlink... last known value: %s; ", symlink, entry.path)) + } else { + sb.WriteString(fmt.Sprintf("%s -> %s; ", symlink, entry.path)) + } + } + return strings.TrimSuffix(sb.String(), "; ") +} From e3a190b3741785d8b0a476591effdbda343ae749 Mon Sep 17 00:00:00 2001 From: juliankatz Date: Wed, 21 May 2025 11:02:59 -0700 Subject: [PATCH 26/51] Some doc comment updates --- pkg/linkcache/cache.go | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/pkg/linkcache/cache.go b/pkg/linkcache/cache.go index ee8e70b73..f62d7eb40 100644 --- a/pkg/linkcache/cache.go +++ b/pkg/linkcache/cache.go @@ -15,10 +15,10 @@ import ( var partitionNameRegex = regexp.MustCompile(`-part[0-9]+$`) // ListingCache polls the filesystem at the specified directory once per -// periodand checks each non-directory entry for a symlink. The results are -// cached. Changes to the cache are logged, as well as the full contents of the -// cache. The cache's Run() method is expected to be called in a goroutine. -// Its cancellation is controlled via the context argument. +// period and checks each non-directory entry for a symlink. The results are +// cached. Changes to the cache are logged, as well as the full contents of the +// cache. The cache's Run() method is expected to be called in a goroutine. Its +// cancellation is controlled via the context argument. type ListingCache struct { period time.Duration dir string @@ -33,9 +33,9 @@ func NewListingCache(period time.Duration, dir string) *ListingCache { } } -// Run starts the cache's background loop. The filesystem is listed and the -// cache updated according to the frequency specified by the period. It will run -// until the context is cancelled. +// Run starts the cache's background loop. The filesystem is listed and the cache +// updated according to the frequency specified by the period. It will run until +// the context is cancelled. func (l *ListingCache) Run(ctx context.Context) { // Start the loop that runs every minute ticker := time.NewTicker(l.period) From 7d2a6790c3822a7922782af7698e31749963afd0 Mon Sep 17 00:00:00 2001 From: juliankatz Date: Wed, 21 May 2025 15:33:41 -0700 Subject: [PATCH 27/51] Add unit tests --- pkg/linkcache/cache.go | 31 +++-- pkg/linkcache/cache_test.go | 238 ++++++++++++++++++++++++++++++++++++ 2 files changed, 262 insertions(+), 7 deletions(-) create mode 100644 pkg/linkcache/cache_test.go diff --git a/pkg/linkcache/cache.go b/pkg/linkcache/cache.go index f62d7eb40..7f3040725 100644 --- a/pkg/linkcache/cache.go +++ b/pkg/linkcache/cache.go @@ -3,9 +3,11 @@ package linkcache import ( "context" "fmt" + "maps" "os" "path/filepath" "regexp" + "slices" "strings" "time" @@ -14,6 +16,23 @@ import ( var partitionNameRegex = regexp.MustCompile(`-part[0-9]+$`) +// fsInterface defines the filesystem operations needed by ListingCache +type fsInterface interface { + ReadDir(name string) ([]os.DirEntry, error) + EvalSymlinks(path string) (string, error) +} + +// realFS implements fsInterface using the real filesystem +type realFS struct{} + +func (f *realFS) ReadDir(name string) ([]os.DirEntry, error) { + return os.ReadDir(name) +} + +func (f *realFS) EvalSymlinks(path string) (string, error) { + return filepath.EvalSymlinks(path) +} + // ListingCache polls the filesystem at the specified directory once per // period and checks each non-directory entry for a symlink. The results are // cached. Changes to the cache are logged, as well as the full contents of the @@ -23,6 +42,7 @@ type ListingCache struct { period time.Duration dir string links *linkCache + fs fsInterface } func NewListingCache(period time.Duration, dir string) *ListingCache { @@ -30,6 +50,7 @@ func NewListingCache(period time.Duration, dir string) *ListingCache { period: period, dir: dir, links: newLinkCache(), + fs: &realFS{}, } } @@ -67,7 +88,7 @@ func (l *ListingCache) Run(ctx context.Context) { func (l *ListingCache) listAndUpdate() error { visited := make(map[string]struct{}) - entries, err := os.ReadDir(l.dir) + entries, err := l.fs.ReadDir(l.dir) if err != nil { return fmt.Errorf("failed to read directory %s: %w", l.dir, err) } @@ -90,7 +111,7 @@ func (l *ListingCache) listAndUpdate() error { // Otherwise, a broken symlink will lead us to remove it from the cache. visited[diskByIdPath] = struct{}{} - realFSPath, err := filepath.EvalSymlinks(diskByIdPath) + realFSPath, err := l.fs.EvalSymlinks(diskByIdPath) if err != nil { errs = append(errs, fmt.Errorf("failed to evaluate symlink for %s: %w", diskByIdPath, err)) l.links.BrokenSymlink(diskByIdPath) @@ -153,11 +174,7 @@ func (d *linkCache) RemoveDevice(symlink string) { } func (d *linkCache) DeviceIDs() []string { - ids := make([]string, 0, len(d.devices)) - for id := range d.devices { - ids = append(ids, id) - } - return ids + return slices.Collect(maps.Keys(d.devices)) } func (d *linkCache) String() string { diff --git a/pkg/linkcache/cache_test.go b/pkg/linkcache/cache_test.go new file mode 100644 index 000000000..65c86fcbd --- /dev/null +++ b/pkg/linkcache/cache_test.go @@ -0,0 +1,238 @@ +package linkcache + +import ( + "os" + "testing" + "testing/fstest" +) + +const ( + // Test disk names in /dev/disk/by-id format + gcpPersistentDiskID = "google-persistent-disk-0" + gcpPVCID = "google-pvc-f5418f78-dc07-4d69-9487-6c4a7232dd67" + gcpPersistentDiskPartitionID = "google-persistent-disk-0-part1" + + // Test device paths in /dev format + devicePathSDA = "/dev/sda" + devicePathSDB = "/dev/sdb" +) + +// mockFS implements fsInterface for testing +type mockFS struct { + fstest.MapFS + symlinks map[string]string +} + +func newMockFS() *mockFS { + return &mockFS{ + MapFS: make(fstest.MapFS), + symlinks: make(map[string]string), + } +} + +func (m *mockFS) ReadDir(name string) ([]os.DirEntry, error) { + entries, err := m.MapFS.ReadDir(name) + if err != nil { + return nil, err + } + return entries, nil +} + +func (m *mockFS) EvalSymlinks(path string) (string, error) { + if target, ok := m.symlinks[path]; ok { + return target, nil + } + return "", os.ErrNotExist +} + +func TestListAndUpdate(t *testing.T) { + tests := []struct { + name string + setupFS func(*mockFS) + expectedLinks map[string]string + expectError bool + }{ + { + name: "valid symlinks", + setupFS: func(m *mockFS) { + // Create some device files + m.MapFS[gcpPersistentDiskID] = &fstest.MapFile{} + m.MapFS[gcpPVCID] = &fstest.MapFile{} + // Create symlinks + m.symlinks[gcpPersistentDiskID] = devicePathSDA + m.symlinks[gcpPVCID] = devicePathSDB + }, + expectedLinks: map[string]string{ + gcpPersistentDiskID: devicePathSDA, + gcpPVCID: devicePathSDB, + }, + expectError: false, + }, + { + name: "broken symlink not added to cache", + setupFS: func(m *mockFS) { + m.MapFS[gcpPersistentDiskID] = &fstest.MapFile{} + // No symlink target for gcpPersistentDiskID + }, + expectedLinks: map[string]string{}, + expectError: true, + }, + { + name: "partition files ignored", + setupFS: func(m *mockFS) { + m.MapFS[gcpPersistentDiskPartitionID] = &fstest.MapFile{} + m.MapFS[gcpPersistentDiskID] = &fstest.MapFile{} + m.symlinks[gcpPersistentDiskID] = devicePathSDA + }, + expectedLinks: map[string]string{ + gcpPersistentDiskID: devicePathSDA, + }, + expectError: false, + }, + } + + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + mock := newMockFS() + tt.setupFS(mock) + + cache := NewListingCache(0, ".") + cache.fs = mock // Inject our mock filesystem + err := cache.listAndUpdate() + + if tt.expectError { + if err == nil { + t.Error("expected error but got none") + } + } else { + if err != nil { + t.Errorf("unexpected error: %v", err) + } + } + + // Verify the cache contents + for symlink, expectedTarget := range tt.expectedLinks { + entry, exists := cache.links.devices[symlink] + if !exists { + t.Errorf("symlink %s should exist in cache", symlink) + continue + } + if entry.path != expectedTarget { + t.Errorf("symlink %s should point to %s, got %s", symlink, expectedTarget, entry.path) + } + if entry.brokenSymlink { + t.Errorf("symlink %s should not be marked as broken", symlink) + } + } + }) + } +} + +func TestListAndUpdateWithChanges(t *testing.T) { + mock := newMockFS() + cache := NewListingCache(0, ".") + cache.fs = mock + + // Initial state: one disk with a valid symlink + mock.MapFS[gcpPersistentDiskID] = &fstest.MapFile{} + mock.symlinks[gcpPersistentDiskID] = devicePathSDA + + // First listAndUpdate should add the disk to cache + err := cache.listAndUpdate() + if err != nil { + t.Fatalf("unexpected error in first listAndUpdate: %v", err) + } + + // Verify initial state + entry, exists := cache.links.devices[gcpPersistentDiskID] + if !exists { + t.Fatal("gcpPersistentDiskID should exist in cache after first listAndUpdate") + } + if entry.path != devicePathSDA { + t.Errorf("gcpPersistentDiskID should point to %s, got %s", devicePathSDA, entry.path) + } + + // Add a new disk and update the symlink target + mock.MapFS[gcpPVCID] = &fstest.MapFile{} + mock.symlinks[gcpPVCID] = devicePathSDB + mock.symlinks[gcpPersistentDiskID] = devicePathSDB // Update existing disk's target + + // Second listAndUpdate should update the cache + err = cache.listAndUpdate() + if err != nil { + t.Fatalf("unexpected error in second listAndUpdate: %v", err) + } + + // Verify both disks are in cache with correct paths + entry, exists = cache.links.devices[gcpPersistentDiskID] + if !exists { + t.Fatal("gcpPersistentDiskID should still exist in cache") + } + if entry.path != devicePathSDB { + t.Errorf("gcpPersistentDiskID should now point to %s, got %s", devicePathSDB, entry.path) + } + + entry, exists = cache.links.devices[gcpPVCID] + if !exists { + t.Fatal("gcpPVCID should exist in cache after second listAndUpdate") + } + if entry.path != devicePathSDB { + t.Errorf("gcpPVCID should point to %s, got %s", devicePathSDB, entry.path) + } + + // Break the symlink for gcpPersistentDiskID but keep the file + delete(mock.symlinks, gcpPersistentDiskID) + + // Third listAndUpdate should mark the disk as broken but keep its last known value + err = cache.listAndUpdate() + if err == nil { + t.Error("expected error for broken symlink") + } + + // Verify gcpPersistentDiskID is marked as broken but maintains its last known value + entry, exists = cache.links.devices[gcpPersistentDiskID] + if !exists { + t.Fatal("gcpPersistentDiskID should still exist in cache") + } + if entry.path != devicePathSDB { + t.Errorf("gcpPersistentDiskID should maintain its last known value %s, got %s", devicePathSDB, entry.path) + } + if !entry.brokenSymlink { + t.Error("gcpPersistentDiskID should be marked as broken") + } + + // Verify gcpPVCID is still valid + entry, exists = cache.links.devices[gcpPVCID] + if !exists { + t.Fatal("gcpPVCID should still exist in cache") + } + if entry.path != devicePathSDB { + t.Errorf("gcpPVCID should still point to %s, got %s", devicePathSDB, entry.path) + } + if entry.brokenSymlink { + t.Error("gcpPVCID should not be marked as broken") + } + + // Remove one disk + delete(mock.MapFS, gcpPersistentDiskID) + delete(mock.symlinks, gcpPersistentDiskID) + + // Fourth listAndUpdate should remove the deleted disk + err = cache.listAndUpdate() + if err != nil { + t.Fatalf("unexpected error in fourth listAndUpdate: %v", err) + } + + // Verify only gcpPVCID remains + if _, exists := cache.links.devices[gcpPersistentDiskID]; exists { + t.Error("gcpPersistentDiskID should be removed from cache") + } + + entry, exists = cache.links.devices[gcpPVCID] + if !exists { + t.Fatal("gcpPVCID should still exist in cache") + } + if entry.path != devicePathSDB { + t.Errorf("gcpPVCID should still point to %s, got %s", devicePathSDB, entry.path) + } +} From 15361099fc72a4e9d6571271f886ccba961e3bc4 Mon Sep 17 00:00:00 2001 From: juliankatz Date: Wed, 21 May 2025 15:35:20 -0700 Subject: [PATCH 28/51] improve partition unit test --- pkg/linkcache/cache_test.go | 1 + 1 file changed, 1 insertion(+) diff --git a/pkg/linkcache/cache_test.go b/pkg/linkcache/cache_test.go index 65c86fcbd..e43799bc7 100644 --- a/pkg/linkcache/cache_test.go +++ b/pkg/linkcache/cache_test.go @@ -83,6 +83,7 @@ func TestListAndUpdate(t *testing.T) { m.MapFS[gcpPersistentDiskPartitionID] = &fstest.MapFile{} m.MapFS[gcpPersistentDiskID] = &fstest.MapFile{} m.symlinks[gcpPersistentDiskID] = devicePathSDA + m.symlinks[gcpPersistentDiskPartitionID] = devicePathSDA + "1" }, expectedLinks: map[string]string{ gcpPersistentDiskID: devicePathSDA, From 31cf7874f9ee21a94c4795d34c4764a0f8a8b4cc Mon Sep 17 00:00:00 2001 From: juliankatz Date: Wed, 21 May 2025 15:37:48 -0700 Subject: [PATCH 29/51] Log on removal as well --- pkg/linkcache/cache.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pkg/linkcache/cache.go b/pkg/linkcache/cache.go index 7f3040725..c2ceb4ab1 100644 --- a/pkg/linkcache/cache.go +++ b/pkg/linkcache/cache.go @@ -170,7 +170,10 @@ func (d *linkCache) BrokenSymlink(symlink string) { } func (d *linkCache) RemoveDevice(symlink string) { - delete(d.devices, symlink) + if entry, ok := d.devices[symlink]; ok { + klog.Infof("Removing device %s with path %s from cache, brokenSymlink: %t", symlink, entry.path, entry.brokenSymlink) + delete(d.devices, symlink) + } } func (d *linkCache) DeviceIDs() []string { From 081f515eac474fb6fff33fe0550c05a596184aba Mon Sep 17 00:00:00 2001 From: juliankatz Date: Wed, 21 May 2025 16:03:48 -0700 Subject: [PATCH 30/51] Updated unit tests to be clearer, relying on asserting linkCache --- pkg/linkcache/cache.go | 9 ++ pkg/linkcache/cache_test.go | 194 +++++++++++++----------------------- 2 files changed, 79 insertions(+), 124 deletions(-) diff --git a/pkg/linkcache/cache.go b/pkg/linkcache/cache.go index c2ceb4ab1..006eed27d 100644 --- a/pkg/linkcache/cache.go +++ b/pkg/linkcache/cache.go @@ -54,6 +54,15 @@ func NewListingCache(period time.Duration, dir string) *ListingCache { } } +func NewMockListingCache(period time.Duration, dir string) *ListingCache { + return &ListingCache{ + period: period, + dir: dir, + links: newLinkCache(), + fs: &mockFS{}, + } +} + // Run starts the cache's background loop. The filesystem is listed and the cache // updated according to the frequency specified by the period. It will run until // the context is cancelled. diff --git a/pkg/linkcache/cache_test.go b/pkg/linkcache/cache_test.go index e43799bc7..7683ed258 100644 --- a/pkg/linkcache/cache_test.go +++ b/pkg/linkcache/cache_test.go @@ -4,8 +4,12 @@ import ( "os" "testing" "testing/fstest" + + "github.com/google/go-cmp/cmp" ) +var allowUnexportedLinkCache = cmp.AllowUnexported(linkCache{}, linkCacheEntry{}) + const ( // Test disk names in /dev/disk/by-id format gcpPersistentDiskID = "google-persistent-disk-0" @@ -49,7 +53,7 @@ func TestListAndUpdate(t *testing.T) { tests := []struct { name string setupFS func(*mockFS) - expectedLinks map[string]string + expectedCache *linkCache expectError bool }{ { @@ -62,9 +66,11 @@ func TestListAndUpdate(t *testing.T) { m.symlinks[gcpPersistentDiskID] = devicePathSDA m.symlinks[gcpPVCID] = devicePathSDB }, - expectedLinks: map[string]string{ - gcpPersistentDiskID: devicePathSDA, - gcpPVCID: devicePathSDB, + expectedCache: &linkCache{ + devices: map[string]linkCacheEntry{ + gcpPersistentDiskID: {path: devicePathSDA, brokenSymlink: false}, + gcpPVCID: {path: devicePathSDB, brokenSymlink: false}, + }, }, expectError: false, }, @@ -74,8 +80,10 @@ func TestListAndUpdate(t *testing.T) { m.MapFS[gcpPersistentDiskID] = &fstest.MapFile{} // No symlink target for gcpPersistentDiskID }, - expectedLinks: map[string]string{}, - expectError: true, + expectedCache: &linkCache{ + devices: map[string]linkCacheEntry{}, + }, + expectError: true, }, { name: "partition files ignored", @@ -85,8 +93,10 @@ func TestListAndUpdate(t *testing.T) { m.symlinks[gcpPersistentDiskID] = devicePathSDA m.symlinks[gcpPersistentDiskPartitionID] = devicePathSDA + "1" }, - expectedLinks: map[string]string{ - gcpPersistentDiskID: devicePathSDA, + expectedCache: &linkCache{ + devices: map[string]linkCacheEntry{ + gcpPersistentDiskID: {path: devicePathSDA, brokenSymlink: false}, + }, }, expectError: false, }, @@ -111,129 +121,65 @@ func TestListAndUpdate(t *testing.T) { } } - // Verify the cache contents - for symlink, expectedTarget := range tt.expectedLinks { - entry, exists := cache.links.devices[symlink] - if !exists { - t.Errorf("symlink %s should exist in cache", symlink) - continue - } - if entry.path != expectedTarget { - t.Errorf("symlink %s should point to %s, got %s", symlink, expectedTarget, entry.path) - } - if entry.brokenSymlink { - t.Errorf("symlink %s should not be marked as broken", symlink) - } + // Compare the entire cache state + if diff := cmp.Diff(tt.expectedCache, cache.links, allowUnexportedLinkCache); diff != "" { + t.Errorf("linkCache mismatch (-expected +got):\n%s", diff) } }) } } -func TestListAndUpdateWithChanges(t *testing.T) { - mock := newMockFS() - cache := NewListingCache(0, ".") - cache.fs = mock - - // Initial state: one disk with a valid symlink - mock.MapFS[gcpPersistentDiskID] = &fstest.MapFile{} - mock.symlinks[gcpPersistentDiskID] = devicePathSDA - - // First listAndUpdate should add the disk to cache - err := cache.listAndUpdate() - if err != nil { - t.Fatalf("unexpected error in first listAndUpdate: %v", err) - } - - // Verify initial state - entry, exists := cache.links.devices[gcpPersistentDiskID] - if !exists { - t.Fatal("gcpPersistentDiskID should exist in cache after first listAndUpdate") - } - if entry.path != devicePathSDA { - t.Errorf("gcpPersistentDiskID should point to %s, got %s", devicePathSDA, entry.path) - } - - // Add a new disk and update the symlink target - mock.MapFS[gcpPVCID] = &fstest.MapFile{} - mock.symlinks[gcpPVCID] = devicePathSDB - mock.symlinks[gcpPersistentDiskID] = devicePathSDB // Update existing disk's target - - // Second listAndUpdate should update the cache - err = cache.listAndUpdate() - if err != nil { - t.Fatalf("unexpected error in second listAndUpdate: %v", err) - } - - // Verify both disks are in cache with correct paths - entry, exists = cache.links.devices[gcpPersistentDiskID] - if !exists { - t.Fatal("gcpPersistentDiskID should still exist in cache") - } - if entry.path != devicePathSDB { - t.Errorf("gcpPersistentDiskID should now point to %s, got %s", devicePathSDB, entry.path) - } - - entry, exists = cache.links.devices[gcpPVCID] - if !exists { - t.Fatal("gcpPVCID should exist in cache after second listAndUpdate") - } - if entry.path != devicePathSDB { - t.Errorf("gcpPVCID should point to %s, got %s", devicePathSDB, entry.path) - } - - // Break the symlink for gcpPersistentDiskID but keep the file - delete(mock.symlinks, gcpPersistentDiskID) - - // Third listAndUpdate should mark the disk as broken but keep its last known value - err = cache.listAndUpdate() - if err == nil { - t.Error("expected error for broken symlink") - } - - // Verify gcpPersistentDiskID is marked as broken but maintains its last known value - entry, exists = cache.links.devices[gcpPersistentDiskID] - if !exists { - t.Fatal("gcpPersistentDiskID should still exist in cache") - } - if entry.path != devicePathSDB { - t.Errorf("gcpPersistentDiskID should maintain its last known value %s, got %s", devicePathSDB, entry.path) - } - if !entry.brokenSymlink { - t.Error("gcpPersistentDiskID should be marked as broken") - } - - // Verify gcpPVCID is still valid - entry, exists = cache.links.devices[gcpPVCID] - if !exists { - t.Fatal("gcpPVCID should still exist in cache") - } - if entry.path != devicePathSDB { - t.Errorf("gcpPVCID should still point to %s, got %s", devicePathSDB, entry.path) - } - if entry.brokenSymlink { - t.Error("gcpPVCID should not be marked as broken") - } - - // Remove one disk - delete(mock.MapFS, gcpPersistentDiskID) - delete(mock.symlinks, gcpPersistentDiskID) - - // Fourth listAndUpdate should remove the deleted disk - err = cache.listAndUpdate() - if err != nil { - t.Fatalf("unexpected error in fourth listAndUpdate: %v", err) +func TestLinkCache(t *testing.T) { + tests := []struct { + name string + setupCache func(*linkCache) + expected *linkCache + }{ + { + name: "AddOrUpdateDevice", + setupCache: func(lc *linkCache) { + lc.AddOrUpdateDevice("symlink1", "/dev/sda") + lc.AddOrUpdateDevice("symlink2", "/dev/sdb") + }, + expected: &linkCache{ + devices: map[string]linkCacheEntry{ + "symlink1": {path: "/dev/sda", brokenSymlink: false}, + "symlink2": {path: "/dev/sdb", brokenSymlink: false}, + }, + }, + }, + { + name: "BrokenSymlink", + setupCache: func(lc *linkCache) { + lc.AddOrUpdateDevice("symlink1", "/dev/sda") + lc.BrokenSymlink("symlink1") + }, + expected: &linkCache{ + devices: map[string]linkCacheEntry{ + "symlink1": {path: "/dev/sda", brokenSymlink: true}, + }, + }, + }, + { + name: "RemoveDevice", + setupCache: func(lc *linkCache) { + lc.AddOrUpdateDevice("symlink1", "/dev/sda") + lc.RemoveDevice("symlink1") + }, + expected: &linkCache{ + devices: map[string]linkCacheEntry{}, + }, + }, } - // Verify only gcpPVCID remains - if _, exists := cache.links.devices[gcpPersistentDiskID]; exists { - t.Error("gcpPersistentDiskID should be removed from cache") - } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + cache := newLinkCache() + tt.setupCache(cache) - entry, exists = cache.links.devices[gcpPVCID] - if !exists { - t.Fatal("gcpPVCID should still exist in cache") - } - if entry.path != devicePathSDB { - t.Errorf("gcpPVCID should still point to %s, got %s", devicePathSDB, entry.path) + if diff := cmp.Diff(tt.expected, cache, allowUnexportedLinkCache); diff != "" { + t.Errorf("linkCache mismatch (-expected +got):\n%s", diff) + } + }) } } From e55114a621ef9d389bc3e38001036b1e4295bb15 Mon Sep 17 00:00:00 2001 From: juliankatz Date: Wed, 21 May 2025 16:30:07 -0700 Subject: [PATCH 31/51] Remove unused broken function --- pkg/linkcache/cache.go | 9 --------- 1 file changed, 9 deletions(-) diff --git a/pkg/linkcache/cache.go b/pkg/linkcache/cache.go index 006eed27d..c2ceb4ab1 100644 --- a/pkg/linkcache/cache.go +++ b/pkg/linkcache/cache.go @@ -54,15 +54,6 @@ func NewListingCache(period time.Duration, dir string) *ListingCache { } } -func NewMockListingCache(period time.Duration, dir string) *ListingCache { - return &ListingCache{ - period: period, - dir: dir, - links: newLinkCache(), - fs: &mockFS{}, - } -} - // Run starts the cache's background loop. The filesystem is listed and the cache // updated according to the frequency specified by the period. It will run until // the context is cancelled. From 9b5c15d0762a75b3f9aa6a39ed473a9da4ee3968 Mon Sep 17 00:00:00 2001 From: juliankatz Date: Fri, 23 May 2025 14:04:02 -0700 Subject: [PATCH 32/51] Move partition checking into the inner linkcache type. This makes it easier to unit test. --- pkg/linkcache/cache.go | 14 ++++++++++---- pkg/linkcache/cache_test.go | 14 ++++++++++++++ 2 files changed, 24 insertions(+), 4 deletions(-) diff --git a/pkg/linkcache/cache.go b/pkg/linkcache/cache.go index c2ceb4ab1..034cba99d 100644 --- a/pkg/linkcache/cache.go +++ b/pkg/linkcache/cache.go @@ -99,14 +99,12 @@ func (l *ListingCache) listAndUpdate() error { continue } - // TODO(juliankatz): To have certainty this works for all edge cases, we - // need to test this with a manually partitioned disk. + diskByIdPath := filepath.Join(l.dir, entry.Name()) + if partitionNameRegex.MatchString(entry.Name()) { continue } - diskByIdPath := filepath.Join(l.dir, entry.Name()) - // Add the device to the map regardless of successful symlink eval. // Otherwise, a broken symlink will lead us to remove it from the cache. visited[diskByIdPath] = struct{}{} @@ -153,6 +151,14 @@ func newLinkCache() *linkCache { } func (d *linkCache) AddOrUpdateDevice(symlink, realPath string) { + // Ignore partitions, which are noise as far as our logging is concerned. + // Expression: -part[0-9]+$ + if partitionNameRegex.MatchString(symlink) { + // TODO(juliankatz): To have certainty this works for all edge cases, we + // need to test this with a manually partitioned disk. + return + } + prevEntry, exists := d.devices[symlink] if !exists || prevEntry.path != realPath { klog.Infof("Symlink updated for link %s, previous value: %s, new value: %s", symlink, prevEntry.path, realPath) diff --git a/pkg/linkcache/cache_test.go b/pkg/linkcache/cache_test.go index 7683ed258..0b811e833 100644 --- a/pkg/linkcache/cache_test.go +++ b/pkg/linkcache/cache_test.go @@ -170,6 +170,20 @@ func TestLinkCache(t *testing.T) { devices: map[string]linkCacheEntry{}, }, }, + { + name: "PartitionIgnored", + setupCache: func(lc *linkCache) { + lc.AddOrUpdateDevice(gcpPersistentDiskPartitionID, devicePathSDA+"1") + lc.AddOrUpdateDevice(gcpPersistentDiskID, devicePathSDA) + lc.AddOrUpdateDevice(gcpPVCID, devicePathSDB) + }, + expected: &linkCache{ + devices: map[string]linkCacheEntry{ + gcpPersistentDiskID: {path: devicePathSDA, brokenSymlink: false}, + gcpPVCID: {path: devicePathSDB, brokenSymlink: false}, + }, + }, + }, } for _, tt := range tests { From e5ec0ce2d8bb0f5d063628c4875c5377be17cd0a Mon Sep 17 00:00:00 2001 From: juliankatz Date: Fri, 23 May 2025 14:14:36 -0700 Subject: [PATCH 33/51] Log when linkcache Run is triggered --- pkg/linkcache/cache.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pkg/linkcache/cache.go b/pkg/linkcache/cache.go index 034cba99d..d4ec426ba 100644 --- a/pkg/linkcache/cache.go +++ b/pkg/linkcache/cache.go @@ -58,6 +58,8 @@ func NewListingCache(period time.Duration, dir string) *ListingCache { // updated according to the frequency specified by the period. It will run until // the context is cancelled. func (l *ListingCache) Run(ctx context.Context) { + klog.Infof("Starting symlink cache watcher for directory %s with period %s", l.dir, l.period) + // Start the loop that runs every minute ticker := time.NewTicker(l.period) defer ticker.Stop() @@ -150,6 +152,9 @@ func newLinkCache() *linkCache { } } +// AddOrUpdateDevice adds a new device or updates an existing device in the cache. +// It ignores partition symlinks as they are considered noise for logging purposes. +// If the symlink already exists and the real path has changed, it logs the update. func (d *linkCache) AddOrUpdateDevice(symlink, realPath string) { // Ignore partitions, which are noise as far as our logging is concerned. // Expression: -part[0-9]+$ From 1183e64fe24218f07779420e62001ecd4eecb420 Mon Sep 17 00:00:00 2001 From: juliankatz Date: Fri, 6 Jun 2025 14:38:56 -0700 Subject: [PATCH 34/51] New implementation that is hooked into nodestage/unstage. Just linux right now. --- cmd/gce-pd-csi-driver/main.go | 10 +- .../base/controller/controller.yaml | 1 + .../images/stable-master/image.yaml | 2 +- pkg/gce-pd-csi-driver/cache.go | 42 +--- pkg/gce-pd-csi-driver/gce-pd-driver.go | 3 +- pkg/gce-pd-csi-driver/node.go | 25 ++- pkg/k8sclient/node.go | 49 +++++ pkg/linkcache/cache.go | 204 ------------------ pkg/linkcache/cache_test.go | 198 ----------------- pkg/linkcache/devices.go | 136 ++++++++++++ 10 files changed, 215 insertions(+), 455 deletions(-) create mode 100644 pkg/k8sclient/node.go delete mode 100644 pkg/linkcache/cache.go create mode 100644 pkg/linkcache/devices.go diff --git a/cmd/gce-pd-csi-driver/main.go b/cmd/gce-pd-csi-driver/main.go index c4f1be981..e1e024410 100644 --- a/cmd/gce-pd-csi-driver/main.go +++ b/cmd/gce-pd-csi-driver/main.go @@ -276,6 +276,12 @@ func handle() { klog.Fatalf("Failed to get node info from API server: %v", err.Error()) } + deviceCache, err := linkcache.NewDeviceCacheForNode(ctx, 1*time.Minute, *nodeName) + if err != nil { + klog.Fatalf("Failed to create device cache: %v", err.Error()) + } + go deviceCache.Run(ctx) + // TODO(2042): Move more of the constructor args into this struct nsArgs := &driver.NodeServerArgs{ EnableDeviceInUseCheck: *enableDeviceInUseCheck, @@ -284,6 +290,7 @@ func handle() { DataCacheEnabledNodePool: isDataCacheEnabledNodePool, SysfsPath: "/sys", MetricsManager: metricsManager, + DeviceCache: deviceCache, } nodeServer = driver.NewNodeServer(gceDriver, mounter, deviceUtils, meta, statter, nsArgs) @@ -302,9 +309,10 @@ func handle() { } } - go linkcache.NewListingCache(1*time.Minute, "/dev/disk/by-id/").Run(ctx) } + klog.Infof("NOT BLOCKED") + err = gceDriver.SetupGCEDriver(driverName, version, extraVolumeLabels, extraTags, identityServer, controllerServer, nodeServer) if err != nil { klog.Fatalf("Failed to initialize GCE CSI Driver: %v", err.Error()) diff --git a/deploy/kubernetes/base/controller/controller.yaml b/deploy/kubernetes/base/controller/controller.yaml index e15b8593a..302874f82 100644 --- a/deploy/kubernetes/base/controller/controller.yaml +++ b/deploy/kubernetes/base/controller/controller.yaml @@ -145,6 +145,7 @@ spec: - "--supports-dynamic-iops-provisioning=hyperdisk-balanced,hyperdisk-extreme" - "--supports-dynamic-throughput-provisioning=hyperdisk-balanced,hyperdisk-throughput,hyperdisk-ml" - --enable-data-cache + - --run-node-service=false - --enable-multitenancy command: - /gce-pd-csi-driver diff --git a/deploy/kubernetes/images/stable-master/image.yaml b/deploy/kubernetes/images/stable-master/image.yaml index 0663677c3..b0da81d85 100644 --- a/deploy/kubernetes/images/stable-master/image.yaml +++ b/deploy/kubernetes/images/stable-master/image.yaml @@ -46,6 +46,6 @@ imageTag: name: gke.gcr.io/gcp-compute-persistent-disk-csi-driver # pdImagePlaceholder in test/k8s-integration/main.go is updated automatically with the newTag newName: registry.k8s.io/cloud-provider-gcp/gcp-compute-persistent-disk-csi-driver - newTag: "v1.17.3" + newTag: "v1.17.4" --- diff --git a/pkg/gce-pd-csi-driver/cache.go b/pkg/gce-pd-csi-driver/cache.go index 971ca8f1d..66bf25f53 100644 --- a/pkg/gce-pd-csi-driver/cache.go +++ b/pkg/gce-pd-csi-driver/cache.go @@ -7,19 +7,14 @@ import ( "regexp" "strconv" "strings" - "time" csi "github.com/container-storage-interface/spec/lib/go/csi" fsnotify "github.com/fsnotify/fsnotify" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" - v1 "k8s.io/api/core/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/util/wait" - "k8s.io/client-go/kubernetes" - "k8s.io/client-go/rest" "k8s.io/klog/v2" "sigs.k8s.io/gcp-compute-persistent-disk-csi-driver/pkg/common" + "sigs.k8s.io/gcp-compute-persistent-disk-csi-driver/pkg/k8sclient" ) const ( @@ -257,18 +252,11 @@ func ValidateDataCacheConfig(dataCacheMode string, dataCacheSize string, ctx con } func GetDataCacheCountFromNodeLabel(ctx context.Context, nodeName string) (int, error) { - cfg, err := rest.InClusterConfig() - if err != nil { - return 0, err - } - kubeClient, err := kubernetes.NewForConfig(cfg) - if err != nil { - return 0, err - } - node, err := getNodeWithRetry(ctx, kubeClient, nodeName) + node, err := k8sclient.GetNodeWithRetry(ctx, nodeName) if err != nil { return 0, err } + if val, found := node.GetLabels()[fmt.Sprintf(common.NodeLabelPrefix, common.DataCacheLssdCountLabel)]; found { dataCacheCount, err := strconv.Atoi(val) if err != nil { @@ -280,30 +268,6 @@ func GetDataCacheCountFromNodeLabel(ctx context.Context, nodeName string) (int, return 0, nil } -func getNodeWithRetry(ctx context.Context, kubeClient *kubernetes.Clientset, nodeName string) (*v1.Node, error) { - var nodeObj *v1.Node - backoff := wait.Backoff{ - Duration: 1 * time.Second, - Factor: 2.0, - Steps: 5, - } - err := wait.ExponentialBackoffWithContext(ctx, backoff, func(_ context.Context) (bool, error) { - node, err := kubeClient.CoreV1().Nodes().Get(ctx, nodeName, metav1.GetOptions{}) - if err != nil { - klog.Warningf("Error getting node %s: %v, retrying...\n", nodeName, err) - return false, nil - } - nodeObj = node - klog.V(4).Infof("Successfully retrieved node info %s\n", nodeName) - return true, nil - }) - - if err != nil { - klog.Errorf("Failed to get node %s after retries: %v\n", nodeName, err) - } - return nodeObj, err -} - func FetchRaidedLssdCountForDatacache() (int, error) { raidedPath, err := fetchRAIDedLocalSsdPath() if err != nil { diff --git a/pkg/gce-pd-csi-driver/gce-pd-driver.go b/pkg/gce-pd-csi-driver/gce-pd-driver.go index 76aa38381..83ff9767a 100644 --- a/pkg/gce-pd-csi-driver/gce-pd-driver.go +++ b/pkg/gce-pd-csi-driver/gce-pd-driver.go @@ -159,6 +159,7 @@ func NewNodeServer(gceDriver *GCEDriver, mounter *mount.SafeFormatAndMount, devi DataCacheEnabledNodePool: args.DataCacheEnabledNodePool, SysfsPath: args.SysfsPath, metricsManager: args.MetricsManager, + DeviceCache: args.DeviceCache, } } @@ -184,7 +185,7 @@ func (gceDriver *GCEDriver) Run(endpoint string, grpcLogCharCap int, enableOtelT maxLogChar = grpcLogCharCap klog.V(4).Infof("Driver: %v", gceDriver.name) - //Start the nonblocking GRPC + // Start the nonblocking GRPC s := NewNonBlockingGRPCServer(enableOtelTracing, metricsManager) // TODO(#34): Only start specific servers based on a flag. // In the future have this only run specific combinations of servers depending on which version this is. diff --git a/pkg/gce-pd-csi-driver/node.go b/pkg/gce-pd-csi-driver/node.go index 00f0b0859..9c1960cc4 100644 --- a/pkg/gce-pd-csi-driver/node.go +++ b/pkg/gce-pd-csi-driver/node.go @@ -32,14 +32,14 @@ import ( csi "github.com/container-storage-interface/spec/lib/go/csi" - "k8s.io/client-go/kubernetes" - "k8s.io/client-go/rest" "k8s.io/klog/v2" "k8s.io/mount-utils" "sigs.k8s.io/gcp-compute-persistent-disk-csi-driver/pkg/common" "sigs.k8s.io/gcp-compute-persistent-disk-csi-driver/pkg/deviceutils" metadataservice "sigs.k8s.io/gcp-compute-persistent-disk-csi-driver/pkg/gce-cloud-provider/metadata" + "sigs.k8s.io/gcp-compute-persistent-disk-csi-driver/pkg/k8sclient" + "sigs.k8s.io/gcp-compute-persistent-disk-csi-driver/pkg/linkcache" "sigs.k8s.io/gcp-compute-persistent-disk-csi-driver/pkg/metrics" mountmanager "sigs.k8s.io/gcp-compute-persistent-disk-csi-driver/pkg/mount-manager" "sigs.k8s.io/gcp-compute-persistent-disk-csi-driver/pkg/resizefs" @@ -80,6 +80,8 @@ type GCENodeServer struct { csi.UnimplementedNodeServer metricsManager *metrics.MetricsManager + // A cache of the device paths for the volumes that are attached to the node. + DeviceCache *linkcache.DeviceCache } type NodeServerArgs struct { @@ -97,6 +99,7 @@ type NodeServerArgs struct { SysfsPath string MetricsManager *metrics.MetricsManager + DeviceCache *linkcache.DeviceCache } var _ csi.NodeServer = &GCENodeServer{} @@ -509,6 +512,11 @@ func (ns *GCENodeServer) NodeStageVolume(ctx context.Context, req *csi.NodeStage } } + err = ns.DeviceCache.AddVolume(volumeID) + if err != nil { + klog.Warningf("Error adding volume %s to cache: %v", volumeID, err) + } + klog.V(4).Infof("NodeStageVolume succeeded on %v to %s", volumeID, stagingTargetPath) return &csi.NodeStageVolumeResponse{}, nil } @@ -622,6 +630,9 @@ func (ns *GCENodeServer) NodeUnstageVolume(ctx context.Context, req *csi.NodeUns return nil, status.Errorf(codes.DataLoss, "Failed to cleanup cache for volume %s: %v", volumeID, err) } } + + ns.DeviceCache.RemoveVolume(volumeID) + klog.V(4).Infof("NodeUnstageVolume succeeded on %v from %s", volumeID, stagingTargetPath) return &csi.NodeUnstageVolumeResponse{}, nil } @@ -899,15 +910,7 @@ func (ns *GCENodeServer) GetVolumeLimits(ctx context.Context) (int64, error) { } func GetAttachLimitsOverrideFromNodeLabel(ctx context.Context, nodeName string) (int64, error) { - cfg, err := rest.InClusterConfig() - if err != nil { - return 0, err - } - kubeClient, err := kubernetes.NewForConfig(cfg) - if err != nil { - return 0, err - } - node, err := getNodeWithRetry(ctx, kubeClient, nodeName) + node, err := k8sclient.GetNodeWithRetry(ctx, nodeName) if err != nil { return 0, err } diff --git a/pkg/k8sclient/node.go b/pkg/k8sclient/node.go new file mode 100644 index 000000000..1c4fa9b8b --- /dev/null +++ b/pkg/k8sclient/node.go @@ -0,0 +1,49 @@ +package k8sclient + +import ( + "context" + "time" + + v1 "k8s.io/api/core/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/util/wait" + "k8s.io/client-go/kubernetes" + "k8s.io/client-go/rest" + "k8s.io/klog/v2" +) + +func GetNodeWithRetry(ctx context.Context, nodeName string) (*v1.Node, error) { + cfg, err := rest.InClusterConfig() + if err != nil { + return nil, err + } + kubeClient, err := kubernetes.NewForConfig(cfg) + if err != nil { + return nil, err + } + return getNodeWithRetry(ctx, kubeClient, nodeName) +} + +func getNodeWithRetry(ctx context.Context, kubeClient *kubernetes.Clientset, nodeName string) (*v1.Node, error) { + var nodeObj *v1.Node + backoff := wait.Backoff{ + Duration: 1 * time.Second, + Factor: 2.0, + Steps: 5, + } + err := wait.ExponentialBackoffWithContext(ctx, backoff, func(_ context.Context) (bool, error) { + node, err := kubeClient.CoreV1().Nodes().Get(ctx, nodeName, metav1.GetOptions{}) + if err != nil { + klog.Warningf("Error getting node %s: %v, retrying...\n", nodeName, err) + return false, nil + } + nodeObj = node + klog.V(4).Infof("Successfully retrieved node info %s\n", nodeName) + return true, nil + }) + + if err != nil { + klog.Errorf("Failed to get node %s after retries: %v\n", nodeName, err) + } + return nodeObj, err +} diff --git a/pkg/linkcache/cache.go b/pkg/linkcache/cache.go deleted file mode 100644 index d4ec426ba..000000000 --- a/pkg/linkcache/cache.go +++ /dev/null @@ -1,204 +0,0 @@ -package linkcache - -import ( - "context" - "fmt" - "maps" - "os" - "path/filepath" - "regexp" - "slices" - "strings" - "time" - - "k8s.io/klog/v2" -) - -var partitionNameRegex = regexp.MustCompile(`-part[0-9]+$`) - -// fsInterface defines the filesystem operations needed by ListingCache -type fsInterface interface { - ReadDir(name string) ([]os.DirEntry, error) - EvalSymlinks(path string) (string, error) -} - -// realFS implements fsInterface using the real filesystem -type realFS struct{} - -func (f *realFS) ReadDir(name string) ([]os.DirEntry, error) { - return os.ReadDir(name) -} - -func (f *realFS) EvalSymlinks(path string) (string, error) { - return filepath.EvalSymlinks(path) -} - -// ListingCache polls the filesystem at the specified directory once per -// period and checks each non-directory entry for a symlink. The results are -// cached. Changes to the cache are logged, as well as the full contents of the -// cache. The cache's Run() method is expected to be called in a goroutine. Its -// cancellation is controlled via the context argument. -type ListingCache struct { - period time.Duration - dir string - links *linkCache - fs fsInterface -} - -func NewListingCache(period time.Duration, dir string) *ListingCache { - return &ListingCache{ - period: period, - dir: dir, - links: newLinkCache(), - fs: &realFS{}, - } -} - -// Run starts the cache's background loop. The filesystem is listed and the cache -// updated according to the frequency specified by the period. It will run until -// the context is cancelled. -func (l *ListingCache) Run(ctx context.Context) { - klog.Infof("Starting symlink cache watcher for directory %s with period %s", l.dir, l.period) - - // Start the loop that runs every minute - ticker := time.NewTicker(l.period) - defer ticker.Stop() - - // Initial list and update so we don't wait for the first tick. - err := l.listAndUpdate() - if err != nil { - klog.Warningf("Error listing and updating symlinks: %v", err) - } - - for { - select { - case <-ctx.Done(): - klog.Infof("Context done, stopping watcher") - return - case <-ticker.C: - err := l.listAndUpdate() - if err != nil { - klog.Warningf("Error listing and updating symlinks: %v", err) - continue - } - - klog.Infof("periodic symlink cache read: %s", l.links.String()) - } - } -} - -func (l *ListingCache) listAndUpdate() error { - visited := make(map[string]struct{}) - - entries, err := l.fs.ReadDir(l.dir) - if err != nil { - return fmt.Errorf("failed to read directory %s: %w", l.dir, err) - } - - var errs []error - for _, entry := range entries { - if entry.IsDir() { - continue - } - - diskByIdPath := filepath.Join(l.dir, entry.Name()) - - if partitionNameRegex.MatchString(entry.Name()) { - continue - } - - // Add the device to the map regardless of successful symlink eval. - // Otherwise, a broken symlink will lead us to remove it from the cache. - visited[diskByIdPath] = struct{}{} - - realFSPath, err := l.fs.EvalSymlinks(diskByIdPath) - if err != nil { - errs = append(errs, fmt.Errorf("failed to evaluate symlink for %s: %w", diskByIdPath, err)) - l.links.BrokenSymlink(diskByIdPath) - continue - } - - l.links.AddOrUpdateDevice(diskByIdPath, realFSPath) - } - - for _, id := range l.links.DeviceIDs() { - if _, found := visited[id]; !found { - l.links.RemoveDevice(id) - } - } - - if len(errs) > 0 { - return fmt.Errorf("failed to evaluate symlinks for %d devices: %v", len(errs), errs) - } - return nil -} - -// linkCache is a structure that maintains a cache of symlinks between -// /dev/disk/by-id and /dev/sd* paths. It provides methods to add/update, -// retrieve, and remove device symlinks from the cache. -type linkCache struct { - devices map[string]linkCacheEntry -} - -type linkCacheEntry struct { - path string - // If true, the symlink is known to be broken. - brokenSymlink bool -} - -func newLinkCache() *linkCache { - return &linkCache{ - devices: make(map[string]linkCacheEntry), - } -} - -// AddOrUpdateDevice adds a new device or updates an existing device in the cache. -// It ignores partition symlinks as they are considered noise for logging purposes. -// If the symlink already exists and the real path has changed, it logs the update. -func (d *linkCache) AddOrUpdateDevice(symlink, realPath string) { - // Ignore partitions, which are noise as far as our logging is concerned. - // Expression: -part[0-9]+$ - if partitionNameRegex.MatchString(symlink) { - // TODO(juliankatz): To have certainty this works for all edge cases, we - // need to test this with a manually partitioned disk. - return - } - - prevEntry, exists := d.devices[symlink] - if !exists || prevEntry.path != realPath { - klog.Infof("Symlink updated for link %s, previous value: %s, new value: %s", symlink, prevEntry.path, realPath) - } - d.devices[symlink] = linkCacheEntry{path: realPath, brokenSymlink: false} -} - -// BrokenSymlink marks a symlink as broken. If the symlink is not in the cache, -// it is ignored. -func (d *linkCache) BrokenSymlink(symlink string) { - if entry, ok := d.devices[symlink]; ok { - entry.brokenSymlink = true - d.devices[symlink] = entry - } -} - -func (d *linkCache) RemoveDevice(symlink string) { - if entry, ok := d.devices[symlink]; ok { - klog.Infof("Removing device %s with path %s from cache, brokenSymlink: %t", symlink, entry.path, entry.brokenSymlink) - delete(d.devices, symlink) - } -} - -func (d *linkCache) DeviceIDs() []string { - return slices.Collect(maps.Keys(d.devices)) -} - -func (d *linkCache) String() string { - var sb strings.Builder - for symlink, entry := range d.devices { - if entry.brokenSymlink { - sb.WriteString(fmt.Sprintf("%s -> broken symlink... last known value: %s; ", symlink, entry.path)) - } else { - sb.WriteString(fmt.Sprintf("%s -> %s; ", symlink, entry.path)) - } - } - return strings.TrimSuffix(sb.String(), "; ") -} diff --git a/pkg/linkcache/cache_test.go b/pkg/linkcache/cache_test.go index 0b811e833..aeb2416bf 100644 --- a/pkg/linkcache/cache_test.go +++ b/pkg/linkcache/cache_test.go @@ -1,199 +1 @@ package linkcache - -import ( - "os" - "testing" - "testing/fstest" - - "github.com/google/go-cmp/cmp" -) - -var allowUnexportedLinkCache = cmp.AllowUnexported(linkCache{}, linkCacheEntry{}) - -const ( - // Test disk names in /dev/disk/by-id format - gcpPersistentDiskID = "google-persistent-disk-0" - gcpPVCID = "google-pvc-f5418f78-dc07-4d69-9487-6c4a7232dd67" - gcpPersistentDiskPartitionID = "google-persistent-disk-0-part1" - - // Test device paths in /dev format - devicePathSDA = "/dev/sda" - devicePathSDB = "/dev/sdb" -) - -// mockFS implements fsInterface for testing -type mockFS struct { - fstest.MapFS - symlinks map[string]string -} - -func newMockFS() *mockFS { - return &mockFS{ - MapFS: make(fstest.MapFS), - symlinks: make(map[string]string), - } -} - -func (m *mockFS) ReadDir(name string) ([]os.DirEntry, error) { - entries, err := m.MapFS.ReadDir(name) - if err != nil { - return nil, err - } - return entries, nil -} - -func (m *mockFS) EvalSymlinks(path string) (string, error) { - if target, ok := m.symlinks[path]; ok { - return target, nil - } - return "", os.ErrNotExist -} - -func TestListAndUpdate(t *testing.T) { - tests := []struct { - name string - setupFS func(*mockFS) - expectedCache *linkCache - expectError bool - }{ - { - name: "valid symlinks", - setupFS: func(m *mockFS) { - // Create some device files - m.MapFS[gcpPersistentDiskID] = &fstest.MapFile{} - m.MapFS[gcpPVCID] = &fstest.MapFile{} - // Create symlinks - m.symlinks[gcpPersistentDiskID] = devicePathSDA - m.symlinks[gcpPVCID] = devicePathSDB - }, - expectedCache: &linkCache{ - devices: map[string]linkCacheEntry{ - gcpPersistentDiskID: {path: devicePathSDA, brokenSymlink: false}, - gcpPVCID: {path: devicePathSDB, brokenSymlink: false}, - }, - }, - expectError: false, - }, - { - name: "broken symlink not added to cache", - setupFS: func(m *mockFS) { - m.MapFS[gcpPersistentDiskID] = &fstest.MapFile{} - // No symlink target for gcpPersistentDiskID - }, - expectedCache: &linkCache{ - devices: map[string]linkCacheEntry{}, - }, - expectError: true, - }, - { - name: "partition files ignored", - setupFS: func(m *mockFS) { - m.MapFS[gcpPersistentDiskPartitionID] = &fstest.MapFile{} - m.MapFS[gcpPersistentDiskID] = &fstest.MapFile{} - m.symlinks[gcpPersistentDiskID] = devicePathSDA - m.symlinks[gcpPersistentDiskPartitionID] = devicePathSDA + "1" - }, - expectedCache: &linkCache{ - devices: map[string]linkCacheEntry{ - gcpPersistentDiskID: {path: devicePathSDA, brokenSymlink: false}, - }, - }, - expectError: false, - }, - } - - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - mock := newMockFS() - tt.setupFS(mock) - - cache := NewListingCache(0, ".") - cache.fs = mock // Inject our mock filesystem - err := cache.listAndUpdate() - - if tt.expectError { - if err == nil { - t.Error("expected error but got none") - } - } else { - if err != nil { - t.Errorf("unexpected error: %v", err) - } - } - - // Compare the entire cache state - if diff := cmp.Diff(tt.expectedCache, cache.links, allowUnexportedLinkCache); diff != "" { - t.Errorf("linkCache mismatch (-expected +got):\n%s", diff) - } - }) - } -} - -func TestLinkCache(t *testing.T) { - tests := []struct { - name string - setupCache func(*linkCache) - expected *linkCache - }{ - { - name: "AddOrUpdateDevice", - setupCache: func(lc *linkCache) { - lc.AddOrUpdateDevice("symlink1", "/dev/sda") - lc.AddOrUpdateDevice("symlink2", "/dev/sdb") - }, - expected: &linkCache{ - devices: map[string]linkCacheEntry{ - "symlink1": {path: "/dev/sda", brokenSymlink: false}, - "symlink2": {path: "/dev/sdb", brokenSymlink: false}, - }, - }, - }, - { - name: "BrokenSymlink", - setupCache: func(lc *linkCache) { - lc.AddOrUpdateDevice("symlink1", "/dev/sda") - lc.BrokenSymlink("symlink1") - }, - expected: &linkCache{ - devices: map[string]linkCacheEntry{ - "symlink1": {path: "/dev/sda", brokenSymlink: true}, - }, - }, - }, - { - name: "RemoveDevice", - setupCache: func(lc *linkCache) { - lc.AddOrUpdateDevice("symlink1", "/dev/sda") - lc.RemoveDevice("symlink1") - }, - expected: &linkCache{ - devices: map[string]linkCacheEntry{}, - }, - }, - { - name: "PartitionIgnored", - setupCache: func(lc *linkCache) { - lc.AddOrUpdateDevice(gcpPersistentDiskPartitionID, devicePathSDA+"1") - lc.AddOrUpdateDevice(gcpPersistentDiskID, devicePathSDA) - lc.AddOrUpdateDevice(gcpPVCID, devicePathSDB) - }, - expected: &linkCache{ - devices: map[string]linkCacheEntry{ - gcpPersistentDiskID: {path: devicePathSDA, brokenSymlink: false}, - gcpPVCID: {path: devicePathSDB, brokenSymlink: false}, - }, - }, - }, - } - - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - cache := newLinkCache() - tt.setupCache(cache) - - if diff := cmp.Diff(tt.expected, cache, allowUnexportedLinkCache); diff != "" { - t.Errorf("linkCache mismatch (-expected +got):\n%s", diff) - } - }) - } -} diff --git a/pkg/linkcache/devices.go b/pkg/linkcache/devices.go new file mode 100644 index 000000000..963ba43a9 --- /dev/null +++ b/pkg/linkcache/devices.go @@ -0,0 +1,136 @@ +package linkcache + +import ( + "context" + "fmt" + "path/filepath" + "strings" + "time" + + v1 "k8s.io/api/core/v1" + "k8s.io/klog/v2" + "sigs.k8s.io/gcp-compute-persistent-disk-csi-driver/pkg/common" + "sigs.k8s.io/gcp-compute-persistent-disk-csi-driver/pkg/k8sclient" +) + +const byIdDir = "/dev/disk/by-id" + +type deviceMapping struct { + symlink string + realPath string +} + +type DeviceCache struct { + volumes map[string]deviceMapping + period time.Duration + // dir is the directory to look for device symlinks + dir string +} + +func NewDeviceCacheForNode(ctx context.Context, period time.Duration, nodeName string) (*DeviceCache, error) { + node, err := k8sclient.GetNodeWithRetry(ctx, nodeName) + if err != nil { + return nil, fmt.Errorf("failed to get node %s: %w", nodeName, err) + } + + return newDeviceCacheForNode(ctx, period, node) +} + +func newDeviceCacheForNode(ctx context.Context, period time.Duration, node *v1.Node) (*DeviceCache, error) { + deviceCache := &DeviceCache{ + volumes: make(map[string]deviceMapping), + period: period, + dir: byIdDir, + } + + // Look at the status.volumesInUse field. For each, take the last section + // of the string (after the last "/") and call AddVolume for that + for _, volume := range node.Status.VolumesInUse { + klog.Infof("Adding volume %s to cache", string(volume)) + volumeID := strings.Split(string(volume), "^")[1] + deviceCache.AddVolume(volumeID) + } + + return deviceCache, nil +} + +// Run since it needs an infinite loop to keep itself up to date +func (d *DeviceCache) Run(ctx context.Context) { + klog.Infof("Starting device cache watcher for directory %s with period %s", d.dir, d.period) + + // Start the loop that runs every minute + ticker := time.NewTicker(d.period) + defer ticker.Stop() + + for { + select { + case <-ctx.Done(): + klog.Infof("Context done, stopping watcher") + return + case <-ticker.C: + d.listAndUpdate() + + klog.Infof("Cache contents: %+v", d.volumes) + } + } +} + +// Add a volume. This will yield a call to the filesystem to find a +// /dev/disk/by-id symlink and an evaluation of that symlink. +func (d *DeviceCache) AddVolume(volumeID string) error { + klog.Infof("Adding volume %s to cache", volumeID) + + _, volumeKey, err := common.VolumeIDToKey(volumeID) + if err != nil { + return fmt.Errorf("error converting volume ID to key: %w", err) + } + deviceName, err := common.GetDeviceName(volumeKey) + if err != nil { + return fmt.Errorf("error getting device name: %w", err) + } + + // Look at the dir for a symlink that matches the pvName + symlink := filepath.Join(d.dir, "google-"+deviceName) + klog.Infof("Looking for symlink %s", symlink) + + realPath, err := filepath.EvalSymlinks(symlink) + if err != nil { + klog.Warningf("Error evaluating symlink for volume %s: %v", volumeID, err) + return nil + } + + klog.Infof("Found real path %s for volume %s", realPath, volumeID) + + d.volumes[volumeID] = deviceMapping{ + symlink: symlink, + realPath: realPath, + } + + return nil +} + +// Remove the volume from the cache. +func (d *DeviceCache) RemoveVolume(volumeID string) { + klog.Infof("Removing volume %s from cache", volumeID) + delete(d.volumes, volumeID) +} + +func (d *DeviceCache) listAndUpdate() { + for volumeID, device := range d.volumes { + // Evaluate the symlink + realPath, err := filepath.EvalSymlinks(device.symlink) + if err != nil { + klog.Warningf("Error evaluating symlink for volume %s: %v", volumeID, err) + continue + } + + // Check if the realPath has changed + if realPath != device.realPath { + klog.Warningf("Change in device path for volume %s (symlink: %s), previous path: %s, new path: %s", volumeID, device.symlink, device.realPath, realPath) + + // Update the cache with the new realPath + device.realPath = realPath + d.volumes[volumeID] = device + } + } +} From c925927cf6473767aeb40e7bea3af0e3ac6d0a87 Mon Sep 17 00:00:00 2001 From: juliankatz Date: Wed, 28 May 2025 13:11:52 -0700 Subject: [PATCH 35/51] Made a no-op windows implementation of the linkcache package --- manifest_osversion.sh | 4 +-- pkg/linkcache/cache_test.go | 1 - .../{devices.go => devices_linux.go} | 12 --------- pkg/linkcache/devices_windows.go | 25 +++++++++++++++++++ pkg/linkcache/types.go | 15 +++++++++++ 5 files changed, 42 insertions(+), 15 deletions(-) delete mode 100644 pkg/linkcache/cache_test.go rename pkg/linkcache/{devices.go => devices_linux.go} (94%) create mode 100644 pkg/linkcache/devices_windows.go create mode 100644 pkg/linkcache/types.go diff --git a/manifest_osversion.sh b/manifest_osversion.sh index 4feb4d5c6..37f61e3f2 100755 --- a/manifest_osversion.sh +++ b/manifest_osversion.sh @@ -4,7 +4,7 @@ set -o xtrace # The following is a workaround for issue https://github.com/moby/moby/issues/41417 # to manually inserver os.version information into docker manifest file -# TODO: once docker manifest annotation for os.versions is availabler for the installed docker here, +# TODO: once docker manifest annotation for os.versions is available for the installed docker here, # replace the following with annotation approach. https://github.com/docker/cli/pull/2578 export DOCKER_CLI_EXPERIMENTAL=enabled @@ -14,7 +14,7 @@ IFS=', ' read -r -a imagetags <<< "$WINDOWS_IMAGE_TAGS" IFS=', ' read -r -a baseimages <<< "$WINDOWS_BASE_IMAGES" MANIFEST_TAG=${STAGINGIMAGE}:${STAGINGVERSION} -# translate from image tag to docker manifest foler format +# translate from image tag to docker manifest folder format # e.g., gcr.io_k8s-staging-csi_gce-pd-windows-v2 manifest_folder=$(echo "${MANIFEST_TAG}" | sed "s|/|_|g" | sed "s/:/-/") echo ${manifest_folder} diff --git a/pkg/linkcache/cache_test.go b/pkg/linkcache/cache_test.go deleted file mode 100644 index aeb2416bf..000000000 --- a/pkg/linkcache/cache_test.go +++ /dev/null @@ -1 +0,0 @@ -package linkcache diff --git a/pkg/linkcache/devices.go b/pkg/linkcache/devices_linux.go similarity index 94% rename from pkg/linkcache/devices.go rename to pkg/linkcache/devices_linux.go index 963ba43a9..a6f61edff 100644 --- a/pkg/linkcache/devices.go +++ b/pkg/linkcache/devices_linux.go @@ -15,18 +15,6 @@ import ( const byIdDir = "/dev/disk/by-id" -type deviceMapping struct { - symlink string - realPath string -} - -type DeviceCache struct { - volumes map[string]deviceMapping - period time.Duration - // dir is the directory to look for device symlinks - dir string -} - func NewDeviceCacheForNode(ctx context.Context, period time.Duration, nodeName string) (*DeviceCache, error) { node, err := k8sclient.GetNodeWithRetry(ctx, nodeName) if err != nil { diff --git a/pkg/linkcache/devices_windows.go b/pkg/linkcache/devices_windows.go new file mode 100644 index 000000000..59e8eac73 --- /dev/null +++ b/pkg/linkcache/devices_windows.go @@ -0,0 +1,25 @@ +//go:build windows + +package linkcache + +import ( + "context" + "fmt" + "time" +) + +func NewDeviceCacheForNode(ctx context.Context, period time.Duration, nodeName string) (*DeviceCache, error) { + return nil, fmt.Errorf("NewDeviceCacheForNode is not implemented for Windows") +} + +func (d *DeviceCache) Run(ctx context.Context) { + // Not implemented for Windows +} + +func (d *DeviceCache) AddVolume(volumeID string) error { + return fmt.Errorf("AddVolume is not implemented for Windows") +} + +func (d *DeviceCache) RemoveVolume(volumeID string) { + // Not implemented for Windows +} diff --git a/pkg/linkcache/types.go b/pkg/linkcache/types.go new file mode 100644 index 000000000..b8dcae3fb --- /dev/null +++ b/pkg/linkcache/types.go @@ -0,0 +1,15 @@ +package linkcache + +import "time" + +type deviceMapping struct { + symlink string + realPath string +} + +type DeviceCache struct { + volumes map[string]deviceMapping + period time.Duration + // dir is the directory to look for device symlinks + dir string +} From b4b0c256df730a2cdf02a25d3279f3a70ca787fb Mon Sep 17 00:00:00 2001 From: juliankatz Date: Fri, 6 Jun 2025 15:05:05 -0700 Subject: [PATCH 36/51] Made test device caches in node_test.go --- pkg/gce-pd-csi-driver/node_test.go | 17 +++++++++---- pkg/linkcache/devices_linux.go | 39 ++++++++++++++++++++++++++---- 2 files changed, 46 insertions(+), 10 deletions(-) diff --git a/pkg/gce-pd-csi-driver/node_test.go b/pkg/gce-pd-csi-driver/node_test.go index 2ac1b9e2e..0ac7805d3 100644 --- a/pkg/gce-pd-csi-driver/node_test.go +++ b/pkg/gce-pd-csi-driver/node_test.go @@ -34,6 +34,7 @@ import ( "k8s.io/mount-utils" "sigs.k8s.io/gcp-compute-persistent-disk-csi-driver/pkg/deviceutils" metadataservice "sigs.k8s.io/gcp-compute-persistent-disk-csi-driver/pkg/gce-cloud-provider/metadata" + "sigs.k8s.io/gcp-compute-persistent-disk-csi-driver/pkg/linkcache" mountmanager "sigs.k8s.io/gcp-compute-persistent-disk-csi-driver/pkg/mount-manager" ) @@ -44,11 +45,13 @@ const ( ) func getTestGCEDriver(t *testing.T) *GCEDriver { - return getCustomTestGCEDriver(t, mountmanager.NewFakeSafeMounter(), deviceutils.NewFakeDeviceUtils(false), metadataservice.NewFakeService(), &NodeServerArgs{}) + return getCustomTestGCEDriver(t, mountmanager.NewFakeSafeMounter(), deviceutils.NewFakeDeviceUtils(false), metadataservice.NewFakeService(), &NodeServerArgs{ + DeviceCache: linkcache.TestDeviceCache(1*time.Minute, linkcache.TestNodeWithVolumes([]string{defaultVolumeID})), + }) } -func getTestGCEDriverWithCustomMounter(t *testing.T, mounter *mount.SafeFormatAndMount) *GCEDriver { - return getCustomTestGCEDriver(t, mounter, deviceutils.NewFakeDeviceUtils(false), metadataservice.NewFakeService(), &NodeServerArgs{}) +func getTestGCEDriverWithCustomMounter(t *testing.T, mounter *mount.SafeFormatAndMount, args *NodeServerArgs) *GCEDriver { + return getCustomTestGCEDriver(t, mounter, deviceutils.NewFakeDeviceUtils(false), metadataservice.NewFakeService(), args) } func getCustomTestGCEDriver(t *testing.T, mounter *mount.SafeFormatAndMount, deviceUtils deviceutils.DeviceUtils, metaService metadataservice.MetadataService, args *NodeServerArgs) *GCEDriver { @@ -188,7 +191,9 @@ func TestNodeGetVolumeStats(t *testing.T) { } mounter := mountmanager.NewFakeSafeMounterWithCustomExec(&testingexec.FakeExec{CommandScript: actionList}) - gceDriver := getTestGCEDriverWithCustomMounter(t, mounter) + gceDriver := getTestGCEDriverWithCustomMounter(t, mounter, &NodeServerArgs{ + DeviceCache: linkcache.TestDeviceCache(1*time.Minute, linkcache.TestNodeWithVolumes([]string{tc.volumeID})), + }) ns := gceDriver.ns req := &csi.NodeGetVolumeStatsRequest{ @@ -1227,7 +1232,9 @@ func TestNodeStageVolume(t *testing.T) { )) } mounter := mountmanager.NewFakeSafeMounterWithCustomExec(&testingexec.FakeExec{CommandScript: actionList, ExactOrder: true}) - gceDriver := getTestGCEDriverWithCustomMounter(t, mounter) + gceDriver := getTestGCEDriverWithCustomMounter(t, mounter, &NodeServerArgs{ + DeviceCache: linkcache.TestDeviceCache(1*time.Minute, linkcache.TestNodeWithVolumes([]string{volumeID})), + }) ns := gceDriver.ns ns.SysfsPath = tempDir + "/sys" _, err := ns.NodeStageVolume(context.Background(), tc.req) diff --git a/pkg/linkcache/devices_linux.go b/pkg/linkcache/devices_linux.go index a6f61edff..96e4732b8 100644 --- a/pkg/linkcache/devices_linux.go +++ b/pkg/linkcache/devices_linux.go @@ -21,10 +21,27 @@ func NewDeviceCacheForNode(ctx context.Context, period time.Duration, nodeName s return nil, fmt.Errorf("failed to get node %s: %w", nodeName, err) } - return newDeviceCacheForNode(ctx, period, node) + return newDeviceCacheForNode(period, node), nil } -func newDeviceCacheForNode(ctx context.Context, period time.Duration, node *v1.Node) (*DeviceCache, error) { +func TestDeviceCache(period time.Duration, node *v1.Node) *DeviceCache { + return newDeviceCacheForNode(period, node) +} + +func TestNodeWithVolumes(volumes []string) *v1.Node { + volumesInUse := make([]v1.UniqueVolumeName, len(volumes)) + for i, volume := range volumes { + volumesInUse[i] = v1.UniqueVolumeName("kubernetes.io/csi/pd.csi.storage.gke.io^" + volume) + } + + return &v1.Node{ + Status: v1.NodeStatus{ + VolumesInUse: volumesInUse, + }, + } +} + +func newDeviceCacheForNode(period time.Duration, node *v1.Node) *DeviceCache { deviceCache := &DeviceCache{ volumes: make(map[string]deviceMapping), period: period, @@ -35,11 +52,23 @@ func newDeviceCacheForNode(ctx context.Context, period time.Duration, node *v1.N // of the string (after the last "/") and call AddVolume for that for _, volume := range node.Status.VolumesInUse { klog.Infof("Adding volume %s to cache", string(volume)) - volumeID := strings.Split(string(volume), "^")[1] - deviceCache.AddVolume(volumeID) + vID, err := pvNameFromVolumeID(string(volume)) + if err != nil { + klog.Warningf("failure to retrieve name, skipping volume %q: %v", string(volume), err) + continue + } + deviceCache.AddVolume(vID) } - return deviceCache, nil + return deviceCache +} + +func pvNameFromVolumeID(volumeID string) (string, error) { + tokens := strings.Split(volumeID, "^") + if len(tokens) != 2 { + return "", fmt.Errorf("invalid volume ID, split on `^` returns %d tokens, expected 2", len(tokens)) + } + return tokens[1], nil } // Run since it needs an infinite loop to keep itself up to date From 97c89a5b087f78c1e85357feb5410baf0f9dc1e4 Mon Sep 17 00:00:00 2001 From: juliankatz Date: Fri, 6 Jun 2025 15:16:32 -0700 Subject: [PATCH 37/51] Fix sanity test --- test/sanity/sanity_test.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/test/sanity/sanity_test.go b/test/sanity/sanity_test.go index 89192f150..408dc047e 100644 --- a/test/sanity/sanity_test.go +++ b/test/sanity/sanity_test.go @@ -33,6 +33,7 @@ import ( gce "sigs.k8s.io/gcp-compute-persistent-disk-csi-driver/pkg/gce-cloud-provider/compute" metadataservice "sigs.k8s.io/gcp-compute-persistent-disk-csi-driver/pkg/gce-cloud-provider/metadata" driver "sigs.k8s.io/gcp-compute-persistent-disk-csi-driver/pkg/gce-pd-csi-driver" + "sigs.k8s.io/gcp-compute-persistent-disk-csi-driver/pkg/linkcache" mountmanager "sigs.k8s.io/gcp-compute-persistent-disk-csi-driver/pkg/mount-manager" ) @@ -77,6 +78,7 @@ func TestSanity(t *testing.T) { EnableDeviceInUseCheck: true, DeviceInUseTimeout: 0, EnableDataCache: enableDataCache, + DeviceCache: linkcache.TestDeviceCache(1*time.Minute, linkcache.TestNodeWithVolumes([]string{})), } // Initialize GCE Driver From 7de39b80aa50d69dea7be05e76e3b1404b38eee9 Mon Sep 17 00:00:00 2001 From: juliankatz Date: Wed, 2 Jul 2025 15:35:40 -0700 Subject: [PATCH 38/51] Only warn on failure to create cache --- cmd/gce-pd-csi-driver/main.go | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/cmd/gce-pd-csi-driver/main.go b/cmd/gce-pd-csi-driver/main.go index e1e024410..60cc593c7 100644 --- a/cmd/gce-pd-csi-driver/main.go +++ b/cmd/gce-pd-csi-driver/main.go @@ -278,7 +278,7 @@ func handle() { deviceCache, err := linkcache.NewDeviceCacheForNode(ctx, 1*time.Minute, *nodeName) if err != nil { - klog.Fatalf("Failed to create device cache: %v", err.Error()) + klog.Warningf("Failed to create device cache: %v", err.Error()) } go deviceCache.Run(ctx) @@ -311,8 +311,6 @@ func handle() { } - klog.Infof("NOT BLOCKED") - err = gceDriver.SetupGCEDriver(driverName, version, extraVolumeLabels, extraTags, identityServer, controllerServer, nodeServer) if err != nil { klog.Fatalf("Failed to initialize GCE CSI Driver: %v", err.Error()) From 66b522ac90bf806e84ea9776d6cb2db76a63f276 Mon Sep 17 00:00:00 2001 From: juliankatz Date: Wed, 2 Jul 2025 15:37:45 -0700 Subject: [PATCH 39/51] Only warn on windows instantiation --- pkg/linkcache/devices_windows.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pkg/linkcache/devices_windows.go b/pkg/linkcache/devices_windows.go index 59e8eac73..bfed9158d 100644 --- a/pkg/linkcache/devices_windows.go +++ b/pkg/linkcache/devices_windows.go @@ -6,10 +6,13 @@ import ( "context" "fmt" "time" + + "k8s.io/klog/v2" ) func NewDeviceCacheForNode(ctx context.Context, period time.Duration, nodeName string) (*DeviceCache, error) { - return nil, fmt.Errorf("NewDeviceCacheForNode is not implemented for Windows") + klog.Warningf("NewDeviceCacheForNode is not implemented for Windows") + return nil, nil } func (d *DeviceCache) Run(ctx context.Context) { From ecbda6bccdfd34bfd8831c44580859ffc8c45b5b Mon Sep 17 00:00:00 2001 From: juliankatz Date: Wed, 2 Jul 2025 16:02:19 -0700 Subject: [PATCH 40/51] Make non-implemented on windows an info --- pkg/linkcache/devices_windows.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkg/linkcache/devices_windows.go b/pkg/linkcache/devices_windows.go index bfed9158d..b767556ea 100644 --- a/pkg/linkcache/devices_windows.go +++ b/pkg/linkcache/devices_windows.go @@ -4,14 +4,13 @@ package linkcache import ( "context" - "fmt" "time" "k8s.io/klog/v2" ) func NewDeviceCacheForNode(ctx context.Context, period time.Duration, nodeName string) (*DeviceCache, error) { - klog.Warningf("NewDeviceCacheForNode is not implemented for Windows") + klog.Infof("NewDeviceCacheForNode is not implemented for Windows") return nil, nil } @@ -20,7 +19,8 @@ func (d *DeviceCache) Run(ctx context.Context) { } func (d *DeviceCache) AddVolume(volumeID string) error { - return fmt.Errorf("AddVolume is not implemented for Windows") + klog.Infof("AddVolume is not implemented for Windows") + return nil } func (d *DeviceCache) RemoveVolume(volumeID string) { From 38851a9808eaedf898f332592723a4ba105cad3e Mon Sep 17 00:00:00 2001 From: juliankatz Date: Wed, 2 Jul 2025 16:44:19 -0700 Subject: [PATCH 41/51] Improved some error messages to provide better test failure feedback --- test/remote/setup-teardown.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/remote/setup-teardown.go b/test/remote/setup-teardown.go index 3026b28b0..14cbbbf19 100644 --- a/test/remote/setup-teardown.go +++ b/test/remote/setup-teardown.go @@ -73,7 +73,7 @@ func SetupNewDriverAndClient(instance *InstanceInfo, config *ClientConfig) (*Tes archiveName := fmt.Sprintf("e2e_driver_binaries_%s.tar.gz", uuid.NewUUID()) archivePath, err := CreateDriverArchive(archiveName, instance.cfg.Architecture, config.PkgPath, config.BinPath) if err != nil { - return nil, err + return nil, fmt.Errorf("failed to create driver archive: %v", err.Error()) } defer func() { err = os.Remove(archivePath) @@ -92,7 +92,7 @@ func SetupNewDriverAndClient(instance *InstanceInfo, config *ClientConfig) (*Tes // Upload archive to instance and run binaries driverPID, err := instance.UploadAndRun(archivePath, config.WorkspaceDir, config.RunDriverCmd) if err != nil { - return nil, err + return nil, fmt.Errorf("failed to upload and run driver: %v", err.Error()) } // Create an SSH tunnel from port to port From 45dd67730d463c32a2fe09c1b5fa4ea0a7798022 Mon Sep 17 00:00:00 2001 From: juliankatz Date: Wed, 2 Jul 2025 16:47:18 -0700 Subject: [PATCH 42/51] Always print helpful logs in failing area --- test/remote/runner.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test/remote/runner.go b/test/remote/runner.go index 860646e71..87543e433 100644 --- a/test/remote/runner.go +++ b/test/remote/runner.go @@ -29,7 +29,7 @@ import ( func (i *InstanceInfo) UploadAndRun(archivePath, remoteWorkspace, driverRunCmd string) (int, error) { // Create the temp staging directory - klog.V(4).Infof("Staging test binaries on %q", i.cfg.Name) + klog.Infof("Staging test binaries on %q", i.cfg.Name) // Do not sudo here, so that we can use scp to copy test archive to the directdory. if output, err := i.SSHNoSudo("mkdir", remoteWorkspace); err != nil { @@ -49,7 +49,7 @@ func (i *InstanceInfo) UploadAndRun(archivePath, remoteWorkspace, driverRunCmd s fmt.Sprintf("cd %s", remoteWorkspace), fmt.Sprintf("tar -xzvf ./%s", archiveName), ) - klog.V(4).Infof("Extracting tar on %q", i.cfg.Name) + klog.Infof("Extracting tar on %q", i.cfg.Name) // Do not use sudo here, because `sudo tar -x` will recover the file ownership inside the tar ball, but // we want the extracted files to be owned by the current user. if output, err := i.SSHNoSudo("sh", "-c", cmd); err != nil { @@ -57,7 +57,7 @@ func (i *InstanceInfo) UploadAndRun(archivePath, remoteWorkspace, driverRunCmd s return -1, fmt.Errorf("failed to extract test archive: %v, output: %q", err.Error(), output) } - klog.V(4).Infof("Starting driver on %q", i.cfg.Name) + klog.Infof("Starting driver on %q", i.cfg.Name) // When the process is killed the driver should close the TCP endpoint, then we want to download the logs output, err := i.SSH(driverRunCmd) if err != nil { From ffba1116084a7eb705a7ac66580e0511d926a50e Mon Sep 17 00:00:00 2001 From: juliankatz Date: Wed, 2 Jul 2025 17:11:28 -0700 Subject: [PATCH 43/51] Remove now unnecessary corp-helper when running from cloudtop --- test/remote/instance.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/test/remote/instance.go b/test/remote/instance.go index 554e7612e..84c56625f 100644 --- a/test/remote/instance.go +++ b/test/remote/instance.go @@ -235,7 +235,7 @@ func (i *InstanceInfo) CreateOrGetInstance(localSSDCount int) error { } if i.cfg.CloudtopHost { - output, err := exec.Command("gcloud", "compute", "ssh", i.cfg.Name, "--zone", i.cfg.Zone, "--project", i.cfg.Project, "--", "-o", "ProxyCommand=corp-ssh-helper %h %p", "--", "echo").CombinedOutput() + output, err := exec.Command("gcloud", "compute", "ssh", i.cfg.Name, "--zone", i.cfg.Zone, "--project", i.cfg.Project).CombinedOutput() if err != nil { klog.Errorf("Failed to bootstrap ssh (%v): %s", err, string(output)) return false, nil @@ -257,9 +257,8 @@ func (i *InstanceInfo) CreateOrGetInstance(localSSDCount int) error { return true, nil }) - // If instance didn't reach running state in time, return with error now. if err != nil { - return err + return fmt.Errorf("instance %v did not reach running state in time: %v", i.cfg.Name, err.Error()) } // Instance reached running state in time, make sure that cloud-init is complete From 5e6dcb58229938c03e90ae6d299d264094719efb Mon Sep 17 00:00:00 2001 From: juliankatz Date: Wed, 2 Jul 2025 17:24:41 -0700 Subject: [PATCH 44/51] Only run device cache if successfully created --- cmd/gce-pd-csi-driver/main.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cmd/gce-pd-csi-driver/main.go b/cmd/gce-pd-csi-driver/main.go index 60cc593c7..68f237856 100644 --- a/cmd/gce-pd-csi-driver/main.go +++ b/cmd/gce-pd-csi-driver/main.go @@ -279,8 +279,9 @@ func handle() { deviceCache, err := linkcache.NewDeviceCacheForNode(ctx, 1*time.Minute, *nodeName) if err != nil { klog.Warningf("Failed to create device cache: %v", err.Error()) + } else { + go deviceCache.Run(ctx) } - go deviceCache.Run(ctx) // TODO(2042): Move more of the constructor args into this struct nsArgs := &driver.NodeServerArgs{ From 7612520a5312f445fb13555af5c50941e4adc119 Mon Sep 17 00:00:00 2001 From: juliankatz Date: Wed, 2 Jul 2025 17:27:39 -0700 Subject: [PATCH 45/51] Replace verbosities --- test/remote/runner.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test/remote/runner.go b/test/remote/runner.go index 87543e433..860646e71 100644 --- a/test/remote/runner.go +++ b/test/remote/runner.go @@ -29,7 +29,7 @@ import ( func (i *InstanceInfo) UploadAndRun(archivePath, remoteWorkspace, driverRunCmd string) (int, error) { // Create the temp staging directory - klog.Infof("Staging test binaries on %q", i.cfg.Name) + klog.V(4).Infof("Staging test binaries on %q", i.cfg.Name) // Do not sudo here, so that we can use scp to copy test archive to the directdory. if output, err := i.SSHNoSudo("mkdir", remoteWorkspace); err != nil { @@ -49,7 +49,7 @@ func (i *InstanceInfo) UploadAndRun(archivePath, remoteWorkspace, driverRunCmd s fmt.Sprintf("cd %s", remoteWorkspace), fmt.Sprintf("tar -xzvf ./%s", archiveName), ) - klog.Infof("Extracting tar on %q", i.cfg.Name) + klog.V(4).Infof("Extracting tar on %q", i.cfg.Name) // Do not use sudo here, because `sudo tar -x` will recover the file ownership inside the tar ball, but // we want the extracted files to be owned by the current user. if output, err := i.SSHNoSudo("sh", "-c", cmd); err != nil { @@ -57,7 +57,7 @@ func (i *InstanceInfo) UploadAndRun(archivePath, remoteWorkspace, driverRunCmd s return -1, fmt.Errorf("failed to extract test archive: %v, output: %q", err.Error(), output) } - klog.Infof("Starting driver on %q", i.cfg.Name) + klog.V(4).Infof("Starting driver on %q", i.cfg.Name) // When the process is killed the driver should close the TCP endpoint, then we want to download the logs output, err := i.SSH(driverRunCmd) if err != nil { From ee9172a6375255ebbeda9ee60b559c9fbea0c639 Mon Sep 17 00:00:00 2001 From: Engin Akdemir Date: Tue, 5 Aug 2025 16:44:13 +0000 Subject: [PATCH 46/51] Add nil checks around the usage of the device cache --- pkg/gce-pd-csi-driver/node.go | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/pkg/gce-pd-csi-driver/node.go b/pkg/gce-pd-csi-driver/node.go index 9c1960cc4..f96bdac14 100644 --- a/pkg/gce-pd-csi-driver/node.go +++ b/pkg/gce-pd-csi-driver/node.go @@ -512,9 +512,11 @@ func (ns *GCENodeServer) NodeStageVolume(ctx context.Context, req *csi.NodeStage } } - err = ns.DeviceCache.AddVolume(volumeID) - if err != nil { - klog.Warningf("Error adding volume %s to cache: %v", volumeID, err) + if ns.DeviceCache != nil { + err = ns.DeviceCache.AddVolume(volumeID) + if err != nil { + klog.Warningf("Error adding volume %s to cache: %v", volumeID, err) + } } klog.V(4).Infof("NodeStageVolume succeeded on %v to %s", volumeID, stagingTargetPath) @@ -631,7 +633,9 @@ func (ns *GCENodeServer) NodeUnstageVolume(ctx context.Context, req *csi.NodeUns } } - ns.DeviceCache.RemoveVolume(volumeID) + if ns.DeviceCache != nil { + ns.DeviceCache.RemoveVolume(volumeID) + } klog.V(4).Infof("NodeUnstageVolume succeeded on %v from %s", volumeID, stagingTargetPath) return &csi.NodeUnstageVolumeResponse{}, nil From b281364d1e839b822186937bcf56c1f76029dbc1 Mon Sep 17 00:00:00 2001 From: Engin Akdemir Date: Thu, 7 Aug 2025 20:37:26 +0000 Subject: [PATCH 47/51] Add support for NVMe disk types by using deviceutils Change volumes map to use symlink as key and add volumeID and real path to the deviceMappings object, this is because there can be multiple symlinks per volume Filter out caching and logging info on non pd/hyperdisk volumes Failure to get real path at add volume time is no longer an error the real path may be unavailable at this time Fix the device_windows.go NewDeviceCacheForNode parameters Add clarifying comments and remove excessive logging Move wg.Add out of goroutine to fix -verify presubmit --- cmd/gce-pd-csi-driver/main.go | 4 +- pkg/gce-pd-csi-driver/node_test.go | 6 +- pkg/linkcache/devices_linux.go | 103 +++++++++++++++++------------ pkg/linkcache/devices_windows.go | 3 +- pkg/linkcache/types.go | 17 +++-- test/e2e/tests/setup_e2e_test.go | 2 +- test/sanity/sanity_test.go | 2 +- 7 files changed, 83 insertions(+), 54 deletions(-) diff --git a/cmd/gce-pd-csi-driver/main.go b/cmd/gce-pd-csi-driver/main.go index 68f237856..b0883a444 100644 --- a/cmd/gce-pd-csi-driver/main.go +++ b/cmd/gce-pd-csi-driver/main.go @@ -98,6 +98,8 @@ var ( diskTopology = flag.Bool("disk-topology", false, "If set to true, the driver will add a disk-type.gke.io/[disk-type] topology label when the StorageClass has the use-allowed-disk-topology parameter set to true. That topology label is included in the Topologies returned in CreateVolumeResponse. This flag is disabled by default.") + diskCacheSyncPeriod = flag.Duration("disk-cache-sync-period", 10*time.Minute, "Period for the disk cache to check the /dev/disk/by-id/ directory and evaluate the symlinks") + version string ) @@ -276,7 +278,7 @@ func handle() { klog.Fatalf("Failed to get node info from API server: %v", err.Error()) } - deviceCache, err := linkcache.NewDeviceCacheForNode(ctx, 1*time.Minute, *nodeName) + deviceCache, err := linkcache.NewDeviceCacheForNode(ctx, *diskCacheSyncPeriod, *nodeName, driverName, deviceUtils) if err != nil { klog.Warningf("Failed to create device cache: %v", err.Error()) } else { diff --git a/pkg/gce-pd-csi-driver/node_test.go b/pkg/gce-pd-csi-driver/node_test.go index 0ac7805d3..77ef9c39c 100644 --- a/pkg/gce-pd-csi-driver/node_test.go +++ b/pkg/gce-pd-csi-driver/node_test.go @@ -46,7 +46,7 @@ const ( func getTestGCEDriver(t *testing.T) *GCEDriver { return getCustomTestGCEDriver(t, mountmanager.NewFakeSafeMounter(), deviceutils.NewFakeDeviceUtils(false), metadataservice.NewFakeService(), &NodeServerArgs{ - DeviceCache: linkcache.TestDeviceCache(1*time.Minute, linkcache.TestNodeWithVolumes([]string{defaultVolumeID})), + DeviceCache: linkcache.NewTestDeviceCache(1*time.Minute, linkcache.NewTestNodeWithVolumes([]string{defaultVolumeID})), }) } @@ -192,7 +192,7 @@ func TestNodeGetVolumeStats(t *testing.T) { mounter := mountmanager.NewFakeSafeMounterWithCustomExec(&testingexec.FakeExec{CommandScript: actionList}) gceDriver := getTestGCEDriverWithCustomMounter(t, mounter, &NodeServerArgs{ - DeviceCache: linkcache.TestDeviceCache(1*time.Minute, linkcache.TestNodeWithVolumes([]string{tc.volumeID})), + DeviceCache: linkcache.NewTestDeviceCache(1*time.Minute, linkcache.NewTestNodeWithVolumes([]string{tc.volumeID})), }) ns := gceDriver.ns @@ -1233,7 +1233,7 @@ func TestNodeStageVolume(t *testing.T) { } mounter := mountmanager.NewFakeSafeMounterWithCustomExec(&testingexec.FakeExec{CommandScript: actionList, ExactOrder: true}) gceDriver := getTestGCEDriverWithCustomMounter(t, mounter, &NodeServerArgs{ - DeviceCache: linkcache.TestDeviceCache(1*time.Minute, linkcache.TestNodeWithVolumes([]string{volumeID})), + DeviceCache: linkcache.NewTestDeviceCache(1*time.Minute, linkcache.NewTestNodeWithVolumes([]string{volumeID})), }) ns := gceDriver.ns ns.SysfsPath = tempDir + "/sys" diff --git a/pkg/linkcache/devices_linux.go b/pkg/linkcache/devices_linux.go index 96e4732b8..b6e367d1e 100644 --- a/pkg/linkcache/devices_linux.go +++ b/pkg/linkcache/devices_linux.go @@ -10,25 +10,26 @@ import ( v1 "k8s.io/api/core/v1" "k8s.io/klog/v2" "sigs.k8s.io/gcp-compute-persistent-disk-csi-driver/pkg/common" + "sigs.k8s.io/gcp-compute-persistent-disk-csi-driver/pkg/deviceutils" "sigs.k8s.io/gcp-compute-persistent-disk-csi-driver/pkg/k8sclient" ) const byIdDir = "/dev/disk/by-id" -func NewDeviceCacheForNode(ctx context.Context, period time.Duration, nodeName string) (*DeviceCache, error) { +func NewDeviceCacheForNode(ctx context.Context, period time.Duration, nodeName string, driverName string, deviceUtils deviceutils.DeviceUtils) (*DeviceCache, error) { node, err := k8sclient.GetNodeWithRetry(ctx, nodeName) if err != nil { return nil, fmt.Errorf("failed to get node %s: %w", nodeName, err) } - return newDeviceCacheForNode(period, node), nil + return newDeviceCacheForNode(period, node, driverName, deviceUtils), nil } -func TestDeviceCache(period time.Duration, node *v1.Node) *DeviceCache { - return newDeviceCacheForNode(period, node) +func NewTestDeviceCache(period time.Duration, node *v1.Node) *DeviceCache { + return newDeviceCacheForNode(period, node, "pd.csi.storage.gke.io", deviceutils.NewDeviceUtils()) } -func TestNodeWithVolumes(volumes []string) *v1.Node { +func NewTestNodeWithVolumes(volumes []string) *v1.Node { volumesInUse := make([]v1.UniqueVolumeName, len(volumes)) for i, volume := range volumes { volumesInUse[i] = v1.UniqueVolumeName("kubernetes.io/csi/pd.csi.storage.gke.io^" + volume) @@ -41,36 +42,37 @@ func TestNodeWithVolumes(volumes []string) *v1.Node { } } -func newDeviceCacheForNode(period time.Duration, node *v1.Node) *DeviceCache { +func newDeviceCacheForNode(period time.Duration, node *v1.Node, driverName string, deviceUtils deviceutils.DeviceUtils) *DeviceCache { deviceCache := &DeviceCache{ - volumes: make(map[string]deviceMapping), - period: period, - dir: byIdDir, + symlinks: make(map[string]deviceMapping), + period: period, + deviceUtils: deviceUtils, + dir: byIdDir, } // Look at the status.volumesInUse field. For each, take the last section - // of the string (after the last "/") and call AddVolume for that + // of the string (after the last "/") and call AddVolume for that. + // The expected format of the volume name is "kubernetes.io/csi/pd.csi.storage.gke.io^" for _, volume := range node.Status.VolumesInUse { - klog.Infof("Adding volume %s to cache", string(volume)) - vID, err := pvNameFromVolumeID(string(volume)) - if err != nil { - klog.Warningf("failure to retrieve name, skipping volume %q: %v", string(volume), err) + volumeName := string(volume) + tokens := strings.Split(volumeName, "^") + if len(tokens) != 2 { + klog.V(5).Infof("Skipping volume %q because splitting volumeName on `^` returns %d tokens, expected 2", volumeName, len(tokens)) + continue + } + + // The first token is of the form "kubernetes.io/csi/" or just "". + // We should check if it contains the driver name we are interested in. + if !strings.Contains(tokens[0], driverName) { continue } - deviceCache.AddVolume(vID) + klog.Infof("Adding volume %s to cache", string(volume)) + deviceCache.AddVolume(tokens[1]) } return deviceCache } -func pvNameFromVolumeID(volumeID string) (string, error) { - tokens := strings.Split(volumeID, "^") - if len(tokens) != 2 { - return "", fmt.Errorf("invalid volume ID, split on `^` returns %d tokens, expected 2", len(tokens)) - } - return tokens[1], nil -} - // Run since it needs an infinite loop to keep itself up to date func (d *DeviceCache) Run(ctx context.Context) { klog.Infof("Starting device cache watcher for directory %s with period %s", d.dir, d.period) @@ -87,7 +89,7 @@ func (d *DeviceCache) Run(ctx context.Context) { case <-ticker.C: d.listAndUpdate() - klog.Infof("Cache contents: %+v", d.volumes) + klog.Infof("Cache contents: %+v", d.symlinks) } } } @@ -106,21 +108,32 @@ func (d *DeviceCache) AddVolume(volumeID string) error { return fmt.Errorf("error getting device name: %w", err) } - // Look at the dir for a symlink that matches the pvName - symlink := filepath.Join(d.dir, "google-"+deviceName) - klog.Infof("Looking for symlink %s", symlink) - - realPath, err := filepath.EvalSymlinks(symlink) - if err != nil { - klog.Warningf("Error evaluating symlink for volume %s: %v", volumeID, err) - return nil + symlinks := d.deviceUtils.GetDiskByIdPaths(deviceName, "") + if len(symlinks) == 0 { + return fmt.Errorf("no symlink paths found for volume %s", volumeID) } - klog.Infof("Found real path %s for volume %s", realPath, volumeID) + d.mutex.Lock() + defer d.mutex.Unlock() - d.volumes[volumeID] = deviceMapping{ - symlink: symlink, - realPath: realPath, + // We may have multiple symlinks for a given device, we should add all of them. + for _, symlink := range symlinks { + realPath, err := filepath.EvalSymlinks(symlink) + if err != nil { + // This is not an error, as the symlink may not have been created yet. + // Leave real_path empty; the periodic check will update it. + klog.V(5).Infof("Could not evaluate symlink %s, will retry: %v", symlink, err) + realPath = "" + } else { + klog.Infof("Found real path %s for volume %s", realPath, volumeID) + } + // The key is the symlink path. The value contains the evaluated + // real path and the original volumeID for better logging. + d.symlinks[symlink] = deviceMapping{ + volumeID: volumeID, + realPath: realPath, + } + klog.V(4).Infof("Added volume %s to cache with symlink %s", volumeID, symlink) } return nil @@ -129,25 +142,31 @@ func (d *DeviceCache) AddVolume(volumeID string) error { // Remove the volume from the cache. func (d *DeviceCache) RemoveVolume(volumeID string) { klog.Infof("Removing volume %s from cache", volumeID) - delete(d.volumes, volumeID) + d.mutex.Lock() + defer d.mutex.Unlock() + for symlink, device := range d.symlinks { + if device.volumeID == volumeID { + delete(d.symlinks, symlink) + } + } } func (d *DeviceCache) listAndUpdate() { - for volumeID, device := range d.volumes { + for symlink, device := range d.symlinks { // Evaluate the symlink - realPath, err := filepath.EvalSymlinks(device.symlink) + realPath, err := filepath.EvalSymlinks(symlink) if err != nil { - klog.Warningf("Error evaluating symlink for volume %s: %v", volumeID, err) + klog.Warningf("Error evaluating symlink for volume %s: %v", device.volumeID, err) continue } // Check if the realPath has changed if realPath != device.realPath { - klog.Warningf("Change in device path for volume %s (symlink: %s), previous path: %s, new path: %s", volumeID, device.symlink, device.realPath, realPath) + klog.Warningf("Change in device path for volume %s (symlink: %s), previous path: %s, new path: %s", device.volumeID, symlink, device.realPath, realPath) // Update the cache with the new realPath device.realPath = realPath - d.volumes[volumeID] = device + d.symlinks[symlink] = device } } } diff --git a/pkg/linkcache/devices_windows.go b/pkg/linkcache/devices_windows.go index b767556ea..d7937bc0b 100644 --- a/pkg/linkcache/devices_windows.go +++ b/pkg/linkcache/devices_windows.go @@ -7,9 +7,10 @@ import ( "time" "k8s.io/klog/v2" + "sigs.k8s.io/gcp-compute-persistent-disk-csi-driver/pkg/deviceutils" ) -func NewDeviceCacheForNode(ctx context.Context, period time.Duration, nodeName string) (*DeviceCache, error) { +func NewDeviceCacheForNode(ctx context.Context, period time.Duration, nodeName string, driverName string, deviceUtils deviceutils.DeviceUtils) (*DeviceCache, error) { klog.Infof("NewDeviceCacheForNode is not implemented for Windows") return nil, nil } diff --git a/pkg/linkcache/types.go b/pkg/linkcache/types.go index b8dcae3fb..04d4688eb 100644 --- a/pkg/linkcache/types.go +++ b/pkg/linkcache/types.go @@ -1,15 +1,22 @@ package linkcache -import "time" +import ( + "sync" + "time" + + "sigs.k8s.io/gcp-compute-persistent-disk-csi-driver/pkg/deviceutils" +) type deviceMapping struct { - symlink string + volumeID string realPath string } type DeviceCache struct { - volumes map[string]deviceMapping - period time.Duration + mutex sync.Mutex + symlinks map[string]deviceMapping + period time.Duration // dir is the directory to look for device symlinks - dir string + dir string + deviceUtils deviceutils.DeviceUtils } diff --git a/test/e2e/tests/setup_e2e_test.go b/test/e2e/tests/setup_e2e_test.go index bd6de4581..a822a972b 100644 --- a/test/e2e/tests/setup_e2e_test.go +++ b/test/e2e/tests/setup_e2e_test.go @@ -120,8 +120,8 @@ var _ = BeforeSuite(func() { tcc <- NewDefaultTestContext(curZone, strconv.Itoa(randInt)) }(zone, j) } + wg.Add(1) go func(curZone string) { - wg.Add(1) defer GinkgoRecover() defer wg.Done() hdtcc <- NewTestContext(curZone, *hdMinCpuPlatform, *hdMachineType, "0") diff --git a/test/sanity/sanity_test.go b/test/sanity/sanity_test.go index 408dc047e..5ce72493c 100644 --- a/test/sanity/sanity_test.go +++ b/test/sanity/sanity_test.go @@ -78,7 +78,7 @@ func TestSanity(t *testing.T) { EnableDeviceInUseCheck: true, DeviceInUseTimeout: 0, EnableDataCache: enableDataCache, - DeviceCache: linkcache.TestDeviceCache(1*time.Minute, linkcache.TestNodeWithVolumes([]string{})), + DeviceCache: linkcache.NewTestDeviceCache(1*time.Minute, linkcache.NewTestNodeWithVolumes([]string{})), } // Initialize GCE Driver From a00c59a300072c020a70ea50f7bfcfdacba8befb Mon Sep 17 00:00:00 2001 From: Elijah Rodriguez-Beltran Date: Thu, 25 Sep 2025 02:12:47 +0000 Subject: [PATCH 48/51] Add NodeStageVolume disk size validation before mounting --- pkg/common/constants.go | 1 + pkg/gce-pd-csi-driver/controller.go | 4 ++- pkg/gce-pd-csi-driver/node.go | 11 ++++++ pkg/gce-pd-csi-driver/node_test.go | 54 +++++++++++++++++++++++++++++ 4 files changed, 69 insertions(+), 1 deletion(-) diff --git a/pkg/common/constants.go b/pkg/common/constants.go index 62d8a6bc9..250105836 100644 --- a/pkg/common/constants.go +++ b/pkg/common/constants.go @@ -48,6 +48,7 @@ const ( ContextDataCacheSize = "data-cache-size" ContextDataCacheMode = "data-cache-mode" + ContextDiskSizeGB = "disk-size" // Keys in the publish context ContexLocalSsdCacheSize = "local-ssd-cache-size" diff --git a/pkg/gce-pd-csi-driver/controller.go b/pkg/gce-pd-csi-driver/controller.go index f77d0982b..e17fa0e84 100644 --- a/pkg/gce-pd-csi-driver/controller.go +++ b/pkg/gce-pd-csi-driver/controller.go @@ -21,6 +21,7 @@ import ( "math/rand" neturl "net/url" "sort" + "strconv" "strings" "time" @@ -1113,7 +1114,7 @@ func (gceCS *GCEControllerServer) executeControllerPublishVolume(ctx context.Con volumeCapability := req.GetVolumeCapability() pubVolResp := &csi.ControllerPublishVolumeResponse{ - PublishContext: nil, + PublishContext: map[string]string{}, } // Set data cache publish context @@ -1162,6 +1163,7 @@ func (gceCS *GCEControllerServer) executeControllerPublishVolume(ctx context.Con } return nil, common.LoggedError("Failed to getDisk: ", err), disk } + pubVolResp.PublishContext[common.ContextDiskSizeGB] = strconv.FormatInt(disk.GetSizeGb(), 10) instance, err := gceCS.CloudProvider.GetInstanceOrError(ctx, project, instanceZone, instanceName) if err != nil { if gce.IsGCENotFoundError(err) { diff --git a/pkg/gce-pd-csi-driver/node.go b/pkg/gce-pd-csi-driver/node.go index f96bdac14..ce8e6afbb 100644 --- a/pkg/gce-pd-csi-driver/node.go +++ b/pkg/gce-pd-csi-driver/node.go @@ -435,6 +435,17 @@ func (ns *GCENodeServer) NodeStageVolume(ctx context.Context, req *csi.NodeStage klog.V(4).Infof("CSI volume is read-only, mounting with extra option ro") } + // If a disk size is provided in the publish context, ensure it matches the actual device size. + if expectedSize := req.GetPublishContext()[common.ContextDiskSizeGB]; expectedSize != "" { + actualSize, err := getBlockSizeBytes(devicePath, ns.Mounter) + if err != nil { + return nil, status.Error(codes.Internal, fmt.Sprintf("failed to get block size for '%s': %v", devicePath, err.Error())) + } + if expectedSize != strconv.FormatInt(actualSize, 10) { + return nil, status.Error(codes.Internal, fmt.Sprintf("expected block size %q, got %q", expectedSize, strconv.FormatInt(actualSize, 10))) + } + } + err = ns.formatAndMount(devicePath, stagingTargetPath, fstype, options, ns.Mounter) if err != nil { // If a volume is created from a content source like snapshot or cloning, the filesystem might get marked diff --git a/pkg/gce-pd-csi-driver/node_test.go b/pkg/gce-pd-csi-driver/node_test.go index 77ef9c39c..e7f4d927e 100644 --- a/pkg/gce-pd-csi-driver/node_test.go +++ b/pkg/gce-pd-csi-driver/node_test.go @@ -32,6 +32,7 @@ import ( "google.golang.org/grpc/codes" "google.golang.org/grpc/status" "k8s.io/mount-utils" + "sigs.k8s.io/gcp-compute-persistent-disk-csi-driver/pkg/common" "sigs.k8s.io/gcp-compute-persistent-disk-csi-driver/pkg/deviceutils" metadataservice "sigs.k8s.io/gcp-compute-persistent-disk-csi-driver/pkg/gce-cloud-provider/metadata" "sigs.k8s.io/gcp-compute-persistent-disk-csi-driver/pkg/linkcache" @@ -1104,6 +1105,41 @@ func TestNodeStageVolume(t *testing.T) { }, }, }, + { + name: "Valid request with disk size check", + req: &csi.NodeStageVolumeRequest{ + VolumeId: volumeID, + StagingTargetPath: stagingPath, + VolumeCapability: stdVolCap, + PublishContext: map[string]string{common.ContextDiskSizeGB: "1"}, + }, + deviceSize: 1, + blockExtSize: 1, + readonlyBit: "1", + expResize: false, + expCommandList: []fakeCmd{ + { + cmd: "blockdev", + args: "--getsize64 /dev/disk/fake-path", + stdout: "%v", + }, + { + cmd: "blkid", + args: "-p -s TYPE -s PTTYPE -o export /dev/disk/fake-path", + stdout: "DEVNAME=/dev/sdb\nTYPE=%v", + }, + { + cmd: "fsck", + args: "-a /dev/disk/fake-path", + stdout: "", + }, + { + cmd: "blockdev", + args: "--getro /dev/disk/fake-path", + stdout: "%v", + }, + }, + }, { name: "Invalid request (Bad Access Mode)", req: &csi.NodeStageVolumeRequest{ @@ -1183,6 +1219,24 @@ func TestNodeStageVolume(t *testing.T) { }, expErrCode: codes.InvalidArgument, }, + { + name: "Invalid request, block size mismatch", + req: &csi.NodeStageVolumeRequest{ + VolumeId: volumeID, + StagingTargetPath: stagingPath, + VolumeCapability: stdVolCap, + PublishContext: map[string]string{common.ContextDiskSizeGB: "10"}, + }, + deviceSize: 5, + expErrCode: codes.Internal, + expCommandList: []fakeCmd{ + { + cmd: "blockdev", + args: "--getsize64 /dev/disk/fake-path", + stdout: "%v", + }, + }, + }, } for _, tc := range testCases { t.Run(tc.name, func(t *testing.T) { From c2fe2e7d2dabf359620d84135e0aadb0230cd3d7 Mon Sep 17 00:00:00 2001 From: Elijah Rodriguez-Beltran Date: Fri, 26 Sep 2025 18:26:03 +0000 Subject: [PATCH 49/51] Flag protect disk validation --- cmd/gce-pd-csi-driver/main.go | 5 ++++- pkg/gce-pd-csi-driver/controller.go | 10 +++++++--- pkg/gce-pd-csi-driver/gce-pd-driver.go | 1 + 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/cmd/gce-pd-csi-driver/main.go b/cmd/gce-pd-csi-driver/main.go index b0883a444..9f3f1554d 100644 --- a/cmd/gce-pd-csi-driver/main.go +++ b/cmd/gce-pd-csi-driver/main.go @@ -100,6 +100,8 @@ var ( diskCacheSyncPeriod = flag.Duration("disk-cache-sync-period", 10*time.Minute, "Period for the disk cache to check the /dev/disk/by-id/ directory and evaluate the symlinks") + enableDiskSizeValidation = flag.Bool("enable-disk-size-validation", false, "If set to true, the driver will validate that the requested disk size is matches the physical disk size. This flag is disabled by default.") + version string ) @@ -251,7 +253,8 @@ func handle() { maxBackoffDuration := time.Duration(*errorBackoffMaxDurationMs) * time.Millisecond // TODO(2042): Move more of the constructor args into this struct args := &driver.GCEControllerServerArgs{ - EnableDiskTopology: *diskTopology, + EnableDiskTopology: *diskTopology, + EnableDiskSizeValidation: *enableDiskSizeValidation, } controllerServer = driver.NewControllerServer(gceDriver, cloudProvider, initialBackoffDuration, maxBackoffDuration, fallbackRequisiteZones, *enableStoragePoolsFlag, *enableDataCacheFlag, multiZoneVolumeHandleConfig, listVolumesConfig, provisionableDisksConfig, *enableHdHAFlag, args) diff --git a/pkg/gce-pd-csi-driver/controller.go b/pkg/gce-pd-csi-driver/controller.go index e17fa0e84..8526b2bf7 100644 --- a/pkg/gce-pd-csi-driver/controller.go +++ b/pkg/gce-pd-csi-driver/controller.go @@ -122,11 +122,13 @@ type GCEControllerServer struct { // new RPC methods that might be introduced in future versions of the spec. csi.UnimplementedControllerServer - EnableDiskTopology bool + EnableDiskTopology bool + EnableDiskSizeValidation bool } type GCEControllerServerArgs struct { - EnableDiskTopology bool + EnableDiskTopology bool + EnableDiskSizeValidation bool } type MultiZoneVolumeHandleConfig struct { @@ -1163,7 +1165,9 @@ func (gceCS *GCEControllerServer) executeControllerPublishVolume(ctx context.Con } return nil, common.LoggedError("Failed to getDisk: ", err), disk } - pubVolResp.PublishContext[common.ContextDiskSizeGB] = strconv.FormatInt(disk.GetSizeGb(), 10) + if gceCS.EnableDiskSizeValidation && pubVolResp.GetPublishContext() != nil { + pubVolResp.PublishContext[common.ContextDiskSizeGB] = strconv.FormatInt(disk.GetSizeGb(), 10) + } instance, err := gceCS.CloudProvider.GetInstanceOrError(ctx, project, instanceZone, instanceName) if err != nil { if gce.IsGCENotFoundError(err) { diff --git a/pkg/gce-pd-csi-driver/gce-pd-driver.go b/pkg/gce-pd-csi-driver/gce-pd-driver.go index 83ff9767a..c1740df80 100644 --- a/pkg/gce-pd-csi-driver/gce-pd-driver.go +++ b/pkg/gce-pd-csi-driver/gce-pd-driver.go @@ -178,6 +178,7 @@ func NewControllerServer(gceDriver *GCEDriver, cloudProvider gce.GCECompute, err provisionableDisksConfig: provisionableDisksConfig, enableHdHA: enableHdHA, EnableDiskTopology: args.EnableDiskTopology, + EnableDiskSizeValidation: args.EnableDiskSizeValidation, } } From db5f1ba7628833df230350c04f1dae5548373780 Mon Sep 17 00:00:00 2001 From: Jan Safranek Date: Wed, 8 Nov 2023 13:27:55 +0100 Subject: [PATCH 50/51] UPSTREAM: : Add OpenShift files and remove .github go mod vendor && go mod tidy --- .ci-operator.yaml | 4 ++ .github/PULL_REQUEST_TEMPLATE.md | 40 ---------------- .github/dependabot.yml | 53 --------------------- .snyk | 8 ++++ Dockerfile.openshift | 18 +++++++ Makefile | 3 +- OWNERS | 26 +--------- release-tools/KUBERNETES_CSI_OWNERS_ALIASES | 46 ++++-------------- release-tools/OWNERS | 8 ---- 9 files changed, 43 insertions(+), 163 deletions(-) create mode 100644 .ci-operator.yaml delete mode 100644 .github/PULL_REQUEST_TEMPLATE.md delete mode 100644 .github/dependabot.yml create mode 100644 .snyk create mode 100644 Dockerfile.openshift delete mode 100644 release-tools/OWNERS diff --git a/.ci-operator.yaml b/.ci-operator.yaml new file mode 100644 index 000000000..461415cbc --- /dev/null +++ b/.ci-operator.yaml @@ -0,0 +1,4 @@ +build_root_image: + name: release + namespace: openshift + tag: rhel-9-release-golang-1.24-openshift-4.20 diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md deleted file mode 100644 index d70526403..000000000 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ /dev/null @@ -1,40 +0,0 @@ - - -**What type of PR is this?** -> Uncomment only one ` /kind <>` line, hit enter to put that in a new line, and remove leading whitespaces from that line: -> -> /kind api-change -> /kind bug -> /kind cleanup -> /kind design -> /kind documentation -> /kind failing-test -> /kind feature -> /kind flake - -**What this PR does / why we need it**: - -**Which issue(s) this PR fixes**: - -Fixes # - -**Special notes for your reviewer**: - -**Does this PR introduce a user-facing change?**: - -```release-note - -``` diff --git a/.github/dependabot.yml b/.github/dependabot.yml deleted file mode 100644 index 7b044a09b..000000000 --- a/.github/dependabot.yml +++ /dev/null @@ -1,53 +0,0 @@ -version: 2 -enable-beta-ecosystems: true -updates: -- package-ecosystem: "docker" - directory: "/" - schedule: - interval: weekly - labels: - - "area/dependency" - - "release-note-none" - - "ok-to-test" - - "kind/cleanup" -- package-ecosystem: gomod - directory: "/" - allow: - - dependency-type: "all" - schedule: - interval: weekly - groups: - golang-x: - patterns: - - "golang.org/x*" - cloud-go: - patterns: - - "cloud.google.com/go*" - google-golang: - patterns: - - "google.golang.org*" - onsi: - patterns: - - "github.com/onsi*" - k8s-dependencies: - patterns: - - "k8s.io*" - - "sigs.k8s.io*" - - "github.com/kubernetes-csi*" - github-dependencies: - patterns: - - "*" - exclude-patterns: - - "golang.org/x*" - - "cloud.google.com/go*" - - "google.golang.org*" - - "github.com/onsi*" - - "k8s.io*" - - "sigs.k8s.io*" - - "github.com/kubernetes-csi*" - labels: - - "area/dependency" - - "release-note-none" - - "ok-to-test" - - "kind/cleanup" - open-pull-requests-limit: 10 diff --git a/.snyk b/.snyk new file mode 100644 index 000000000..390fbec67 --- /dev/null +++ b/.snyk @@ -0,0 +1,8 @@ +# References: +# https://docs.snyk.io/scan-applications/snyk-code/using-snyk-code-from-the-cli/excluding-directories-and-files-from-the-snyk-code-cli-test +# https://docs.snyk.io/snyk-cli/commands/ignore +exclude: + global: + - vendor/** + - release-tools/** + - test/** diff --git a/Dockerfile.openshift b/Dockerfile.openshift new file mode 100644 index 000000000..ce3cbe567 --- /dev/null +++ b/Dockerfile.openshift @@ -0,0 +1,18 @@ +FROM registry.ci.openshift.org/ocp/builder:rhel-9-golang-1.24-openshift-4.20 AS builder +WORKDIR /go/src/github.com/kubernetes-sigs/gcp-compute-persistent-disk-csi-driver +COPY . . +# Skip Windows driver build +RUN make gce-pd-driver + +FROM registry.ci.openshift.org/ocp/4.20:base-rhel9 + +# Get all deps +# nvme-cli and /usr/bin/xxd are deps of google_nvme_id +RUN yum update -y && \ + yum install --setopt=tsflags=nodocs -y e2fsprogs xfsprogs util-linux nvme-cli /usr/lib/udev/scsi_id /usr/bin/xxd && \ + yum clean all && rm -rf /var/cache/yum/* && \ + mkdir -p /lib/udev_containerized && cp /usr/lib/udev/scsi_id /lib/udev_containerized/scsi_id # The driver assumes this path + +COPY --from=builder /go/src/github.com/kubernetes-sigs/gcp-compute-persistent-disk-csi-driver/bin/gce-pd-csi-driver /usr/bin/ +COPY --from=builder /go/src/github.com/kubernetes-sigs/gcp-compute-persistent-disk-csi-driver/deploy/kubernetes/udev/google_nvme_id /lib/udev_containerized/google_nvme_id +ENTRYPOINT ["/usr/bin/gce-pd-csi-driver"] diff --git a/Makefile b/Makefile index 8a375b916..fa1ea91bb 100644 --- a/Makefile +++ b/Makefile @@ -38,7 +38,8 @@ endif all: gce-pd-driver gce-pd-driver-windows gce-pd-driver: require-GCE_PD_CSI_STAGING_VERSION mkdir -p bin - CGO_ENABLED=0 go build -mod=vendor -gcflags=$(GCFLAGS) -ldflags "-extldflags=static -X main.version=$(STAGINGVERSION)" -o bin/${DRIVERBINARY} ./cmd/gce-pd-csi-driver/ + # OpenShift carry: remove -extldflags=static to compile with FIPS OpenSSL + CGO_ENABLED=0 go build -mod=vendor -gcflags=$(GCFLAGS) -ldflags "-X main.version=$(STAGINGVERSION)" -o bin/${DRIVERBINARY} ./cmd/gce-pd-csi-driver/ gce-pd-driver-windows: require-GCE_PD_CSI_STAGING_VERSION ifeq (${GOARCH}, amd64) diff --git a/OWNERS b/OWNERS index 7540388a0..660fd9dbd 100644 --- a/OWNERS +++ b/OWNERS @@ -1,25 +1,3 @@ -reviewers: - - amacaskill - - leiyiz - - mattcary - - msau42 - - saikat-royc - - sunnylovestiramisu - - pwschuurman - - tyuchn - - tonyzhc - - juliankatz - - hajiler approvers: - - amacaskill - - leiyiz - - mattcary - - msau42 - - saikat-royc - - sunnylovestiramisu - - pwschuurman - - tyuchn -emeritus_reviewers: - - davidz627 - - jingxu97 - - saad-ali +- openshift-storage-maintainers +component: "Storage / Kubernetes External Components" diff --git a/release-tools/KUBERNETES_CSI_OWNERS_ALIASES b/release-tools/KUBERNETES_CSI_OWNERS_ALIASES index 344fbe4db..8cb9d2c29 100644 --- a/release-tools/KUBERNETES_CSI_OWNERS_ALIASES +++ b/release-tools/KUBERNETES_CSI_OWNERS_ALIASES @@ -1,38 +1,10 @@ -# See the OWNERS docs: https://git.k8s.io/community/contributors/guide/owners.md - aliases: - - # SIG-Storage chairs and leads should always have approval rights in all repos. - # Others may be added as needed here or in each repo. - kubernetes-csi-approvers: - - jsafrane - - msau42 - - saad-ali - - xing-yang - - # Reviewers are automatically assigned to new PRs. The following - # reviewers will be active in all repos. Other reviewers can be - # added in each repo. - # - # Reviewers are encouraged to set the "Busy" flag in their GitHub status - # when they are temporarily unable to review PRs. - kubernetes-csi-reviewers: - - andyzhangx - - chrishenzie - - ggriffiths - - gnufied - - humblec - - j-griffith - - Jiawei0227 - - jingxu97 - - jsafrane - - pohly - - RaunakShah - - xing-yang - -# This documents who previously contributed to Kubernetes-CSI -# as approver. -emeritus_approvers: -- lpabon -- sbezverk -- vladimirvivien + openshift-storage-maintainers: + - jsafrane + - tsmetana + - gnufied + - dobsonj + - RomanBednar + - mpatlasov + - dfajmon + - rhrmo diff --git a/release-tools/OWNERS b/release-tools/OWNERS deleted file mode 100644 index 1fb74587b..000000000 --- a/release-tools/OWNERS +++ /dev/null @@ -1,8 +0,0 @@ -# See the OWNERS docs: https://git.k8s.io/community/contributors/guide/owners.md - -approvers: -- kubernetes-csi-approvers -- pohly - -reviewers: -- kubernetes-csi-reviewers From 9c4723a0ebaebc0074f328289b9c669722fec048 Mon Sep 17 00:00:00 2001 From: AOS Automation Release Team Date: Tue, 30 Sep 2025 00:15:08 +0000 Subject: [PATCH 51/51] UPSTREAM: : Updating ose-gcp-pd-csi-driver-container image to be consistent with ART for 4.21 Reconciling with https://github.com/openshift/ocp-build-data/tree/4fbe3fab45239dc4be6f5d9d98a0bf36e0274ec9/images/ose-gcp-pd-csi-driver.yml --- .ci-operator.yaml | 2 +- Dockerfile.openshift | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.ci-operator.yaml b/.ci-operator.yaml index 461415cbc..e307e5af6 100644 --- a/.ci-operator.yaml +++ b/.ci-operator.yaml @@ -1,4 +1,4 @@ build_root_image: name: release namespace: openshift - tag: rhel-9-release-golang-1.24-openshift-4.20 + tag: rhel-9-release-golang-1.24-openshift-4.21 diff --git a/Dockerfile.openshift b/Dockerfile.openshift index ce3cbe567..b186027d3 100644 --- a/Dockerfile.openshift +++ b/Dockerfile.openshift @@ -1,10 +1,10 @@ -FROM registry.ci.openshift.org/ocp/builder:rhel-9-golang-1.24-openshift-4.20 AS builder +FROM registry.ci.openshift.org/ocp/builder:rhel-9-golang-1.24-openshift-4.21 AS builder WORKDIR /go/src/github.com/kubernetes-sigs/gcp-compute-persistent-disk-csi-driver COPY . . # Skip Windows driver build RUN make gce-pd-driver -FROM registry.ci.openshift.org/ocp/4.20:base-rhel9 +FROM registry.ci.openshift.org/ocp/4.21:base-rhel9 # Get all deps # nvme-cli and /usr/bin/xxd are deps of google_nvme_id