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

proc: detect kubernetes runtime by mounts #2054

Merged
merged 1 commit into from
Apr 18, 2022

Conversation

mrvik
Copy link
Contributor

@mrvik mrvik commented Apr 18, 2022

Kubernetes was not being detected by files not by /proc/?/cgroup
contents. Now it detects the kubernetes runtime if any of those
conditions are met:

  • /var/run/secrets/kubernetes.io/serviceaccount exists
  • /proc/mounts has the mount for "/" with fs type "overlay"

Fixes #1936

Description

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. (not needed)

Reviewer Notes

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

Release Notes

- kaniko doesn't need --force on kubernetes when /proc/self/cgroup reports `0::/`
- kaniko detects overlay mounts in "/" as kubernetes

Fix GoogleContainerTools#1936
Kubernetes was not being detected by files not by /proc/?/cgroup
contents. Now it detects the kubernetes runtime if any of those
conditions are met:

* /var/run/secrets/kubernetes.io/serviceaccount exists
* /proc/mounts has the mount for "/" with fs type "overlay"
@imjasonh imjasonh merged commit 13ed53e into GoogleContainerTools:main Apr 18, 2022
@imjasonh imjasonh mentioned this pull request Jun 1, 2022
chuangw6 added a commit that referenced this pull request Jun 1, 2022
Highlights
- Installed binaries are missing from image [#2049](#2049)
- proc: detect kubernetes runtime by mounts [#2054](#2054)
- Fixes #2046: make target stage lookup case insensitive [#2047](#2047)
- fix: Refactor LayersMap to correct old strange code behavior [#2066](#2066)
- Fix missing setuid flags on COPY --from=build operation [#2089](#2089)
- Fixes #2046: make target stage lookup case insensitive [#2047](#2047)
- Add GitLab CI credentials helper [#2040]((#2040))
- and a number of dependency bumps
chuangw6 added a commit that referenced this pull request Jun 1, 2022
Highlights
- Installed binaries are missing from image #2049
- proc: detect kubernetes runtime by mounts #2054
- Fixes #2046: make target stage lookup case insensitive #2047
- Fix: Refactor LayersMap to correct old strange code behavior #2066
- Fix missing setuid flags on COPY --from=build operation #2089
- Fixes #2046: make target stage lookup case insensitive #2047
- Add GitLab CI credentials helper #2040
- And a number of dependency bumps
@chuangw6 chuangw6 mentioned this pull request Jun 1, 2022
4 tasks
chuangw6 added a commit that referenced this pull request Aug 9, 2022
Highlights
- Installed binaries are missing from image #2049
- proc: detect kubernetes runtime by mounts #2054
- Fixes #2046: make target stage lookup case insensitive #2047
- Fix: Refactor LayersMap to correct old strange code behavior #2066
- Fix missing setuid flags on COPY --from=build operation #2089
- Fixes #2046: make target stage lookup case insensitive #2047
- Add GitLab CI credentials helper #2040
- And a number of dependency bumps
chuangw6 added a commit that referenced this pull request Aug 10, 2022
Highlights
- Installed binaries are missing from image #2049
- proc: detect kubernetes runtime by mounts #2054
- Fixes #2046: make target stage lookup case insensitive #2047
- Fix: Refactor LayersMap to correct old strange code behavior #2066
- Fix missing setuid flags on COPY --from=build operation #2089
- Fixes #2046: make target stage lookup case insensitive #2047
- Add GitLab CI credentials helper #2040
- And a number of dependency bumps
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.

[bug] getContainerRuntime reports error with gcr.io/kaniko-project/executor:debug
2 participants