From fe623f0a66b3e7f65e7c6930bc398196f09d39fe Mon Sep 17 00:00:00 2001 From: Don Khan Date: Thu, 22 Aug 2024 01:14:45 -0400 Subject: [PATCH 1/3] Update CODEOWNERS based on new component ownership. --- .github/CODEOWNERS | 29 +++++++---------------------- 1 file changed, 7 insertions(+), 22 deletions(-) diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 1c8cb1ba..e9332729 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -1,31 +1,16 @@ # CODEOWNERS # -# documentation for this file can be found at: +# Documentation for this file can be found at: # https://help.github.com/en/articles/about-code-owners + # These are the default owners for the code and will # be requested for review when someone opens a pull request. -# order is alphabetical for easier maintenance. +# Order is alphabetical for easier maintenance. # -# Abhilash (abhi16394) +# Abhilash Muralidhara (abhi16394) # Adarsh Kumar Yadav (adarsh-dell) # Akshay Saini (AkshaySainiDell) -# Aaron Tye (atye) -# Ashley Joy (ashleyvjoy) -# Bharath Sreekanth (bharathsreekanth) -# Deepak Ghivari (Deepak-Ghivari) -# Emily Kinuthia (EmilyKatdell) -# Jacob Grosner (JacobGros) -# Jooseppi Luna (jooseppi-luna) -# Rajshree Khare (khareRajshree) -# Kshitija Kakde (KshitijaKakde) -# Kumar Karthik Gosa (kumarkgosa) -# Abrar Basha (mbasha-dell) -# Matt Schmaelzle (mjsdell) -# Prabhu Revur (prabhu-dell) -# Rishabh Raj (rishabhatdell) -# Sakshi Garg (sakshi-garg1) -# Shayna Finocchiaro (shaynafinocchiaro) -# Surya Prakash Gupta (suryagupta4) - +# Don Khan (donatwork) -* @abhi16394 @adarsh-dell @AkshaySainiDell @atye @ashleyvjoy @bharathsreekanth @Deepak-Ghivari @EmilyKatdell @JacobGros @jooseppi-luna @khareRajshree @KshitijaKakde @kumarkgosa @mbasha-dell @mjsdell @prabhu-dell @rishabhatdell @sakshi-garg1 @shaynafinocchiaro @suryagupta4 +# for all files +* @abhi16394 @adarsh-dell @AkshaySainiDell @donatwork From f88fb582068404573977c9fab0904b21201f7a06 Mon Sep 17 00:00:00 2001 From: Don Khan Date: Thu, 22 Aug 2024 06:43:54 -0400 Subject: [PATCH 2/3] Fix unit tests. --- service/controller.go | 18 +++++++++--------- service/replication.go | 2 +- service/service.go | 18 +++++++++--------- service/step_defs_test.go | 8 ++++---- test/integration/step_defs_test.go | 18 +++++++++--------- 5 files changed, 32 insertions(+), 32 deletions(-) diff --git a/service/controller.go b/service/controller.go index b7b7229c..2df20d72 100644 --- a/service/controller.go +++ b/service/controller.go @@ -524,7 +524,7 @@ func (s *service) CreateVolume( // volume already exists, look it up by name id, err = s.adminClients[systemID].FindVolumeID(name) if err != nil { - return nil, status.Errorf(codes.Internal, err.Error()) + return nil, status.Errorf(codes.Internal, "%s", err.Error()) } } else { id = createResp.ID @@ -1243,9 +1243,9 @@ func (s *service) ControllerPublishVolume( sdcIPs, err := s.getSDCIPs(nodeID, systemID) if err != nil { - return nil, status.Errorf(codes.NotFound, err.Error()) + return nil, status.Errorf(codes.NotFound, "%s", err.Error()) } else if len(sdcIPs) == 0 { - return nil, status.Errorf(codes.NotFound, "received empty sdcIPs") + return nil, status.Errorf(codes.NotFound, "%s", "received empty sdcIPs") } externalAccess := s.opts.ExternalAccess @@ -1284,7 +1284,7 @@ func (s *service) ControllerPublishVolume( sdcID, err := s.getSDCID(nodeID, systemID) if err != nil { - return nil, status.Errorf(codes.NotFound, err.Error()) + return nil, status.Errorf(codes.NotFound, "%s", err.Error()) } vc := req.GetVolumeCapability() @@ -1356,7 +1356,7 @@ func (s *service) ControllerPublishVolume( allowMultipleMappings, err = shouldAllowMultipleMappings(isBlock, am) if err != nil { - return nil, status.Errorf(codes.InvalidArgument, err.Error()) + return nil, status.Errorf(codes.InvalidArgument, "%s", err.Error()) } if err := validateAccessType(am, isBlock); err != nil { @@ -1365,7 +1365,7 @@ func (s *service) ControllerPublishVolume( } else { allowMultipleMappings, err = shouldAllowMultipleMappings(isBlock, am) if err != nil { - return nil, status.Errorf(codes.InvalidArgument, err.Error()) + return nil, status.Errorf(codes.InvalidArgument, "%s", err.Error()) } } @@ -1566,9 +1566,9 @@ func (s *service) ControllerUnpublishVolume( sdcIPs, err := s.getSDCIPs(nodeID, systemID) if err != nil { - return nil, status.Errorf(codes.NotFound, err.Error()) + return nil, status.Errorf(codes.NotFound, "%s", err.Error()) } else if len(sdcIPs) == 0 { - return nil, status.Errorf(codes.NotFound, "received empty sdcIPs") + return nil, status.Errorf(codes.NotFound, "%s", "received empty sdcIPs") } // unexport for NFS @@ -1594,7 +1594,7 @@ func (s *service) ControllerUnpublishVolume( sdcID, err := s.getSDCID(nodeID, systemID) if err != nil { - return nil, status.Errorf(codes.NotFound, err.Error()) + return nil, status.Errorf(codes.NotFound, "%s", err.Error()) } // check if volume is attached to node at all diff --git a/service/replication.go b/service/replication.go index 1819b5b7..2ac837c8 100644 --- a/service/replication.go +++ b/service/replication.go @@ -502,7 +502,7 @@ func (s *service) ExecuteAction(ctx context.Context, req *replication.ExecuteAct client, err := s.verifySystem(localSystem) if err != nil { - return nil, status.Errorf(codes.FailedPrecondition, err.Error()) + return nil, status.Errorf(codes.FailedPrecondition, "%s", err.Error()) } group, err := s.getReplicationConsistencyGroupByID(localSystem, protectionGroupID) diff --git a/service/service.go b/service/service.go index 34362fd9..2faa6c6e 100644 --- a/service/service.go +++ b/service/service.go @@ -800,13 +800,13 @@ func getArrayConfig(ctx context.Context) (map[string]*ArrayConnectionData, error if err != nil { Log.Errorf("Found error %v while checking stat of file %s ", err, ArrayConfigFile) if os.IsNotExist(err) { - return nil, fmt.Errorf(fmt.Sprintf("File %s does not exist", ArrayConfigFile)) + return nil, fmt.Errorf("File %s does not exist", ArrayConfigFile) } } config, err := os.ReadFile(filepath.Clean(ArrayConfigFile)) if err != nil { - return nil, fmt.Errorf(fmt.Sprintf("File %s errors: %v", ArrayConfigFile, err)) + return nil, fmt.Errorf("File %s errors: %v", ArrayConfigFile, err) } if string(config) != "" { @@ -815,30 +815,30 @@ func getArrayConfig(ctx context.Context) (map[string]*ArrayConnectionData, error config, _ = yaml.JSONToYAML(config) err = yaml.Unmarshal(config, &creds) if err != nil { - return nil, fmt.Errorf(fmt.Sprintf("Unable to parse the credentials: %v", err)) + return nil, fmt.Errorf("Unable to parse the credentials: %v", err) } if len(creds) == 0 { - return nil, fmt.Errorf("no arrays are provided in vxflexos-creds secret") + return nil, fmt.Errorf("%s", "no arrays are provided in vxflexos-creds secret") } noOfDefaultArray := 0 for i, c := range creds { systemID := c.SystemID if _, ok := arrays[systemID]; ok { - return nil, fmt.Errorf(fmt.Sprintf("duplicate system ID %s found at index %d", systemID, i)) + return nil, fmt.Errorf("duplicate system ID %s found at index %d", systemID, i) } if systemID == "" { - return nil, fmt.Errorf(fmt.Sprintf("invalid value for system name at index %d", i)) + return nil, fmt.Errorf("invalid value for system name at index %d", i) } if c.Username == "" { - return nil, fmt.Errorf(fmt.Sprintf("invalid value for Username at index %d", i)) + return nil, fmt.Errorf("invalid value for Username at index %d", i) } if c.Password == "" { - return nil, fmt.Errorf(fmt.Sprintf("invalid value for Password at index %d", i)) + return nil, fmt.Errorf("invalid value for Password at index %d", i) } if c.Endpoint == "" { - return nil, fmt.Errorf(fmt.Sprintf("invalid value for Endpoint at index %d", i)) + return nil, fmt.Errorf("invalid value for Endpoint at index %d", i) } // ArrayConnectionData if c.AllSystemNames != "" { diff --git a/service/step_defs_test.go b/service/step_defs_test.go index 74418674..1e2310b3 100644 --- a/service/step_defs_test.go +++ b/service/step_defs_test.go @@ -2144,7 +2144,7 @@ func (f *feature) iCallListVolumesWith(maxEntriesString, startingToken string) e default: return fmt.Errorf(`want start token of "next", "none", "invalid", "larger", got %q`, st) } - req = f.getControllerListVolumesRequest(int32(maxEntries), startingToken) + req = f.getControllerListVolumesRequest(int32(maxEntries), startingToken) // #nosec: G115 false positive f.listVolumesRequest = req } log.Printf("Calling ListVolumes with req=%+v", f.listVolumesRequest) @@ -2401,7 +2401,7 @@ func (f *feature) aControllerPublishedEphemeralVolume() error { if err != nil { err = os.MkdirAll(nodePublishSymlinkDir, 0o777) if err != nil { - fmt.Printf("by-id: " + err.Error()) + fmt.Printf("by-id: %s", err.Error()) } } @@ -2472,7 +2472,7 @@ func (f *feature) aControllerPublishedVolume() error { if err != nil { err = os.MkdirAll(nodePublishSymlinkDir, 0o777) if err != nil { - fmt.Printf("by-id: " + err.Error()) + fmt.Printf("by-id: %s", err.Error()) } } @@ -3667,7 +3667,7 @@ func (f *feature) iCallListSnapshotsWithMaxentriesAndStartingtoken(maxEntriesStr return nil } ctx := new(context.Context) - req := &csi.ListSnapshotsRequest{MaxEntries: int32(maxEntries), StartingToken: startingTokenString} + req := &csi.ListSnapshotsRequest{MaxEntries: int32(maxEntries), StartingToken: startingTokenString} // #nosec: G115 false positive f.listSnapshotsRequest = req log.Printf("Calling ListSnapshots with req=%+v", f.listVolumesRequest) f.listSnapshotsResponse, f.err = f.service.ListSnapshots(*ctx, req) diff --git a/test/integration/step_defs_test.go b/test/integration/step_defs_test.go index b26dce64..15a57db6 100644 --- a/test/integration/step_defs_test.go +++ b/test/integration/step_defs_test.go @@ -134,20 +134,20 @@ func (f *feature) getArrayConfig() (map[string]*ArrayConnectionData, error) { _, err := os.Stat(configFile) if err != nil { if os.IsNotExist(err) { - return nil, fmt.Errorf(fmt.Sprintf("File %s does not exist", configFile)) + return nil, fmt.Errorf("File %s does not exist", configFile) } } config, err := os.ReadFile(filepath.Clean(configFile)) if err != nil { - return nil, fmt.Errorf(fmt.Sprintf("File %s errors: %v", configFile, err)) + return nil, fmt.Errorf("File %s errors: %v", configFile, err) } if string(config) != "" { jsonCreds := make([]ArrayConnectionData, 0) err := json.Unmarshal(config, &jsonCreds) if err != nil { - return nil, fmt.Errorf(fmt.Sprintf("Unable to parse the credentials: %v", err)) + return nil, fmt.Errorf("Unable to parse the credentials: %v", err) } if len(jsonCreds) == 0 { @@ -158,19 +158,19 @@ func (f *feature) getArrayConfig() (map[string]*ArrayConnectionData, error) { for i, c := range jsonCreds { systemID := c.SystemID if _, ok := arrays[systemID]; ok { - return nil, fmt.Errorf(fmt.Sprintf("duplicate system ID %s found at index %d", systemID, i)) + return nil, fmt.Errorf("duplicate system ID %s found at index %d", systemID, i) } if systemID == "" { - return nil, fmt.Errorf(fmt.Sprintf("invalid value for system name at index %d", i)) + return nil, fmt.Errorf("invalid value for system name at index %d", i) } if c.Username == "" { - return nil, fmt.Errorf(fmt.Sprintf("invalid value for Username at index %d", i)) + return nil, fmt.Errorf("invalid value for Username at index %d", i) } if c.Password == "" { - return nil, fmt.Errorf(fmt.Sprintf("invalid value for Password at index %d", i)) + return nil, fmt.Errorf("invalid value for Password at index %d", i) } if c.Endpoint == "" { - return nil, fmt.Errorf(fmt.Sprintf("invalid value for Endpoint at index %d", i)) + return nil, fmt.Errorf("invalid value for Endpoint at index %d", i) } // ArrayConnectionData if c.AllSystemNames != "" { @@ -1126,7 +1126,7 @@ func (f *feature) expectErrorListSnapshotResponse() error { if !strings.Contains(err.Error(), expected) { return fmt.Errorf("Error %s does not contain the expected message: %s", err.Error(), expected) } - fmt.Printf("got expected error " + err.Error()) + fmt.Printf("got expected error: %s", err.Error()) return nil } From 5691835437919744444f7387956b3846bde05d67 Mon Sep 17 00:00:00 2001 From: Don Khan Date: Sun, 25 Aug 2024 08:45:35 -0400 Subject: [PATCH 3/3] Add technologists. --- .github/CODEOWNERS | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index e9332729..59e46c3a 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -10,7 +10,10 @@ # Abhilash Muralidhara (abhi16394) # Adarsh Kumar Yadav (adarsh-dell) # Akshay Saini (AkshaySainiDell) +# Bahubali Jain (bpjain2004) # Don Khan (donatwork) +# Trevor Dawe (tdawe) # for all files -* @abhi16394 @adarsh-dell @AkshaySainiDell @donatwork +* @abhi16394 @adarsh-dell @AkshaySainiDell @bpjain2004 @donatwork @tdawe +