From dd3c29c9711d55f376cebedc822ad70c0e7eafb7 Mon Sep 17 00:00:00 2001 From: Chirag S Date: Thu, 29 Jan 2026 14:01:55 +0530 Subject: [PATCH] fix: [CI-14073]: Print absolute lookup path incase dockerfile not present (#163) --- kaniko.go | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/kaniko.go b/kaniko.go index 51f3dd6..a484971 100644 --- a/kaniko.go +++ b/kaniko.go @@ -227,7 +227,15 @@ func (p Plugin) Exec() error { } if _, err := os.Stat(p.Build.Dockerfile); os.IsNotExist(err) { - return fmt.Errorf("dockerfile does not exist at path: %s", p.Build.Dockerfile) + + // Get absolute path for better error message. If path is empty, this will + // return the current working directory, showing where the plugin looked. + absPath, absErr := filepath.Abs(p.Build.Dockerfile) + if absErr != nil { + absPath = p.Build.Dockerfile + } + + return fmt.Errorf("dockerfile does not exist at path: %s", absPath) } var tags = p.Build.Tags