1
0
mirror of https://github.com/openshift/source-to-image.git synced 2026-02-05 12:44:54 +01:00
Commit Graph

550 Commits

Author SHA1 Message Date
openshift-ci[bot]
13eb77360b Merge pull request #1125 from cuppett/cuppett/fix-1124
Resolves #1124: Always scan the repository for provided scripts
2023-11-03 13:52:45 +00:00
Stephen Cuppett
63fa22d8bd Nit: Comment update to getImageScriptsDir 2023-11-02 13:52:29 -04:00
divyansh42
4894b3d40d Improve stacktrace to fix tech debts
Signed-off-by: divyansh42 <diagrawa@redhat.com>
2023-10-30 12:25:34 +05:30
Stephen Cuppett
f849cd7789 Resolves #1124: Always scan the repository for provided scripts
Whether the base image provides the scripts or not, the repository can supply override scripts.
Removes the expectation/need of a location specified in the image.
2023-10-26 15:53:30 -04:00
Stephen Cuppett
83e9e15c1c Revert "Resolves #1124: Always scan the repository for provided scripts"
This reverts commit 0397929d34.
2023-10-26 14:14:20 -04:00
Stephen Cuppett
0397929d34 Resolves #1124: Always scan the repository for provided scripts
Whether the base image provides the scripts or not, the repository can supply override scripts.
Removes the expectation/need of a location specified in the image.
2023-08-11 09:31:36 -04:00
Corey Daley
ad74e0303b S2I command always uses 'latest' tag
Fixes #1122
2023-07-05 20:20:12 -04:00
Corey Daley
3606c1c768 code updates for dependency bump 2023-07-02 00:51:41 -04:00
Corey Daley
898b43c0a1 commiting results of running goio 2023-03-16 00:59:21 -04:00
Corey Daley
c7acbba501 updating to fix gofmt issues 2023-03-16 00:59:21 -04:00
Eng Zer Jun
97a4019573 refactor(fs): simplify CopyContents
We can simplify the following code
	dir, err := os.Open(dirname)
	if err != nil {
		return err
	}
	defer dir.Close()

	dirs, err := dir.Readdir(-1)

with just `os.ReadDir(dirname)`.

Reference: https://pkg.go.dev/os#ReadDir
Signed-off-by: Eng Zer Jun <engzerjun@gmail.com>
2023-03-14 23:52:28 +08:00
Matej Vasek
0bc1f25dac fixup
Signed-off-by: Matej Vasek <mvasek@redhat.com>
2023-03-09 22:57:56 +01:00
Matej Vasek
73fe5b59e1 fix: honor --exclude when using --as-dockerfile
Signed-off-by: Matej Vasek <mvasek@redhat.com>
2023-03-09 19:53:07 +01:00
Matej Vasek
a2855300cd refactor: Copy() takes a predicate not a set
Predicate is more universal than a set (Go map).

