Skip to content

Allow passwd entry with non-existing home path - #757

Merged
xingao267 merged 6 commits into
bazelbuild:masterfrom
chanseokoh:patch-1
Mar 27, 2019
Merged

xingao267 merged 6 commits into
bazelbuild:masterfrom
chanseokoh:patch-1

Conversation

@chanseokoh

Copy link
Copy Markdown
Contributor

This will be useful to create an entry like nobody:x:65534:65534:nobody:/nonexistent:/usr/sbin/nologin.

I'm new to Starlark, so I need some help actually.

This will be useful to create an entry like `nobody:x:65534:65534:nobody:/nonexistent:/usr/sbin/nologin`
@k8s-ci-robot

Copy link
Copy Markdown

Hi @chanseokoh. Thanks for your PR.

I'm waiting for a bazelbuild member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@xingao267 xingao267 self-assigned this Mar 26, 2019
@xingao267

Copy link
Copy Markdown
Contributor

Hi @chanseokoh thanks for the PR, could you add passwd_entry, passwd_file, passwd_tar targets for this use case and tests in testdata/BUILD? Like these ones https://github.com/bazelbuild/rules_docker/blob/master/testdata/BUILD#L517

@chanseokoh

Copy link
Copy Markdown
Contributor Author

Thanks @xingao267, will do (some time later).

@chanseokoh

Copy link
Copy Markdown
Contributor Author

Added tests. Hopefully the tests pass on Travis. I couldn't run tests locally. Don't know what's wrong.

$ bazel test //container:image_test
INFO: Invocation ID: caf22c72-2cba-457c-baa8-f45f82348e1d
ERROR: .../rules_docker/lang/image.bzl:320:44: name 'PyInfo' is not defined (did you mean 'ApkInfo'?)
ERROR: error loading package '': in .../rules_docker/python/image.bzl: Extension 'lang/image.bzl' has errors
ERROR: error loading package '': in .../rules_docker/python/image.bzl: Extension 'lang/image.bzl' has errors
INFO: Elapsed time: 0.122s
INFO: 0 processes.
FAILED: Build did NOT complete successfully (0 packages loaded)
FAILED: Build did NOT complete successfully (0 packages loaded)

@chanseokoh

Copy link
Copy Markdown
Contributor Author

Never mind. Using the latest Bazel works. There seem test failures, so I'll fix them.

@chanseokoh

Copy link
Copy Markdown
Contributor Author

Tests passing. I believe the self.assertTopLayerContains(img, ['.', './etc', './etc/password', './root', './myhomedir']) confirms that /nonexistent doesn't exist in the tar??

@chanseokoh

Copy link
Copy Markdown
Contributor Author

Indeed, I verified an actual image created with create_home = False, and it doesn't create the directory.

@k8s-ci-robot

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: chanseokoh, xingao267
To fully approve this pull request, please assign additional approvers.
We suggest the following additional approvers:

If they are not already assigned, you can assign the PR to them by writing /assign in a comment when ready.

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants