diff --git a/api/ignite.md b/api/ignite.md index 597aece47..815b804c8 100644 --- a/api/ignite.md +++ b/api/ignite.md @@ -10,6 +10,7 @@ +k8s:deepcopy-gen=package +k8s:defaulter-gen=TypeMeta +k8s:openapi-gen=true ++k8s:conversion-gen=github.com/weaveworks/ignite/pkg/apis/ignite @@ -26,7 +27,6 @@ * [func SetDefaults_VMNetworkSpec(obj *VMNetworkSpec)](#SetDefaults_VMNetworkSpec) * [func SetDefaults_VMSpec(obj *VMSpec)](#SetDefaults_VMSpec) * [func SetDefaults_VMStatus(obj *VMStatus)](#SetDefaults_VMStatus) -* [func ValidateNetworkMode(mode NetworkMode) error](#ValidateNetworkMode) * [type FileMapping](#FileMapping) * [type Image](#Image) * [type ImageSourceType](#ImageSourceType) @@ -36,7 +36,6 @@ * [type KernelSpec](#KernelSpec) * [type KernelStatus](#KernelStatus) * [type NetworkMode](#NetworkMode) - * [func GetNetworkModes() []NetworkMode](#GetNetworkModes) * [func (nm NetworkMode) String() string](#NetworkMode.String) * [type OCIImageClaim](#OCIImageClaim) * [type OCIImageSource](#OCIImageSource) @@ -49,8 +48,6 @@ * [func (s *SSH) MarshalJSON() ([]byte, error)](#SSH.MarshalJSON) * [func (s *SSH) UnmarshalJSON(b []byte) error](#SSH.UnmarshalJSON) * [type VM](#VM) - * [func (vm *VM) SetImage(image *Image)](#VM.SetImage) - * [func (vm *VM) SetKernel(kernel *Kernel)](#VM.SetKernel) * [type VMImageSpec](#VMImageSpec) * [type VMKernelSpec](#VMKernelSpec) * [type VMNetworkSpec](#VMNetworkSpec) @@ -60,30 +57,21 @@ #### Package files -[defaults.go](/pkg/apis/ignite/v1alpha1/defaults.go) [doc.go](/pkg/apis/ignite/v1alpha1/doc.go) [helpers.go](/pkg/apis/ignite/v1alpha1/helpers.go) [json.go](/pkg/apis/ignite/v1alpha1/json.go) [register.go](/pkg/apis/ignite/v1alpha1/register.go) [types.go](/pkg/apis/ignite/v1alpha1/types.go) +[defaults.go](/pkg/apis/ignite/v1alpha1/defaults.go) [doc.go](/pkg/apis/ignite/v1alpha1/doc.go) [json.go](/pkg/apis/ignite/v1alpha1/json.go) [register.go](/pkg/apis/ignite/v1alpha1/register.go) [types.go](/pkg/apis/ignite/v1alpha1/types.go) ## Constants ``` go const ( - // GroupName is the group name use in this package - GroupName = "ignite.weave.works" - - // VMKind returns the kind for the VM API type - VMKind = "VM" - // KernelKind returns the kind for the Kernel API type - KernelKind = "Kernel" - // PoolKind returns the kind for the Pool API type - PoolKind = "Pool" - // ImageKind returns the kind for the Image API type - ImageKind = "Image" + KindImage meta.Kind = "Image" + KindKernel meta.Kind = "Kernel" + KindVM meta.Kind = "VM" ) ``` ``` go const ( - KindImage meta.Kind = "Image" - KindKernel meta.Kind = "Kernel" - KindVM meta.Kind = "VM" + // GroupName is the group name use in this package + GroupName = "ignite.weave.works" ) ``` @@ -165,15 +153,6 @@ func SetDefaults_VMStatus(obj *VMStatus) ``` -## func [ValidateNetworkMode](/pkg/apis/ignite/v1alpha1/helpers.go?s=317:365#L15) -``` go -func ValidateNetworkMode(mode NetworkMode) error -``` -ValidateNetworkMode validates the network mode -TODO: This should move into a dedicated validation package - - - ## type [FileMapping](/pkg/apis/ignite/v1alpha1/types.go?s=7677:7772#L206) ``` go @@ -364,13 +343,6 @@ const ( -### func [GetNetworkModes](/pkg/apis/ignite/v1alpha1/helpers.go?s=92:128#L6) -``` go -func GetNetworkModes() []NetworkMode -``` -GetNetworkModes gets the list of available network modes - - @@ -615,24 +587,6 @@ These files are stored in /var/lib/firecracker/vm/{vm-id}/metadata.json -### func (\*VM) [SetImage](/pkg/apis/ignite/v1alpha1/helpers.go?s=658:694#L30) -``` go -func (vm *VM) SetImage(image *Image) -``` -SetImage populates relevant fields to an Image on the VM object - - - - -### func (\*VM) [SetKernel](/pkg/apis/ignite/v1alpha1/helpers.go?s=856:895#L36) -``` go -func (vm *VM) SetKernel(kernel *Kernel) -``` -SetKernel populates relevant fields to a Kernel on the VM object - - - - ## type [VMImageSpec](/pkg/apis/ignite/v1alpha1/types.go?s=7298:7367#L191) ``` go type VMImageSpec struct { diff --git a/cmd/ignite/cmd/cmdutil/flags.go b/cmd/ignite/cmd/cmdutil/flags.go index f7294030a..48f616ca0 100644 --- a/cmd/ignite/cmd/cmdutil/flags.go +++ b/cmd/ignite/cmd/cmdutil/flags.go @@ -119,11 +119,7 @@ type NetworkModeFlag struct { } func (nf *NetworkModeFlag) Set(val string) error { - nm := api.NetworkMode(val) - if err := api.ValidateNetworkMode(nm); err != nil { - return err - } - *nf.value = nm + *nf.value = api.NetworkMode(val) return nil } diff --git a/cmd/ignite/run/create.go b/cmd/ignite/run/create.go index 78a016d11..3aff53b30 100644 --- a/cmd/ignite/run/create.go +++ b/cmd/ignite/run/create.go @@ -5,8 +5,8 @@ import ( "path" "strings" - "github.com/weaveworks/ignite/pkg/apis/ignite/scheme" api "github.com/weaveworks/ignite/pkg/apis/ignite" + "github.com/weaveworks/ignite/pkg/apis/ignite/scheme" meta "github.com/weaveworks/ignite/pkg/apis/meta/v1alpha1" "github.com/weaveworks/ignite/pkg/client" "github.com/weaveworks/ignite/pkg/metadata" diff --git a/cmd/ignite/run/inspect.go b/cmd/ignite/run/inspect.go index b189929f5..98603fc50 100644 --- a/cmd/ignite/run/inspect.go +++ b/cmd/ignite/run/inspect.go @@ -5,8 +5,8 @@ import ( "fmt" "strings" - "github.com/weaveworks/ignite/pkg/apis/ignite/scheme" api "github.com/weaveworks/ignite/pkg/apis/ignite" + "github.com/weaveworks/ignite/pkg/apis/ignite/scheme" meta "github.com/weaveworks/ignite/pkg/apis/meta/v1alpha1" "github.com/weaveworks/ignite/pkg/client" "github.com/weaveworks/ignite/pkg/filter" diff --git a/docs/dependencies.svg b/docs/dependencies.svg index 28e2be7fa..1c3f9bcb8 100644 --- a/docs/dependencies.svg +++ b/docs/dependencies.svg @@ -1,4348 +1,4348 @@ - - - + + %3 - + github.com/weaveworks/\nignite - -github.com/weaveworks/ -ignite + +github.com/weaveworks/ +ignite golang.org/x/sync -golang.org/x/sync +golang.org/x/sync github.com/weaveworks/\nignite->golang.org/x/sync - - + + google.golang.org/grpc -google.golang.org/grpc +google.golang.org/grpc github.com/weaveworks/\nignite->google.golang.org/grpc - - + + github.com/firecracker-microvm/\nfirecracker-go-sdk -github.com/firecracker-microvm/ -firecracker-go-sdk +github.com/firecracker-microvm/ +firecracker-go-sdk github.com/weaveworks/\nignite->github.com/firecracker-microvm/\nfirecracker-go-sdk - - + + github.com/sirupsen/\nlogrus -github.com/sirupsen/ -logrus +github.com/sirupsen/ +logrus github.com/weaveworks/\nignite->github.com/sirupsen/\nlogrus - - + + github.com/go-openapi/\nspec -github.com/go-openapi/ -spec +github.com/go-openapi/ +spec github.com/weaveworks/\nignite->github.com/go-openapi/\nspec - - + + github.com/pkg/\nerrors -github.com/pkg/ -errors +github.com/pkg/ +errors github.com/weaveworks/\nignite->github.com/pkg/\nerrors - - + + github.com/spf13/\npflag -github.com/spf13/ -pflag +github.com/spf13/ +pflag github.com/weaveworks/\nignite->github.com/spf13/\npflag - - + + k8s.io/apimachinery -k8s.io/apimachinery +k8s.io/apimachinery github.com/weaveworks/\nignite->k8s.io/apimachinery - - + + k8s.io/kube-openapi -k8s.io/kube-openapi +k8s.io/kube-openapi github.com/weaveworks/\nignite->k8s.io/kube-openapi - - + + sigs.k8s.io/yaml -sigs.k8s.io/yaml +sigs.k8s.io/yaml github.com/weaveworks/\nignite->sigs.k8s.io/yaml - - + + github.com/gorilla/\nmux -github.com/gorilla/ -mux +github.com/gorilla/ +mux github.com/weaveworks/\nignite->github.com/gorilla/\nmux - - + + github.com/prometheus/\nclient_golang -github.com/prometheus/ -client_golang +github.com/prometheus/ +client_golang github.com/weaveworks/\nignite->github.com/prometheus/\nclient_golang - - + + github.com/spf13/\ncobra -github.com/spf13/ -cobra +github.com/spf13/ +cobra github.com/weaveworks/\nignite->github.com/spf13/\ncobra - - + + github.com/weaveworks/\nflux -github.com/weaveworks/ -flux +github.com/weaveworks/ +flux github.com/weaveworks/\nignite->github.com/weaveworks/\nflux - - + + github.com/docker/\ndistribution -github.com/docker/ -distribution +github.com/docker/ +distribution github.com/weaveworks/\nignite->github.com/docker/\ndistribution - - + + github.com/Azure/\ngo-ansiterm -github.com/Azure/ -go-ansiterm +github.com/Azure/ +go-ansiterm github.com/weaveworks/\nignite->github.com/Azure/\ngo-ansiterm - - + + github.com/c2h5oh/\ndatasize -github.com/c2h5oh/ -datasize +github.com/c2h5oh/ +datasize github.com/weaveworks/\nignite->github.com/c2h5oh/\ndatasize - - + + github.com/containernetworking/\ncni -github.com/containernetworking/ -cni +github.com/containernetworking/ +cni github.com/weaveworks/\nignite->github.com/containernetworking/\ncni - - + + github.com/containers/\nimage -github.com/containers/ -image +github.com/containers/ +image github.com/weaveworks/\nignite->github.com/containers/\nimage - - + + github.com/docker/\ndocker -github.com/docker/ -docker +github.com/docker/ +docker github.com/weaveworks/\nignite->github.com/docker/\ndocker - - + + github.com/docker/\ngo-connections -github.com/docker/ -go-connections +github.com/docker/ +go-connections github.com/weaveworks/\nignite->github.com/docker/\ngo-connections - - + + github.com/emicklei/\ngo-restful -github.com/emicklei/ -go-restful +github.com/emicklei/ +go-restful github.com/weaveworks/\nignite->github.com/emicklei/\ngo-restful - - + + github.com/freddierice/\ngo-losetup -github.com/freddierice/ -go-losetup +github.com/freddierice/ +go-losetup github.com/weaveworks/\nignite->github.com/freddierice/\ngo-losetup - - + + github.com/goombaio/\nnamegenerator -github.com/goombaio/ -namegenerator +github.com/goombaio/ +namegenerator github.com/weaveworks/\nignite->github.com/goombaio/\nnamegenerator - - + + github.com/krolaw/\ndhcp4 -github.com/krolaw/ -dhcp4 +github.com/krolaw/ +dhcp4 github.com/weaveworks/\nignite->github.com/krolaw/\ndhcp4 - - + + github.com/lithammer/\ndedent -github.com/lithammer/ -dedent +github.com/lithammer/ +dedent github.com/weaveworks/\nignite->github.com/lithammer/\ndedent - - + + github.com/Microsoft/\ngo-winio -github.com/Microsoft/ -go-winio +github.com/Microsoft/ +go-winio github.com/weaveworks/\nignite->github.com/Microsoft/\ngo-winio - - + + github.com/miekg/\ndns -github.com/miekg/ -dns +github.com/miekg/ +dns github.com/weaveworks/\nignite->github.com/miekg/\ndns - - + + github.com/morikuni/\naec -github.com/morikuni/ -aec +github.com/morikuni/ +aec github.com/weaveworks/\nignite->github.com/morikuni/\naec - - + + gotest.tools -gotest.tools +gotest.tools github.com/weaveworks/\nignite->gotest.tools - - + + cloud.google.com/go -cloud.google.com/go +cloud.google.com/go github.com/golang/\nmock -github.com/golang/ -mock +github.com/golang/ +mock cloud.google.com/go->github.com/golang/\nmock - - + + github.com/golang/\nprotobuf -github.com/golang/ -protobuf +github.com/golang/ +protobuf cloud.google.com/go->github.com/golang/\nprotobuf - - + + github.com/googleapis/\ngax-go/v2 -github.com/googleapis/ -gax-go/v2 +github.com/googleapis/ +gax-go/v2 cloud.google.com/go->github.com/googleapis/\ngax-go/v2 - - + + github.com/google/\nbtree -github.com/google/ -btree +github.com/google/ +btree cloud.google.com/go->github.com/google/\nbtree - - + + github.com/google/\ngo-cmp -github.com/google/ -go-cmp +github.com/google/ +go-cmp cloud.google.com/go->github.com/google/\ngo-cmp - - + + github.com/google/\nmartian -github.com/google/ -martian +github.com/google/ +martian cloud.google.com/go->github.com/google/\nmartian - - + + github.com/google/\npprof -github.com/google/ -pprof +github.com/google/ +pprof cloud.google.com/go->github.com/google/\npprof - - + + github.com/jstemmer/\ngo-junit-report -github.com/jstemmer/ -go-junit-report +github.com/jstemmer/ +go-junit-report cloud.google.com/go->github.com/jstemmer/\ngo-junit-report - - + + golang.org/x/exp -golang.org/x/exp +golang.org/x/exp cloud.google.com/go->golang.org/x/exp - - + + golang.org/x/lint -golang.org/x/lint +golang.org/x/lint cloud.google.com/go->golang.org/x/lint - - + + golang.org/x/oauth2 -golang.org/x/oauth2 +golang.org/x/oauth2 cloud.google.com/go->golang.org/x/oauth2 - - + + cloud.google.com/go->golang.org/x/sync - - + + golang.org/x/text -golang.org/x/text +golang.org/x/text cloud.google.com/go->golang.org/x/text - - + + golang.org/x/time -golang.org/x/time +golang.org/x/time cloud.google.com/go->golang.org/x/time - - + + golang.org/x/tools -golang.org/x/tools +golang.org/x/tools cloud.google.com/go->golang.org/x/tools - - + + google.golang.org/api -google.golang.org/api +google.golang.org/api cloud.google.com/go->google.golang.org/api - - + + google.golang.org/genproto -google.golang.org/genproto +google.golang.org/genproto cloud.google.com/go->google.golang.org/genproto - - + + cloud.google.com/go->google.golang.org/grpc - - + + go.opencensus.io -go.opencensus.io +go.opencensus.io cloud.google.com/go->go.opencensus.io - - + + honnef.co/go/tools -honnef.co/go/tools +honnef.co/go/tools cloud.google.com/go->honnef.co/go/tools - - + + github.com/googleapis/\ngax-go/v2->google.golang.org/grpc - - + + golang.org/x/exp->golang.org/x/tools - - + + golang.org/x/sys -golang.org/x/sys +golang.org/x/sys golang.org/x/exp->golang.org/x/sys - - + + github.com/BurntSushi/\nxgb -github.com/BurntSushi/ -xgb +github.com/BurntSushi/ +xgb golang.org/x/exp->github.com/BurntSushi/\nxgb - - + + golang.org/x/image -golang.org/x/image +golang.org/x/image golang.org/x/exp->golang.org/x/image - - + + golang.org/x/mobile -golang.org/x/mobile +golang.org/x/mobile golang.org/x/exp->golang.org/x/mobile - - + + golang.org/x/lint->golang.org/x/tools - - + + golang.org/x/oauth2->cloud.google.com/go - - + + golang.org/x/oauth2->golang.org/x/sync - - + + golang.org/x/net -golang.org/x/net +golang.org/x/net golang.org/x/oauth2->golang.org/x/net - - + + google.golang.org/appengine -google.golang.org/appengine +google.golang.org/appengine golang.org/x/oauth2->google.golang.org/appengine - - + + golang.org/x/text->golang.org/x/tools - - + + golang.org/x/tools->golang.org/x/sync - - + + golang.org/x/tools->golang.org/x/net - - + + golang.org/x/tools->google.golang.org/appengine - - + + google.golang.org/api->github.com/google/\ngo-cmp - - + + google.golang.org/api->golang.org/x/lint - - + + google.golang.org/api->golang.org/x/oauth2 - - + + google.golang.org/api->golang.org/x/sync - - + + google.golang.org/api->golang.org/x/tools - - + + google.golang.org/api->google.golang.org/genproto - - + + google.golang.org/api->google.golang.org/grpc - - + + google.golang.org/api->go.opencensus.io - - + + google.golang.org/api->honnef.co/go/tools - - + + google.golang.org/api->google.golang.org/appengine - - + + google.golang.org/genproto->github.com/golang/\nprotobuf - - + + google.golang.org/genproto->golang.org/x/exp - - + + google.golang.org/genproto->golang.org/x/lint - - + + google.golang.org/genproto->golang.org/x/sync - - + + google.golang.org/genproto->golang.org/x/tools - - + + google.golang.org/genproto->google.golang.org/grpc - - + + google.golang.org/genproto->honnef.co/go/tools - - + + google.golang.org/genproto->golang.org/x/net - - + + google.golang.org/grpc->cloud.google.com/go - - + + google.golang.org/grpc->github.com/golang/\nmock - - + + google.golang.org/grpc->github.com/golang/\nprotobuf - - + + google.golang.org/grpc->github.com/google/\ngo-cmp - - + + google.golang.org/grpc->golang.org/x/lint - - + + google.golang.org/grpc->golang.org/x/oauth2 - - + + google.golang.org/grpc->golang.org/x/sync - - + + google.golang.org/grpc->golang.org/x/text - - + + google.golang.org/grpc->golang.org/x/tools - - + + google.golang.org/grpc->google.golang.org/genproto - - + + google.golang.org/grpc->honnef.co/go/tools - - + + google.golang.org/grpc->golang.org/x/net - - + + github.com/gogo/\ngoogleapis -github.com/gogo/ -googleapis +github.com/gogo/ +googleapis google.golang.org/grpc->github.com/gogo/\ngoogleapis - - + + github.com/gogo/\nprotobuf -github.com/gogo/ -protobuf +github.com/gogo/ +protobuf google.golang.org/grpc->github.com/gogo/\nprotobuf - - + + google.golang.org/grpc->golang.org/x/sys - - + + github.com/golang/\nglog -github.com/golang/ -glog +github.com/golang/ +glog google.golang.org/grpc->github.com/golang/\nglog - - + + github.com/kisielk/\ngotool -github.com/kisielk/ -gotool +github.com/kisielk/ +gotool google.golang.org/grpc->github.com/kisielk/\ngotool - - + + github.com/BurntSushi/\ntoml -github.com/BurntSushi/ -toml +github.com/BurntSushi/ +toml google.golang.org/grpc->github.com/BurntSushi/\ntoml - - + + google.golang.org/grpc->google.golang.org/appengine - - + + github.com/client9/\nmisspell -github.com/client9/ -misspell +github.com/client9/ +misspell google.golang.org/grpc->github.com/client9/\nmisspell - - + + github.com/envoyproxy/\ngo-control-plane -github.com/envoyproxy/ -go-control-plane +github.com/envoyproxy/ +go-control-plane google.golang.org/grpc->github.com/envoyproxy/\ngo-control-plane - - + + github.com/lyft/\nprotoc-gen-validate -github.com/lyft/ -protoc-gen-validate +github.com/lyft/ +protoc-gen-validate google.golang.org/grpc->github.com/lyft/\nprotoc-gen-validate - - + + go.opencensus.io->github.com/golang/\nprotobuf - - + + go.opencensus.io->github.com/google/\ngo-cmp - - + + go.opencensus.io->google.golang.org/api - - + + go.opencensus.io->google.golang.org/grpc - - + + go.opencensus.io->golang.org/x/net - - + + github.com/openzipkin/\nzipkin-go -github.com/openzipkin/ -zipkin-go +github.com/openzipkin/ +zipkin-go go.opencensus.io->github.com/openzipkin/\nzipkin-go - - + + go.opencensus.io->github.com/prometheus/\nclient_golang - - + + github.com/hashicorp/\ngolang-lru -github.com/hashicorp/ -golang-lru +github.com/hashicorp/ +golang-lru go.opencensus.io->github.com/hashicorp/\ngolang-lru - - + + github.com/apache/\nthrift -github.com/apache/ -thrift +github.com/apache/ +thrift go.opencensus.io->github.com/apache/\nthrift - - + + contrib.go.opencensus.io/exporter/ocagent -contrib.go.opencensus.io/exporter/ocagent +contrib.go.opencensus.io/exporter/ocagent contrib.go.opencensus.io/exporter/ocagent->github.com/golang/\nprotobuf - - + + contrib.go.opencensus.io/exporter/ocagent->google.golang.org/api - - + + contrib.go.opencensus.io/exporter/ocagent->google.golang.org/grpc - - + + contrib.go.opencensus.io/exporter/ocagent->go.opencensus.io - - + + github.com/census-instrumentation/\nopencensus-proto -github.com/census-instrumentation/ -opencensus-proto +github.com/census-instrumentation/ +opencensus-proto contrib.go.opencensus.io/exporter/ocagent->github.com/census-instrumentation/\nopencensus-proto - - + + github.com/grpc-ecosystem/\ngrpc-gateway -github.com/grpc-ecosystem/ -grpc-gateway +github.com/grpc-ecosystem/ +grpc-gateway contrib.go.opencensus.io/exporter/ocagent->github.com/grpc-ecosystem/\ngrpc-gateway - - + + github.com/grpc-ecosystem/\ngrpc-gateway->github.com/golang/\nprotobuf - - + + github.com/grpc-ecosystem/\ngrpc-gateway->google.golang.org/genproto - - + + github.com/grpc-ecosystem/\ngrpc-gateway->google.golang.org/grpc - - + + github.com/grpc-ecosystem/\ngrpc-gateway->golang.org/x/net - - + + gopkg.in/yaml.v2 -gopkg.in/yaml.v2 +gopkg.in/yaml.v2 github.com/grpc-ecosystem/\ngrpc-gateway->gopkg.in/yaml.v2 - - + + github.com/grpc-ecosystem/\ngrpc-gateway->golang.org/x/sys - - + + github.com/ghodss/\nyaml -github.com/ghodss/ -yaml +github.com/ghodss/ +yaml github.com/grpc-ecosystem/\ngrpc-gateway->github.com/ghodss/\nyaml - - + + github.com/grpc-ecosystem/\ngrpc-gateway->github.com/golang/\nglog - - + + github.com/kr/\npretty -github.com/kr/ -pretty +github.com/kr/ +pretty github.com/grpc-ecosystem/\ngrpc-gateway->github.com/kr/\npretty - - + + github.com/rogpeppe/\nfastuuid -github.com/rogpeppe/ -fastuuid +github.com/rogpeppe/ +fastuuid github.com/grpc-ecosystem/\ngrpc-gateway->github.com/rogpeppe/\nfastuuid - - + + gopkg.in/check.v1 -gopkg.in/check.v1 +gopkg.in/check.v1 github.com/grpc-ecosystem/\ngrpc-gateway->gopkg.in/check.v1 - - + + gopkg.in/resty.v1 -gopkg.in/resty.v1 +gopkg.in/resty.v1 github.com/grpc-ecosystem/\ngrpc-gateway->gopkg.in/resty.v1 - - + + github.com/aws/\naws-sdk-go -github.com/aws/ -aws-sdk-go +github.com/aws/ +aws-sdk-go github.com/jmespath/\ngo-jmespath -github.com/jmespath/ -go-jmespath +github.com/jmespath/ +go-jmespath github.com/aws/\naws-sdk-go->github.com/jmespath/\ngo-jmespath - - + + github.com/cpuguy83/\ngo-md2man -github.com/cpuguy83/ -go-md2man +github.com/cpuguy83/ +go-md2man github.com/russross/\nblackfriday -github.com/russross/ -blackfriday +github.com/russross/ +blackfriday github.com/cpuguy83/\ngo-md2man->github.com/russross/\nblackfriday - - + + github.com/elazarl/\ngoproxy/ext -github.com/elazarl/ -goproxy/ext +github.com/elazarl/ +goproxy/ext github.com/rogpeppe/\ngo-charset -github.com/rogpeppe/ -go-charset +github.com/rogpeppe/ +go-charset github.com/elazarl/\ngoproxy/ext->github.com/rogpeppe/\ngo-charset - - + + github.com/go-openapi/\nerrors -github.com/go-openapi/ -errors +github.com/go-openapi/ +errors github.com/firecracker-microvm/\nfirecracker-go-sdk->github.com/go-openapi/\nerrors - - + + github.com/go-openapi/\nruntime -github.com/go-openapi/ -runtime +github.com/go-openapi/ +runtime github.com/firecracker-microvm/\nfirecracker-go-sdk->github.com/go-openapi/\nruntime - - + + github.com/go-openapi/\nstrfmt -github.com/go-openapi/ -strfmt +github.com/go-openapi/ +strfmt github.com/firecracker-microvm/\nfirecracker-go-sdk->github.com/go-openapi/\nstrfmt - - + + github.com/go-openapi/\nswag -github.com/go-openapi/ -swag +github.com/go-openapi/ +swag github.com/firecracker-microvm/\nfirecracker-go-sdk->github.com/go-openapi/\nswag - - + + github.com/go-openapi/\nvalidate -github.com/go-openapi/ -validate +github.com/go-openapi/ +validate github.com/firecracker-microvm/\nfirecracker-go-sdk->github.com/go-openapi/\nvalidate - - + + github.com/firecracker-microvm/\nfirecracker-go-sdk->github.com/sirupsen/\nlogrus - - + + github.com/stretchr/\ntestify -github.com/stretchr/ -testify +github.com/stretchr/ +testify github.com/firecracker-microvm/\nfirecracker-go-sdk->github.com/stretchr/\ntestify - - + + github.com/firecracker-microvm/\nfirecracker-go-sdk->golang.org/x/net - - + + github.com/go-openapi/\nerrors->github.com/stretchr/\ntestify - - + + github.com/davecgh/\ngo-spew -github.com/davecgh/ -go-spew +github.com/davecgh/ +go-spew github.com/go-openapi/\nerrors->github.com/davecgh/\ngo-spew - - + + github.com/pmezard/\ngo-difflib -github.com/pmezard/ -go-difflib +github.com/pmezard/ +go-difflib github.com/go-openapi/\nerrors->github.com/pmezard/\ngo-difflib - - + + github.com/go-openapi/\nruntime->github.com/go-openapi/\nerrors - - + + github.com/go-openapi/\nruntime->github.com/go-openapi/\nstrfmt - - + + github.com/go-openapi/\nruntime->github.com/go-openapi/\nswag - - + + github.com/go-openapi/\nruntime->github.com/go-openapi/\nvalidate - - + + github.com/go-openapi/\nruntime->github.com/stretchr/\ntestify - - + + github.com/go-openapi/\nanalysis -github.com/go-openapi/ -analysis +github.com/go-openapi/ +analysis github.com/go-openapi/\nruntime->github.com/go-openapi/\nanalysis - - + + github.com/go-openapi/\nloads -github.com/go-openapi/ -loads +github.com/go-openapi/ +loads github.com/go-openapi/\nruntime->github.com/go-openapi/\nloads - - + + github.com/go-openapi/\nruntime->github.com/go-openapi/\nspec - - + + github.com/go-openapi/\nruntime->gopkg.in/yaml.v2 - - + + github.com/docker/\ngo-units -github.com/docker/ -go-units +github.com/docker/ +go-units github.com/go-openapi/\nruntime->github.com/docker/\ngo-units - - + + github.com/go-openapi/\nstrfmt->github.com/go-openapi/\nerrors - - + + github.com/go-openapi/\nstrfmt->github.com/stretchr/\ntestify - - + + github.com/go-openapi/\nstrfmt->github.com/davecgh/\ngo-spew - - + + github.com/go-openapi/\nstrfmt->github.com/pmezard/\ngo-difflib - - + + github.com/mailru/\neasyjson -github.com/mailru/ -easyjson +github.com/mailru/ +easyjson github.com/go-openapi/\nstrfmt->github.com/mailru/\neasyjson - - + + github.com/asaskevich/\ngovalidator -github.com/asaskevich/ -govalidator +github.com/asaskevich/ +govalidator github.com/go-openapi/\nstrfmt->github.com/asaskevich/\ngovalidator - - + + github.com/globalsign/\nmgo -github.com/globalsign/ -mgo +github.com/globalsign/ +mgo github.com/go-openapi/\nstrfmt->github.com/globalsign/\nmgo - - + + github.com/mitchellh/\nmapstructure -github.com/mitchellh/ -mapstructure +github.com/mitchellh/ +mapstructure github.com/go-openapi/\nstrfmt->github.com/mitchellh/\nmapstructure - - + + github.com/pborman/\nuuid -github.com/pborman/ -uuid +github.com/pborman/ +uuid github.com/go-openapi/\nstrfmt->github.com/pborman/\nuuid - - + + github.com/go-openapi/\nswag->github.com/stretchr/\ntestify - - + + github.com/go-openapi/\nswag->github.com/davecgh/\ngo-spew - - + + github.com/go-openapi/\nswag->github.com/pmezard/\ngo-difflib - - + + github.com/go-openapi/\nswag->github.com/mailru/\neasyjson - - + + github.com/go-openapi/\nswag->gopkg.in/yaml.v2 - - + + github.com/go-openapi/\nvalidate->github.com/go-openapi/\nerrors - - + + github.com/go-openapi/\nvalidate->github.com/go-openapi/\nruntime - - + + github.com/go-openapi/\nvalidate->github.com/go-openapi/\nstrfmt - - + + github.com/go-openapi/\nvalidate->github.com/go-openapi/\nswag - - + + github.com/go-openapi/\nvalidate->github.com/stretchr/\ntestify - - + + github.com/go-openapi/\nvalidate->github.com/go-openapi/\nanalysis - - + + github.com/go-openapi/\njsonpointer -github.com/go-openapi/ -jsonpointer +github.com/go-openapi/ +jsonpointer github.com/go-openapi/\nvalidate->github.com/go-openapi/\njsonpointer - - + + github.com/go-openapi/\nvalidate->github.com/go-openapi/\nloads - - + + github.com/go-openapi/\nvalidate->github.com/go-openapi/\nspec - - + + github.com/go-openapi/\nvalidate->gopkg.in/yaml.v2 - - + + github.com/sirupsen/\nlogrus->github.com/stretchr/\ntestify - - + + github.com/sirupsen/\nlogrus->github.com/davecgh/\ngo-spew - - + + github.com/sirupsen/\nlogrus->github.com/pmezard/\ngo-difflib - - + + golang.org/x/crypto -golang.org/x/crypto +golang.org/x/crypto github.com/sirupsen/\nlogrus->golang.org/x/crypto - - + + github.com/sirupsen/\nlogrus->golang.org/x/sys - - + + github.com/konsorten/\ngo-windows-terminal-sequences -github.com/konsorten/ -go-windows-terminal-sequences +github.com/konsorten/ +go-windows-terminal-sequences github.com/sirupsen/\nlogrus->github.com/konsorten/\ngo-windows-terminal-sequences - - + + github.com/stretchr/\nobjx -github.com/stretchr/ -objx +github.com/stretchr/ +objx github.com/sirupsen/\nlogrus->github.com/stretchr/\nobjx - - + + github.com/stretchr/\ntestify->github.com/davecgh/\ngo-spew - - + + github.com/stretchr/\ntestify->github.com/pmezard/\ngo-difflib - - + + github.com/stretchr/\ntestify->github.com/stretchr/\nobjx - - + + golang.org/x/net->golang.org/x/text - - + + golang.org/x/net->golang.org/x/crypto - - + + github.com/gogo/\ngoogleapis->github.com/gogo/\nprotobuf - - + + github.com/kisielk/\nerrcheck -github.com/kisielk/ -errcheck +github.com/kisielk/ +errcheck github.com/gogo/\nprotobuf->github.com/kisielk/\nerrcheck - - + + github.com/kisielk/\nerrcheck->golang.org/x/tools - - + + github.com/kisielk/\nerrcheck->github.com/kisielk/\ngotool - - + + github.com/gogo/\nstatus -github.com/gogo/ -status +github.com/gogo/ +status github.com/gogo/\nstatus->github.com/golang/\nprotobuf - - + + github.com/gogo/\nstatus->golang.org/x/sync - - + + github.com/gogo/\nstatus->google.golang.org/genproto - - + + github.com/gogo/\nstatus->google.golang.org/grpc - - + + github.com/gogo/\nstatus->github.com/gogo/\ngoogleapis - - + + github.com/gogo/\nstatus->github.com/gogo/\nprotobuf - - + + github.com/go-logfmt/\nlogfmt -github.com/go-logfmt/ -logfmt +github.com/go-logfmt/ +logfmt github.com/kr/\nlogfmt -github.com/kr/ -logfmt +github.com/kr/ +logfmt github.com/go-logfmt/\nlogfmt->github.com/kr/\nlogfmt - - + + github.com/go-openapi/\nanalysis->github.com/go-openapi/\nstrfmt - - + + github.com/go-openapi/\nanalysis->github.com/go-openapi/\nswag - - + + github.com/go-openapi/\nanalysis->github.com/stretchr/\ntestify - - + + github.com/go-openapi/\nanalysis->github.com/go-openapi/\njsonpointer - - + + github.com/go-openapi/\nanalysis->github.com/go-openapi/\nloads - - + + github.com/go-openapi/\nanalysis->github.com/go-openapi/\nspec - - + + github.com/go-openapi/\njsonpointer->github.com/go-openapi/\nswag - - + + github.com/go-openapi/\njsonpointer->github.com/stretchr/\ntestify - - + + github.com/go-openapi/\njsonpointer->github.com/davecgh/\ngo-spew - - + + github.com/go-openapi/\njsonpointer->github.com/pmezard/\ngo-difflib - - + + github.com/go-openapi/\njsonpointer->github.com/mailru/\neasyjson - - + + github.com/go-openapi/\njsonpointer->gopkg.in/yaml.v2 - - + + github.com/go-openapi/\nloads->golang.org/x/text - - + + github.com/go-openapi/\nloads->github.com/go-openapi/\nerrors - - + + github.com/go-openapi/\nloads->github.com/go-openapi/\nstrfmt - - + + github.com/go-openapi/\nloads->github.com/go-openapi/\nswag - - + + github.com/go-openapi/\nloads->github.com/stretchr/\ntestify - - + + github.com/go-openapi/\nloads->golang.org/x/net - - + + github.com/go-openapi/\nloads->github.com/go-openapi/\nanalysis - - + + github.com/go-openapi/\nloads->github.com/go-openapi/\njsonpointer - - + + github.com/go-openapi/\nloads->github.com/go-openapi/\nspec - - + + github.com/go-openapi/\nloads->github.com/davecgh/\ngo-spew - - + + github.com/go-openapi/\nloads->github.com/pmezard/\ngo-difflib - - + + github.com/go-openapi/\nloads->github.com/mailru/\neasyjson - - + + github.com/go-openapi/\nloads->gopkg.in/yaml.v2 - - + + github.com/go-openapi/\njsonreference -github.com/go-openapi/ -jsonreference +github.com/go-openapi/ +jsonreference github.com/go-openapi/\nloads->github.com/go-openapi/\njsonreference - - + + github.com/PuerkitoBio/\npurell -github.com/PuerkitoBio/ -purell +github.com/PuerkitoBio/ +purell github.com/go-openapi/\nloads->github.com/PuerkitoBio/\npurell - - + + github.com/PuerkitoBio/\nurlesc -github.com/PuerkitoBio/ -urlesc +github.com/PuerkitoBio/ +urlesc github.com/go-openapi/\nloads->github.com/PuerkitoBio/\nurlesc - - + + github.com/go-openapi/\nloads->github.com/asaskevich/\ngovalidator - - + + github.com/go-openapi/\nloads->github.com/globalsign/\nmgo - - + + github.com/go-openapi/\nloads->github.com/mitchellh/\nmapstructure - - + + github.com/go-openapi/\nspec->golang.org/x/text - - + + github.com/go-openapi/\nspec->github.com/go-openapi/\nswag - - + + github.com/go-openapi/\nspec->github.com/stretchr/\ntestify - - + + github.com/go-openapi/\nspec->golang.org/x/net - - + + github.com/go-openapi/\nspec->github.com/go-openapi/\njsonpointer - - + + github.com/go-openapi/\nspec->github.com/davecgh/\ngo-spew - - + + github.com/go-openapi/\nspec->github.com/pmezard/\ngo-difflib - - + + github.com/go-openapi/\nspec->github.com/mailru/\neasyjson - - + + github.com/go-openapi/\nspec->gopkg.in/yaml.v2 - - + + github.com/go-openapi/\nspec->github.com/go-openapi/\njsonreference - - + + github.com/go-openapi/\nspec->github.com/PuerkitoBio/\npurell - - + + github.com/go-openapi/\nspec->github.com/PuerkitoBio/\nurlesc - - + + gopkg.in/yaml.v2->gopkg.in/check.v1 - - + + github.com/go-openapi/\njsonreference->golang.org/x/text - - + + github.com/go-openapi/\njsonreference->github.com/go-openapi/\nswag - - + + github.com/go-openapi/\njsonreference->github.com/stretchr/\ntestify - - + + github.com/go-openapi/\njsonreference->golang.org/x/net - - + + github.com/go-openapi/\njsonreference->github.com/go-openapi/\njsonpointer - - + + github.com/go-openapi/\njsonreference->github.com/davecgh/\ngo-spew - - + + github.com/go-openapi/\njsonreference->github.com/pmezard/\ngo-difflib - - + + github.com/go-openapi/\njsonreference->github.com/mailru/\neasyjson - - + + github.com/go-openapi/\njsonreference->gopkg.in/yaml.v2 - - + + github.com/go-openapi/\njsonreference->github.com/PuerkitoBio/\npurell - - + + github.com/go-openapi/\njsonreference->github.com/PuerkitoBio/\nurlesc - - + + github.com/google/\nuuid -github.com/google/ -uuid +github.com/google/ +uuid github.com/pborman/\nuuid->github.com/google/\nuuid - - + + github.com/gophercloud/\ngophercloud -github.com/gophercloud/ -gophercloud +github.com/gophercloud/ +gophercloud github.com/gophercloud/\ngophercloud->gopkg.in/yaml.v2 - - + + github.com/gophercloud/\ngophercloud->golang.org/x/crypto - - + + github.com/gophercloud/\ngophercloud->golang.org/x/sys - - + + golang.org/x/crypto->golang.org/x/sys - - + + github.com/kr/\ntext -github.com/kr/ -text +github.com/kr/ +text github.com/kr/\npretty->github.com/kr/\ntext - - + + gopkg.in/resty.v1->golang.org/x/net - - + + github.com/hashicorp/\nhcl -github.com/hashicorp/ -hcl +github.com/hashicorp/ +hcl github.com/hashicorp/\nhcl->github.com/davecgh/\ngo-spew - - + + github.com/justinbarrick/\ngo-k8s-portforward -github.com/justinbarrick/ -go-k8s-portforward +github.com/justinbarrick/ +go-k8s-portforward github.com/justinbarrick/\ngo-k8s-portforward->golang.org/x/time - - + + github.com/justinbarrick/\ngo-k8s-portforward->contrib.go.opencensus.io/exporter/ocagent - - + + github.com/justinbarrick/\ngo-k8s-portforward->github.com/elazarl/\ngoproxy/ext - - + + github.com/justinbarrick/\ngo-k8s-portforward->github.com/stretchr/\ntestify - - + + github.com/justinbarrick/\ngo-k8s-portforward->github.com/gophercloud/\ngophercloud - - + + github.com/justinbarrick/\ngo-k8s-portforward->github.com/justinbarrick/\ngo-k8s-portforward - - + + github.com/Azure/\ngo-autorest -github.com/Azure/ -go-autorest +github.com/Azure/ +go-autorest github.com/justinbarrick/\ngo-k8s-portforward->github.com/Azure/\ngo-autorest - - + + github.com/dgrijalva/\njwt-go -github.com/dgrijalva/ -jwt-go +github.com/dgrijalva/ +jwt-go github.com/justinbarrick/\ngo-k8s-portforward->github.com/dgrijalva/\njwt-go - - + + github.com/docker/\nspdystream -github.com/docker/ -spdystream +github.com/docker/ +spdystream github.com/justinbarrick/\ngo-k8s-portforward->github.com/docker/\nspdystream - - + + github.com/elazarl/\ngoproxy -github.com/elazarl/ -goproxy +github.com/elazarl/ +goproxy github.com/justinbarrick/\ngo-k8s-portforward->github.com/elazarl/\ngoproxy - - + + github.com/evanphx/\njson-patch -github.com/evanphx/ -json-patch +github.com/evanphx/ +json-patch github.com/justinbarrick/\ngo-k8s-portforward->github.com/evanphx/\njson-patch - - + + github.com/googleapis/\ngnostic -github.com/googleapis/ -gnostic +github.com/googleapis/ +gnostic github.com/justinbarrick/\ngo-k8s-portforward->github.com/googleapis/\ngnostic - - + + github.com/google/\ngofuzz -github.com/google/ -gofuzz +github.com/google/ +gofuzz github.com/justinbarrick/\ngo-k8s-portforward->github.com/google/\ngofuzz - - + + github.com/imdario/\nmergo -github.com/imdario/ -mergo +github.com/imdario/ +mergo github.com/justinbarrick/\ngo-k8s-portforward->github.com/imdario/\nmergo - - + + github.com/json-iterator/\ngo -github.com/json-iterator/ -go +github.com/json-iterator/ +go github.com/justinbarrick/\ngo-k8s-portforward->github.com/json-iterator/\ngo - - + + github.com/modern-go/\nconcurrent -github.com/modern-go/ -concurrent +github.com/modern-go/ +concurrent github.com/justinbarrick/\ngo-k8s-portforward->github.com/modern-go/\nconcurrent - - + + github.com/modern-go/\nreflect2 -github.com/modern-go/ -reflect2 +github.com/modern-go/ +reflect2 github.com/justinbarrick/\ngo-k8s-portforward->github.com/modern-go/\nreflect2 - - + + github.com/justinbarrick/\ngo-k8s-portforward->github.com/pkg/\nerrors - - + + github.com/justinbarrick/\ngo-k8s-portforward->github.com/spf13/\npflag - - + + gopkg.in/inf.v0 -gopkg.in/inf.v0 +gopkg.in/inf.v0 github.com/justinbarrick/\ngo-k8s-portforward->gopkg.in/inf.v0 - - + + k8s.io/api -k8s.io/api +k8s.io/api github.com/justinbarrick/\ngo-k8s-portforward->k8s.io/api - - + + github.com/justinbarrick/\ngo-k8s-portforward->k8s.io/apimachinery - - + + k8s.io/client-go -k8s.io/client-go +k8s.io/client-go github.com/justinbarrick/\ngo-k8s-portforward->k8s.io/client-go - - + + k8s.io/klog -k8s.io/klog +k8s.io/klog github.com/justinbarrick/\ngo-k8s-portforward->k8s.io/klog - - + + github.com/justinbarrick/\ngo-k8s-portforward->k8s.io/kube-openapi - - + + k8s.io/utils -k8s.io/utils +k8s.io/utils github.com/justinbarrick/\ngo-k8s-portforward->k8s.io/utils - - + + github.com/justinbarrick/\ngo-k8s-portforward->sigs.k8s.io/yaml - - + + k8s.io/apimachinery->github.com/golang/\nprotobuf - - + + k8s.io/apimachinery->github.com/google/\ngo-cmp - - + + k8s.io/apimachinery->golang.org/x/sync - - + + k8s.io/apimachinery->golang.org/x/text - - + + k8s.io/apimachinery->github.com/stretchr/\ntestify - - + + k8s.io/apimachinery->golang.org/x/net - - + + k8s.io/apimachinery->github.com/gogo/\nprotobuf - - + + k8s.io/apimachinery->github.com/davecgh/\ngo-spew - - + + k8s.io/apimachinery->github.com/pmezard/\ngo-difflib - - + + k8s.io/apimachinery->gopkg.in/yaml.v2 - - + + k8s.io/apimachinery->golang.org/x/sys - - + + k8s.io/apimachinery->github.com/docker/\nspdystream - - + + k8s.io/apimachinery->github.com/elazarl/\ngoproxy - - + + k8s.io/apimachinery->github.com/evanphx/\njson-patch - - + + k8s.io/apimachinery->github.com/googleapis/\ngnostic - - + + k8s.io/apimachinery->github.com/google/\ngofuzz - - + + k8s.io/apimachinery->github.com/json-iterator/\ngo - - + + k8s.io/apimachinery->github.com/modern-go/\nconcurrent - - + + k8s.io/apimachinery->github.com/modern-go/\nreflect2 - - + + k8s.io/apimachinery->github.com/spf13/\npflag - - + + k8s.io/apimachinery->gopkg.in/inf.v0 - - + + k8s.io/apimachinery->k8s.io/klog - - + + k8s.io/apimachinery->k8s.io/kube-openapi - - + + k8s.io/apimachinery->sigs.k8s.io/yaml - - + + github.com/onsi/\ngomega -github.com/onsi/ -gomega +github.com/onsi/ +gomega k8s.io/apimachinery->github.com/onsi/\ngomega - - + + k8s.io/apimachinery->github.com/google/\nuuid - - + + github.com/golang/\ngroupcache -github.com/golang/ -groupcache +github.com/golang/ +groupcache k8s.io/apimachinery->github.com/golang/\ngroupcache - - + + k8s.io/apimachinery->github.com/hashicorp/\ngolang-lru - - + + github.com/mxk/\ngo-flowrate -github.com/mxk/ -go-flowrate +github.com/mxk/ +go-flowrate k8s.io/apimachinery->github.com/mxk/\ngo-flowrate - - + + github.com/kr/\npty -github.com/kr/ -pty +github.com/kr/ +pty github.com/kr/\ntext->github.com/kr/\npty - - + + github.com/onsi/\ngomega->github.com/golang/\nprotobuf - - + + github.com/onsi/\ngomega->golang.org/x/sync - - + + github.com/onsi/\ngomega->golang.org/x/text - - + + github.com/onsi/\ngomega->golang.org/x/net - - + + github.com/onsi/\ngomega->gopkg.in/yaml.v2 - - + + github.com/onsi/\ngomega->golang.org/x/sys - - + + github.com/fsnotify/\nfsnotify -github.com/fsnotify/ -fsnotify +github.com/fsnotify/ +fsnotify github.com/onsi/\ngomega->github.com/fsnotify/\nfsnotify - - + + github.com/hpcloud/\ntail -github.com/hpcloud/ -tail +github.com/hpcloud/ +tail github.com/onsi/\ngomega->github.com/hpcloud/\ntail - - + + github.com/onsi/\nginkgo -github.com/onsi/ -ginkgo +github.com/onsi/ +ginkgo github.com/onsi/\ngomega->github.com/onsi/\nginkgo - - + + gopkg.in/fsnotify.v1 -gopkg.in/fsnotify.v1 +gopkg.in/fsnotify.v1 github.com/onsi/\ngomega->gopkg.in/fsnotify.v1 - - + + gopkg.in/tomb.v1 -gopkg.in/tomb.v1 +gopkg.in/tomb.v1 github.com/onsi/\ngomega->gopkg.in/tomb.v1 - - + + github.com/openzipkin/\nzipkin-go->github.com/golang/\nprotobuf - - + + github.com/openzipkin/\nzipkin-go->golang.org/x/sync - - + + github.com/openzipkin/\nzipkin-go->google.golang.org/grpc - - + + github.com/openzipkin/\nzipkin-go->golang.org/x/net - - + + github.com/openzipkin/\nzipkin-go->github.com/gogo/\nprotobuf - - + + github.com/openzipkin/\nzipkin-go->github.com/davecgh/\ngo-spew - - + + github.com/openzipkin/\nzipkin-go->golang.org/x/sys - - + + github.com/openzipkin/\nzipkin-go->github.com/onsi/\ngomega - - + + github.com/openzipkin/\nzipkin-go->github.com/onsi/\nginkgo - - + + github.com/eapache/\ngo-resiliency -github.com/eapache/ -go-resiliency +github.com/eapache/ +go-resiliency github.com/openzipkin/\nzipkin-go->github.com/eapache/\ngo-resiliency - - + + github.com/eapache/\ngo-xerial-snappy -github.com/eapache/ -go-xerial-snappy +github.com/eapache/ +go-xerial-snappy github.com/openzipkin/\nzipkin-go->github.com/eapache/\ngo-xerial-snappy - - + + github.com/eapache/\nqueue -github.com/eapache/ -queue +github.com/eapache/ +queue github.com/openzipkin/\nzipkin-go->github.com/eapache/\nqueue - - + + github.com/golang/\nsnappy -github.com/golang/ -snappy +github.com/golang/ +snappy github.com/openzipkin/\nzipkin-go->github.com/golang/\nsnappy - - + + github.com/gorilla/\ncontext -github.com/gorilla/ -context +github.com/gorilla/ +context github.com/openzipkin/\nzipkin-go->github.com/gorilla/\ncontext - - + + github.com/openzipkin/\nzipkin-go->github.com/gorilla/\nmux - - + + github.com/pierrec/\nlz4 -github.com/pierrec/ -lz4 +github.com/pierrec/ +lz4 github.com/openzipkin/\nzipkin-go->github.com/pierrec/\nlz4 - - + + github.com/rcrowley/\ngo-metrics -github.com/rcrowley/ -go-metrics +github.com/rcrowley/ +go-metrics github.com/openzipkin/\nzipkin-go->github.com/rcrowley/\ngo-metrics - - + + github.com/Shopify/\nsarama -github.com/Shopify/ -sarama +github.com/Shopify/ +sarama github.com/openzipkin/\nzipkin-go->github.com/Shopify/\nsarama - - + + github.com/Shopify/\ntoxiproxy -github.com/Shopify/ -toxiproxy +github.com/Shopify/ +toxiproxy github.com/openzipkin/\nzipkin-go->github.com/Shopify/\ntoxiproxy - - + + github.com/prometheus/\nclient_golang->github.com/golang/\nprotobuf - - + + github.com/prometheus/\nclient_golang->golang.org/x/sync - - + + github.com/prometheus/\nclient_golang->github.com/stretchr/\ntestify - - + + github.com/prometheus/\nclient_golang->golang.org/x/net - - + + github.com/prometheus/\nclient_golang->golang.org/x/sys - - + + github.com/prometheus/\nclient_golang->github.com/json-iterator/\ngo - - + + github.com/prometheus/\nclient_golang->github.com/modern-go/\nconcurrent - - + + github.com/prometheus/\nclient_golang->github.com/modern-go/\nreflect2 - - + + github.com/beorn7/\nperks -github.com/beorn7/ -perks +github.com/beorn7/ +perks github.com/prometheus/\nclient_golang->github.com/beorn7/\nperks - - + + github.com/prometheus/\nclient_model -github.com/prometheus/ -client_model +github.com/prometheus/ +client_model github.com/prometheus/\nclient_golang->github.com/prometheus/\nclient_model - - + + github.com/prometheus/\ncommon -github.com/prometheus/ -common +github.com/prometheus/ +common github.com/prometheus/\nclient_golang->github.com/prometheus/\ncommon - - + + github.com/prometheus/\nprocfs -github.com/prometheus/ -procfs +github.com/prometheus/ +procfs github.com/prometheus/\nclient_golang->github.com/prometheus/\nprocfs - - + + github.com/prometheus/\nclient_model->github.com/golang/\nprotobuf - - + + github.com/prometheus/\nclient_model->golang.org/x/sync - - + + github.com/prometheus/\ncommon->github.com/golang/\nprotobuf - - + + github.com/prometheus/\ncommon->golang.org/x/sync - - + + github.com/prometheus/\ncommon->github.com/sirupsen/\nlogrus - - + + github.com/prometheus/\ncommon->golang.org/x/net - - + + github.com/prometheus/\ncommon->github.com/gogo/\nprotobuf - - + + github.com/prometheus/\ncommon->github.com/go-logfmt/\nlogfmt - - + + github.com/prometheus/\ncommon->github.com/kr/\nlogfmt - - + + github.com/prometheus/\ncommon->gopkg.in/yaml.v2 - - + + github.com/prometheus/\ncommon->golang.org/x/sys - - + + github.com/prometheus/\ncommon->github.com/pkg/\nerrors - - + + github.com/prometheus/\ncommon->github.com/prometheus/\nclient_golang - - + + github.com/prometheus/\ncommon->github.com/beorn7/\nperks - - + + github.com/prometheus/\ncommon->github.com/prometheus/\nclient_model - - + + github.com/prometheus/\ncommon->github.com/prometheus/\nprocfs - - + + github.com/alecthomas/\ntemplate -github.com/alecthomas/ -template +github.com/alecthomas/ +template github.com/prometheus/\ncommon->github.com/alecthomas/\ntemplate - - + + github.com/alecthomas/\nunits -github.com/alecthomas/ -units +github.com/alecthomas/ +units github.com/prometheus/\ncommon->github.com/alecthomas/\nunits - - + + github.com/go-kit/\nkit -github.com/go-kit/ -kit +github.com/go-kit/ +kit github.com/prometheus/\ncommon->github.com/go-kit/\nkit - - + + github.com/go-stack/\nstack -github.com/go-stack/ -stack +github.com/go-stack/ +stack github.com/prometheus/\ncommon->github.com/go-stack/\nstack - - + + github.com/julienschmidt/\nhttprouter -github.com/julienschmidt/ -httprouter +github.com/julienschmidt/ +httprouter github.com/prometheus/\ncommon->github.com/julienschmidt/\nhttprouter - - + + github.com/matttproud/\ngolang_protobuf_extensions -github.com/matttproud/ -golang_protobuf_extensions +github.com/matttproud/ +golang_protobuf_extensions github.com/prometheus/\ncommon->github.com/matttproud/\ngolang_protobuf_extensions - - + + github.com/mwitkow/\ngo-conntrack -github.com/mwitkow/ -go-conntrack +github.com/mwitkow/ +go-conntrack github.com/prometheus/\ncommon->github.com/mwitkow/\ngo-conntrack - - + + gopkg.in/alecthomas/kingpin.v2 -gopkg.in/alecthomas/kingpin.v2 +gopkg.in/alecthomas/kingpin.v2 github.com/prometheus/\ncommon->gopkg.in/alecthomas/kingpin.v2 - - + + github.com/prometheus/\nprocfs->golang.org/x/sync - - + + github.com/spf13/\ncast -github.com/spf13/ -cast +github.com/spf13/ +cast github.com/spf13/\ncast->github.com/stretchr/\ntestify - - + + github.com/spf13/\ncast->github.com/davecgh/\ngo-spew - - + + github.com/spf13/\ncast->github.com/pmezard/\ngo-difflib - - + + github.com/spf13/\ncobra->github.com/cpuguy83/\ngo-md2man - - + + github.com/spf13/\ncobra->gopkg.in/yaml.v2 - - + + github.com/spf13/\ncobra->github.com/spf13/\npflag - - + + github.com/spf13/\ncobra->github.com/BurntSushi/\ntoml - - + + github.com/inconshreveable/\nmousetrap -github.com/inconshreveable/ -mousetrap +github.com/inconshreveable/ +mousetrap github.com/spf13/\ncobra->github.com/inconshreveable/\nmousetrap - - + + github.com/mitchellh/\ngo-homedir -github.com/mitchellh/ -go-homedir +github.com/mitchellh/ +go-homedir github.com/spf13/\ncobra->github.com/mitchellh/\ngo-homedir - - + + github.com/spf13/\nviper -github.com/spf13/ -viper +github.com/spf13/ +viper github.com/spf13/\ncobra->github.com/spf13/\nviper - - + + github.com/spf13/\nviper->golang.org/x/text - - + + github.com/spf13/\nviper->github.com/stretchr/\ntestify - - + + github.com/spf13/\nviper->gopkg.in/yaml.v2 - - + + github.com/spf13/\nviper->github.com/mitchellh/\nmapstructure - - + + github.com/spf13/\nviper->golang.org/x/crypto - - + + github.com/spf13/\nviper->golang.org/x/sys - - + + github.com/spf13/\nviper->github.com/hashicorp/\nhcl - - + + github.com/spf13/\nviper->github.com/spf13/\npflag - - + + github.com/spf13/\nviper->github.com/fsnotify/\nfsnotify - - + + github.com/spf13/\nviper->github.com/spf13/\ncast - - + + github.com/armon/\nconsul-api -github.com/armon/ -consul-api +github.com/armon/ +consul-api github.com/spf13/\nviper->github.com/armon/\nconsul-api - - + + github.com/coreos/\netcd -github.com/coreos/ -etcd +github.com/coreos/ +etcd github.com/spf13/\nviper->github.com/coreos/\netcd - - + + github.com/coreos/\ngo-etcd -github.com/coreos/ -go-etcd +github.com/coreos/ +go-etcd github.com/spf13/\nviper->github.com/coreos/\ngo-etcd - - + + github.com/coreos/\ngo-semver -github.com/coreos/ -go-semver +github.com/coreos/ +go-semver github.com/spf13/\nviper->github.com/coreos/\ngo-semver - - + + github.com/magiconair/\nproperties -github.com/magiconair/ -properties +github.com/magiconair/ +properties github.com/spf13/\nviper->github.com/magiconair/\nproperties - - + + github.com/pelletier/\ngo-toml -github.com/pelletier/ -go-toml +github.com/pelletier/ +go-toml github.com/spf13/\nviper->github.com/pelletier/\ngo-toml - - + + github.com/spf13/\nafero -github.com/spf13/ -afero +github.com/spf13/ +afero github.com/spf13/\nviper->github.com/spf13/\nafero - - + + github.com/spf13/\njwalterweatherman -github.com/spf13/ -jwalterweatherman +github.com/spf13/ +jwalterweatherman github.com/spf13/\nviper->github.com/spf13/\njwalterweatherman - - + + github.com/ugorji/\ngo/codec -github.com/ugorji/ -go/codec +github.com/ugorji/ +go/codec github.com/spf13/\nviper->github.com/ugorji/\ngo/codec - - + + github.com/xordataexchange/\ncrypt -github.com/xordataexchange/ -crypt +github.com/xordataexchange/ +crypt github.com/spf13/\nviper->github.com/xordataexchange/\ncrypt - - + + github.com/weaveworks/\nflux->cloud.google.com/go - - + + github.com/weaveworks/\nflux->github.com/golang/\nprotobuf - - + + github.com/weaveworks/\nflux->github.com/google/\ngo-cmp - - + + github.com/weaveworks/\nflux->golang.org/x/oauth2 - - + + github.com/weaveworks/\nflux->golang.org/x/time - - + + github.com/weaveworks/\nflux->google.golang.org/api - - + + github.com/weaveworks/\nflux->google.golang.org/grpc - - + + github.com/weaveworks/\nflux->github.com/aws/\naws-sdk-go - - + + github.com/weaveworks/\nflux->github.com/sirupsen/\nlogrus - - + + github.com/weaveworks/\nflux->github.com/stretchr/\ntestify - - + + github.com/weaveworks/\nflux->golang.org/x/net - - + + github.com/weaveworks/\nflux->github.com/gogo/\ngoogleapis - - + + github.com/weaveworks/\nflux->github.com/gogo/\nstatus - - + + github.com/weaveworks/\nflux->github.com/go-logfmt/\nlogfmt - - + + github.com/weaveworks/\nflux->gopkg.in/yaml.v2 - - + + github.com/weaveworks/\nflux->github.com/gophercloud/\ngophercloud - - + + github.com/weaveworks/\nflux->golang.org/x/crypto - - + + github.com/weaveworks/\nflux->golang.org/x/sys - - + + github.com/weaveworks/\nflux->github.com/ghodss/\nyaml - - + + github.com/weaveworks/\nflux->github.com/justinbarrick/\ngo-k8s-portforward - - + + github.com/weaveworks/\nflux->github.com/docker/\nspdystream - - + + github.com/weaveworks/\nflux->github.com/evanphx/\njson-patch - - + + github.com/weaveworks/\nflux->github.com/google/\ngofuzz - - + + github.com/weaveworks/\nflux->github.com/imdario/\nmergo - - + + github.com/weaveworks/\nflux->github.com/pkg/\nerrors - - + + github.com/weaveworks/\nflux->github.com/spf13/\npflag - - + + github.com/weaveworks/\nflux->k8s.io/api - - + + github.com/weaveworks/\nflux->k8s.io/apimachinery - - + + github.com/weaveworks/\nflux->k8s.io/client-go - - + + github.com/weaveworks/\nflux->k8s.io/klog - - + + github.com/weaveworks/\nflux->k8s.io/kube-openapi - - + + github.com/weaveworks/\nflux->github.com/gorilla/\nmux - - + + github.com/weaveworks/\nflux->github.com/google/\nuuid - - + + github.com/weaveworks/\nflux->github.com/prometheus/\nclient_golang - - + + github.com/weaveworks/\nflux->github.com/prometheus/\nclient_model - - + + github.com/weaveworks/\nflux->github.com/prometheus/\ncommon - - + + github.com/weaveworks/\nflux->github.com/prometheus/\nprocfs - - + + github.com/weaveworks/\nflux->github.com/go-kit/\nkit - - + + github.com/weaveworks/\nflux->github.com/konsorten/\ngo-windows-terminal-sequences - - + + github.com/weaveworks/\nflux->github.com/spf13/\ncobra - - + + github.com/weaveworks/\nflux->github.com/inconshreveable/\nmousetrap - - + + github.com/bradfitz/\ngomemcache -github.com/bradfitz/ -gomemcache +github.com/bradfitz/ +gomemcache github.com/weaveworks/\nflux->github.com/bradfitz/\ngomemcache - - + + github.com/codahale/\nhdrhistogram -github.com/codahale/ -hdrhistogram +github.com/codahale/ +hdrhistogram github.com/weaveworks/\nflux->github.com/codahale/\nhdrhistogram - - + + github.com/cyphar/\nfilepath-securejoin -github.com/cyphar/ -filepath-securejoin +github.com/cyphar/ +filepath-securejoin github.com/weaveworks/\nflux->github.com/cyphar/\nfilepath-securejoin - - + + github.com/weaveworks/\nflux->github.com/docker/\ndistribution - - + + github.com/docker/\ngo-metrics -github.com/docker/ -go-metrics +github.com/docker/ +go-metrics github.com/weaveworks/\nflux->github.com/docker/\ngo-metrics - - + + github.com/docker/\nlibtrust -github.com/docker/ -libtrust +github.com/docker/ +libtrust github.com/weaveworks/\nflux->github.com/docker/\nlibtrust - - + + github.com/gobwas/\nglob -github.com/gobwas/ -glob +github.com/gobwas/ +glob github.com/weaveworks/\nflux->github.com/gobwas/\nglob - - + + github.com/golang/\ngddo -github.com/golang/ -gddo +github.com/golang/ +gddo github.com/weaveworks/\nflux->github.com/golang/\ngddo - - + + github.com/weaveworks/\nflux->github.com/golang/\ngroupcache - - + + github.com/gorilla/\nwebsocket -github.com/gorilla/ -websocket +github.com/gorilla/ +websocket github.com/weaveworks/\nflux->github.com/gorilla/\nwebsocket - - + + github.com/hashicorp/\ngo-cleanhttp -github.com/hashicorp/ -go-cleanhttp +github.com/hashicorp/ +go-cleanhttp github.com/weaveworks/\nflux->github.com/hashicorp/\ngo-cleanhttp - - + + github.com/weaveworks/\nflux->github.com/hashicorp/\ngolang-lru - - + + github.com/huandu/\nxstrings -github.com/huandu/ -xstrings +github.com/huandu/ +xstrings github.com/weaveworks/\nflux->github.com/huandu/\nxstrings - - + + github.com/Masterminds/\ngoutils -github.com/Masterminds/ -goutils +github.com/Masterminds/ +goutils github.com/weaveworks/\nflux->github.com/Masterminds/\ngoutils - - + + github.com/Masterminds/\nsemver -github.com/Masterminds/ -semver +github.com/Masterminds/ +semver github.com/weaveworks/\nflux->github.com/Masterminds/\nsemver - - + + github.com/Masterminds/\nsprig -github.com/Masterminds/ -sprig +github.com/Masterminds/ +sprig github.com/weaveworks/\nflux->github.com/Masterminds/\nsprig - - + + github.com/ncabatoff/\ngo-seq -github.com/ncabatoff/ -go-seq +github.com/ncabatoff/ +go-seq github.com/weaveworks/\nflux->github.com/ncabatoff/\ngo-seq - - + + github.com/opencontainers/\ngo-digest -github.com/opencontainers/ -go-digest +github.com/opencontainers/ +go-digest github.com/weaveworks/\nflux->github.com/opencontainers/\ngo-digest - - + + github.com/opencontainers/\nimage-spec -github.com/opencontainers/ -image-spec +github.com/opencontainers/ +image-spec github.com/weaveworks/\nflux->github.com/opencontainers/\nimage-spec - - + + github.com/opentracing-contrib/\ngo-stdlib -github.com/opentracing-contrib/ -go-stdlib +github.com/opentracing-contrib/ +go-stdlib github.com/weaveworks/\nflux->github.com/opentracing-contrib/\ngo-stdlib - - + + github.com/opentracing/\nopentracing-go -github.com/opentracing/ -opentracing-go +github.com/opentracing/ +opentracing-go github.com/weaveworks/\nflux->github.com/opentracing/\nopentracing-go - - + + github.com/pkg/\nterm -github.com/pkg/ -term +github.com/pkg/ +term github.com/weaveworks/\nflux->github.com/pkg/\nterm - - + + github.com/ryanuber/\ngo-glob -github.com/ryanuber/ -go-glob +github.com/ryanuber/ +go-glob github.com/weaveworks/\nflux->github.com/ryanuber/\ngo-glob - - + + github.com/uber/\njaeger-client-go -github.com/uber/ -jaeger-client-go +github.com/uber/ +jaeger-client-go github.com/weaveworks/\nflux->github.com/uber/\njaeger-client-go - - + + github.com/uber/\njaeger-lib -github.com/uber/ -jaeger-lib +github.com/uber/ +jaeger-lib github.com/weaveworks/\nflux->github.com/uber/\njaeger-lib - - + + github.com/VividCortex/\ngohistogram -github.com/VividCortex/ -gohistogram +github.com/VividCortex/ +gohistogram github.com/weaveworks/\nflux->github.com/VividCortex/\ngohistogram - - + + github.com/weaveworks/\ncommon -github.com/weaveworks/ -common +github.com/weaveworks/ +common github.com/weaveworks/\nflux->github.com/weaveworks/\ncommon - - + + github.com/weaveworks/\ngo-checkpoint -github.com/weaveworks/ -go-checkpoint +github.com/weaveworks/ +go-checkpoint github.com/weaveworks/\nflux->github.com/weaveworks/\ngo-checkpoint - - + + github.com/weaveworks/\npromrus -github.com/weaveworks/ -promrus +github.com/weaveworks/ +promrus github.com/weaveworks/\nflux->github.com/weaveworks/\npromrus - - + + github.com/whilp/\ngit-urls -github.com/whilp/ -git-urls +github.com/whilp/ +git-urls github.com/weaveworks/\nflux->github.com/whilp/\ngit-urls - - + + github.com/weaveworks/\nflux->google.golang.org/appengine - - + + k8s.io/apiextensions-apiserver -k8s.io/apiextensions-apiserver +k8s.io/apiextensions-apiserver github.com/weaveworks/\nflux->k8s.io/apiextensions-apiserver - - + + k8s.io/code-generator -k8s.io/code-generator +k8s.io/code-generator github.com/weaveworks/\nflux->k8s.io/code-generator - - + + k8s.io/helm -k8s.io/helm +k8s.io/helm github.com/weaveworks/\nflux->k8s.io/helm - - + + google.golang.org/appengine->github.com/golang/\nprotobuf - - + + google.golang.org/appengine->golang.org/x/text - - + + google.golang.org/appengine->golang.org/x/net - - + + k8s.io/code-generator->golang.org/x/tools - - + + k8s.io/code-generator->github.com/gogo/\nprotobuf - - + + k8s.io/code-generator->github.com/spf13/\npflag - - + + k8s.io/code-generator->k8s.io/klog - - + + gonum.org/v1/gonum -gonum.org/v1/gonum +gonum.org/v1/gonum k8s.io/code-generator->gonum.org/v1/gonum - - + + gonum.org/v1/netlib -gonum.org/v1/netlib +gonum.org/v1/netlib k8s.io/code-generator->gonum.org/v1/netlib - - + + k8s.io/gengo -k8s.io/gengo +k8s.io/gengo k8s.io/code-generator->k8s.io/gengo - - + + golang.org/x/image->golang.org/x/text - - + + gonum.org/v1/gonum->golang.org/x/exp - - + + gonum.org/v1/gonum->golang.org/x/tools - - + + gonum.org/v1/gonum->gonum.org/v1/netlib - - + + gonum.org/v1/netlib->golang.org/x/exp - - + + gonum.org/v1/netlib->gonum.org/v1/gonum - - + + github.com/remyoudompheng/\nbigfft -github.com/remyoudompheng/ -bigfft +github.com/remyoudompheng/ +bigfft gonum.org/v1/netlib->github.com/remyoudompheng/\nbigfft - - + + modernc.org/cc -modernc.org/cc +modernc.org/cc gonum.org/v1/netlib->modernc.org/cc - - + + modernc.org/golex -modernc.org/golex +modernc.org/golex gonum.org/v1/netlib->modernc.org/golex - - + + modernc.org/mathutil -modernc.org/mathutil +modernc.org/mathutil gonum.org/v1/netlib->modernc.org/mathutil - - + + modernc.org/strutil -modernc.org/strutil +modernc.org/strutil gonum.org/v1/netlib->modernc.org/strutil - - + + modernc.org/xc -modernc.org/xc +modernc.org/xc gonum.org/v1/netlib->modernc.org/xc - - + + diff --git a/pkg/apis/ignite/helpers.go b/pkg/apis/ignite/helpers.go index 03bd9f7fd..8eb3bb015 100644 --- a/pkg/apis/ignite/helpers.go +++ b/pkg/apis/ignite/helpers.go @@ -1,7 +1,5 @@ package ignite -import "fmt" - // GetNetworkModes gets the list of available network modes func GetNetworkModes() []NetworkMode { return []NetworkMode{ @@ -10,20 +8,20 @@ func GetNetworkModes() []NetworkMode { } } -// ValidateNetworkMode validates the network mode -// TODO: This should move into a dedicated validation package -func ValidateNetworkMode(mode NetworkMode) error { - found := false - modes := GetNetworkModes() - for _, nm := range modes { - if nm == mode { - found = true - } +// GetImageSourceTypes gets the list of available network modes +func GetImageSourceTypes() []ImageSourceType { + return []ImageSourceType{ + ImageSourceTypeDocker, } - if !found { - return fmt.Errorf("invalid network mode %s, must be one of %v", mode, modes) +} + +// GetVMStates gets the list of available VM states +func GetVMStates() []VMState { + return []VMState{ + VMStateCreated, + VMStateRunning, + VMStateStopped, } - return nil } // SetImage populates relevant fields to an Image on the VM object diff --git a/pkg/apis/ignite/v1alpha1/helpers.go b/pkg/apis/ignite/v1alpha1/helpers.go deleted file mode 100644 index 95379402b..000000000 --- a/pkg/apis/ignite/v1alpha1/helpers.go +++ /dev/null @@ -1,39 +0,0 @@ -package v1alpha1 - -import "fmt" - -// GetNetworkModes gets the list of available network modes -func GetNetworkModes() []NetworkMode { - return []NetworkMode{ - NetworkModeCNI, - NetworkModeDockerBridge, - } -} - -// ValidateNetworkMode validates the network mode -// TODO: This should move into a dedicated validation package -func ValidateNetworkMode(mode NetworkMode) error { - found := false - modes := GetNetworkModes() - for _, nm := range modes { - if nm == mode { - found = true - } - } - if !found { - return fmt.Errorf("invalid network mode %s, must be one of %v", mode, modes) - } - return nil -} - -// SetImage populates relevant fields to an Image on the VM object -func (vm *VM) SetImage(image *Image) { - vm.Spec.Image.OCIClaim = image.Spec.OCIClaim - vm.Status.Image = image.Status.OCISource -} - -// SetKernel populates relevant fields to a Kernel on the VM object -func (vm *VM) SetKernel(kernel *Kernel) { - vm.Spec.Kernel.OCIClaim = kernel.Spec.OCIClaim - vm.Status.Kernel = kernel.Status.OCISource -} diff --git a/pkg/apis/ignite/validation/validation.go b/pkg/apis/ignite/validation/validation.go new file mode 100644 index 000000000..1988dc570 --- /dev/null +++ b/pkg/apis/ignite/validation/validation.go @@ -0,0 +1,90 @@ +package validation + +import ( + "fmt" + "path" + + api "github.com/weaveworks/ignite/pkg/apis/ignite" + + "k8s.io/apimachinery/pkg/util/validation/field" +) + +// ValidateVM validates a VM object and collects all encountered errors +func ValidateVM(obj *api.VM) (allErrs field.ErrorList) { + allErrs = append(allErrs, ValidateNetworkMode(obj.Spec.Network.Mode, field.NewPath(".spec.network.mode"))...) + allErrs = append(allErrs, ValidateOCIImageClaim(&obj.Spec.Image.OCIClaim, field.NewPath(".spec.image.ociClaim"))...) + allErrs = append(allErrs, ValidateOCIImageClaim(&obj.Spec.Kernel.OCIClaim, field.NewPath(".spec.kernel.ociClaim"))...) + allErrs = append(allErrs, ValidateFileMappings(&obj.Spec.CopyFiles, field.NewPath(".spec.copyFiles"))...) + allErrs = append(allErrs, ValidateVMState(obj.Status.State, field.NewPath(".status.state"))...) + // TODO: Add vCPU, memory, disk max and min sizes + return +} + +// ValidateOCIImageClaim validates an OCI image claim +func ValidateOCIImageClaim(c *api.OCIImageClaim, fldPath *field.Path) (allErrs field.ErrorList) { + allErrs = append(allErrs, ValidateImageSourceType(c.Type, fldPath.Child("type"))...) + return +} + +// ValidateFileMappings validates if the filemappings is valid +func ValidateFileMappings(mappings *[]api.FileMapping, fldPath *field.Path) (allErrs field.ErrorList) { + for i, mapping := range *mappings { + mappingPath := fldPath.Child(fmt.Sprintf("[%d]", i)) + allErrs = append(allErrs, ValidateAbsolutePath(mapping.HostPath, mappingPath.Child("hostPath"))...) + allErrs = append(allErrs, ValidateAbsolutePath(mapping.VMPath, mappingPath.Child("vmPath"))...) + } + return +} + +// ValidateAbsolutePath validates if a path is absolute +func ValidateAbsolutePath(pathStr string, fldPath *field.Path) (allErrs field.ErrorList) { + if !path.IsAbs(pathStr) { + allErrs = append(allErrs, field.Invalid(fldPath, pathStr, fmt.Sprintf("path must be absolute %q", pathStr))) + } + return +} + +// ValidateNetworkMode validates if a network mode is valid +func ValidateNetworkMode(mode api.NetworkMode, fldPath *field.Path) (allErrs field.ErrorList) { + found := false + modes := api.GetNetworkModes() + for _, nm := range modes { + if nm == mode { + found = true + } + } + if !found { + allErrs = append(allErrs, field.Invalid(fldPath, mode, fmt.Sprintf("network mode must be one of %v", modes))) + } + return +} + +// ValidateImageSourceType validates if an image source type is valid +func ValidateImageSourceType(t api.ImageSourceType, fldPath *field.Path) (allErrs field.ErrorList) { + found := false + types := api.GetImageSourceTypes() + for _, tt := range types { + if tt == t { + found = true + } + } + if !found { + allErrs = append(allErrs, field.Invalid(fldPath, t, fmt.Sprintf("image source type must be one of %v", types))) + } + return +} + +// ValidateVMState validates if an VM state is valid +func ValidateVMState(s api.VMState, fldPath *field.Path) (allErrs field.ErrorList) { + found := false + states := api.GetVMStates() + for _, state := range states { + if state == s { + found = true + } + } + if !found { + allErrs = append(allErrs, field.Invalid(fldPath, s, fmt.Sprintf("VM state must be one of %v", states))) + } + return +} diff --git a/pkg/metadata/imgmd/imgmd.go b/pkg/metadata/imgmd/imgmd.go index 5cb7b6ce9..04433a71a 100644 --- a/pkg/metadata/imgmd/imgmd.go +++ b/pkg/metadata/imgmd/imgmd.go @@ -3,8 +3,8 @@ package imgmd import ( "path" - "github.com/weaveworks/ignite/pkg/apis/ignite/scheme" api "github.com/weaveworks/ignite/pkg/apis/ignite" + "github.com/weaveworks/ignite/pkg/apis/ignite/scheme" "github.com/weaveworks/ignite/pkg/client" "github.com/weaveworks/ignite/pkg/constants" "github.com/weaveworks/ignite/pkg/metadata" diff --git a/pkg/metadata/kernmd/kernmd.go b/pkg/metadata/kernmd/kernmd.go index eadd02c08..59a9407db 100644 --- a/pkg/metadata/kernmd/kernmd.go +++ b/pkg/metadata/kernmd/kernmd.go @@ -3,8 +3,8 @@ package kernmd import ( "path" - "github.com/weaveworks/ignite/pkg/apis/ignite/scheme" api "github.com/weaveworks/ignite/pkg/apis/ignite" + "github.com/weaveworks/ignite/pkg/apis/ignite/scheme" "github.com/weaveworks/ignite/pkg/client" "github.com/weaveworks/ignite/pkg/constants" "github.com/weaveworks/ignite/pkg/metadata" diff --git a/pkg/metadata/metadata.go b/pkg/metadata/metadata.go index 3b5761f05..b56f6a2d8 100644 --- a/pkg/metadata/metadata.go +++ b/pkg/metadata/metadata.go @@ -7,8 +7,8 @@ import ( "path" "regexp" - "github.com/weaveworks/ignite/pkg/apis/ignite/scheme" api "github.com/weaveworks/ignite/pkg/apis/ignite" + "github.com/weaveworks/ignite/pkg/apis/ignite/scheme" meta "github.com/weaveworks/ignite/pkg/apis/meta/v1alpha1" "github.com/weaveworks/ignite/pkg/client" "github.com/weaveworks/ignite/pkg/constants" diff --git a/pkg/metadata/vmmd/vmmd.go b/pkg/metadata/vmmd/vmmd.go index 87265cf4c..5d59044c9 100644 --- a/pkg/metadata/vmmd/vmmd.go +++ b/pkg/metadata/vmmd/vmmd.go @@ -5,8 +5,9 @@ import ( "path" log "github.com/sirupsen/logrus" - "github.com/weaveworks/ignite/pkg/apis/ignite/scheme" api "github.com/weaveworks/ignite/pkg/apis/ignite" + "github.com/weaveworks/ignite/pkg/apis/ignite/scheme" + "github.com/weaveworks/ignite/pkg/apis/ignite/validation" meta "github.com/weaveworks/ignite/pkg/apis/meta/v1alpha1" "github.com/weaveworks/ignite/pkg/client" "github.com/weaveworks/ignite/pkg/constants" @@ -47,7 +48,10 @@ func NewVM(obj *api.VM, c *client.Client) (*VM, error) { return nil, err } - // TODO: Validate the API object here + // Validate the VM object + if err := validation.ValidateVM(obj).ToAggregate(); err != nil { + return nil, err + } // Construct the runtime object vm := &VM{ diff --git a/pkg/storage/gitops/rawstorage.go b/pkg/storage/gitops/rawstorage.go index 95cba7e6a..36cb8b89e 100644 --- a/pkg/storage/gitops/rawstorage.go +++ b/pkg/storage/gitops/rawstorage.go @@ -10,8 +10,8 @@ import ( "strings" log "github.com/sirupsen/logrus" - "github.com/weaveworks/ignite/pkg/apis/ignite/scheme" api "github.com/weaveworks/ignite/pkg/apis/ignite" + "github.com/weaveworks/ignite/pkg/apis/ignite/scheme" meta "github.com/weaveworks/ignite/pkg/apis/meta/v1alpha1" "github.com/weaveworks/ignite/pkg/storage" "github.com/weaveworks/ignite/pkg/util" diff --git a/pkg/storage/serializer/serializer_test.go b/pkg/storage/serializer/serializer_test.go index 63f9256c1..d9ab182fd 100644 --- a/pkg/storage/serializer/serializer_test.go +++ b/pkg/storage/serializer/serializer_test.go @@ -3,8 +3,8 @@ package serializer_test import ( "testing" - "github.com/weaveworks/ignite/pkg/apis/ignite/scheme" api "github.com/weaveworks/ignite/pkg/apis/ignite" + "github.com/weaveworks/ignite/pkg/apis/ignite/scheme" meta "github.com/weaveworks/ignite/pkg/apis/meta/v1alpha1" "github.com/weaveworks/ignite/pkg/storage/serializer" ) diff --git a/vendor/modules.txt b/vendor/modules.txt index c3dcaa081..aecfaed6d 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -199,14 +199,15 @@ gopkg.in/inf.v0 gopkg.in/yaml.v2 # k8s.io/apimachinery v0.0.0-20190612205821-1799e75a0719 k8s.io/apimachinery/pkg/runtime +k8s.io/apimachinery/pkg/runtime/schema k8s.io/apimachinery/pkg/runtime/serializer k8s.io/apimachinery/pkg/util/runtime -k8s.io/apimachinery/pkg/runtime/schema +k8s.io/apimachinery/pkg/conversion +k8s.io/apimachinery/pkg/util/validation/field k8s.io/apimachinery/pkg/apis/meta/v1 k8s.io/apimachinery/pkg/util/duration k8s.io/apimachinery/pkg/util/wait k8s.io/apimachinery/pkg/runtime/serializer/json -k8s.io/apimachinery/pkg/conversion k8s.io/apimachinery/pkg/conversion/queryparams k8s.io/apimachinery/pkg/util/errors k8s.io/apimachinery/pkg/util/json @@ -215,6 +216,7 @@ k8s.io/apimachinery/pkg/util/sets k8s.io/apimachinery/pkg/runtime/serializer/protobuf k8s.io/apimachinery/pkg/runtime/serializer/recognizer k8s.io/apimachinery/pkg/runtime/serializer/versioning +k8s.io/apimachinery/third_party/forked/golang/reflect k8s.io/apimachinery/pkg/api/resource k8s.io/apimachinery/pkg/fields k8s.io/apimachinery/pkg/labels @@ -224,11 +226,9 @@ k8s.io/apimachinery/pkg/util/intstr k8s.io/apimachinery/pkg/watch k8s.io/apimachinery/pkg/util/framer k8s.io/apimachinery/pkg/util/yaml -k8s.io/apimachinery/third_party/forked/golang/reflect k8s.io/apimachinery/pkg/apis/meta/v1/unstructured k8s.io/apimachinery/pkg/util/validation k8s.io/apimachinery/pkg/util/net -k8s.io/apimachinery/pkg/util/validation/field # k8s.io/klog v0.3.1 k8s.io/klog # k8s.io/kube-openapi v0.0.0-20190401085232-94e1e7b7574c