Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: admission webhooks #553

Merged
merged 11 commits into from
Jul 14, 2023
11 changes: 11 additions & 0 deletions pkg/analyzer/mutating_webhook.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,17 @@ func (MutatingWebhookAnalyzer) Analyze(a common.Analyzer) ([]common.Result, erro
// Get the service
service, err := a.Client.GetClient().CoreV1().Services(svc.Namespace).Get(context.Background(), svc.Name, v1.GetOptions{})
if err != nil {
AlexsJones marked this conversation as resolved.
Show resolved Hide resolved
AlexsJones marked this conversation as resolved.
Show resolved Hide resolved
// If the service is not found, we can't check the pods
failures = append(failures, common.Failure{
Text: fmt.Sprintf("Service %s not found as mapped to by Mutating Webhook %s", svc.Name, webhook.Name),
KubernetesDoc: apiDoc.GetApiDocV2("spec.webhook.clientConfig.service"),
Sensitive: []common.Sensitive{
AlexsJones marked this conversation as resolved.
Show resolved Hide resolved
{
Unmasked: webhookConfig.Namespace,
Masked: util.MaskString(webhookConfig.Namespace),
},
},
})
return nil, err
}

Expand Down