Skip to content
This repository was archived by the owner on May 3, 2022. It is now read-only.

Commit 8725217

Browse files
committed
shipper: don't lie about webhook's identity
The webhook was getting a client that had rolloutblocks controller as its user agent. Even though rollout blocks were indeed what the client was being used for, that's not guaranteed to stay true forever. So let's make sure we give the webhook a client tied to its own identity.
1 parent 210dc95 commit 8725217

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

cmd/shipper/main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -518,7 +518,7 @@ func startWebhook(cfg *cfg) (bool, error) {
518518
cfg.webhookBindPort,
519519
cfg.webhookKeyPath,
520520
cfg.webhookCertPath,
521-
client.NewShipperClientOrDie(cfg.restCfg, rolloutblock.AgentName, cfg.restTimeout),
521+
client.NewShipperClientOrDie(cfg.restCfg, webhook.AgentName, cfg.restTimeout),
522522
cfg.shipperInformerFactory)
523523

524524
cfg.wg.Add(1)

pkg/webhook/webhook.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,10 @@ import (
2424
"github.com/bookingcom/shipper/pkg/util/rolloutblock"
2525
)
2626

27+
const (
28+
AgentName = "webhook"
29+
)
30+
2731
type Webhook struct {
2832
shipperClientset clientset.Interface
2933
rolloutBlocksLister listers.RolloutBlockLister

0 commit comments

Comments
 (0)