diff --git a/deploy-all-in-one-tls.yaml b/deploy-all-in-one-tls.yaml index 3401bca52..f5b05363c 100644 --- a/deploy-all-in-one-tls.yaml +++ b/deploy-all-in-one-tls.yaml @@ -280,7 +280,7 @@ data: ca-certificates.crt: ENCODED_CERTIFICATE --- # deployment -apiVersion: extensions/v1beta1 +apiVersion: apps/v1 kind: Deployment metadata: name: botkube diff --git a/deploy-all-in-one.yaml b/deploy-all-in-one.yaml index f3f4df10c..d7123b8e2 100644 --- a/deploy-all-in-one.yaml +++ b/deploy-all-in-one.yaml @@ -270,7 +270,7 @@ subjects: namespace: botkube --- # deployment -apiVersion: extensions/v1beta1 +apiVersion: apps/v1 kind: Deployment metadata: name: botkube diff --git a/helm/botkube/templates/deployment.yaml b/helm/botkube/templates/deployment.yaml index 809392ad2..cfcc87916 100644 --- a/helm/botkube/templates/deployment.yaml +++ b/helm/botkube/templates/deployment.yaml @@ -1,4 +1,4 @@ -apiVersion: extensions/v1beta1 +apiVersion: apps/v1 kind: Deployment metadata: name: {{ include "botkube.fullname" . }} diff --git a/pkg/events/events.go b/pkg/events/events.go index 8b1c215ee..5ae52b62b 100644 --- a/pkg/events/events.go +++ b/pkg/events/events.go @@ -10,7 +10,7 @@ import ( appsV1 "k8s.io/api/apps/v1" batchV1 "k8s.io/api/batch/v1" apiV1 "k8s.io/api/core/v1" - extV1beta1 "k8s.io/api/extensions/v1beta1" + networkV1beta1 "k8s.io/api/networking/v1beta1" rbacV1 "k8s.io/api/rbac/v1" ) @@ -134,7 +134,7 @@ func New(object interface{}, eventType config.EventType, kind string) Event { case *apiV1.ConfigMap: event.Kind = "ConfigMap" - case *extV1beta1.Ingress: + case *networkV1beta1.Ingress: event.Kind = "Ingress" case *appsV1.DaemonSet: diff --git a/pkg/filterengine/filters/ingress_validator.go b/pkg/filterengine/filters/ingress_validator.go index d79444cf2..04b0d2fb6 100644 --- a/pkg/filterengine/filters/ingress_validator.go +++ b/pkg/filterengine/filters/ingress_validator.go @@ -7,7 +7,7 @@ import ( "github.com/infracloudio/botkube/pkg/events" "github.com/infracloudio/botkube/pkg/filterengine" log "github.com/infracloudio/botkube/pkg/logging" - extV1beta1 "k8s.io/api/extensions/v1beta1" + networkV1beta1 "k8s.io/api/networking/v1beta1" ) // IngressValidator checks if service and tls secret used in ingress specs is already present @@ -28,7 +28,7 @@ func (iv IngressValidator) Run(object interface{}, event *events.Event) { if event.Kind != "Ingress" || event.Type != config.CreateEvent { return } - ingressObj, ok := object.(*extV1beta1.Ingress) + ingressObj, ok := object.(*networkV1beta1.Ingress) if !ok { return } diff --git a/pkg/utils/utils.go b/pkg/utils/utils.go index 0dedb9153..6b7a9e13b 100644 --- a/pkg/utils/utils.go +++ b/pkg/utils/utils.go @@ -11,7 +11,7 @@ import ( appsV1 "k8s.io/api/apps/v1" batchV1 "k8s.io/api/batch/v1" apiV1 "k8s.io/api/core/v1" - extV1beta1 "k8s.io/api/extensions/v1beta1" + networkV1beta1 "k8s.io/api/networking/v1beta1" rbacV1 "k8s.io/api/rbac/v1" metaV1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/client-go/informers" @@ -103,7 +103,7 @@ func InitInformerMap() { ResourceInformerMap["replicaset"] = KubeInformerFactory.Apps().V1().ReplicaSets().Informer() ResourceInformerMap["statefulset"] = KubeInformerFactory.Apps().V1().StatefulSets().Informer() - ResourceInformerMap["ingress"] = KubeInformerFactory.Extensions().V1beta1().Ingresses().Informer() + ResourceInformerMap["ingress"] = KubeInformerFactory.Networking().V1beta1().Ingresses().Informer() ResourceInformerMap["job"] = KubeInformerFactory.Batch().V1().Jobs().Informer() @@ -186,7 +186,7 @@ func GetObjectMetaData(obj interface{}) metaV1.ObjectMeta { case *appsV1.StatefulSet: objectMeta = object.ObjectMeta - case *extV1beta1.Ingress: + case *networkV1beta1.Ingress: objectMeta = object.ObjectMeta case *batchV1.Job: @@ -240,7 +240,7 @@ func GetObjectTypeMetaData(obj interface{}) metaV1.TypeMeta { case *appsV1.StatefulSet: typeMeta = object.TypeMeta - case *extV1beta1.Ingress: + case *networkV1beta1.Ingress: typeMeta = object.TypeMeta case *batchV1.Job: diff --git a/test/e2e/filters/filters.go b/test/e2e/filters/filters.go index 07577b061..375735e0c 100644 --- a/test/e2e/filters/filters.go +++ b/test/e2e/filters/filters.go @@ -10,7 +10,7 @@ import ( "github.com/nlopes/slack" "github.com/stretchr/testify/assert" v1 "k8s.io/api/core/v1" - extV1beta1 "k8s.io/api/extensions/v1beta1" + networkV1beta1 "k8s.io/api/networking/v1beta1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/util/intstr" ) @@ -54,7 +54,7 @@ func (c *context) testFilters(t *testing.T) { "test IngressValidator filter": { Kind: "ingress", Namespace: "test", - Specs: &extV1beta1.Ingress{ObjectMeta: metav1.ObjectMeta{Name: "ingress-with-service"}, Spec: extV1beta1.IngressSpec{Rules: []extV1beta1.IngressRule{{IngressRuleValue: extV1beta1.IngressRuleValue{HTTP: &extV1beta1.HTTPIngressRuleValue{Paths: []extV1beta1.HTTPIngressPath{{Path: "testpath", Backend: extV1beta1.IngressBackend{ServiceName: "test-service", ServicePort: intstr.FromInt(80)}}}}}}}}}, + Specs: &networkV1beta1.Ingress{ObjectMeta: metav1.ObjectMeta{Name: "ingress-with-service"}, Spec: networkV1beta1.IngressSpec{Rules: []networkV1beta1.IngressRule{{IngressRuleValue: networkV1beta1.IngressRuleValue{HTTP: &networkV1beta1.HTTPIngressRuleValue{Paths: []networkV1beta1.HTTPIngressPath{{Path: "testpath", Backend: networkV1beta1.IngressBackend{ServiceName: "test-service", ServicePort: intstr.FromInt(80)}}}}}}}}}, ExpectedSlackMessage: utils.SlackMessage{ Attachments: []slack.Attachment{{Color: "good", Fields: []slack.AttachmentField{{Title: "Ingress create", Value: "Ingress *test/ingress-with-service* has been created in *test-cluster-1* cluster\n```Warnings:\n- Service 'test-service' used in ingress 'ingress-with-service' config does not exist or port '80' not exposed\n```", Short: false}}, Footer: "BotKube"}}, }, diff --git a/test/e2e/utils/utils.go b/test/e2e/utils/utils.go index 351e69b7e..0e9e62d3e 100644 --- a/test/e2e/utils/utils.go +++ b/test/e2e/utils/utils.go @@ -8,7 +8,7 @@ import ( "github.com/infracloudio/botkube/pkg/utils" "github.com/nlopes/slack" v1 "k8s.io/api/core/v1" - extV1beta1 "k8s.io/api/extensions/v1beta1" + networkV1beta1 "k8s.io/api/networking/v1beta1" "k8s.io/apimachinery/pkg/runtime" ) @@ -51,8 +51,8 @@ func CreateResource(t *testing.T, obj CreateObjects) { t.Fatalf("Failed to create service: %v", err) } case "ingress": - s := obj.Specs.(*extV1beta1.Ingress) - _, err := utils.KubeClient.ExtensionsV1beta1().Ingresses(obj.Namespace).Create(s) + s := obj.Specs.(*networkV1beta1.Ingress) + _, err := utils.KubeClient.NetworkingV1beta1().Ingresses(obj.Namespace).Create(s) if err != nil { t.Fatalf("Failed to create service: %v", err) }