Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: fix test breakage caused by external dependency update #3049

Merged

Conversation

aaron-prindle
Copy link
Collaborator

@aaron-prindle aaron-prindle commented Mar 6, 2024

Recently kaniko CI/CD tests started failing due to external dependency change. Tests are failing stating the ENV produced by kaniko differes from docker now although this failure occured not directly related to a kaniko PR and no kaniko logic related to this has changed recently. PR here attempts to fix this

log snippet

              		Diff: &integration.metaDiffResult{
            - 			Adds: []string{"Env: PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"},
            + 			Adds: []string{},
            - 			Dels: []string{"Env: "},
            + 			Dels: []string{},

full logs showing the test failure
https://github.com/GoogleContainerTools/kaniko/actions/runs/8177044948/job/22357785283

This test failure is not directly related to any kaniko PR but some external dependency change, either an external image our tests rely (busybox:latest) on changing or the docker on the Github Action Runner being updated in some form

By default kaniko adds the following to SCRATCH containers which I believe mirrors how docker works:

pkg/constants/constants.go
64:var ScratchEnvVars = []string{"PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"}

This is the env shown when I run busybox:latest locally:

aprindle@aprindle-ssd ~/kaniko  [root-cause-test-issue]docker run -it  --entrypoint=sh busybox:latest
/ # 
/ # env
HOSTNAME=d12a084c5d2e
SHLVL=1
HOME=/root
TERM=xterm
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin # <-------------value as expected here
PWD=/

The fix is to add these ENV vars explicity in the two docker tests seeing issues for now as I believe this is not an issue with kaniko's logic IIUC

Copy link
Collaborator

@JeromeJu JeromeJu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @aaron-prindle , LGTM for the patch.

@aaron-prindle aaron-prindle merged commit 805a239 into GoogleContainerTools:main Mar 6, 2024
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants