Commit Graph

35 Commits

Author SHA1 Message Date
Mary 49c06c746e
removing tls environment var (#1151)
* removing var

* fixing unused variable - CI failure
2025-10-30 17:46:37 -03:00
renovate-rancher[bot] 7ac219ffda
Update dependency golangci/golangci-lint to v2 (main) (#841)
* Update dependency golangci/golangci-lint to v2

* Migrate the golangci config file.

* Fix golangci-lint-flagged problems

Most of them fall in these categories:

* stop ignoring returned errors from function calls

* Apply deMorgan's law to complex negative boolean expressions

* Delete unused local variables and struct fields

* Successfully get the linter to stop complaining about
  uncommented global names

* If one import in a block has an import prefix, all must

* Deal with deprecated code

* Prefer switch-blocks to if/else if/...

* Remove unnecessary intermediate struct fields.

* Orphans are now deleted only via propagation-policy

* Stop checking goimports on generated files.

* Remove unused field comment

---------

Co-authored-by: renovate-rancher[bot] <119870437+renovate-rancher[bot]@users.noreply.github.com>
Co-authored-by: Eric Promislow <epromislow@suse.com>
2025-09-18 11:39:45 -07:00
Mary cefc4a0c0f
48484 bug webhook error msg (#1046)
* new env variable IGNORE_TLS_HANDSHAKE_ERROR

* bump dynamiclistener v0.7.1-rc1
2025-09-09 16:48:02 -03:00
Eric Promislow 0ca113673c
Display error output from dynamiclistener.Server (#494) 2024-09-09 15:28:22 -07:00
Peter Matseykanets ae4cc3b8a2
[main] Use the proper config when fetching mutating webhook configuration (#460)
Forwardport of #451
2024-08-03 17:14:30 -04:00
Tom Lebreux 97679b88dd
Add k8s 1.30 support (#412) 2024-06-28 09:23:25 -04:00
Tom Lebreux 49160dee86
Add support for k8s 1.28 (#341) 2024-03-27 16:56:34 -04:00
Tom Lebreux 128b387a3c
Remove CAPI webhook (#338) 2024-03-19 13:24:29 -04:00
Kevin Joiner 8a45bf3f41 Adds startup error. 2023-09-19 10:18:56 -04:00
Colleen Murphy c10f608e13 Add cert-based API server authentication
Add the ability to authenticate incoming requests, verifying that all
requests originate from the Kubernetes API server and no where else.

Authenticating the API server requires manual steps to configure both
the API server and the webhook. Follow the Kubernetes webhook
documentation[1] to create an admission configuration and kubeconfig for
the API server, and update the kube-apiserver flags to use them. Only
cert-based authentication is supported, basic auth and token
authentication will not be recognized. Then, set auth.clientCA in the
webhook chart's values.yaml to the base64-encoded CA for the certs, and
set auth.allowedCNs to the CN for the client cert the apiserver will
present.

[1] https://kubernetes.io/docs/reference/access-authn-authz/extensible-admission-controllers/#authenticate-apiservers
2023-08-15 09:55:59 -07:00
Kevin Joiner 851f4cbdf6 Adds the ability to set custom ports for Webhook.
This commit also adds helm unittest and updates integration-test to run
K3s without Rancher.
2023-07-19 16:24:44 -04:00
Kevin Joiner 56151d6337
Merge pull request #202 from rancher/renovate/golangci-golangci-lint-1.x
Update dependency golangci/golangci-lint to v1.52.2
2023-06-22 14:54:00 -04:00
Michael Bolot 572d5cc9bc Allowing validators to have multiple admits
Changes the validator interface to allow a given validator to
use multiple admit functions
2023-05-31 08:57:11 -05:00
Kevin Joiner f36421b8a7 golangci-lint cleanup 2023-05-04 11:30:52 -04:00
Kevin Joiner 035bb26e6e Use clients instead of apply. 2023-04-21 13:29:36 -05:00
Kevin Joiner 5506f400e3 Allows namespace webhook to provide multiple configurations.
This commit allows attempts to create the kube-system namespace
while the webhook is down to pass through rancher-webhook.
2023-03-17 14:12:20 -04:00
Kevin Joiner 5f4f390a87 Restructered webhook registration.
Webhook request routing is now handled by K8s.
2022-12-15 12:05:58 -05:00
Kevin Joiner b40aaecc2d Add healthz endpoint.
When starting up the webhook waits 15 second until applying its inital configuration.
The healthz endpoint was added to better signal if the configuration has been applied.
2022-11-18 10:45:05 -05:00
Kevin Joiner f7d97f52c2 Fix HTTPS Port 2022-09-08 16:20:21 -04:00
Kevin Joiner f1c9826fc8 Synchronizes TLS options for webhooks servers.
This commit also removes depericated code 'sigs.k8s.io/cluster-api/api/v1beta1.Cluster'
2022-09-07 12:56:51 -04:00
Donnie Adams 027b171b08 Bump CAPI to v1.0.2 2021-12-23 17:16:26 -07:00
Nick Gerace c85c8d7fcd Set certificate expiration to 10 years by default 2021-11-19 14:04:34 -05:00
Donnie Adams e0bd65cd73 Remove mutation webhook config for global role bindings
A previous change mistakenly added a mutation webhook configuration for
global role bindings. This change removes this configuration because
there are no such webhooks.
2021-09-16 12:26:25 -07:00
Ryan Sanna b5673383d6 omit rules from webhook configs if mcm is disabled and update wrangler, always mount v1.Cluster validation handler 2021-09-15 15:05:30 -07:00
Ricardo Weir 258c781cc5 Move features registration 2021-08-26 15:32:09 -07:00
Ricardo Weir c563c16d19 Migrate Feature type validation 2021-08-25 14:53:18 -07:00
Dan Ramich dc96bcbfd7 Add creatorID anno to secrets on create 2021-07-16 13:57:10 -06:00
Donnie Adams 355a6233e3 Use mutationPath for mutation service config
The validationPath was accidentally used for the mutation service
config. This change alters this to use the mutationPath.
2021-07-06 10:38:59 -07:00
Dan Ramich e25132add2 Add mutation and validation for provisioning clusters 2021-07-01 16:28:18 -06:00
Ryan Sanna c52a5a2d01 forwardport global role validation logic 2021-06-23 10:30:36 -07:00
Dan Ramich 9e95240815 Add versions and wait for k8s to be available on startup 2021-06-21 10:20:57 -06:00
Darren Shepherd 918498f107 Allow webhook to run when mcm is disabled 2021-06-16 10:55:15 -07:00
Darren Shepherd 8b96e4600a Add capi webhooks 2021-02-19 19:33:54 -07:00
Daishan 938754f369 Add mutatingwebhook for fleetworkspace
Add mutating webhook so that when user creates fleetworkspace they are
automatically assigned to fleetworkspace-admin role in that namespace
2020-11-23 13:15:47 -07:00
Darren Shepherd 0e8491720f Restructure code 2020-11-09 22:03:39 -07:00