1
0
mirror of https://github.com/openshift/source-to-image.git synced 2026-02-06 15:45:00 +01:00
Commit Graph

152 Commits

Author SHA1 Message Date
divyansh42
4894b3d40d Improve stacktrace to fix tech debts
Signed-off-by: divyansh42 <diagrawa@redhat.com>
2023-10-30 12:25:34 +05:30
Corey Daley
3606c1c768 code updates for dependency bump 2023-07-02 00:51:41 -04:00
Nalin Dahyabhai
46b21861b8 Add unit tests for pkg/docker.GetAssembleUser()
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>
2022-06-29 15:59:35 -04:00
Nalin Dahyabhai
e72ed0c67f Update for API changes in dependencies
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>
2022-06-29 15:58:57 -04:00
Nalin Dahyabhai
aa690147cc Strip groups before checking if AssembleUser is Allowed
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>
2021-11-09 16:39:01 -05:00
Corey Daley
adfc3ee2f4 Cleaning up imports 2020-06-02 14:29:57 -04:00
Tadeu Andrade
cbcefe1f18 Add option to set TLS from environment variable
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
2020-02-12 11:36:15 -03:00
Adam Kaplan
1fad0a5e69 Refactor glog to log/klog in code
* pkg/util/glog -> pkg/util/log
* var glog replaced with var log
* Removed unnecessary flag.Parse call (fixed with klog)
2019-07-15 15:04:15 -04:00
magicsong
a999b00a7e add seed to container name 2019-03-14 12:06:00 +08:00
05601970475
e685afa89f add assemble-runtime-user flag
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
2018-11-19 17:13:54 -03:00
Ben Parees
04aeb9dc07 check for container termination, not state transition 2018-10-15 16:52:51 -04:00
Ben Parees
7757fe4d6b use generic iserrnotfound 2018-09-24 11:42:41 -04:00
magicsong
1b45714ced add --add-host flag 2018-09-21 11:57:04 +08:00
Adam Kaplan
9b55f54e76 api/constants package
Moved docker labels, s2i scripts, and deprecated env var constants
to it's own package.

Fixes #882
2018-06-21 08:49:12 -04:00
Adam Kaplan
cfd8419086 Check Assemble Users Against Allowed UIDs
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
2018-05-29 10:55:15 -04:00
Corey Daley
31ed38ab85 Miscellaneous cleanup and refactoring
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.
2018-01-26 11:02:08 -05:00
Lou Yihua
48ce9276f6 Remove the out-of-dated hack related on docker engine-api
Since the code does not rely on docker's engine-api now, this hack
should be removed.
2018-01-17 13:42:59 +08:00
Maciej Szulik
de8ef59861 Use ParseNormalizedNamed rather than ParseNamed for parsing reference 2017-11-28 13:14:11 +01:00
Maciej Szulik
173efccd3c Code changes to match current dependecies 2017-11-28 13:14:11 +01:00
Cesar Wong
22808234bc Add force remove option to layered image builds 2017-11-13 16:11:22 -05:00
Maciej Szulik
8e7b897a42 Update s2i code to new dependencies 2017-11-06 21:23:12 +01:00
Ben Parees
1f112e03be allow passing securityopt args down to s2i via config 2017-10-30 14:35:57 -04:00
gabemontero
598486699b expose more failure specifics (incluidng OOMKilled) on run container failures 2017-10-11 13:36:46 -04:00
Ben Parees
d7058c9777 remove origin dependency 2017-09-21 15:57:04 -04:00
Ricardo Pchevuzinske Katz
48d9ae3ce9 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 support for assemble-user label
2017-08-17 17:02:31 -03:00
Jim Minter
d4e9bd0df6 break out util/cmd, util/fs, util/cygpath packages 2017-07-11 13:58:16 +01:00
Ben Parees
39dcc8507a allow setting cgroup parent for child containers 2017-06-15 16:41:47 -04:00
Ben Parees
cb5b034cb7 rework credential redacting 2017-05-09 19:08:37 -04:00
OpenShift Bot
c85c59c96b Merge pull request #742 from jim-minter/issue736
Merged by openshift-bot
2017-05-09 09:35:58 -05:00
Jim Minter
1164885bb2 silence failed to kill container warning 2017-05-09 12:07:43 +01:00
Ben Parees
96dfa97078 de-boiler-plate credential stripping logic 2017-05-08 10:12:46 -04:00
Jim Minter
df3fe56aca prevent huge numbers of hanging goroutines 2017-04-26 16:19:20 +01:00
Jim Minter
7751799a38 use only one engine client instance 2017-04-26 16:19:00 +01:00
Ben Parees
8eebcd9b1e fix handling of unparseable urls 2017-04-17 11:15:41 -04:00
Ben Parees
5fc2ce001e strip proxy credentials from proxy variables before logging them 2017-04-12 17:54:03 -04:00
guangxuli
7e291d806d fix kill container failed warning
update

print failed info

fix fail print

address comment
2017-03-31 08:43:15 +08:00
guangxuli
be552ee0f8 add retry
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
2017-03-28 23:01:08 +08:00
guangxuli
2816855ca0 delete deprecated force pull flag
update bash and zsh

remove --force-pull
2017-03-28 10:55:04 +08:00
guangxuli
bd33ac6e86 set each default pull policy at begining 2017-03-22 15:14:36 +08:00
Ben Parees
f2a8ded578 only use image user for running containers 2017-03-15 20:34:21 -04:00
Jim Minter
952341a9d6 Don't use force remove, as it can cause docker to leak storage 2017-03-14 17:50:36 +00:00
Ben Parees
f1efc30e68 use indefinite timeout for docker commit 2017-02-28 13:15:00 -05:00
Jim Minter
c2ae5ac90f Fix occasional TestLayeredBuildNoTarNoName test failure seen on Windows
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.
2017-01-30 14:07:28 +01:00
Victor
70c2f5ac3a improve failure status messages 2017-01-05 10:25:28 +01:00
Rodolfo Carvalho
2f31eb2414 Fix package doc
- 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.
2016-12-01 11:29:43 +01:00
Rodolfo Carvalho
868b2fe6cd Fix goroutine leak
Send on receiveStdout would block forever in goroutine when
holdHijackedConnection returns earlier.
2016-12-01 11:29:43 +01:00
Rodolfo Carvalho
717e77a0dc Reorganize code to log correct values
We should be updating createOpts.HostConfig.ShmSize before we log
createOpts.HostConfig.
2016-12-01 11:28:21 +01:00
Jim Minter
251057d7f3 s2i windows build enablement
- 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
2016-11-29 19:17:50 +00:00
Jim Minter
eb59ecae86 resolve race condition worries in docker communication 2016-11-29 15:39:56 +00:00
Jim Minter
c0eb0e35ed streamline tar API, stop writing intermediate directories 2016-11-28 15:14:01 +00:00