Skip to content

Commit

Permalink
kosmosctl image pull/push
Browse files Browse the repository at this point in the history
feat: kosmosctl image pull/push

Signed-off-by: kuangcheng <[email protected]>

fix: add klog level and check image name

Signed-off-by: kuangcheng <[email protected]>
  • Loading branch information
kuangcheng66 committed Nov 23, 2023
1 parent af81979 commit 546d553
Show file tree
Hide file tree
Showing 1,371 changed files with 237,453 additions and 7,086 deletions.
67 changes: 44 additions & 23 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@ go 1.20

require (
github.com/bep/debounce v1.2.1
github.com/containerd/console v1.0.3
github.com/containerd/containerd v1.6.14
github.com/coreos/go-iptables v0.6.0
github.com/docker/docker v24.0.6+incompatible
github.com/evanphx/json-patch v4.12.0+incompatible
github.com/go-logr/logr v1.2.3
github.com/gogo/protobuf v1.3.2
Expand All @@ -19,9 +22,9 @@ require (
github.com/spf13/cobra v1.6.0
github.com/spf13/pflag v1.0.5
github.com/vishvananda/netlink v1.2.1-beta.2.0.20220630165224-c591ada0fb2b
golang.org/x/sys v0.6.0
golang.org/x/sys v0.12.0
golang.org/x/time v0.3.0
golang.org/x/tools v0.7.0
golang.org/x/tools v0.13.0
k8s.io/api v0.26.3
k8s.io/apiextensions-apiserver v0.26.3
k8s.io/apimachinery v0.26.3
Expand All @@ -37,29 +40,37 @@ require (
k8s.io/kube-openapi v0.0.0-20230303024457-afdc3dddf62d
k8s.io/kube-scheduler v0.0.0
k8s.io/kubectl v0.26.3
k8s.io/kubernetes v0.0.0-00010101000000-000000000000
k8s.io/kubernetes v1.13.0
k8s.io/metrics v0.26.3
k8s.io/utils v0.0.0-20221128185143-99ec85e7a448
sigs.k8s.io/controller-runtime v0.14.5
sigs.k8s.io/mcs-api v0.1.0
)

require (
cloud.google.com/go/compute/metadata v0.2.3 // indirect
github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1 // indirect
github.com/BurntSushi/toml v1.0.0 // indirect
github.com/MakeNowJust/heredoc v1.0.0 // indirect
github.com/Microsoft/go-winio v0.6.0 // indirect
github.com/Microsoft/hcsshim v0.9.6 // indirect
github.com/NYTimes/gziphandler v1.1.1 // indirect
github.com/antlr/antlr4/runtime/Go/antlr v1.4.10 // indirect
github.com/beorn7/perks v1.0.1 // indirect
github.com/blang/semver/v4 v4.0.0 // indirect
github.com/cenkalti/backoff/v4 v4.1.3 // indirect
github.com/cespare/xxhash/v2 v2.1.2 // indirect
github.com/cespare/xxhash/v2 v2.2.0 // indirect
github.com/chai2010/gettext-go v1.0.2 // indirect
github.com/containerd/cgroups v1.0.4 // indirect
github.com/containerd/continuity v0.3.0 // indirect
github.com/containerd/fifo v1.0.0 // indirect
github.com/containerd/ttrpc v1.1.0 // indirect
github.com/containerd/typeurl v1.0.2 // indirect
github.com/coreos/go-semver v0.3.1 // indirect
github.com/coreos/go-systemd/v22 v22.3.3-0.20220203105225-a9a7ef127534 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/docker/distribution v2.8.1+incompatible // indirect
github.com/docker/go-connections v0.4.0 // indirect
github.com/docker/go-events v0.0.0-20190806004212-e31b211e4f1c // indirect
github.com/docker/go-units v0.5.0 // indirect
github.com/emicklei/go-restful/v3 v3.9.0 // indirect
github.com/evanphx/json-patch/v5 v5.6.0 // indirect
github.com/exponent-io/jsonpath v0.0.0-20151013193312-d6023ce2651d // indirect
Expand All @@ -74,6 +85,7 @@ require (
github.com/go-playground/locales v0.12.1 // indirect
github.com/go-playground/universal-translator v0.0.0-20170327191703-71201497bace // indirect
github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572 // indirect
github.com/gogo/googleapis v1.4.1 // indirect
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
github.com/golang/protobuf v1.5.3 // indirect
github.com/google/btree v1.0.1 // indirect
Expand All @@ -85,29 +97,35 @@ require (
github.com/google/uuid v1.3.0 // indirect
github.com/gregjones/httpcache v0.0.0-20180305231024-9cad4c3443a7 // indirect
github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0 // indirect
github.com/grpc-ecosystem/grpc-gateway/v2 v2.7.0 // indirect
github.com/imdario/mergo v0.3.9 // indirect
github.com/grpc-ecosystem/grpc-gateway/v2 v2.11.3 // indirect
github.com/imdario/mergo v0.3.12 // indirect
github.com/inconshreveable/mousetrap v1.0.1 // indirect
github.com/josharian/intern v1.0.0 // indirect
github.com/json-iterator/go v1.1.12 // indirect
github.com/kelseyhightower/envconfig v0.0.0-20180517194557-dd1402a4d99d // indirect
github.com/kr/pretty v0.3.0 // indirect
github.com/klauspost/compress v1.11.13 // indirect
github.com/leodido/go-urn v0.0.0-20181204092800-a67a23e1c1af // indirect
github.com/liggitt/tabwriter v0.0.0-20181228230101-89fcab3d43de // indirect
github.com/mailru/easyjson v0.7.7 // indirect
github.com/mattn/go-runewidth v0.0.7 // indirect
github.com/matttproud/golang_protobuf_extensions v1.0.2 // indirect
github.com/matttproud/golang_protobuf_extensions v1.0.4 // indirect
github.com/mitchellh/go-wordwrap v1.0.0 // indirect
github.com/moby/locker v1.0.1 // indirect
github.com/moby/spdystream v0.2.0 // indirect
github.com/moby/sys/mountinfo v0.6.2 // indirect
github.com/moby/sys/signal v0.6.0 // indirect
github.com/moby/term v0.0.0-20220808134915-39b0c02b01ae // indirect
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/modern-go/reflect2 v1.0.2 // indirect
github.com/monochromegane/go-gitignore v0.0.0-20200626010858-205db1a8cc00 // indirect
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f // indirect
github.com/opencontainers/go-digest v1.0.0 // indirect
github.com/opencontainers/selinux v1.10.0 // indirect
github.com/opencontainers/image-spec v1.0.3-0.20211202183452-c5a74bcca799 // indirect
github.com/opencontainers/runc v1.1.4 // indirect
github.com/opencontainers/runtime-spec v1.1.0-rc.1 // indirect
github.com/opencontainers/selinux v1.10.1 // indirect
github.com/pelletier/go-toml v1.9.5 // indirect
github.com/peterbourgon/diskv v2.0.1+incompatible // indirect
github.com/projectcalico/go-json v0.0.0-20161128004156-6219dc7339ba // indirect
github.com/projectcalico/go-yaml-wrapper v0.0.0-20191112210931-090425220c54 // indirect
Expand All @@ -124,6 +142,7 @@ require (
go.etcd.io/etcd/client/pkg/v3 v3.5.7 // indirect
go.etcd.io/etcd/client/v2 v2.305.7 // indirect
go.etcd.io/etcd/client/v3 v3.5.7 // indirect
go.opencensus.io v0.24.0 // indirect
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.35.0 // indirect
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.35.0 // indirect
go.opentelemetry.io/otel v1.10.0 // indirect
Expand All @@ -138,26 +157,26 @@ require (
go.uber.org/atomic v1.9.0 // indirect
go.uber.org/multierr v1.8.0 // indirect
go.uber.org/zap v1.24.0 // indirect
golang.org/x/crypto v0.1.0 // indirect
golang.org/x/mod v0.9.0 // indirect
golang.org/x/net v0.8.0 // indirect
golang.org/x/oauth2 v0.0.0-20221014153046-6fdb5e3db783 // indirect
golang.org/x/sync v0.1.0 // indirect
golang.org/x/term v0.6.0 // indirect
golang.org/x/text v0.8.0 // indirect
golang.org/x/crypto v0.13.0 // indirect
golang.org/x/mod v0.12.0 // indirect
golang.org/x/net v0.15.0 // indirect
golang.org/x/oauth2 v0.4.0 // indirect
golang.org/x/sync v0.3.0 // indirect
golang.org/x/term v0.12.0 // indirect
golang.org/x/text v0.13.0 // indirect
golang.zx2c4.com/wireguard/wgctrl v0.0.0-20200324154536-ceff61240acf // indirect
gomodules.xyz/jsonpatch/v2 v2.2.0 // indirect
google.golang.org/appengine v1.6.7 // indirect
google.golang.org/genproto v0.0.0-20221024183307-1bc688fe9f3e // indirect
google.golang.org/grpc v1.50.1 // indirect
google.golang.org/protobuf v1.28.1 // indirect
google.golang.org/genproto v0.0.0-20230110181048-76db0878b65f // indirect
google.golang.org/grpc v1.53.0-dev.0.20230123225046-4075ef07c5d5 // indirect
google.golang.org/protobuf v1.28.2-0.20230118093459-a9481185b34d // indirect
gopkg.in/go-playground/validator.v9 v9.27.0 // indirect
gopkg.in/inf.v0 v0.9.1 // indirect
gopkg.in/natefinch/lumberjack.v2 v2.0.0 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
k8s.io/cloud-provider v0.23.3 // indirect
k8s.io/csi-translation-lib v0.23.3 // indirect
k8s.io/cloud-provider v0.26.3 // indirect
k8s.io/csi-translation-lib v0.26.3 // indirect
k8s.io/dynamic-resource-allocation v0.0.0 // indirect
k8s.io/gengo v0.0.0-20220902162205-c0856e24416d // indirect
k8s.io/kms v0.26.3 // indirect
Expand All @@ -172,6 +191,7 @@ require (

replace (
golang.org/x/oauth2 => golang.org/x/oauth2 v0.1.0
golang.zx2c4.com/wireguard => golang.zx2c4.com/wireguard v0.0.0-20231022001213-2e0774f246fb
k8s.io/api => k8s.io/api v0.26.3
k8s.io/apiextensions-apiserver => k8s.io/apiextensions-apiserver v0.26.3
k8s.io/apimachinery => k8s.io/apimachinery v0.26.3
Expand All @@ -187,6 +207,7 @@ replace (
k8s.io/cri-api => k8s.io/cri-api v0.26.3
k8s.io/csi-translation-lib => k8s.io/csi-translation-lib v0.26.3
k8s.io/dynamic-resource-allocation => k8s.io/dynamic-resource-allocation v0.26.3
k8s.io/kms => k8s.io/kms v0.26.3
k8s.io/kube-aggregator => k8s.io/kube-aggregator v0.26.3
k8s.io/kube-controller-manager => k8s.io/kube-controller-manager v0.26.3
k8s.io/kube-proxy => k8s.io/kube-proxy v0.26.3
Expand Down
18 changes: 18 additions & 0 deletions pkg/kosmosctl/image/image.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
package image

import (
"github.com/spf13/cobra"
"k8s.io/kubectl/pkg/util/i18n"
)

// NewCmdImage pull/push a kosmos offline installation package.
func NewCmdImage() *cobra.Command {
cmd := &cobra.Command{
Use: "image",
Short: i18n.T("pull and push kosmos offline installation package. "),
}

cmd.AddCommand(NewCmdPull())
cmd.AddCommand(NewCmdPush())
return cmd
}
Loading

0 comments on commit 546d553

Please sign in to comment.