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

Fix bug with docker compatibility ArgsEscaped #964

Merged
merged 1 commit into from
Jan 17, 2020

Conversation

samos123
Copy link
Contributor

ArgsEscaped according to Docker docs should only be set in Windows
environments: https://docs.docker.com/engine/api/v1.30/

It was causing a few integration tests to fail with following message:

FAIL: TestRun/test_Dockerfile_test_metadata (8.48s)
           "Diff": {
             "Adds": [
               "ArgsEscaped: true"
             ],
             "Dels": [
               "ArgsEscaped: false"
             ]

Submitter Checklist

These are the criteria that every PR should meet, please check them off as you
review them:

  • Includes unit tests
  • Adds integration tests if needed.

See the contribution guide for more details.

Reviewer Notes

  • The code flow looks good.
  • Unit tests and or integration tests added.

Release Notes

Change ArgsEscaped from true to false since this should only be used in Windows environments.

@googlebot googlebot added the cla: yes CLA signed by all commit authors label Jan 13, 2020
@samos123
Copy link
Contributor Author

kokoro is failing but I believe this might be due to different behaviour with different docker versions. The latest stable version will return ArgsEscape: false however kokoro seems to be running an older version of Docker that returns ArgsEscaped: true.

@samos123 samos123 changed the title Fix bug with docker compatibility WIP: Fix bug with docker compatibility Jan 13, 2020
@samos123 samos123 changed the title WIP: Fix bug with docker compatibility WIP don't merge: Fix bug with docker compatibility Jan 13, 2020
@samos123 samos123 force-pushed the fix-argsescape branch 5 times, most recently from 368e860 to 34fb6c5 Compare January 14, 2020 01:14
ArgsEscaped according to Docker docs should only be set in Windows
environments: https://docs.docker.com/engine/api/v1.30/

It was causing integration test to fail with following message:
```
FAIL: TestRun/test_Dockerfile_test_metadata (8.48s)
           "Diff": {
             "Adds": [
               "ArgsEscaped: true"
             ],
             "Dels": [
               "ArgsEscaped: false"
             ]
```

However docker 18.xx returns ArgsEscaped: true
whereas docker 19.xx returns ArgsEscaped: false
Hence this patch also adds the docker version check to the integration
to ignore ArgsEscaped being different when 18.xx is used.
@samos123 samos123 changed the title WIP don't merge: Fix bug with docker compatibility Fix bug with docker compatibility ArgsEscaped Jan 14, 2020
@@ -18,6 +18,8 @@ set -ex
GCS_BUCKET="${GCS_BUCKET:-gs://kaniko-test-bucket}"
IMAGE_REPO="${IMAGE_REPO:-gcr.io/kaniko-test}"

docker version
Copy link
Member

Choose a reason for hiding this comment

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

just 1 nit: you can remove this here and log it in the newly added getDockerMajorVersion

Copy link
Contributor Author

Choose a reason for hiding this comment

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

getDockerMajorVersion uses a template string to only get engine version. The command in script shows more info that's useful for debugging so I think should be kept as is.

@tejal29 tejal29 merged commit e702d75 into GoogleContainerTools:master Jan 17, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla: yes CLA signed by all commit authors
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants