-
Notifications
You must be signed in to change notification settings - Fork 70
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Add global client, accessible via webhooks (#353)
**Reason for Change**: Add global client, accessible via webhooks In this PR I also Separate setup and execution phase of webhook server, allows us to handle setup errors and setup context before attempting to run the webhook server
- Loading branch information
1 parent
9e2ac24
commit e2f5e25
Showing
2 changed files
with
35 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
// Copyright (c) Microsoft Corporation. | ||
// Licensed under the MIT license. | ||
package k8sclient | ||
|
||
import ( | ||
"sigs.k8s.io/controller-runtime/pkg/client" | ||
) | ||
|
||
var Client client.Client | ||
|
||
func SetGlobalClient(c client.Client) { | ||
Client = c | ||
} | ||
|
||
func GetGlobalClient() client.Client { | ||
return Client | ||
} |