mirror of
https://github.com/GoogleContainerTools/kaniko
synced 2026-10-21 12:54:35 +02:00
feat: kaniko dir config option (#1997)
* remove configurables from constants * add configurables to config init * add kaniko dir flag * cleanup pkg constants * replace buildcontext constants pkg occurrences with config * add KanikoDir to KanikoOptions * replace executor constants pkg occurrences with config * remove redundant KanikoDir assignment * replace constants to config for IntermediateStagesDir * fix imports * add default kaniko directory into constants * add check for kanikoDir on use * update init to use default path constant * update executor kanikoDir check Co-authored-by: Jason Hall <jasonhall@redhat.com> * alter checkKanikoDir parameter * add TestKanikoDir func * update error handling style Co-authored-by: Jason Hall <jasonhall@redhat.com> * remove shorthand flag usage from test Co-authored-by: Jason Hall <jasonhall@redhat.com> * add docstring to integration test Co-authored-by: Jason Hall <jasonhall@redhat.com> * remove shorthand flag from kaniko-dir Co-authored-by: Jason Hall <jasonhall@redhat.com>
This commit is contained in:
@@ -22,6 +22,7 @@ import (
|
||||
"os"
|
||||
"strings"
|
||||
|
||||
kConfig "github.com/GoogleContainerTools/kaniko/pkg/config"
|
||||
"github.com/go-git/go-billy/v5/osfs"
|
||||
"github.com/go-git/go-git/v5"
|
||||
"github.com/go-git/go-git/v5/config"
|
||||
@@ -31,8 +32,6 @@ import (
|
||||
"github.com/go-git/go-git/v5/plumbing/transport/http"
|
||||
"github.com/go-git/go-git/v5/storage/filesystem"
|
||||
"github.com/sirupsen/logrus"
|
||||
|
||||
"github.com/GoogleContainerTools/kaniko/pkg/constants"
|
||||
)
|
||||
|
||||
const (
|
||||
@@ -57,7 +56,7 @@ type Git struct {
|
||||
|
||||
// UnpackTarFromBuildContext will provide the directory where Git Repository is Cloned
|
||||
func (g *Git) UnpackTarFromBuildContext() (string, error) {
|
||||
directory := constants.BuildContextDir
|
||||
directory := kConfig.BuildContextDir
|
||||
parts := strings.Split(g.context, "#")
|
||||
url := getGitPullMethod() + "://" + parts[0]
|
||||
options := git.CloneOptions{
|
||||
|
||||
Reference in New Issue
Block a user