From f9aaa9fca7bf4077778ed527c1a8a6e09e60c53c Mon Sep 17 00:00:00 2001 From: almg80 <47817080+almg80@users.noreply.github.com> Date: Thu, 8 Sep 2022 18:08:51 +0100 Subject: [PATCH] (fix):Pass full context to S3 context handler (#2221) On version 1.9.0 context fetch from S3 is broken since `url.Parse` requires full path: https://github.com/GoogleContainerTools/kaniko/blob/90e426ba3fde4b72efbcec5f10e4f73963313228/pkg/util/bucket/bucket_util.go#L77 Currently on a --context=s3://my-bucket/my-path/context.tar.gz we would pass only my-bucket/my-path/context.tar.gz which breaks context fetch Closes #2200 --- pkg/buildcontext/buildcontext.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/buildcontext/buildcontext.go b/pkg/buildcontext/buildcontext.go index 6e40ece8f..3e637e578 100644 --- a/pkg/buildcontext/buildcontext.go +++ b/pkg/buildcontext/buildcontext.go @@ -50,9 +50,9 @@ func GetBuildContext(srcContext string, opts BuildOptions) (BuildContext, error) switch prefix { case constants.GCSBuildContextPrefix: - return &GCS{context: context}, nil + return &GCS{context: srcContext}, nil case constants.S3BuildContextPrefix: - return &S3{context: context}, nil + return &S3{context: srcContext}, nil case constants.LocalDirBuildContextPrefix: return &Dir{context: context}, nil case constants.GitBuildContextPrefix: