Add unit tests for pkg/docker.GetAssembleUser(), and tweak its logic so
that it returns the image's default user instead of an empty string when
the image doesn't have a configured assemble user.
Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
The client ContainerCreate() method now takes an optional Platform
argument, but we'll just pass `nil` in for now.
In integration tests, recognize when ContainerWait(WaitConditionNextExit)
timed out because the container had already exited and work around it.
Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
When checking if the user that we'll use for running the assemble step
is in the allowed user range, we strip any potential group part from the
value for the user that we extract from the image's configuration before
checking if it's in the allowed range, but we haven't been doing that
for values configured through the "s2i.assemble-user" label.
Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
Add option to set TLS in default docker config from environment variable DOCKER_TLS, same as docker cli (https://github.com/docker/cli/pull/863)
Adds tests
documentation of assemble-runtime-user's flag
add LABEL assemble-runtime-user
removing debug messages
change the failure reason of GetAssembleRuntimeUser
assemble-runtime-user is optional
generate completitions
check getAssembleRuntimeUser error
Adding check to ensure the s2i assemble user is allowed if the --allowed-uids flag is set.
The assemble user can come from one of two sources:
1. --assemble-user flag
2. builder image io.openshift.s2i.assemble-user label
The assemble user overrides the default image user for an s2i build.
However, if the base image has ONBUILD instructions with USER directives,
all USER directives will be checked to ensure compliance.
Bug 1582976
I was messing around with Jetbrains GoLand and ran it's code inspection
against openshift/source-to-image and it found quite a few things, so
I went through and picked the ones that seemed like good ones to fix
and fixed them.
Some of the issues that were fixed consist of:
- Removing unused function parameters
- Removing unused non-exported function
- Replacing deprecated os.SEEK_SET with io.SeekStart
- Replacing deprecated msg.ProgressMessage with msg.Progress.Current
- Removing duplicate parenthesis
- Renaming variables that could mask imports
- Downcasing the first letter of error messages
I think that is mostly it, I am sure there will need to be some updates
to openshift/origin in response to these updates.
Add support for assemble-user label
Add support for assemble-user label
Add support for assemble-user label
Add support for assemble-user label
Add support for assemble-user label
add retry action for pulling image
fix compile error
fix compile error
fix golint
add err print
if err == nil no need to retry
gofmt
update printing info
infrastructure.
If the remote container doesn't have sh or tar, it may reasonably terminate
before consuming all the tar file being sent to it. In this case, we will
already have the error message indicating the missing requirements. Use this
to fall back to a layered build.
- The package documentation must not be separated from the package
declaration by blank lines.
- The godoc convention is to follow the pattern "Package <name> ...".
- The statement about go-dockerclient is wrong for some time now, and
refers to an implementation detail, not fundamental to explain the
purpose of the package.
- enable use of cygwin to build and test s2i
- simplify git and file downloaders
- track posix file permissions on windows
- remove unnecessary runtime.GOOS == "windows" checks
- unit test fixes