mirror of https://github.com/knative/func.git
fix: update to Knative 0.17 (#145)
Also adjusted some dependencies and overwrite version to align transitive dependencies. Not sure why buildpack uses such an older docker dependency but that clases with the docker dependency that is introduced by knative-dev/test-infra (which is a dependency of the knative direct dependencies) If there is a way to exclude a transitive dependency like that on test-infra, this could be the better way to achieve the same result. The build now works on macOs natively which was not the case before.
This commit is contained in:
parent
54e9b2703e
commit
5fe70526e5
41
go.mod
41
go.mod
|
@ -3,23 +3,34 @@ module github.com/boson-project/faas
|
|||
go 1.14
|
||||
|
||||
require (
|
||||
github.com/buildpacks/pack v0.13.1
|
||||
github.com/golang/mock v1.4.3 // indirect
|
||||
github.com/google/go-containerregistry v0.0.0-20200423114255-8f808463544c // indirect
|
||||
github.com/imdario/mergo v0.3.10 // indirect
|
||||
github.com/buildpacks/pack v0.14.0
|
||||
github.com/markbates/pkger v0.17.0
|
||||
github.com/mattn/go-colorable v0.1.7 // indirect
|
||||
github.com/mitchellh/go-homedir v1.1.0
|
||||
github.com/onsi/gomega v1.10.1 // indirect
|
||||
github.com/ory/viper v1.7.4
|
||||
github.com/spf13/cobra v1.0.0
|
||||
github.com/stretchr/testify v1.5.1 // indirect
|
||||
golang.org/x/sys v0.0.0-20200728102440-3e129f6d46b1 // indirect
|
||||
github.com/spf13/cobra v1.0.1-0.20200715031239-b95db644ed1c
|
||||
golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f // indirect
|
||||
gopkg.in/yaml.v2 v2.3.0
|
||||
k8s.io/api v0.17.4
|
||||
k8s.io/apimachinery v0.17.4
|
||||
k8s.io/client-go v0.17.4
|
||||
knative.dev/client v0.14.0
|
||||
knative.dev/eventing v0.14.1
|
||||
knative.dev/serving v0.14.0
|
||||
k8s.io/api v0.18.8
|
||||
k8s.io/apimachinery v0.19.1
|
||||
k8s.io/client-go v11.0.1-0.20190805182717-6502b5e7b1b5+incompatible
|
||||
knative.dev/client v0.17.0
|
||||
knative.dev/eventing v0.17.5
|
||||
knative.dev/serving v0.17.3
|
||||
)
|
||||
|
||||
replace (
|
||||
// Replace with the version used in docker to overcome an issue with renamed
|
||||
// packages (and old docker versions)
|
||||
github.com/Sirupsen/logrus => github.com/sirupsen/logrus v1.7.0
|
||||
|
||||
// This is required to pin the docker module to that version that build packs are requiring
|
||||
// Otherwise it's overwritten by knative-dev/test-infra to a version v.1.13 that is higher
|
||||
github.com/docker/docker => github.com/docker/docker v1.4.2-0.20200221181110-62bd5a33f707
|
||||
|
||||
// Needed for macos
|
||||
golang.org/x/sys => golang.org/x/sys v0.0.0-20200302150141-5c8b2ff67527
|
||||
|
||||
// Nail down k8 deps to align with transisitive deps
|
||||
k8s.io/apimachinery => k8s.io/apimachinery v0.17.6
|
||||
k8s.io/client-go => k8s.io/client-go v0.17.6
|
||||
)
|
||||
|
|
|
@ -6,8 +6,7 @@ import (
|
|||
"io"
|
||||
"os"
|
||||
|
||||
commands "knative.dev/client/pkg/kn/commands"
|
||||
"knative.dev/client/pkg/kn/core"
|
||||
"knative.dev/client/pkg/kn/root"
|
||||
|
||||
"github.com/boson-project/faas"
|
||||
"github.com/boson-project/faas/k8s"
|
||||
|
@ -45,10 +44,10 @@ func (d *Deployer) Deploy(f faas.Function) (err error) {
|
|||
output = &bytes.Buffer{}
|
||||
}
|
||||
|
||||
params := commands.KnParams{}
|
||||
params.Initialize()
|
||||
params.Output = output
|
||||
c := core.NewKnCommand(params)
|
||||
c, err := root.NewRootCommand(nil)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
c.SetOut(output)
|
||||
args := []string{
|
||||
"service", "create", encodedName,
|
||||
|
|
|
@ -6,8 +6,8 @@ import (
|
|||
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
"k8s.io/client-go/rest"
|
||||
"knative.dev/eventing/pkg/apis/eventing/v1alpha1"
|
||||
eventingv1client "knative.dev/eventing/pkg/client/clientset/versioned/typed/eventing/v1alpha1"
|
||||
"knative.dev/eventing/pkg/apis/eventing/v1beta1"
|
||||
eventingv1client "knative.dev/eventing/pkg/client/clientset/versioned/typed/eventing/v1beta1"
|
||||
servingv1client "knative.dev/serving/pkg/client/clientset/versioned/typed/serving/v1alpha1"
|
||||
|
||||
"github.com/boson-project/faas"
|
||||
|
@ -18,7 +18,7 @@ type Describer struct {
|
|||
Verbose bool
|
||||
namespace string
|
||||
servingClient *servingv1client.ServingV1alpha1Client
|
||||
eventingClient *eventingv1client.EventingV1alpha1Client
|
||||
eventingClient *eventingv1client.EventingV1beta1Client
|
||||
config *rest.Config
|
||||
}
|
||||
|
||||
|
@ -79,7 +79,7 @@ func (describer *Describer) Describe(name string) (description faas.Description,
|
|||
return
|
||||
}
|
||||
|
||||
triggerMatches := func(t *v1alpha1.Trigger) bool {
|
||||
triggerMatches := func(t *v1beta1.Trigger) bool {
|
||||
return (t.Spec.Subscriber.Ref != nil && t.Spec.Subscriber.Ref.Name == service.Name) ||
|
||||
(t.Spec.Subscriber.URI != nil && service.Status.Address != nil && service.Status.Address.URL != nil &&
|
||||
t.Spec.Subscriber.URI.Path == service.Status.Address.URL.Path)
|
||||
|
@ -89,7 +89,7 @@ func (describer *Describer) Describe(name string) (description faas.Description,
|
|||
subscriptions := make([]faas.Subscription, 0, len(triggers.Items))
|
||||
for _, trigger := range triggers.Items {
|
||||
if triggerMatches(&trigger) {
|
||||
filterAttrs := *trigger.Spec.Filter.Attributes
|
||||
filterAttrs := trigger.Spec.Filter.Attributes
|
||||
subscription := faas.Subscription{
|
||||
Source: filterAttrs["source"],
|
||||
Type: filterAttrs["type"],
|
||||
|
|
Loading…
Reference in New Issue