mirror of
https://github.com/k8sgpt-ai/k8sgpt.git
synced 2025-08-19 08:17:04 +00:00
Merge branch 'main' into fix/kubectx
This commit is contained in:
commit
53a19bb04d
@ -35,6 +35,7 @@ var AuthCmd = &cobra.Command{
|
|||||||
// override the default backend if a flag is provided
|
// override the default backend if a flag is provided
|
||||||
if backend != "" {
|
if backend != "" {
|
||||||
backendType = backend
|
backendType = backend
|
||||||
|
color.Green("Using %s as backend AI provider", backendType)
|
||||||
}
|
}
|
||||||
|
|
||||||
fmt.Printf("Enter %s Key: ", backendType)
|
fmt.Printf("Enter %s Key: ", backendType)
|
||||||
|
@ -22,6 +22,26 @@ func AnalyzeIngress(ctx context.Context, config *AnalysisConfiguration, client *
|
|||||||
|
|
||||||
for _, ing := range list.Items {
|
for _, ing := range list.Items {
|
||||||
var failures []string
|
var failures []string
|
||||||
|
|
||||||
|
// get ingressClassName
|
||||||
|
ingressClassName := ing.Spec.IngressClassName
|
||||||
|
if ingressClassName == nil {
|
||||||
|
ingClassValue := ing.Annotations["kubernetes.io/ingress.class"]
|
||||||
|
if ingClassValue == "" {
|
||||||
|
failures = append(failures, fmt.Sprintf("Ingress %s/%s does not specify an Ingress class.", ing.Namespace, ing.Name))
|
||||||
|
} else {
|
||||||
|
ingressClassName = &ingClassValue
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// check if ingressclass exist
|
||||||
|
if ingressClassName != nil {
|
||||||
|
_, err := client.GetClient().NetworkingV1().IngressClasses().Get(ctx, *ingressClassName, metav1.GetOptions{})
|
||||||
|
if err != nil {
|
||||||
|
failures = append(failures, fmt.Sprintf("Ingress uses the ingress class %s which does not exist.", *ingressClassName))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// loop over rules
|
// loop over rules
|
||||||
for _, rule := range ing.Spec.Rules {
|
for _, rule := range ing.Spec.Rules {
|
||||||
// loop over paths
|
// loop over paths
|
||||||
|
Loading…
Reference in New Issue
Block a user