knative / knative/func

cmd: subscribe silently ignores malformed --filter values

Open
#3,941 1 comment 0 reactions 1 assignee Claimed by @axhatggg View on GitHub
Dominant language
Go
Stars
365
Forks
223
Avg merge
2d 3h
Merged PRs (30d)
25

Description

## Problem

`func subscribe --filter` expects filters in `key=value` form, but malformed values are currently printed and ignored instead of returning an error.

For example:

```bash
func subscribe --filter badfilter
```

prints `Invalid pair: badfilter`, continues, and can still write subscription config without the intended filter.

## Expected behavior

Malformed filters should fail before `func.yaml` is changed. Valid values containing `=` should still be preserved, for example `--filter foo=bar=baz` should store key `foo` with value `bar=baz`.

## Suggested fix

Return an error for missing `=` or an empty key, and add regression tests for malformed filters and values containing `=`.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.