From cf95aee0920b0e77de4acd5a7db07d7126cfbf40 Mon Sep 17 00:00:00 2001 From: guoguangwu Date: Fri, 22 Sep 2023 18:06:10 +0800 Subject: [PATCH] chore: import packages only once Signed-off-by: guoguangwu --- pkg/validate/volumes.go | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/pkg/validate/volumes.go b/pkg/validate/volumes.go index 788b87f64..f71aaa55d 100644 --- a/pkg/validate/volumes.go +++ b/pkg/validate/volumes.go @@ -7,7 +7,6 @@ package validate import ( "fmt" - build "github.com/shipwright-io/build/pkg/apis/build/v1alpha1" buildv1alpha1 "github.com/shipwright-io/build/pkg/apis/build/v1alpha1" ) @@ -25,7 +24,7 @@ func BuildRunVolumes(strategyVolumes []buildv1alpha1.BuildStrategyVolume, buildV // validateBuildVolumes validates build overriding the build strategy volumes. in case it tries // to override the non-overridable volume, or volume that does not exist in the strategy, it is // good to fail early -func validateVolumes(strategyVolumes []build.BuildStrategyVolume, buildVolumes []build.BuildVolume) (bool, buildv1alpha1.BuildReason, string) { +func validateVolumes(strategyVolumes []buildv1alpha1.BuildStrategyVolume, buildVolumes []buildv1alpha1.BuildVolume) (bool, buildv1alpha1.BuildReason, string) { strategyVolumesMap := toVolumeMap(strategyVolumes) for _, buildVolume := range buildVolumes { @@ -44,8 +43,8 @@ func validateVolumes(strategyVolumes []build.BuildStrategyVolume, buildVolumes [ } // toVolumeMap coverts slice of build strategy volumes to map of build strategy volumes, in order to later search them quickly by name -func toVolumeMap(strategyVolumes []build.BuildStrategyVolume) map[string]build.BuildStrategyVolume { - res := make(map[string]build.BuildStrategyVolume) +func toVolumeMap(strategyVolumes []buildv1alpha1.BuildStrategyVolume) map[string]buildv1alpha1.BuildStrategyVolume { + res := make(map[string]buildv1alpha1.BuildStrategyVolume) for _, vol := range strategyVolumes { res[vol.Name] = vol }