Skip to content

Commit

Permalink
Revert "feat: add Validating/Mutating webhook analyzer (#548)" (#551)
Browse files Browse the repository at this point in the history
This reverts commit 750a10d.
  • Loading branch information
AlexsJones authored Jul 13, 2023
1 parent f844f73 commit 731e152
Show file tree
Hide file tree
Showing 5 changed files with 0 additions and 246 deletions.
2 changes: 0 additions & 2 deletions pkg/analyzer/analyzer.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,6 @@ var coreAnalyzerMap = map[string]common.IAnalyzer{
"StatefulSet": StatefulSetAnalyzer{},
"CronJob": CronJobAnalyzer{},
"Node": NodeAnalyzer{},
"ValidatingWebhook": ValidatingWebhookAnalyzer{},
"MutatingWebhook": MutatingWebhookAnalyzer{},
}

var additionalAnalyzerMap = map[string]common.IAnalyzer{
Expand Down
111 changes: 0 additions & 111 deletions pkg/analyzer/mutating-webhook.go

This file was deleted.

110 changes: 0 additions & 110 deletions pkg/analyzer/validating-webhook.go

This file was deleted.

3 changes: 0 additions & 3 deletions pkg/common/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ import (
openapi_v2 "github.com/google/gnostic/openapiv2"
"github.com/k8sgpt-ai/k8sgpt/pkg/ai"
"github.com/k8sgpt-ai/k8sgpt/pkg/kubernetes"
regv1 "k8s.io/api/admissionregistration/v1"
appsv1 "k8s.io/api/apps/v1"
autov1 "k8s.io/api/autoscaling/v1"
v1 "k8s.io/api/core/v1"
Expand Down Expand Up @@ -55,8 +54,6 @@ type PreAnalysis struct {
StatefulSet appsv1.StatefulSet
NetworkPolicy networkv1.NetworkPolicy
Node v1.Node
ValidatingWebhook regv1.ValidatingWebhookConfiguration
MutatingWebhook regv1.MutatingWebhookConfiguration
// Integrations
TrivyVulnerabilityReport trivy.VulnerabilityReport
}
Expand Down
20 changes: 0 additions & 20 deletions pkg/util/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -94,26 +94,6 @@ func GetParent(client *kubernetes.Client, meta metav1.ObjectMeta) (string, bool)
return GetParent(client, ds.ObjectMeta)
}
return "Ingress/" + ds.Name, false

case "MutatingWebhookConfiguration":
mw, err := client.GetClient().AdmissionregistrationV1().MutatingWebhookConfigurations().Get(context.Background(), owner.Name, metav1.GetOptions{})
if err != nil {
return "", false
}
if mw.OwnerReferences != nil {
return GetParent(client, mw.ObjectMeta)
}
return "MutatingWebhook/" + mw.Name, false

case "ValidatingWebhookConfiguration":
vw, err := client.GetClient().AdmissionregistrationV1().ValidatingWebhookConfigurations().Get(context.Background(), owner.Name, metav1.GetOptions{})
if err != nil {
return "", false
}
if vw.OwnerReferences != nil {
return GetParent(client, vw.ObjectMeta)
}
return "ValidatingWebhook/" + vw.Name, false
}
}
}
Expand Down

0 comments on commit 731e152

Please sign in to comment.