@@ -281,7 +281,7 @@ func (r *KustomizationReconciler) reconcile(
281281 defer os .RemoveAll (tmpDir )
282282
283283 // download artifact and extract files
284- err = r .download (kustomization , source .GetArtifact ().URL , tmpDir )
284+ err = r .download (source .GetArtifact ().URL , tmpDir )
285285 if err != nil {
286286 return kustomizev1 .KustomizationNotReady (
287287 kustomization ,
@@ -423,11 +423,7 @@ func (r *KustomizationReconciler) checkDependencies(kustomization kustomizev1.Ku
423423 return nil
424424}
425425
426- func (r * KustomizationReconciler ) download (kustomization kustomizev1.Kustomization , artifactURL string , tmpDir string ) error {
427- timeout := kustomization .GetTimeout () + (time .Second * 1 )
428- ctx , cancel := context .WithTimeout (context .Background (), timeout )
429- defer cancel ()
430-
426+ func (r * KustomizationReconciler ) download (artifactURL string , tmpDir string ) error {
431427 if hostname := os .Getenv ("SOURCE_CONTROLLER_LOCALHOST" ); hostname != "" {
432428 u , err := url .Parse (artifactURL )
433429 if err != nil {
@@ -442,7 +438,7 @@ func (r *KustomizationReconciler) download(kustomization kustomizev1.Kustomizati
442438 return fmt .Errorf ("failed to create a new request: %w" , err )
443439 }
444440
445- resp , err := r .httpClient .Do (req . WithContext ( ctx ) )
441+ resp , err := r .httpClient .Do (req )
446442 if err != nil {
447443 return fmt .Errorf ("failed to download artifact, error: %w" , err )
448444 }
0 commit comments