【修改】k8s 配置

This commit is contained in:
PandaGoAdmin
2022-01-26 14:13:23 +08:00
parent 33cc74711d
commit 7723626e79
28 changed files with 221 additions and 372 deletions

View File

@@ -3,12 +3,13 @@ package ingress
import (
"context"
"fmt"
"pandax/base/global"
"pandax/apps/devops/entity/k8s"
k8scommon "pandax/apps/devops/services/k8s/common"
"pandax/apps/devops/services/k8s/dataselect"
//v1 "k8s.io/api/extensions/v1beta1"
v1 "k8s.io/api/networking/v1"
v1 "k8s.io/api/networking/v1beta1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
client "k8s.io/client-go/kubernetes"
)
@@ -36,7 +37,7 @@ type IngressList struct {
// GetIngressList returns all ingresses in the given namespace.
func GetIngressList(client *client.Clientset, namespace *k8scommon.NamespaceQuery, dsQuery *dataselect.DataSelectQuery) (*IngressList, error) {
//ingressList, err := client.ExtensionsV1beta1().Ingresses(namespace.ToRequestParam()).List(context.TODO(), k8s.ListEverything)
ingressList, err := client.NetworkingV1().Ingresses(namespace.ToRequestParam()).List(context.TODO(), k8s.ListEverything)
ingressList, err := client.NetworkingV1beta1().Ingresses(namespace.ToRequestParam()).List(context.TODO(), k8s.ListEverything)
if err != nil {
return nil, err

View File

@@ -3,7 +3,7 @@ package ingress
import (
"pandax/apps/devops/services/k8s/dataselect"
//v1 "k8s.io/api/extensions/v1beta1"
v1 "k8s.io/api/networking/v1"
v1 "k8s.io/api/networking/v1beta1"
)
// The code below allows to perform complex data section on []extensions.Ingress

View File

@@ -6,7 +6,7 @@ import (
"pandax/base/global"
//v1 "k8s.io/api/extensions/v1beta1"
v1 "k8s.io/api/networking/v1"
v1 "k8s.io/api/networking/v1beta1"
metaV1 "k8s.io/apimachinery/pkg/apis/meta/v1"
client "k8s.io/client-go/kubernetes"
)
@@ -29,7 +29,7 @@ func GetIngressDetail(client *client.Clientset, namespace, name string) (*Ingres
global.Log.Info(fmt.Sprintf("Getting details of %s ingress in %s namespace", name, namespace))
//rawIngress, err := client.ExtensionsV1beta1().Ingresses(namespace).Get(context.TODO(), name, metaV1.GetOptions{})
rawIngress, err := client.NetworkingV1().Ingresses(namespace).Get(context.TODO(), name, metaV1.GetOptions{})
rawIngress, err := client.NetworkingV1beta1().Ingresses(namespace).Get(context.TODO(), name, metaV1.GetOptions{})
if err != nil {
return nil, err
}