Commit graph

23 commits

Author SHA1 Message Date
James Strong
66a760794f
update to golang 1.20 (#9690)
update alpine and golang
remove nano
update go modules
remove need for openssl external cli
fix stale

Signed-off-by: James Strong <james.strong@chainguard.dev>
2023-03-11 20:38:39 -08:00
cui fliter
82e836fbe8
fix some comments (#9688)
Signed-off-by: cui fliter <imcusg@gmail.com>
2023-03-05 11:00:57 -08:00
dependabot[bot]
9126401eeb
Bump golang.org/x/net in /images/kube-webhook-certgen/rootfs (#9645)
Bumps [golang.org/x/net](https://github.com/golang/net) from 0.1.0 to 0.7.0.
- [Release notes](https://github.com/golang/net/releases)
- [Commits](https://github.com/golang/net/compare/v0.1.0...v0.7.0)

---
updated-dependencies:
- dependency-name: golang.org/x/net
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-02-17 16:00:03 -08:00
my-git9
787ea74b6b
cleanup: remove ioutil for new go version (#9427)
Signed-off-by: xin.li <xin.li@daocloud.io>

Signed-off-by: xin.li <xin.li@daocloud.io>
2022-12-20 09:39:46 -08:00
James Strong
e3e0d9c1f4
start upgrade to golang 1.19.4 and alpine 3.17.0 (#9417)
* start upgrade to 1.19.4

Signed-off-by: James Strong <james.strong@chainguard.dev>

* add matrix to image test-image

Signed-off-by: James Strong <james.strong@chainguard.dev>

* update to alpine 3.17

Signed-off-by: James Strong <james.strong@chainguard.dev>

* remove need for curl

Signed-off-by: James Strong <james.strong@chainguard.dev>

Signed-off-by: James Strong <james.strong@chainguard.dev>
2022-12-18 17:07:43 -08:00
caption
7b53347984
update gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b to 3.0.0 (#9277) 2022-11-21 13:18:17 -08:00
Oblivion
8949379931 fix CVE-2022-27664 2022-11-08 16:46:53 +00:00
Ehsan Saei
90a9d64575
Fix CVE-2022-1996 (#9244)
* CVE-2022-1996

* clean

* fix

* fix
2022-11-07 15:46:17 -08:00
Ehsan Saei
5a42ec4f35
Fix CVE-2022-32149 (#9258)
* Fix CVE-2022-32149

* fix CI
2022-11-07 15:44:17 -08:00
James Strong
93df796767
upgrade to golang 1.19.2 (#9124)
* upgrade to golang 1.19.2

Signed-off-by: James Strong <strong.james.e@gmail.com>

* update e2e testing to 1.25 kind

Signed-off-by: James Strong <strong.james.e@gmail.com>

Signed-off-by: James Strong <strong.james.e@gmail.com>
2022-10-12 12:39:00 -07:00
Long Wu Yuan
d32f8c3439
bump go to v1.19.1 (#9057) 2022-09-16 06:15:18 -07:00
Ismayil Mirzali
26bc6e4e50
bump Golang to 1.19 #8932 (#8970)
* fix: convert to LF line endings

Signed-off-by: Ismayil Mirzali <ismayilmirzeli@gmail.com>

* Pin exact Go bugfix versions for CI jobs

Signed-off-by: Ismayil Mirzali <ismayilmirzeli@gmail.com>

* Bump go.mod and Dockerfiles to Go 1.19.0

Signed-off-by: Ismayil Mirzali <ismayilmirzeli@gmail.com>

Signed-off-by: Ismayil Mirzali <ismayilmirzeli@gmail.com>
2022-08-26 09:22:25 -07:00
Jintao Zhang
f0490cbfbf
fix: change all cloudbuild jobs configuration (#8870)
Signed-off-by: Jintao Zhang <zhangjintao9020@gmail.com>
2022-07-26 14:43:11 -07:00
Long Wu Yuan
24b8e32b08
bumped go version to 1.18.1 (#8578) 2022-05-11 11:45:03 -07:00
Ricardo Katz
935ea3d830
Update libraries in webhook image (#8227) 2022-02-06 12:42:51 -08:00
Aaron Crickenberger
a9029d2bc7
images: use k8s-staging-test-infra/gcb-docker-gcloud (#7999) 2021-12-12 05:19:59 -08:00
Mateusz Gozdek
1d1e89eb9b
Add myself as a reviewer to images/kube-webhook-certgen (#7845)
* OWNERS_ALIASES: add ingress-nginx-kube-webhook-certgen-reviewers

For extra kube-webhook-certgen reviewers.

Signed-off-by: Mateusz Gozdek <mgozdek@microsoft.com>

* images/kube-webhook-certgen: add separate owners

To add myself as a reviewer as discussed in #7641.

Signed-off-by: Mateusz Gozdek <mgozdek@microsoft.com>
2021-10-25 07:04:24 -07:00
Mateusz Gozdek
54523641a8
images/kube-webhook-certgen/rootfs: add missing tests and fix regression (#7801)
* images/kube-webhook-certgen/rootfs: improve tests objects creation

Signed-off-by: Mateusz Gozdek <mgozdek@microsoft.com>

* images/kube-webhook-certgen/rootfs: use context with deadline for tests

So in case some operations are taking more time, we respect -timeout
flag.

Signed-off-by: Mateusz Gozdek <mgozdek@microsoft.com>

* images/kube-webhook-certgen/rootfs: add missing tests implementation

It should've been added in 9acf62d867.

Signed-off-by: Mateusz Gozdek <mgozdek@microsoft.com>

* images/kube-webhook-certgen/rootfs: fix patching only mutating webhook

Signed-off-by: Mateusz Gozdek <mgozdek@microsoft.com>
2021-10-12 10:07:47 -07:00
Mateusz Gozdek
757aa53686
Add CI for images/kube-webhook-certgen (#7717)
As a follow up to PR #7641, this commit adds some basic e2e tests for
kube-webhook-certgen image.

Signed-off-by: Mateusz Gozdek <mgozdek@microsoft.com>
2021-10-10 11:40:37 -07:00
Mateusz Gozdek
9acf62d867
images/kube-webhook-certgen/rootfs: add support for patching APIService objects (#7641)
* images/kube-webhook-certgen/rootfs/pkg/k8s: return err from functions

Initially only from some to preserve existing behavior.

Signed-off-by: Mateusz Gozdek <mgozdek@microsoft.com>

* images/kube-webhook-certgen/rootfs: make patching return error

So we don't call log.Fatal in so many places, which makes code testable.

Signed-off-by: Mateusz Gozdek <mgozdek@microsoft.com>

* images/kube-webhook-certgen/rootfs/pkg/k8s: require context

So initialize top-level contexts in tests and CLI, then pass them around
all the way down, so there is an ability e.g. to add timeouts to patch
operations, if needed and to follow general conventions.

Signed-off-by: Mateusz Gozdek <mgozdek@microsoft.com>

* images/kube-webhook-certgen/rootfs/pkg/k8s: support patching APIService

APIService object is very similar to MutatingWebhookConfiguration and
ValidatingWebhookConfiguration objects, so support for patching it
shouldn't be too much of a burden.

Signed-off-by: Mateusz Gozdek <mgozdek@microsoft.com>

* images/kube-webhook-certgen/rootfs/cmd: use new patch API

So old function PatchWebhookConfigurations can be unexported and CLI can
be extended to also support patching APIService.

Signed-off-by: Mateusz Gozdek <mgozdek@microsoft.com>

* images/kube-webhook-certgen/rootfs/pkg/k8s: unexport old patch function

PatchObjects should be now used instead.

Signed-off-by: Mateusz Gozdek <mgozdek@microsoft.com>

* images/kube-webhook-certgen/rootfs: add .gitignore

To ignore manually built binaries during development process.

Signed-off-by: Mateusz Gozdek <mgozdek@microsoft.com>

* images/kube-webhook-certgen/rootfs/cmd: test patching

By adding a PatchConfig and Patch function, it is now possible to test
logic of flag validation, which was previously tied to CLI options.

This commit adds nice set of tests covering existing logic.

Signed-off-by: Mateusz Gozdek <mgozdek@microsoft.com>

* images/kube-webhook-certgen/rootfs/cmd: improve formatting

Those strings will be changed anyway in future commits, so at first we
can properly capitalize used names.

Signed-off-by: Mateusz Gozdek <mgozdek@microsoft.com>

* images/kube-webhook-certgen/rootfs/cmd: support patching APIService

As logic for creating a CA certificate and patching an object is almost
the same for both webhook configuration and API services, this commit
adds support to kube-webhook-certgen CLI to also patch APIService
objects, so they can be served over TLS as well.

Signed-off-by: Mateusz Gozdek <mgozdek@microsoft.com>

* images/kube-webhook-certgen/rootfs: pass failure policy by value

k8s.k8s.patchWebhookConfigurations() always dereferences it and we do
not do a nil check, so the code may panic in some conditions, so it's
safer to just pass it by value, as it's just a wrapped string.

Signed-off-by: Mateusz Gozdek <mgozdek@microsoft.com>
2021-09-26 10:44:22 -07:00
Mateusz Gozdek
260910c0a0
images/kube-webhook-certgen/rootfs: improvements (#7630)
* images/kube-webhook-certgen/rootfs/README.md: remove trailing whitespace

Signed-off-by: Mateusz Gozdek <mgozdek@microsoft.com>

* images/kube-webhook-certgen/rootfs: improve code formatting

Automatically using gofumpt.

Signed-off-by: Mateusz Gozdek <mgozdek@microsoft.com>

* images/kube-webhook-certgen/rootfs: remove executable bits from files

Signed-off-by: Mateusz Gozdek <mgozdek@microsoft.com>

* images/kube-webhook-certgen/rootfs/cmd: remove unreachable code

log.Fatal(|f) will alread call os.Exit(1), so this code is never
reached.

Signed-off-by: Mateusz Gozdek <mgozdek@microsoft.com>

* images/kube-webhook-certgen/rootfs/pkg/k8s: fix unit tests

Right now they fail as everything else migrated from using v1beta1 to
v1.

Signed-off-by: Mateusz Gozdek <mgozdek@microsoft.com>

* images/kube-webhook-certgen/rootfs: create clientset in cmd package

So one can easily mock the client, without touching unexported parts of
the code and to soften the dependency between CLI code (kubeconfig
path).

Signed-off-by: Mateusz Gozdek <mgozdek@microsoft.com>

* images/kube-webhook-certgen/rootfs/cmd: simplify bool logic

Signed-off-by: Mateusz Gozdek <mgozdek@microsoft.com>

* images/kube-webhook-certgen/rootfs/pkg/k8s: improve formatting

Signed-off-by: Mateusz Gozdek <mgozdek@microsoft.com>

* images/kube-webhook-certgen/rootfs/pkg/k8s: improve variable names

Signed-off-by: Mateusz Gozdek <mgozdek@microsoft.com>

* images/kube-webhook-certgen/rootfs/pkg/k8s: refactor a bit

Move patching logic to separate functions.

Signed-off-by: Mateusz Gozdek <mgozdek@microsoft.com>

* images/kube-webhook-certgen/rootfs/pkg/k8s: fix error log messages

In patchMutating() function, log messages were waying still patching
validating webhook.

Signed-off-by: Mateusz Gozdek <mgozdek@microsoft.com>
2021-09-16 13:59:26 -07:00
Ricardo Katz
576525dd72 Trigger webhook image generation 2021-08-10 18:06:41 -03:00
Ricardo Katz
492c7b0d94
Migrate the webhook-certgen program to inside ingress repo (#7475) 2021-08-10 13:22:40 -07:00