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

🧹 Dedup code by using client-pkg #1935

Closed
wants to merge 1 commit into from
Closed
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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 0 additions & 2 deletions .codecov.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,3 @@ ignore:
- "hack"
- "pkg/client"
- "test"
- "third_party"
- "vendor"
6 changes: 3 additions & 3 deletions .ko.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@ builds:
- id: knative.dev/client/cmd/kn
main: ./cmd/kn
ldflags:
- -X knative.dev/client/pkg/kn/commands/version.Version={{.Env.KN_BUILD_VERSION}}
- -X knative.dev/client/pkg/kn/commands/version.GitRevision={{.Env.KN_BUILD_GITREV}}
- -X 'knative.dev/client/pkg/kn/commands/version.BuildDate={{.Env.KN_BUILD_DATE}}'
- -X knative.dev/client/pkg/commands/version.Version={{.Env.KN_BUILD_VERSION}}
- -X knative.dev/client/pkg/commands/version.GitRevision={{.Env.KN_BUILD_GITREV}}
- -X 'knative.dev/client/pkg/commands/version.BuildDate={{.Env.KN_BUILD_DATE}}'
6 changes: 3 additions & 3 deletions cmd/kn/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ import (
"strings"

"github.com/spf13/cobra"
"knative.dev/client/pkg/kn/config"
pluginpkg "knative.dev/client/pkg/kn/plugin"
"knative.dev/client/pkg/kn/root"
"knative.dev/client/pkg/config"
pluginpkg "knative.dev/client/pkg/plugin"
"knative.dev/client/pkg/root"
)

