Commit Graph

16 Commits

Author SHA1 Message Date
Joël Pepper 14ea7c4071
Fix Integration tests (#2425)
* fix(ci): Bump golangci-lint to 1.51.1

* chore(lint): fix gofmt and goimport issues

* chore(lint): fix linter issues

- Adapted error comparison according to linter recommendation
- Disabled noctx linting for http request where canceling makes no sense
- Disabled nilerror linting where nil error is returned on purpose
- Disabled makezero linter where slice is explicitly deepcopied

* chore(ci): Update go version in tests workflows

* fix(ci): Allow boilerplate years from 2000-2099

Previously the regex only allowed the copyright notice to contain the
years 2018,2019,2020,2021, or 2022. This commit widens to regex to
20\d\d allowing any year in the range [2000-2099]

* feat(ci): Replace minikube with k3s for intregration tests

The existing setup for minikube is very complicated, replicating most of
the setup steps for a full kubernetes cluster in an only partially
supported minikube configuration (driver=none). Furthermore the existing
setup has been broken for sometime, likely, at least in part due to the
changes to CNI and CRI in recent kubernetes versions.

Since what we actually need is only a running Kubernetes cluster on the
node and access to a registry on localhost:5000, we can switch the
extremely complicated minikube setup for a lightweight cluster using
k3s. Minikube came with a default addon for running a registry on every
node, but the same is not the case for k3s, instead we make use of the
package helm controller and its HelmChart CR to deploy twuni/docker-registry.helm
and expose it on localhost using the integrated LoadBalancer controller.

* fix(test-684): pin base container version

The dockerfile for the regression test connected to issue 684 used a
rolling tag as base image, making it flaky and fail since it was
introduced.

This commit pins the base image to the digest of bionic-20200219, which,
based on the date of the commit that introduced to the dockerfile would
be the most newest ubuntu build and likely what the "rolling" tag
resolved to back then. Since this also an image from the pre-oci days of
ubuntu, this circumvents a bug in container-diff as well
(https://github.com/GoogleContainerTools/container-diff/issues/389)
2023-03-21 12:30:54 -04:00
Gabriel Nützi 323e616a67
fix: Refactor `LayersMap` to correct old strange code behavior (#2066)
* fix: Correct flatten function in layers

- Added a test.
- Cache current image, track deletes in `whiteouts` as well as normal adds in `layers`.
- Fix ugly delete behavior of `layerHashCache`.
  Delete it when crerating a new snapshot.
- Slight cleanup in `snapshot.go`.
- Format ugly `WalkFS` function.

* fix: Add symbolic link changes  to Hasher and CacheHasher

* fix: Better log messages

* fix(ci): Integration tests

* fix(ci): Add `--no-cache` to docker builds

* fix(ci): Pass credentials for error integration test

* np: Missing .gitignore in `hack`

* np: Capitalize every log message

- Correct some linting.

* fix: Key function

- Merge only last layer onto `currentImage`.

* fix: Remove old obsolete `cacheHasher`
2022-05-17 20:30:58 -04:00
Don McCasland 1bb5a41d7d
Fixing lint issues. Adding tests for COPY command. Fixing issue with copying files out of snapshots 2019-09-16 10:48:31 -07:00
dlorenc 734ffe65ce
Rework cache key generation a bit. (#375)
* Rework cache key generation a bit.

Cache keys are now based on the previous commands, rather than the previous state
of the filesystem.

* Refactor command interface a bit, only cache the context for commands that use it.
2018-10-03 16:16:12 -05:00
Priya Wadhwa 4f3ab61b96 Add CacheCommand to DockerCommand interface
CacheCommand returns true if the command should be cached. Currently,
it's only true for RUN but can be added to ADD/COPY later on (these are
different since the contents of files for ADD/COPY need to be included
in the cache key generation).

I also changed CreatedBy to String so that we can log each command
before cache extraction or regular execution takes place.
2018-09-04 13:16:05 -07:00
Nick Kubala e45d1f6aac
Update deps 2018-07-31 16:23:23 -07:00
Jon Johnson 8b0a1a7689 dep update go-containerregistry 2018-06-03 00:59:34 +00:00
Sharif Elgamal 5e6b60f46e
adding metadata tests back to integration tests (#185)
* adding metadata tests back to integration tests and fixing resulting bugs

* fix onbuild and default env

* removing old test files

* adding the ArgsEscaped boolean on CMD commands

* fix onbuild test

* ignore failing test until container-diff is fixed

* code comments

* adding todo to remove uncomment failing test
2018-05-24 11:28:32 -07:00
Priya Wadhwa 282f8abbee
Merge master, refactor to work with ARG 2018-05-11 15:53:11 -07:00
Priya Wadhwa 4de14c34dd
Wrap BuildArgs in our own type 2018-05-11 10:23:13 -07:00
Priya Wadhwa 26d8501489
Support BuildArgs for arg command 2018-05-09 12:24:38 -07:00
dlorenc cd5b744904
Switch from containers/image to go-containerregistry (#140)
* Vendor changes for go-containerregistry switch.

* Manual changes for go-containerregistry switch.

The biggest change is refactoring the tarball unpacking.

* Pull more of container-diff out.

* More vendor removals.

* More unit tests.
2018-04-25 19:21:05 -07:00
Matt Rickard cff201dee6 org rename from GoogleCloudPlatform to GoogleContainerTools 2018-04-17 11:45:39 -07:00
Priya Wadhwa ec510a161b
change imports from k8s-container-builder to kaniko 2018-04-12 15:35:54 -07:00
Priya Wadhwa 59a5950e9e
onbuild integration test 2018-04-05 09:43:52 -07:00
Priya Wadhwa 27f964957b
Support for onbuild and unit test 2018-04-04 17:06:01 -07:00