Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

migrate to the new eventing legacy client #621

Merged
merged 3 commits into from
Jan 22, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
module knative.dev/client

require (
contrib.go.opencensus.io/exporter/ocagent v0.6.0 // indirect
contrib.go.opencensus.io/exporter/prometheus v0.1.0 // indirect
contrib.go.opencensus.io/exporter/stackdriver v0.12.9-0.20191108183826-59d068f8d8ff // indirect
github.com/google/go-containerregistry v0.0.0-20191029173801-50b26ee28691 // indirect
github.com/magiconair/properties v1.8.0
github.com/mattbaird/jsonpatch v0.0.0-20171005235357-81af80346b1a // indirect
github.com/mitchellh/go-homedir v1.1.0
github.com/openzipkin/zipkin-go v0.2.2 // indirect
github.com/pkg/errors v0.8.1
github.com/robfig/cron v1.2.0 // indirect
github.com/spf13/cobra v0.0.5
Expand All @@ -19,8 +21,8 @@ require (
k8s.io/apimachinery v0.0.0-20191004115701-31ade1b30762
k8s.io/cli-runtime v0.0.0-20191016113937-7693ce2cae74
k8s.io/client-go v0.0.0-20191016110837-54936ba21026
knative.dev/eventing v0.11.0
knative.dev/pkg v0.0.0-20191203221237-94a34e416c44
knative.dev/eventing v0.12.0
knative.dev/pkg v0.0.0-20200113182502-b8dc5fbc6d2f
knative.dev/serving v0.11.0
knative.dev/test-infra v0.0.0-20200116044902-d5990f0e5a05
sigs.k8s.io/yaml v1.1.0
Expand Down
36 changes: 32 additions & 4 deletions go.sum

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ package v1alpha1
import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
kn_errors "knative.dev/client/pkg/errors"
"knative.dev/eventing/pkg/apis/sources/v1alpha1"
client_v1alpha1 "knative.dev/eventing/pkg/client/clientset/versioned/typed/sources/v1alpha1"
"knative.dev/eventing/pkg/apis/legacysources/v1alpha1"
client_v1alpha1 "knative.dev/eventing/pkg/legacyclient/clientset/versioned/typed/legacysources/v1alpha1"
duckv1beta1 "knative.dev/pkg/apis/duck/v1beta1"
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ package v1alpha1
import (
"testing"

"knative.dev/eventing/pkg/apis/sources/v1alpha1"
"knative.dev/eventing/pkg/apis/legacysources/v1alpha1"

"knative.dev/client/pkg/util/mock"
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ package v1alpha1
import (
"testing"

"knative.dev/eventing/pkg/apis/sources/v1alpha1"
"knative.dev/eventing/pkg/apis/legacysources/v1alpha1"
)

func TestMockKnAPIServerSourceClient(t *testing.T) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ import (

metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
client_testing "k8s.io/client-go/testing"
"knative.dev/eventing/pkg/apis/sources/v1alpha1"
"knative.dev/eventing/pkg/client/clientset/versioned/typed/sources/v1alpha1/fake"
"knative.dev/eventing/pkg/apis/legacysources/v1alpha1"
"knative.dev/eventing/pkg/legacyclient/clientset/versioned/typed/legacysources/v1alpha1/fake"
"knative.dev/pkg/apis/duck/v1beta1"
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
package v1alpha1

import (
client_v1alpha1 "knative.dev/eventing/pkg/client/clientset/versioned/typed/sources/v1alpha1"
client_v1alpha1 "knative.dev/eventing/pkg/legacyclient/clientset/versioned/typed/legacysources/v1alpha1"
)

// KnSourcesClient to Eventing Sources. All methods are relative to the
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@ import (

metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime"
"knative.dev/eventing/pkg/apis/sources/v1alpha1"
"knative.dev/eventing/pkg/apis/legacysources/v1alpha1"

"knative.dev/client/pkg/util"
"knative.dev/eventing/pkg/client/clientset/versioned/scheme"
client_v1alpha1 "knative.dev/eventing/pkg/client/clientset/versioned/typed/sources/v1alpha1"
"knative.dev/eventing/pkg/legacyclient/clientset/versioned/scheme"
client_v1alpha1 "knative.dev/eventing/pkg/legacyclient/clientset/versioned/typed/legacysources/v1alpha1"
duckv1beta1 "knative.dev/pkg/apis/duck/v1beta1"
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ package v1alpha1
import (
"testing"

"knative.dev/eventing/pkg/apis/sources/v1alpha1"
"knative.dev/eventing/pkg/apis/legacysources/v1alpha1"

"knative.dev/client/pkg/util/mock"
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ package v1alpha1
import (
"testing"

"knative.dev/eventing/pkg/apis/sources/v1alpha1"
"knative.dev/eventing/pkg/apis/legacysources/v1alpha1"
)

func TestMockKnCronJobSourceClient(t *testing.T) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime"
client_testing "k8s.io/client-go/testing"
"knative.dev/eventing/pkg/apis/sources/v1alpha1"
"knative.dev/eventing/pkg/client/clientset/versioned/typed/sources/v1alpha1/fake"
"knative.dev/eventing/pkg/apis/legacysources/v1alpha1"
"knative.dev/eventing/pkg/legacyclient/clientset/versioned/typed/legacysources/v1alpha1/fake"
"knative.dev/pkg/apis/duck/v1beta1"
)

Expand Down
2 changes: 1 addition & 1 deletion pkg/eventing/v1alpha1/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ func (b *TriggerBuilder) Namespace(ns string) *TriggerBuilder {

// Subscriber for the trigger to send to (it's a Sink actually)
func (b *TriggerBuilder) Subscriber(subscriber *duckv1.Destination) *TriggerBuilder {
b.trigger.Spec.Subscriber = subscriber
b.trigger.Spec.Subscriber = *subscriber
return b
}

Expand Down
4 changes: 2 additions & 2 deletions pkg/kn/commands/source/apiserver/apiserver.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ import (
"github.com/spf13/cobra"
"k8s.io/client-go/tools/clientcmd"

sources_v1alpha1 "knative.dev/eventing/pkg/client/clientset/versioned/typed/sources/v1alpha1"
sources_v1alpha1 "knative.dev/eventing/pkg/legacyclient/clientset/versioned/typed/legacysources/v1alpha1"

knsources_v1alpha1 "knative.dev/client/pkg/eventing/sources/v1alpha1"
knsources_v1alpha1 "knative.dev/client/pkg/eventing/legacysources/v1alpha1"
"knative.dev/client/pkg/kn/commands"
)

Expand Down
4 changes: 2 additions & 2 deletions pkg/kn/commands/source/apiserver/apiserver_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ import (
corev1 "k8s.io/api/core/v1"
"k8s.io/client-go/tools/clientcmd"
kn_dynamic "knative.dev/client/pkg/dynamic"
"knative.dev/eventing/pkg/apis/sources/v1alpha1"
"knative.dev/eventing/pkg/apis/legacysources/v1alpha1"
duckv1beta1 "knative.dev/pkg/apis/duck/v1beta1"

knsource_v1alpha1 "knative.dev/client/pkg/eventing/sources/v1alpha1"
knsource_v1alpha1 "knative.dev/client/pkg/eventing/legacysources/v1alpha1"
"knative.dev/client/pkg/kn/commands"
)

Expand Down
2 changes: 1 addition & 1 deletion pkg/kn/commands/source/apiserver/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import (

"github.com/spf13/cobra"

"knative.dev/client/pkg/eventing/sources/v1alpha1"
"knative.dev/client/pkg/eventing/legacysources/v1alpha1"
"knative.dev/client/pkg/kn/commands"
"knative.dev/client/pkg/kn/commands/flags"
)
Expand Down
2 changes: 1 addition & 1 deletion pkg/kn/commands/source/apiserver/create_flag_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import (
"testing"

"gotest.tools/assert"
sources_v1alpha1 "knative.dev/eventing/pkg/apis/sources/v1alpha1"
sources_v1alpha1 "knative.dev/eventing/pkg/apis/legacysources/v1alpha1"
)

func TestGetAPIServerResourceArray(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion pkg/kn/commands/source/apiserver/create_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import (
"gotest.tools/assert"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
dynamic_fake "knative.dev/client/pkg/dynamic/fake"
knsources_v1alpha1 "knative.dev/client/pkg/eventing/sources/v1alpha1"
knsources_v1alpha1 "knative.dev/client/pkg/eventing/legacysources/v1alpha1"
"knative.dev/client/pkg/util"
serving_v1alpha1 "knative.dev/serving/pkg/apis/serving/v1alpha1"
)
Expand Down
2 changes: 1 addition & 1 deletion pkg/kn/commands/source/apiserver/delete_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import (

"gotest.tools/assert"

knsources_v1alpha1 "knative.dev/client/pkg/eventing/sources/v1alpha1"
knsources_v1alpha1 "knative.dev/client/pkg/eventing/legacysources/v1alpha1"
"knative.dev/client/pkg/util"
)

Expand Down
2 changes: 1 addition & 1 deletion pkg/kn/commands/source/apiserver/describe.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import (
"strconv"

"github.com/spf13/cobra"
"knative.dev/eventing/pkg/apis/sources/v1alpha1"
"knative.dev/eventing/pkg/apis/legacysources/v1alpha1"
duckv1beta1 "knative.dev/pkg/apis/duck/v1beta1"

"knative.dev/client/pkg/kn/commands"
Expand Down
2 changes: 1 addition & 1 deletion pkg/kn/commands/source/apiserver/describe_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import (

"gotest.tools/assert"

knsource_v1alpha1 "knative.dev/client/pkg/eventing/sources/v1alpha1"
knsource_v1alpha1 "knative.dev/client/pkg/eventing/legacysources/v1alpha1"
"knative.dev/client/pkg/util"
)

Expand Down
2 changes: 1 addition & 1 deletion pkg/kn/commands/source/apiserver/flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import (
"github.com/spf13/cobra"
"k8s.io/apimachinery/pkg/runtime"
"knative.dev/client/pkg/kn/commands"
"knative.dev/eventing/pkg/apis/sources/v1alpha1"
"knative.dev/eventing/pkg/apis/legacysources/v1alpha1"

metav1beta1 "k8s.io/apimachinery/pkg/apis/meta/v1beta1"
hprinters "knative.dev/client/pkg/printers"
Expand Down
4 changes: 2 additions & 2 deletions pkg/kn/commands/source/apiserver/list_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ import (

"gotest.tools/assert"

knsource_v1alpha1 "knative.dev/client/pkg/eventing/sources/v1alpha1"
knsource_v1alpha1 "knative.dev/client/pkg/eventing/legacysources/v1alpha1"
"knative.dev/client/pkg/util"
"knative.dev/eventing/pkg/apis/sources/v1alpha1"
"knative.dev/eventing/pkg/apis/legacysources/v1alpha1"
)

func TestListAPIServerSource(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion pkg/kn/commands/source/apiserver/update.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import (

"github.com/spf13/cobra"

"knative.dev/client/pkg/eventing/sources/v1alpha1"
"knative.dev/client/pkg/eventing/legacysources/v1alpha1"
"knative.dev/client/pkg/kn/commands"
"knative.dev/client/pkg/kn/commands/flags"
)
Expand Down
2 changes: 1 addition & 1 deletion pkg/kn/commands/source/apiserver/update_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import (
serving_v1alpha1 "knative.dev/serving/pkg/apis/serving/v1alpha1"

dynamic_fake "knative.dev/client/pkg/dynamic/fake"
knsources_v1alpha1 "knative.dev/client/pkg/eventing/sources/v1alpha1"
knsources_v1alpha1 "knative.dev/client/pkg/eventing/legacysources/v1alpha1"
"knative.dev/client/pkg/util"
)

Expand Down
2 changes: 1 addition & 1 deletion pkg/kn/commands/source/cronjob/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import (

"github.com/spf13/cobra"

"knative.dev/client/pkg/eventing/sources/v1alpha1"
"knative.dev/client/pkg/eventing/legacysources/v1alpha1"
"knative.dev/client/pkg/kn/commands"
"knative.dev/client/pkg/kn/commands/flags"
)
Expand Down
2 changes: 1 addition & 1 deletion pkg/kn/commands/source/cronjob/create_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import (
dynamic_fake "knative.dev/client/pkg/dynamic/fake"
serving_v1alpha1 "knative.dev/serving/pkg/apis/serving/v1alpha1"

v1alpha12 "knative.dev/client/pkg/eventing/sources/v1alpha1"
v1alpha12 "knative.dev/client/pkg/eventing/legacysources/v1alpha1"
"knative.dev/client/pkg/util"
)

Expand Down
4 changes: 2 additions & 2 deletions pkg/kn/commands/source/cronjob/cronjob.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ package cronjob
import (
"github.com/spf13/cobra"
"k8s.io/client-go/tools/clientcmd"
sources_v1alpha1 "knative.dev/eventing/pkg/client/clientset/versioned/typed/sources/v1alpha1"
sources_v1alpha1 "knative.dev/eventing/pkg/legacyclient/clientset/versioned/typed/legacysources/v1alpha1"

"knative.dev/client/pkg/eventing/sources/v1alpha1"
"knative.dev/client/pkg/eventing/legacysources/v1alpha1"
"knative.dev/client/pkg/kn/commands"
)

Expand Down
4 changes: 2 additions & 2 deletions pkg/kn/commands/source/cronjob/cronjob_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@ import (

corev1 "k8s.io/api/core/v1"
"k8s.io/client-go/tools/clientcmd"
"knative.dev/eventing/pkg/apis/sources/v1alpha1"
"knative.dev/eventing/pkg/apis/legacysources/v1alpha1"
"knative.dev/pkg/apis/duck/v1beta1"

kn_dynamic "knative.dev/client/pkg/dynamic"
source_client_v1alpha1 "knative.dev/client/pkg/eventing/sources/v1alpha1"
source_client_v1alpha1 "knative.dev/client/pkg/eventing/legacysources/v1alpha1"
"knative.dev/client/pkg/kn/commands"
)

Expand Down
2 changes: 1 addition & 1 deletion pkg/kn/commands/source/cronjob/delete_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import (

"gotest.tools/assert"

v1alpha12 "knative.dev/client/pkg/eventing/sources/v1alpha1"
v1alpha12 "knative.dev/client/pkg/eventing/legacysources/v1alpha1"
"knative.dev/client/pkg/util"
)

Expand Down
2 changes: 1 addition & 1 deletion pkg/kn/commands/source/cronjob/describe.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import (
"fmt"

"github.com/spf13/cobra"
"knative.dev/eventing/pkg/apis/sources/v1alpha1"
"knative.dev/eventing/pkg/apis/legacysources/v1alpha1"
duckv1beta1 "knative.dev/pkg/apis/duck/v1beta1"

"knative.dev/client/pkg/kn/commands"
Expand Down
4 changes: 2 additions & 2 deletions pkg/kn/commands/source/cronjob/describe_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ import (
"gotest.tools/assert"
corev1 "k8s.io/api/core/v1"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"knative.dev/eventing/pkg/apis/sources/v1alpha1"
"knative.dev/eventing/pkg/apis/legacysources/v1alpha1"
"knative.dev/pkg/apis/duck/v1beta1"

v1alpha12 "knative.dev/client/pkg/eventing/sources/v1alpha1"
v1alpha12 "knative.dev/client/pkg/eventing/legacysources/v1alpha1"
"knative.dev/client/pkg/util"
)

Expand Down
2 changes: 1 addition & 1 deletion pkg/kn/commands/source/cronjob/flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import (
"knative.dev/client/pkg/kn/commands"
hprinters "knative.dev/client/pkg/printers"

"knative.dev/eventing/pkg/apis/sources/v1alpha1"
"knative.dev/eventing/pkg/apis/legacysources/v1alpha1"
)

type cronJobUpdateFlags struct {
Expand Down
4 changes: 2 additions & 2 deletions pkg/kn/commands/source/cronjob/list_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ import (

"gotest.tools/assert"

knsource_v1alpha1 "knative.dev/client/pkg/eventing/sources/v1alpha1"
knsource_v1alpha1 "knative.dev/client/pkg/eventing/legacysources/v1alpha1"
"knative.dev/client/pkg/util"
"knative.dev/eventing/pkg/apis/sources/v1alpha1"
"knative.dev/eventing/pkg/apis/legacysources/v1alpha1"
)

func TestListCronJobSource(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion pkg/kn/commands/source/cronjob/update.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import (

"github.com/spf13/cobra"

"knative.dev/client/pkg/eventing/sources/v1alpha1"
"knative.dev/client/pkg/eventing/legacysources/v1alpha1"
"knative.dev/client/pkg/kn/commands"
"knative.dev/client/pkg/kn/commands/flags"
)
Expand Down
4 changes: 2 additions & 2 deletions pkg/kn/commands/source/cronjob/update_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ import (
"gotest.tools/assert"
corev1 "k8s.io/api/core/v1"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"knative.dev/eventing/pkg/apis/sources/v1alpha1"
"knative.dev/eventing/pkg/apis/legacysources/v1alpha1"
"knative.dev/pkg/apis/duck/v1beta1"

v1alpha12 "knative.dev/client/pkg/eventing/sources/v1alpha1"
v1alpha12 "knative.dev/client/pkg/eventing/legacysources/v1alpha1"
"knative.dev/client/pkg/util"
)

Expand Down
4 changes: 2 additions & 2 deletions pkg/kn/commands/testing_helper.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,10 @@ import (

dynamic_fake "k8s.io/client-go/dynamic/fake"
dynamic_kn "knative.dev/client/pkg/dynamic"
sources_client "knative.dev/client/pkg/eventing/sources/v1alpha1"
sources_client "knative.dev/client/pkg/eventing/legacysources/v1alpha1"
eventing_client "knative.dev/client/pkg/eventing/v1alpha1"
eventing_fake "knative.dev/eventing/pkg/client/clientset/versioned/typed/eventing/v1alpha1/fake"
sources_fake "knative.dev/eventing/pkg/client/clientset/versioned/typed/sources/v1alpha1/fake"
sources_fake "knative.dev/eventing/pkg/legacyclient/clientset/versioned/typed/legacysources/v1alpha1/fake"
)

const FakeNamespace = "current"
Expand Down
2 changes: 1 addition & 1 deletion pkg/kn/commands/testing_helper_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import (
"github.com/spf13/cobra"
"gotest.tools/assert"
dynamic_fake "k8s.io/client-go/dynamic/fake"
sources_fake "knative.dev/eventing/pkg/client/clientset/versioned/typed/sources/v1alpha1/fake"
sources_fake "knative.dev/eventing/pkg/legacyclient/clientset/versioned/typed/legacysources/v1alpha1/fake"
"knative.dev/serving/pkg/client/clientset/versioned/typed/serving/v1alpha1/fake"
)

Expand Down
2 changes: 1 addition & 1 deletion pkg/kn/commands/trigger/describe.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ func NewTriggerDescribeCommand(p *commands.KnParams) *cobra.Command {
}

// Revisions summary info
writeSink(dw, trigger.Spec.Subscriber)
writeSink(dw, &trigger.Spec.Subscriber)
dw.WriteLine()
if err := dw.Flush(); err != nil {
return err
Expand Down
Loading