func main() {
Expand Down
10 changes: 5 additions & 5 deletions cmd/kn/main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,15 @@ import (
"strings"
"testing"

pluginpkg "knative.dev/client/pkg/kn/plugin"
pluginpkg "knative.dev/client/pkg/plugin"

"github.com/spf13/cobra"
"gotest.tools/v3/assert"

"knative.dev/client/lib/test"
"knative.dev/client/pkg/kn/config"
"knative.dev/client/pkg/kn/root"
"knative.dev/client/pkg/util"
"knative.dev/client-pkg/pkg/util"
"knative.dev/client-pkg/pkg/util/test"
"knative.dev/client/pkg/config"
"knative.dev/client/pkg/root"
)

func TestValidatePlugin(t *testing.T) {
Expand Down
6 changes: 3 additions & 3 deletions docs/dev/developer-guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ Let's talk now about the three phases separately.

### Bootstrap

The bootstrap performed by [config.BootstrapConfig()](https://github.com/knative/client/blob/0063a263d121702432c1ee71cef30df375a40e76/pkg/kn/config/config.go#L94) extracts all the options relevant for config file detection and plugin configuration.
The bootstrap performed by [config.BootstrapConfig()](https://github.com/knative/client/blob/0063a263d121702432c1ee71cef30df375a40e76/pkg/config/config.go#L94) extracts all the options relevant for config file detection and plugin configuration.
The bootstrap process does not fully parse all arguments but only those that are relevant for starting up and for looking up any plugin.
The configuration can be either provided via a `--config` flag or is picked up from a default location.
The default configuration location conforms to the [XDG Base Directory Specification](https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html) and is different for Unix systems and Windows systems.
Expand All @@ -33,7 +33,7 @@ The default configuration location conforms to the [XDG Base Directory Specifica
### Plugin Lookup

In the next step, a `PluginManager` checks whether the given command-line arguments are pointing to a plugin.
All non-flag arguments are extracted and then used to lookup via [plugin.PluginManager.FindPlugin()](https://github.com/knative/client/blob/0063a263d121702432c1ee71cef30df375a40e76/pkg/kn/plugin/manager.go#L94) in the plugin directory (and the execution `$PATH` if configured) calculated in the _Bootstrap_ phase.
All non-flag arguments are extracted and then used to lookup via [plugin.PluginManager.FindPlugin()](https://github.com/knative/client/blob/0063a263d121702432c1ee71cef30df375a40e76/pkg/plugin/manager.go#L94) in the plugin directory (and the execution `$PATH` if configured) calculated in the _Bootstrap_ phase.

### Execution

Expand Down Expand Up @@ -127,7 +127,7 @@ Some of them might end up in the public API, too.

## Plugins

You can find the central plugin handling in the package `pkg/kn/plugin`.
You can find the central plugin handling in the package `pkg/plugin`.
The entry point here is the `PluginManager`, which is responsible for finding plugins by name and for listing all visible plugins.
An interface `Plugin` describes a plugin.
This interface has currently a single implementation that uses an `exec` system call to run an external plugin command following a naming convention.
Expand Down
2 changes: 1 addition & 1 deletion docs/plugins/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ The following steps are required:
package plugin

import (
"knative.dev/client/pkg/kn/plugin"
"knative.dev/client/pkg/plugin"
)

func init() {
Expand Down
11 changes: 7 additions & 4 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,12 @@ module knative.dev/client

go 1.21

// TODO: remove when https://github.com/knative/client-pkg/pull/177 is merged
replace knative.dev/client-pkg => github.com/cardil/knative-client-pkg v0.0.0-20240416181347-fe59266c904d
//replace knative.dev/client-pkg => ../knative-client-pkg

require (
github.com/google/go-cmp v0.6.0
github.com/google/go-cmp v0.6.0 // indirect
github.com/hashicorp/golang-lru v1.0.2 // indirect
github.com/hashicorp/hcl v1.0.0 // indirect
github.com/mitchellh/go-homedir v1.1.0
Expand All @@ -15,11 +19,12 @@ require (
golang.org/x/term v0.18.0
gotest.tools/v3 v3.3.0
k8s.io/api v0.29.2
k8s.io/apiextensions-apiserver v0.29.2
k8s.io/apiextensions-apiserver v0.29.2 // indirect
k8s.io/apimachinery v0.29.2
k8s.io/cli-runtime v0.29.2
k8s.io/client-go v0.29.2
k8s.io/code-generator v0.29.2
k8s.io/utils v0.0.0-20240102154912-e7106e64919e
knative.dev/client-pkg v0.0.0-20240327121233-6984d81a90ec
knative.dev/eventing v0.40.1-0.20240327131403-47543259ceba
knative.dev/hack v0.0.0-20240327150553-47368d631660
Expand All @@ -29,8 +34,6 @@ require (
sigs.k8s.io/yaml v1.4.0
)

require k8s.io/utils v0.0.0-20240102154912-e7106e64919e

require (
contrib.go.opencensus.io/exporter/ocagent v0.7.1-0.20200907061046-05415f1de66d // indirect
contrib.go.opencensus.io/exporter/prometheus v0.4.2 // indirect
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,8 @@ github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM=
github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw=
github.com/blendle/zapdriver v1.3.1 h1:C3dydBOWYRiOk+B8X9IVZ5IOe+7cl+tGOexN4QqHfpE=
github.com/blendle/zapdriver v1.3.1/go.mod h1:mdXfREi6u5MArG4j9fewC+FGnXaBR+T4Ox4J2u4eHCc=
github.com/cardil/knative-client-pkg v0.0.0-20240416181347-fe59266c904d h1:WCIfRrazum2AB/ggmNJ3gJAs76c/oO7lQQlQPStx7uQ=
github.com/cardil/knative-client-pkg v0.0.0-20240416181347-fe59266c904d/go.mod h1:dV9nC/iTPeSv8dl3wI2sunXgZJu32A3vlEimNzaEsr0=
github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU=
github.com/census-instrumentation/opencensus-proto v0.4.1 h1:iKLQ0xPNFxR/2hzXZMrBo8f1j86j5WHzznCCQxV/b8g=
github.com/census-instrumentation/opencensus-proto v0.4.1/go.mod h1:4T9NM4+4Vw91VeyqjLS6ao50K5bOcLKN6Q42XnYaRYw=
Expand Down Expand Up @@ -839,8 +841,6 @@ k8s.io/kube-openapi v0.0.0-20231010175941-2dd684a91f00 h1:aVUu9fTY98ivBPKR9Y5w/A
k8s.io/kube-openapi v0.0.0-20231010175941-2dd684a91f00/go.mod h1:AsvuZPBlUDVuCdzJ87iajxtXuR9oktsTctW/R9wwouA=
k8s.io/utils v0.0.0-20240102154912-e7106e64919e h1:eQ/4ljkx21sObifjzXwlPKpdGLrCfRziVtos3ofG/sQ=
k8s.io/utils v0.0.0-20240102154912-e7106e64919e/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0=
knative.dev/client-pkg v0.0.0-20240327121233-6984d81a90ec h1:gG8AzUJDHrYONInTv0wm1gSPzWp3n8tooewl+yGpe/I=
knative.dev/client-pkg v0.0.0-20240327121233-6984d81a90ec/go.mod h1:PYodo1bmKTrxnNCfLJa6a8wdg3QQH0XTOPlZJwrY64A=
knative.dev/eventing v0.40.1-0.20240327131403-47543259ceba h1:uX9UsYNHJQDpqVSMVijhSljmCSLZm5ocPdQJ4jrkyig=
knative.dev/eventing v0.40.1-0.20240327131403-47543259ceba/go.mod h1:19sfPiy4dK2jBIHgszOTk43qOvfCXz1GTIncRY3trB8=
knative.dev/hack v0.0.0-20240327150553-47368d631660 h1:tW6NgyjMnSXBS75+k+Xh5uNiLhJ9TFswS9hrkC3OQOc=
Expand Down
2 changes: 1 addition & 1 deletion hack/build-flags.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ function build_flags() {
local now rev
now="$(date -u '+%Y-%m-%d %H:%M:%S')"
rev="$(git rev-parse --short HEAD)"
local pkg="knative.dev/client/pkg/kn/commands/version"
local pkg="knative.dev/client/pkg/commands/version"
local version="${TAG:-}"
# Use vYYYYMMDD-local-<hash> for the version string, if not passed.
if [[ -z "${version}" ]]; then
Expand Down
19 changes: 10 additions & 9 deletions hack/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ source_lint() {
go_build() {
echo "🚧 Compile"
# Env var exported by hack/build-flags.sh
go build -mod=vendor -ldflags "${KN_BUILD_LD_FLAGS:-}" -o kn ./cmd/...
go build -ldflags "${KN_BUILD_LD_FLAGS:-}" -o kn ./cmd/...

if file kn | grep -q -i "Windows"; then
mv kn kn.exe
Expand Down Expand Up @@ -287,19 +287,19 @@ cross_build() {

export CGO_ENABLED=0
echo " 🐧 kn-linux-amd64"
GOOS=linux GOARCH=amd64 go build -mod=vendor -ldflags "${ld_flags}" -o ./kn-linux-amd64 ./cmd/... || failed=1
GOOS=linux GOARCH=amd64 go build -ldflags "${ld_flags}" -o ./kn-linux-amd64 ./cmd/... || failed=1
echo " 💪 kn-linux-arm64"
GOOS=linux GOARCH=arm64 go build -mod=vendor -ldflags "${ld_flags}" -o ./kn-linux-arm64 ./cmd/... || failed=1
GOOS=linux GOARCH=arm64 go build -ldflags "${ld_flags}" -o ./kn-linux-arm64 ./cmd/... || failed=1
echo " 🍏 kn-darwin-amd64"
GOOS=darwin GOARCH=amd64 go build -mod=vendor -ldflags "${ld_flags}" -o ./kn-darwin-amd64 ./cmd/... || failed=1
GOOS=darwin GOARCH=amd64 go build -ldflags "${ld_flags}" -o ./kn-darwin-amd64 ./cmd/... || failed=1
echo " 🍎 kn-darwin-arm64"
GOOS=darwin GOARCH=arm64 go build -mod=vendor -ldflags "${ld_flags}" -o ./kn-darwin-arm64 ./cmd/... || failed=1
GOOS=darwin GOARCH=arm64 go build -ldflags "${ld_flags}" -o ./kn-darwin-arm64 ./cmd/... || failed=1
echo " 🎠 kn-windows-amd64.exe"
GOOS=windows GOARCH=amd64 go build -mod=vendor -ldflags "${ld_flags}" -o ./kn-windows-amd64.exe ./cmd/... || failed=1
GOOS=windows GOARCH=amd64 go build -ldflags "${ld_flags}" -o ./kn-windows-amd64.exe ./cmd/... || failed=1
echo " Z kn-linux-s390x"
GOOS=linux GOARCH=s390x go build -mod=vendor -ldflags "${ld_flags}" -o ./kn-linux-s390x ./cmd/... || failed=1
GOOS=linux GOARCH=s390x go build -ldflags "${ld_flags}" -o ./kn-linux-s390x ./cmd/... || failed=1
echo " P kn-linux-ppc64le"
GOOS=linux GOARCH=ppc64le go build -mod=vendor -ldflags "${ld_flags}" -o ./kn-linux-ppc64le ./cmd/... || failed=1
GOOS=linux GOARCH=ppc64le go build -ldflags "${ld_flags}" -o ./kn-linux-ppc64le ./cmd/... || failed=1

return ${failed}
}
Expand Down Expand Up @@ -368,7 +368,8 @@ if has_flag --debug; then
fi

# Shared funcs from hack repo
source "$(basedir)"/vendor/knative.dev/hack/library.sh
# shellcheck disable=SC1090
source "$(go run knative.dev/hack/cmd/script library.sh)"

# Shared funcs with CI
while IFS= read -r -d '' file; do
Expand Down
2 changes: 1 addition & 1 deletion hack/generate-docs.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import (
"os"

"github.com/spf13/cobra/doc"
"knative.dev/client/pkg/kn/root"
"knative.dev/client/pkg/root"
)

func main() {
Expand Down
17 changes: 9 additions & 8 deletions hack/release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@
# Documentation about this script and how to use it can be found
# at https://github.com/knative/hack

source $(dirname $0)/../vendor/knative.dev/hack/release.sh
# shellcheck disable=SC1090
source "$(go run knative.dev/hack/cmd/script release.sh)"

function build_release() {
# Env var exported by hack/build-flags.sh
Expand All @@ -26,19 +27,19 @@ function build_release() {

export CGO_ENABLED=0
echo "🚧 🐧 Building for Linux (amd64)"
GOOS=linux GOARCH=amd64 go build -mod=vendor -ldflags "${ld_flags}" -o ./kn-linux-amd64 ./cmd/...
GOOS=linux GOARCH=amd64 go build -ldflags "${ld_flags}" -o ./kn-linux-amd64 ./cmd/...
echo "🚧 💪 Building for Linux (arm64)"
GOOS=linux GOARCH=arm64 go build -mod=vendor -ldflags "${ld_flags}" -o ./kn-linux-arm64 ./cmd/...
GOOS=linux GOARCH=arm64 go build -ldflags "${ld_flags}" -o ./kn-linux-arm64 ./cmd/...
echo "🚧 🍏 Building for macOS"
GOOS=darwin GOARCH=amd64 go build -mod=vendor -ldflags "${ld_flags}" -o ./kn-darwin-amd64 ./cmd/...
GOOS=darwin GOARCH=amd64 go build -ldflags "${ld_flags}" -o ./kn-darwin-amd64 ./cmd/...
echo "🚧 🍎 Building for macOS (arm64)"
GOOS=darwin GOARCH=arm64 go build -mod=vendor -ldflags "${ld_flags}" -o ./kn-darwin-arm64 ./cmd/...
GOOS=darwin GOARCH=arm64 go build -ldflags "${ld_flags}" -o ./kn-darwin-arm64 ./cmd/...
echo "🚧 🎠 Building for Windows"
GOOS=windows GOARCH=amd64 go build -mod=vendor -ldflags "${ld_flags}" -o ./kn-windows-amd64.exe ./cmd/...
GOOS=windows GOARCH=amd64 go build -ldflags "${ld_flags}" -o ./kn-windows-amd64.exe ./cmd/...
echo "🚧 Z Building for Linux(s390x)"
GOOS=linux GOARCH=s390x go build -mod=vendor -ldflags "${ld_flags}" -o ./kn-linux-s390x ./cmd/...
GOOS=linux GOARCH=s390x go build -ldflags "${ld_flags}" -o ./kn-linux-s390x ./cmd/...
echo "🚧 P Building for Linux (ppc64le)"
GOOS=linux GOARCH=ppc64le go build -mod=vendor -ldflags "${ld_flags}" -o ./kn-linux-ppc64le ./cmd/...
GOOS=linux GOARCH=ppc64le go build -ldflags "${ld_flags}" -o ./kn-linux-ppc64le ./cmd/...
echo "🚧 🐳 Building the container image"

# Handle latest default tag in `ko` to be present only for latest releases.
Expand Down
2 changes: 1 addition & 1 deletion hack/tools.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ package tools

// This package imports things required by this repository, to force `go mod` to see them as dependencies
import (
_ "knative.dev/hack"
_ "knative.dev/hack/cmd/script"
_ "knative.dev/pkg/hack"

_ "k8s.io/code-generator"
Expand Down
24 changes: 3 additions & 21 deletions hack/update-codegen.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,25 +18,7 @@ set -o errexit
set -o nounset
set -o pipefail

source $(dirname $0)/../vendor/knative.dev/hack/codegen-library.sh
# shellcheck disable=SC1090
source "$(go run knative.dev/hack/cmd/script codegen-library.sh)"

# If we run with -mod=vendor here, then generate-groups.sh looks for vendor files in the wrong place.
export GOFLAGS=-mod=

echo "=== Update Codegen for $MODULE_NAME"

group "Kubernetes Codegen"

# generate the code with:
# --output-base because this script should also be able to run inside the vendor dir of
# k8s.io/kubernetes. The output-base is needed for the generators to output into the vendor dir
# instead of the $GOPATH directly. For normal projects this can be dropped.
"${CODEGEN_PKG}"/generate-groups.sh "deepcopy" \
knative.dev/client/pkg/apis/client/v1alpha1/generated knative.dev/client/pkg/apis \
client:v1alpha1 \
--go-header-file "${REPO_ROOT_DIR}"/hack/boilerplate.go.txt

group "Update deps post-codegen"

# Make sure our dependencies are up-to-date
${REPO_ROOT_DIR}/hack/update-deps.sh
echo "=== Noop codegen for $MODULE_NAME"
3 changes: 2 additions & 1 deletion hack/update-deps.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ set -o errexit
set -o nounset
set -o pipefail

source $(dirname $0)/../vendor/knative.dev/hack/library.sh
# shellcheck disable=SC1090
source "$(go run knative.dev/hack/cmd/script library.sh)"

go_update_deps "$@"
3 changes: 2 additions & 1 deletion hack/verify-codegen.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ set -o errexit
set -o nounset
set -o pipefail

source $(dirname $0)/../vendor/knative.dev/hack/library.sh
# shellcheck disable=SC1090
source "$(go run knative.dev/hack/cmd/script library.sh)"

"${REPO_ROOT_DIR}"/hack/build.sh --codegen
if output="$(git status --porcelain)" && [ -z "$output" ]; then
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ package broker
import (
"github.com/spf13/cobra"

"knative.dev/client/pkg/kn/commands"
"knative.dev/client/pkg/commands"
)

// NewBrokerCommand represents broker management commands
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,14 @@ import (

metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/client-go/tools/clientcmd"
"knative.dev/client/pkg/dynamic"
dynamicfake "knative.dev/client/pkg/dynamic/fake"
"knative.dev/client-pkg/pkg/dynamic"
dynamicfake "knative.dev/client-pkg/pkg/dynamic/fake"
v1 "knative.dev/eventing/pkg/apis/duck/v1"
duckv1 "knative.dev/pkg/apis/duck/v1"
servingv1 "knative.dev/serving/pkg/apis/serving/v1"

clientv1beta1 "knative.dev/client/pkg/eventing/v1"
"knative.dev/client/pkg/kn/commands"
clientv1beta1 "knative.dev/client-pkg/pkg/eventing/v1"
"knative.dev/client/pkg/commands"
v1beta1 "knative.dev/eventing/pkg/apis/eventing/v1"
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ import (
v1 "knative.dev/eventing/pkg/apis/duck/v1"
duckv1 "knative.dev/pkg/apis/duck/v1"

clientv1beta1 "knative.dev/client/pkg/eventing/v1"
"knative.dev/client/pkg/kn/commands"
clientv1beta1 "knative.dev/client-pkg/pkg/eventing/v1"
"knative.dev/client/pkg/commands"
)

var createExample = `
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ import (
"gotest.tools/v3/assert"
v1 "knative.dev/pkg/apis/duck/v1"

clienteventingv1 "knative.dev/client/pkg/eventing/v1"
"knative.dev/client/pkg/util"
clienteventingv1 "knative.dev/client-pkg/pkg/eventing/v1"
"knative.dev/client-pkg/pkg/util"
)

var (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import (

"github.com/spf13/cobra"

"knative.dev/client/pkg/kn/commands"
"knative.dev/client/pkg/commands"
)

var deleteExample = `
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ import (

"gotest.tools/v3/assert"

clienteventingv1 "knative.dev/client/pkg/eventing/v1"
"knative.dev/client/pkg/util"
"knative.dev/client/pkg/util/mock"
clienteventingv1 "knative.dev/client-pkg/pkg/eventing/v1"
"knative.dev/client-pkg/pkg/util"
"knative.dev/client-pkg/pkg/util/mock"
)

func TestBrokerDelete(t *testing.T) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@ import (
"reflect"

"github.com/spf13/cobra"
"knative.dev/client/pkg/dynamic"
"knative.dev/client/pkg/kn/commands/flags"
sinkfl "knative.dev/client-pkg/pkg/commands/flags/sink"
"knative.dev/client-pkg/pkg/dynamic"
duckv1 "knative.dev/pkg/apis/duck/v1"
)

type DeliveryOptionFlags struct {
SinkFlags flags.SinkFlags
SinkFlags sinkfl.Flag
RetryCount int32
Timeout string
BackoffPolicy string
Expand All @@ -49,7 +49,7 @@ func (d *DeliveryOptionFlags) Add(cmd *cobra.Command) {
}

func (d *DeliveryOptionFlags) GetDlSink(cmd *cobra.Command, dynamicClient dynamic.KnDynamicClient, namespace string) (*duckv1.Destination, error) {
var empty = flags.SinkFlags{}
var empty = sinkfl.Flag{}
var destination *duckv1.Destination
var err error
if !reflect.DeepEqual(d.SinkFlags, empty) {
Expand Down
Loading
Loading