added oci-layout-path opt to relativePath check
This commit is contained in:
parent
820f4575f1
commit
efa7da69bd
|
|
@ -454,6 +454,7 @@ func resolveRelativePaths() error {
|
|||
&opts.DigestFile,
|
||||
&opts.ImageNameDigestFile,
|
||||
&opts.ImageNameTagDigestFile,
|
||||
&opts.OCILayoutPath,
|
||||
}
|
||||
|
||||
for _, p := range optsPaths {
|
||||
|
|
|
|||
|
|
@ -196,17 +196,7 @@ func DoPush(image v1.Image, opts *config.KanikoOptions) error {
|
|||
}
|
||||
|
||||
if opts.OCILayoutPath != "" {
|
||||
resolvedPath := opts.OCILayoutPath
|
||||
if !filepath.IsAbs(resolvedPath) {
|
||||
// If the path is relative, make it absolute
|
||||
cwd, err := os.Getwd()
|
||||
if err != nil {
|
||||
return errors.Wrap(err, "getting current working directory")
|
||||
}
|
||||
resolvedPath = filepath.Join(cwd, resolvedPath)
|
||||
}
|
||||
|
||||
path, err := layout.Write(resolvedPath, empty.Index)
|
||||
path, err := layout.Write(opts.OCILayoutPath, empty.Index)
|
||||
if err != nil {
|
||||
return errors.Wrap(err, "writing empty layout")
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue