Skip to content

Commit

Permalink
为webhooks增加setter getter接口 (#192)
Browse files Browse the repository at this point in the history
* setter and getter for AdmissionWebhook

* fix: compatible if PodAvailableConditionsAnnotation already exist
  • Loading branch information
fdingiit committed Apr 25, 2024
1 parent facfc93 commit ac6e593
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions pkg/webhook/server/generic/pod/pod_webhook.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,3 +41,11 @@ func init() {
webhooks = append(webhooks, opslifecycle.New())
webhooks = append(webhooks, gracedelete.New())
}

func RegisterAdmissionWebhook(webhook AdmissionWebhook) {
webhooks = append(webhooks, webhook)
}

func ListAdmissionWebhooks() []AdmissionWebhook {
return webhooks
}

0 comments on commit ac6e593

Please sign in to comment.