Skip to content

Commit

Permalink
cherrypick bugfixes
Browse files Browse the repository at this point in the history
* Fix symlink path separators knative#934
* Make a map when filters is nil knative#958

Signed-off-by: Matej Vašek <[email protected]>
  • Loading branch information
matejvasek committed Nov 5, 2024
1 parent d4911e1 commit 9a3ae2c
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 7 deletions.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,7 @@ require (
replace (
k8s.io/client-go => k8s.io/client-go v0.29.3
knative.dev/eventing => knative.dev/eventing v0.41.0
knative.dev/func => github.com/openshift-knative/kn-plugin-func v1.1.3-0.20241003082231-25c6d78a7626
knative.dev/func => github.com/openshift-knative/kn-plugin-func v1.1.3-0.20241105140205-cf3be2665ba2
knative.dev/hack => knative.dev/hack v0.0.0-20240404013450-1133b37da8d7
knative.dev/kn-plugin-event => github.com/openshift-knative/kn-plugin-event v0.41.1-0.20240628014724-95e8b1e98fe0
knative.dev/networking => knative.dev/networking v0.0.0-20240418213116-979f63728302
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -1484,8 +1484,8 @@ github.com/opencontainers/selinux v1.11.0 h1:+5Zbo97w3Lbmb3PeqQtpmTkMwsW5nRI3YaL
github.com/opencontainers/selinux v1.11.0/go.mod h1:E5dMC3VPuVvVHDYmi78qvhJp8+M586T4DlDRYpFkyec=
github.com/openshift-knative/kn-plugin-event v0.41.1-0.20240628014724-95e8b1e98fe0 h1:kxJHcfXmmvOTQpPbkSXyKs2f/VrhYWeFFIRHN/7nHLE=
github.com/openshift-knative/kn-plugin-event v0.41.1-0.20240628014724-95e8b1e98fe0/go.mod h1:GqjLZQDAULerite/+Va3rcFWSXDdmy8tBYeBGubem3E=
github.com/openshift-knative/kn-plugin-func v1.1.3-0.20241003082231-25c6d78a7626 h1:B5QwoNApxW+y2AbM/u2L//32DI9XrgfeVMgjsPpLF5Q=
github.com/openshift-knative/kn-plugin-func v1.1.3-0.20241003082231-25c6d78a7626/go.mod h1:1zDdXQg49k386+HSijg2CPsF/O9m44KJ+5JL/VyzgfA=
github.com/openshift-knative/kn-plugin-func v1.1.3-0.20241105140205-cf3be2665ba2 h1:/fp9NJ4gCgm5ijTUGcE23e91OmuYYjdyjbjyxut9UyY=
github.com/openshift-knative/kn-plugin-func v1.1.3-0.20241105140205-cf3be2665ba2/go.mod h1:1zDdXQg49k386+HSijg2CPsF/O9m44KJ+5JL/VyzgfA=
github.com/openshift-pipelines/pipelines-as-code v0.27.0 h1:uxpva7/Ad/QEvc40BCBFEWrmYlAjCZ9dZCFYPYWW61c=
github.com/openshift-pipelines/pipelines-as-code v0.27.0/go.mod h1:rzfXtaqbUrsAock3f948p9ekXWc3DFFk9acz5BsEwA4=
github.com/openshift/source-to-image v1.4.1-0.20240605122348-f94ff357628b h1:FGmtvZdOUj8+oEmL773UwU348D1mx42KHSqFoEAXwtw=
Expand Down
5 changes: 5 additions & 0 deletions vendor/knative.dev/func/cmd/subscribe.go
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,11 @@ func updateOrAddSubscription(subscriptions []fn.KnativeSubscription, cfg subscib
for i, subscription := range subscriptions {
if subscription.Source == cfg.Source {
found = true

if subscription.Filters == nil {
subscription.Filters = make(map[string]string)
}

// Update filters. Override if the key already exists.
for newKey, newValue := range newFilters {
subscription.Filters[newKey] = newValue
Expand Down
2 changes: 1 addition & 1 deletion vendor/knative.dev/func/pkg/builders/s2i/builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,7 @@ func (b *Builder) Build(ctx context.Context, f fn.Function, platforms []fn.Platf
}
}

hdr, err := tar.FileInfoHeader(fi, lnk)
hdr, err := tar.FileInfoHeader(fi, filepath.ToSlash(lnk))
if err != nil {
return fmt.Errorf("cannot create tar header: %w", err)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,7 @@ func sourcesAsTarStream(f fn.Function) *io.PipeReader {
}
}

hdr, err := tar.FileInfoHeader(fi, lnk)
hdr, err := tar.FileInfoHeader(fi, filepath.ToSlash(lnk))
if err != nil {
return fmt.Errorf("cannot create a tar header: %w", err)
}
Expand Down
4 changes: 2 additions & 2 deletions vendor/modules.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2041,7 +2041,7 @@ knative.dev/eventing-kafka-broker/control-plane/pkg/apis/sources/v1beta1
knative.dev/eventing-kafka-broker/control-plane/pkg/client/clientset/versioned/scheme
knative.dev/eventing-kafka-broker/control-plane/pkg/client/clientset/versioned/typed/sources/v1beta1
knative.dev/eventing-kafka-broker/control-plane/pkg/client/clientset/versioned/typed/sources/v1beta1/fake
# knative.dev/func v1.15.1 => github.com/openshift-knative/kn-plugin-func v1.1.3-0.20241003082231-25c6d78a7626
# knative.dev/func v1.15.1 => github.com/openshift-knative/kn-plugin-func v1.1.3-0.20241105140205-cf3be2665ba2
## explicit; go 1.22.0
knative.dev/func/cmd
knative.dev/func/cmd/prompt
Expand Down Expand Up @@ -2296,7 +2296,7 @@ sigs.k8s.io/yaml
sigs.k8s.io/yaml/goyaml.v2
# k8s.io/client-go => k8s.io/client-go v0.29.3
# knative.dev/eventing => knative.dev/eventing v0.41.0
# knative.dev/func => github.com/openshift-knative/kn-plugin-func v1.1.3-0.20241003082231-25c6d78a7626
# knative.dev/func => github.com/openshift-knative/kn-plugin-func v1.1.3-0.20241105140205-cf3be2665ba2
# knative.dev/hack => knative.dev/hack v0.0.0-20240404013450-1133b37da8d7
# knative.dev/kn-plugin-event => github.com/openshift-knative/kn-plugin-event v0.41.1-0.20240628014724-95e8b1e98fe0
# knative.dev/networking => knative.dev/networking v0.0.0-20240418213116-979f63728302
Expand Down

0 comments on commit 9a3ae2c

Please sign in to comment.