Skip to content

Commit

Permalink
Merge pull request #92724 from chelseychen/event-e2e
Browse files Browse the repository at this point in the history
Update Event CRUD tests to use events.k8s.io/v1
  • Loading branch information
k8s-ci-robot authored Jul 3, 2020
2 parents d5f76a9 + b0a0335 commit a472138
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
4 changes: 2 additions & 2 deletions test/e2e/instrumentation/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@ go_library(
importpath = "k8s.io/kubernetes/test/e2e/instrumentation",
deps = [
"//staging/src/k8s.io/api/core/v1:go_default_library",
"//staging/src/k8s.io/api/events/v1beta1:go_default_library",
"//staging/src/k8s.io/api/events/v1:go_default_library",
"//staging/src/k8s.io/apimachinery/pkg/api/equality:go_default_library",
"//staging/src/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library",
"//staging/src/k8s.io/apimachinery/pkg/types:go_default_library",
"//staging/src/k8s.io/apimachinery/pkg/util/diff:go_default_library",
"//staging/src/k8s.io/client-go/kubernetes/typed/events/v1beta1:go_default_library",
"//staging/src/k8s.io/client-go/kubernetes/typed/events/v1:go_default_library",
"//test/e2e/framework:go_default_library",
"//test/e2e/instrumentation/common:go_default_library",
"//test/e2e/instrumentation/logging:go_default_library",
Expand Down
18 changes: 9 additions & 9 deletions test/e2e/instrumentation/events.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,21 +23,21 @@ import (
"time"

"k8s.io/api/core/v1"
eventsv1beta1 "k8s.io/api/events/v1beta1"
eventsv1 "k8s.io/api/events/v1"
apiequality "k8s.io/apimachinery/pkg/api/equality"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/util/diff"
typedeventsv1beta1 "k8s.io/client-go/kubernetes/typed/events/v1beta1"
typedeventsv1 "k8s.io/client-go/kubernetes/typed/events/v1"
"k8s.io/kubernetes/test/e2e/framework"
"k8s.io/kubernetes/test/e2e/instrumentation/common"

"github.com/onsi/ginkgo"
"k8s.io/apimachinery/pkg/types"
)

func newTestEvent(namespace, name, label string) *eventsv1beta1.Event {
func newTestEvent(namespace, name, label string) *eventsv1.Event {
someTime := metav1.MicroTime{Time: time.Unix(1505828956, 0)}
return &eventsv1beta1.Event{
return &eventsv1.Event{
ObjectMeta: metav1.ObjectMeta{
Name: name,
Labels: map[string]string{
Expand All @@ -57,7 +57,7 @@ func newTestEvent(namespace, name, label string) *eventsv1beta1.Event {
}
}

func eventExistsInList(client typedeventsv1beta1.EventInterface, namespace, name string) bool {
func eventExistsInList(client typedeventsv1.EventInterface, namespace, name string) bool {
eventsList, err := client.List(context.TODO(), metav1.ListOptions{
LabelSelector: "testevent-constant=true",
})
Expand All @@ -73,12 +73,12 @@ func eventExistsInList(client typedeventsv1beta1.EventInterface, namespace, name

var _ = common.SIGDescribe("Events API", func() {
f := framework.NewDefaultFramework("events")
var client typedeventsv1beta1.EventInterface
var clientAllNamespaces typedeventsv1beta1.EventInterface
var client typedeventsv1.EventInterface
var clientAllNamespaces typedeventsv1.EventInterface

ginkgo.BeforeEach(func() {
client = f.ClientSet.EventsV1beta1().Events(f.Namespace.Name)
clientAllNamespaces = f.ClientSet.EventsV1beta1().Events(metav1.NamespaceAll)
client = f.ClientSet.EventsV1().Events(f.Namespace.Name)
clientAllNamespaces = f.ClientSet.EventsV1().Events(metav1.NamespaceAll)
})

/*
Expand Down

0 comments on commit a472138

Please sign in to comment.