Signed-off-by: Matej Vasek <mvasek@redhat.com>
2023-03-09 19:51:01 +01:00
Yaakov Selkowitz
f691c81e62 Fix tests after git CVE-2022-39253 fix 2022-11-20 11:56:22 -05: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
Travis Semple
6d698a3701 Merge branch 'openshift:master' into windows_ignore_path_fix 2021-10-12 16:22:38 -07:00
gabemontero
4f4cb8b11f revert incorrect allowance of ssh:// prefix with scp styled URLs 2021-07-19 16:10:59 -04:00
gabemontero
ed1f0ecedc update script url from builder image labels with s2i build --as-dockerfile 2021-07-02 15:50:15 -04:00
Max Ludwig
9310b6889b Fix instruction in s2i create README template
Fixes #1056.
2020-10-10 21:47:40 +02:00
gabemontero
129c90e36f Bug 1884270: bypass golang url parsing with scp styled ssh git URLs; refactor URL for older git clients 2020-10-06 15:05:21 -04:00
Corey Daley
8ca83f8ce1 code changes for k8s.io/klog/v2 2020-10-01 20:59:50 -04:00
Travis Semple
0b4cb63090 Path fix for CopyContents, the ignore files use filepath, this probably should too.
Untested on linux.
2020-09-22 16:49:34 -07:00
Corey Daley
adfc3ee2f4 Cleaning up imports 2020-06-02 14:29:57 -04:00
OpenShift Merge Robot
927f64aa92 Merge pull request #1025 from mtatheonly/docker-tls
Add option to set TLS from environment variable
2020-04-28 21:21:23 +02: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
Igor Sutton Lopes
820f21584e Sync names in program from documentation 2020-02-10 13:17:58 +01:00
Igor Sutton Lopes
888560cf0d Add 'docker://' to the builder image if it doesn't have a scheme 2020-02-10 13:15:39 +01:00
Igor Sutton Lopes
a4a8b1114c Sync docs and command usage 2020-02-07 15:47:38 +01:00
Igor Sutton Lopes
de9d5a5e7c Do not propagate URL-like image names to Dockerfile
URL-like image names are required by containers/image in order to find the right
image repository and were propagated to the resulting Dockerfile. This change fixes
that by using containers/image API to properly extract the proper Docker image name.
2020-02-04 14:01:22 +01:00
Igor Sutton Lopes
f8dcf74445 Add generate command
This change adds the generate command to s2i, where it allows
the user to produce a Dockerfile able to be used by any build
system supporting the format, such as buildah and possibly
others.
2020-01-23 16:26:18 +01:00
Adam Kaplan
2044e2993f Reduce usage of docker/docker
* Use moby/buildkit for dockerfile parsing
* Refactor TestConvertEnvironmentToDocker to be a true unit test.
2019-12-10 21:47:58 -05:00
gabemontero
594f5bf313 Revert "support .s2i/image_metadata.json with --as-dockerfile"
This reverts commit 38d2b729fd.
2019-12-10 11:11:13 -05:00
sdarwin
e174a10297 add dotglob for restore artifacts 2019-11-24 21:57:19 -06:00
sdarwin
61ae4a1fa2 update restore artifacts script 2019-11-21 20:32:34 +00:00
gabemontero
38d2b729fd support .s2i/image_metadata.json with --as-dockerfile 2019-10-29 11:58:15 -04:00
soulseen
739bc0504f remove func GetStrategy 2019-08-07 22:55:57 +08: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
Adam Kaplan
19d753b6f6 Migrate glog to klog 2019-07-15 12:53:19 -04:00
Adam Kaplan
9c608549ea Bump golang to 1.12 2019-06-06 15:13:54 -04:00
OpenShift Bot
45ec6af232 Merge pull request #967 from soulseen/master
Merged by openshift-bot
2019-06-05 18:31:21 +02:00
OpenShift Bot
a5488fd69a Merge pull request #958 from nabilbendafi/feature/copy_blacklist
Merged by openshift-bot
2019-05-31 23:24:10 +02:00
Nalin Dahyabhai
725605db82 ConvertEnvironmentToDocker: escape "$", \, and "
When values that are passed to ConvertEnvironmentToDocker() include the
'$', '\', or '"' characters, escape them using a '\'.

Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
2019-05-22 17:58:55 -04:00
soulseen
b09aa26e92 remove basename in main()
Signed-off-by: soulseen <sunzhu@yunify.com>
2019-05-20 11:24:25 +08:00
Nabil BENDAFI
3bdb78d004 Apply .s2iignore during copy from local directory
- Fixes #867
2019-03-25 22:02:53 +01:00
magicsong
a999b00a7e add seed to container name 2019-03-14 12:06:00 +08:00
Adam Kaplan
c53cfb5cb0 Support UTF-8 Filenames in tar streaming
* Allow tar streams readers to set their own timeouts
* Use PAX format to support UTF-8 filenames consistently
2019-02-26 15:14:34 -05:00
Adam Kaplan
c268d8c561 dockerfile - Report Error if No Scripts Install
* Raise an error if no scripts are downloaded from the ScriptsURL
* Update unit and integration tests to check for raised errors

Fixes bug 1668130
2019-01-23 11:10:50 -05:00