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

🧹 Clean up the kn sub-package #155

Merged
merged 1 commit into from Mar 20, 2024
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
File renamed without changes.
File renamed without changes.
Expand Up @@ -20,8 +20,8 @@ import (
"github.com/spf13/cobra"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/cli-runtime/pkg/genericclioptions"
"knative.dev/client-pkg/pkg/commands"

"knative.dev/client-pkg/pkg/kn/commands"
hprinters "knative.dev/client-pkg/pkg/printers"
"knative.dev/client-pkg/pkg/util"
)
Expand Down
Expand Up @@ -22,11 +22,11 @@ import (
"github.com/spf13/cobra"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime/schema"
"knative.dev/client-pkg/pkg/config"
"knative.dev/pkg/apis"
duckv1 "knative.dev/pkg/apis/duck/v1"

clientdynamic "knative.dev/client-pkg/pkg/dynamic"
"knative.dev/client-pkg/pkg/kn/config"
)

type SinkFlags struct {
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
Expand Up @@ -18,13 +18,13 @@ import (
"bytes"

"knative.dev/client-pkg/pkg/dynamic/fake"
"knative.dev/client-pkg/pkg/flags"

"github.com/spf13/cobra"
"k8s.io/apimachinery/pkg/runtime"
clienttesting "k8s.io/client-go/testing"
servingv1fake "knative.dev/serving/pkg/client/clientset/versioned/typed/serving/v1/fake"

"knative.dev/client-pkg/pkg/kn/flags"
clientservingv1 "knative.dev/client-pkg/pkg/serving/v1"
v1 "knative.dev/client-pkg/pkg/sources/v1"

Expand Down
File renamed without changes.
File renamed without changes.
30 changes: 16 additions & 14 deletions pkg/kn/config/config.go → pkg/config/config.go
@@ -1,16 +1,18 @@
// Copyright © 2020 The Knative Authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
/*
Copyright 2024 The Knative Authors

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

package config

Expand All @@ -21,7 +23,7 @@ import (
"path/filepath"
"runtime"

homedir "github.com/mitchellh/go-homedir"
"github.com/mitchellh/go-homedir"
flag "github.com/spf13/pflag"
"github.com/spf13/viper"
)
Expand Down
30 changes: 16 additions & 14 deletions pkg/kn/config/config_test.go → pkg/config/config_test.go
@@ -1,16 +1,18 @@
// Copyright © 2020 The Knative Authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
/*
Copyright 2024 The Knative Authors

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

package config

Expand All @@ -19,7 +21,7 @@ import (
"path/filepath"
"testing"

homedir "github.com/mitchellh/go-homedir"
"github.com/mitchellh/go-homedir"
"github.com/spf13/viper"
"gotest.tools/v3/assert"
)
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
5 changes: 2 additions & 3 deletions pkg/kn-source-pkg/pkg/factories/flags_factory.go
cardil marked this conversation as resolved.
Show resolved Hide resolved
Expand Up @@ -15,10 +15,9 @@
package factories

import (
"knative.dev/client-pkg/pkg/kn-source-pkg/pkg/types"
"knative.dev/client-pkg/pkg/kn/commands"

"github.com/spf13/pflag"
"knative.dev/client-pkg/pkg/commands"
"knative.dev/client-pkg/pkg/kn-source-pkg/pkg/types"
)

type DefautFlagsFactory struct {
Expand Down
3 changes: 1 addition & 2 deletions pkg/kn-source-pkg/pkg/factories/kn_source_factory.go
Expand Up @@ -16,10 +16,9 @@ package factories

import (
"k8s.io/client-go/rest"
"knative.dev/client-pkg/pkg/commands/flags"
"knative.dev/client-pkg/pkg/kn-source-pkg/pkg/client"
"knative.dev/client-pkg/pkg/kn-source-pkg/pkg/types"

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

type DefautKnSourceFactory struct {
Expand Down
3 changes: 1 addition & 2 deletions pkg/kn-source-pkg/pkg/factories/kn_source_factory_test.go
Expand Up @@ -19,9 +19,8 @@ import (

"gotest.tools/v3/assert"
"k8s.io/client-go/rest"
"knative.dev/client-pkg/pkg/commands/flags"
"knative.dev/client-pkg/pkg/kn-source-pkg/pkg/types"
"knative.dev/client-pkg/pkg/kn/commands/flags"

"knative.dev/client-pkg/pkg/kn-source-pkg/pkg/types/typesfakes"
)

Expand Down
4 changes: 2 additions & 2 deletions pkg/kn-source-pkg/pkg/types/structs.go
Expand Up @@ -18,8 +18,8 @@ package types

import (
"github.com/spf13/cobra"
"knative.dev/client-pkg/pkg/kn/commands"
"knative.dev/client-pkg/pkg/kn/commands/flags"
"knative.dev/client-pkg/pkg/commands"
"knative.dev/client-pkg/pkg/commands/flags"
)

type KnSourceParams struct {
Expand Down
3 changes: 1 addition & 2 deletions pkg/kn-source-pkg/pkg/types/structs_test.go
Expand Up @@ -19,8 +19,7 @@ import (

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

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

func TestAddCommonFlags(t *testing.T) {
Expand Down
30 changes: 0 additions & 30 deletions pkg/kn/plugin/types.go
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I had removed this file because the types defined here are already present in the knative.dev/client-pkg/pkg/plugin package.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok

This file was deleted.

2 changes: 1 addition & 1 deletion pkg/serving/config_changes.go
Expand Up @@ -22,7 +22,7 @@ import (
"strings"
"time"

"knative.dev/client-pkg/pkg/kn/flags"
"knative.dev/client-pkg/pkg/flags"
"knative.dev/pkg/ptr"
"knative.dev/serving/pkg/apis/autoscaling"
servingconfig "knative.dev/serving/pkg/apis/config"
Expand Down