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

chore: Upgrade dependences and go version #66

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
  •  
  •  
  •  
25 changes: 13 additions & 12 deletions applier/direct.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ Originally sourced from https://github.com/kubernetes-sigs/kubebuilder-declarati
import (
"context"
"fmt"
"k8s.io/apimachinery/pkg/types"
"k8s.io/cli-runtime/pkg/genericiooptions"
"os"
"strings"

Expand Down Expand Up @@ -35,7 +37,7 @@ func NewDirectApplier() *DirectApplier {
}

func (d *DirectApplier) Apply(ctx context.Context, opt ApplierOptions) error {
ioStreams := genericclioptions.IOStreams{
ioStreams := genericiooptions.IOStreams{
In: os.Stdin,
Out: os.Stdout,
ErrOut: os.Stderr,
Expand All @@ -47,7 +49,7 @@ func (d *DirectApplier) Apply(ctx context.Context, opt ApplierOptions) error {
RESTConfig: opt.RESTConfig,
}

f := cmdutil.NewFactory(restClientGetter)
factory := cmdutil.NewFactory(restClientGetter)
res := resource.NewBuilder(restClientGetter).Unstructured().Stream(ioReader, "manifestString").Do()
infos, err := res.Infos()
if err != nil {
Expand All @@ -64,9 +66,9 @@ func (d *DirectApplier) Apply(ctx context.Context, opt ApplierOptions) error {
}
}

flags := apply.NewApplyFlags(f, ioStreams)
flags := apply.NewApplyFlags(ioStreams)
flags.AddFlags(&cobra.Command{})
applyOpts, err := newOptions(flags, opt.Namespace)
applyOpts, err := newOptions(factory, flags, opt.Namespace)
if err != nil {
return err
}
Expand All @@ -79,14 +81,14 @@ func (d *DirectApplier) Apply(ctx context.Context, opt ApplierOptions) error {
return applyOpts.Run()
}

func newOptions(flags *apply.ApplyFlags, namespace string) (*apply.ApplyOptions, error) {
dynamicClient, err := flags.Factory.DynamicClient()
func newOptions(factory cmdutil.Factory, flags *apply.ApplyFlags, namespace string) (*apply.ApplyOptions, error) {
dynamicClient, err := factory.DynamicClient()
if err != nil {
return nil, err
}

// allow for a success message operation to be specified at print time
dryRunVerifier := resource.NewQueryParamVerifier(dynamicClient, flags.Factory.OpenAPIGetter(), resource.QueryParamDryRun)
//dryRunVerifier := resource.NewQueryParamVerifier(dynamicClient, flags.Factory.OpenAPIGetter(), resource.QueryParamDryRun)
toPrinter := func(operation string) (printers.ResourcePrinter, error) {
flags.PrintFlags.NamePrintFlags.Operation = operation
cmdutil.PrintFlagsWithDryRunStrategy(flags.PrintFlags, cmdutil.DryRunNone)
Expand All @@ -99,8 +101,8 @@ func newOptions(flags *apply.ApplyFlags, namespace string) (*apply.ApplyOptions,
IOStreams: flags.IOStreams,
}

builder := flags.Factory.NewBuilder()
mapper, err := flags.Factory.ToRESTMapper()
builder := factory.NewBuilder()
mapper, err := factory.ToRESTMapper()
if err != nil {
return nil, err
}
Expand All @@ -115,7 +117,6 @@ func newOptions(flags *apply.ApplyFlags, namespace string) (*apply.ApplyOptions,
FieldManager: "vcluster",
Selector: "",
DryRunStrategy: cmdutil.DryRunNone,
DryRunVerifier: dryRunVerifier,
Prune: false,
PruneResources: nil,
All: flags.All,
Expand All @@ -130,8 +131,8 @@ func newOptions(flags *apply.ApplyFlags, namespace string) (*apply.ApplyOptions,
DynamicClient: dynamicClient,

IOStreams: flags.IOStreams,
VisitedUids: sets.NewString(),
VisitedNamespaces: sets.NewString(),
VisitedUids: sets.New[types.UID](),
VisitedNamespaces: sets.New[string](),
}

o.PostProcessorFn = o.PrintAndPrunePostProcessor()
Expand Down
72 changes: 37 additions & 35 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
module github.com/loft-sh/vcluster-sdk

go 1.17
go 1.21

require (
github.com/ghodss/yaml v1.0.0
github.com/go-logr/logr v1.2.3
github.com/go-logr/logr v1.2.4
github.com/kubernetes-csi/external-snapshotter/client/v4 v4.2.0
github.com/pkg/errors v0.9.1
github.com/spf13/cobra v1.6.1
google.golang.org/grpc v1.53.0
google.golang.org/protobuf v1.28.1
github.com/spf13/cobra v1.7.0
google.golang.org/grpc v1.55.0
google.golang.org/protobuf v1.31.0
gotest.tools v2.2.0+incompatible
k8s.io/api v0.26.1
k8s.io/apiextensions-apiserver v0.26.1
k8s.io/apimachinery v0.26.1
k8s.io/cli-runtime v0.26.1
k8s.io/client-go v0.26.1
k8s.io/api v0.28.2
k8s.io/apiextensions-apiserver v0.28.2
k8s.io/apimachinery v0.28.2
k8s.io/cli-runtime v0.28.2
k8s.io/client-go v0.28.2
k8s.io/klog v1.0.0
k8s.io/klog/v2 v2.90.0
k8s.io/kube-aggregator v0.26.1
k8s.io/kubectl v0.26.1
sigs.k8s.io/controller-runtime v0.14.4
k8s.io/klog/v2 v2.100.1
k8s.io/kube-aggregator v0.28.2
k8s.io/kubectl v0.28.2
sigs.k8s.io/controller-runtime v0.16.2
)

require (
Expand All @@ -36,16 +36,16 @@ require (
github.com/exponent-io/jsonpath v0.0.0-20210407135951-1de76d718b3f // indirect
github.com/fatih/camelcase v1.0.0 // indirect
github.com/fsnotify/fsnotify v1.6.0 // indirect
github.com/fvbommel/sortorder v1.0.2 // indirect
github.com/fvbommel/sortorder v1.1.0 // indirect
github.com/go-errors/errors v1.4.2 // indirect
github.com/go-openapi/jsonpointer v0.19.6 // indirect
github.com/go-openapi/jsonreference v0.20.2 // indirect
github.com/go-openapi/swag v0.22.3 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
github.com/golang/protobuf v1.5.2 // indirect
github.com/golang/protobuf v1.5.3 // indirect
github.com/google/btree v1.1.2 // indirect
github.com/google/gnostic v0.6.9 // indirect
github.com/google/gnostic-models v0.6.8 // indirect
github.com/google/go-cmp v0.5.9 // indirect
github.com/google/gofuzz v1.2.0 // indirect
github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 // indirect
Expand All @@ -67,32 +67,34 @@ require (
github.com/monochromegane/go-gitignore v0.0.0-20200626010858-205db1a8cc00 // indirect
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
github.com/peterbourgon/diskv v2.0.1+incompatible // indirect
github.com/prometheus/client_golang v1.14.0 // indirect
github.com/prometheus/client_model v0.3.0 // indirect
github.com/prometheus/common v0.39.0 // indirect
github.com/prometheus/procfs v0.9.0 // indirect
github.com/prometheus/client_golang v1.16.0 // indirect
github.com/prometheus/client_model v0.4.0 // indirect
github.com/prometheus/common v0.44.0 // indirect
github.com/prometheus/procfs v0.10.1 // indirect
github.com/russross/blackfriday/v2 v2.1.0 // indirect
github.com/spf13/pflag v1.0.5 // indirect
github.com/xlab/treeprint v1.1.0 // indirect
go.starlark.net v0.0.0-20230128213706-3f75dec8e403 // indirect
golang.org/x/net v0.6.0 // indirect
golang.org/x/oauth2 v0.5.0 // indirect
golang.org/x/sys v0.5.0 // indirect
golang.org/x/term v0.5.0 // indirect
golang.org/x/text v0.7.0 // indirect
github.com/xlab/treeprint v1.2.0 // indirect
go.starlark.net v0.0.0-20230525235612-a134d8f9ddca // indirect
golang.org/x/exp v0.0.0-20220722155223-a9213eeb770e // indirect
golang.org/x/net v0.13.0 // indirect
golang.org/x/oauth2 v0.8.0 // indirect
golang.org/x/sync v0.2.0 // indirect
golang.org/x/sys v0.11.0 // indirect
golang.org/x/term v0.10.0 // indirect
golang.org/x/text v0.11.0 // indirect
golang.org/x/time v0.3.0 // indirect
gomodules.xyz/jsonpatch/v2 v2.2.0 // indirect
gomodules.xyz/jsonpatch/v2 v2.4.0 // indirect
google.golang.org/appengine v1.6.7 // indirect
google.golang.org/genproto v0.0.0-20230202175211-008b39050e57 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20230525234030-28d5490b6b19 // indirect
gopkg.in/inf.v0 v0.9.1 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
k8s.io/component-base v0.26.1 // indirect
k8s.io/kube-openapi v0.0.0-20230202010329-39b3636cbaa3 // indirect
k8s.io/utils v0.0.0-20230202215443-34013725500c // indirect
k8s.io/component-base v0.28.2 // indirect
k8s.io/kube-openapi v0.0.0-20230717233707-2695361300d9 // indirect
k8s.io/utils v0.0.0-20230406110748-d93618cff8a2 // indirect
sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect
sigs.k8s.io/kustomize/api v0.13.1 // indirect
sigs.k8s.io/kustomize/kyaml v0.14.0 // indirect
sigs.k8s.io/kustomize/api v0.13.5-0.20230601165947-6ce0bf390ce3 // indirect
sigs.k8s.io/kustomize/kyaml v0.14.3-0.20230601165947-6ce0bf390ce3 // indirect
sigs.k8s.io/structured-merge-diff/v4 v4.2.3 // indirect
sigs.k8s.io/yaml v1.3.0 // indirect
)
Loading