From fe0f81b51458a8552f2f68d6439ac453aeb00259 Mon Sep 17 00:00:00 2001 From: Dennis Marttinen Date: Thu, 8 Aug 2019 13:17:23 +0300 Subject: [PATCH 1/4] Remove `vm.status.state`, replace it with `vm.status.running` (boolean) --- cmd/ignite-spawn/ignite-spawn.go | 4 +- cmd/ignite/run/ps.go | 4 +- docs/api/ignite_v1alpha1.md | 24 ++++++++++++ docs/api/ignite_v1alpha2.md | 30 ++------------ go.mod | 2 +- go.sum | 19 +++++++++ pkg/apis/ignite/helpers.go | 11 +----- pkg/apis/ignite/types.go | 11 +----- pkg/apis/ignite/v1alpha1/conversion.go | 28 +++++++++++++ .../v1alpha1/zz_generated.conversion.go | 24 ++++++------ pkg/apis/ignite/v1alpha2/defaults.go | 6 --- pkg/apis/ignite/v1alpha2/types.go | 11 +----- .../v1alpha2/zz_generated.conversion.go | 4 +- .../ignite/v1alpha2/zz_generated.defaults.go | 1 - pkg/apis/ignite/validation/validation.go | 16 -------- pkg/filter/vm.go | 2 +- pkg/openapi/openapi_generated.go | 6 +-- pkg/openapi/violations.txt | 8 ---- pkg/operations/reconcile/reconcile.go | 39 +++---------------- 19 files changed, 105 insertions(+), 145 deletions(-) diff --git a/cmd/ignite-spawn/ignite-spawn.go b/cmd/ignite-spawn/ignite-spawn.go index 9ecf8ef1b..4c01a67f7 100644 --- a/cmd/ignite-spawn/ignite-spawn.go +++ b/cmd/ignite-spawn/ignite-spawn.go @@ -90,7 +90,7 @@ func serveMetrics(metricsSocket string) { func patchRunning(vm *api.VM, ipAddrs []net.IP) error { return patchVM(vm, func(patchVM *api.VM) error { - patchVM.Status.State = api.VMStateRunning + patchVM.Status.Running = true patchVM.Status.IPAddresses = ipAddrs return nil }) @@ -98,7 +98,7 @@ func patchRunning(vm *api.VM, ipAddrs []net.IP) error { func patchStopped(vm *api.VM) error { return patchVM(vm, func(patchVM *api.VM) error { - patchVM.Status.State = api.VMStateStopped + patchVM.Status.Running = false patchVM.Status.IPAddresses = nil return nil }) diff --git a/cmd/ignite/run/ps.go b/cmd/ignite/run/ps.go index 163eae42a..4c7a8f180 100644 --- a/cmd/ignite/run/ps.go +++ b/cmd/ignite/run/ps.go @@ -26,10 +26,10 @@ func Ps(po *psOptions) error { o := util.NewOutput() defer o.Flush() - o.Write("VM ID", "IMAGE", "KERNEL", "CREATED", "SIZE", "CPUS", "MEMORY", "STATE", "IPS", "PORTS", "NAME") + o.Write("VM ID", "IMAGE", "KERNEL", "CREATED", "SIZE", "CPUS", "MEMORY", "RUNNING", "IPS", "PORTS", "NAME") for _, vm := range po.allVMs { o.Write(vm.GetUID(), vm.Spec.Image.OCIClaim.Ref, vm.Spec.Kernel.OCIClaim.Ref, vm.GetCreated(), - vm.Spec.DiskSize, vm.Spec.CPUs, vm.Spec.Memory, vm.Status.State, vm.Status.IPAddresses, + vm.Spec.DiskSize, vm.Spec.CPUs, vm.Spec.Memory, vm.Running(), vm.Status.IPAddresses, vm.Spec.Network.Ports, vm.GetName()) } diff --git a/docs/api/ignite_v1alpha1.md b/docs/api/ignite_v1alpha1.md index ff49bdcc1..d21c4750a 100644 --- a/docs/api/ignite_v1alpha1.md +++ b/docs/api/ignite_v1alpha1.md @@ -18,9 +18,15 @@ - [func Convert\_ignite\_VMSpec\_To\_v1alpha1\_VMSpec(in *ignite.VMSpec, out *VMSpec, s conversion.Scope) error](#Convert_ignite_VMSpec_To_v1alpha1_VMSpec) + - [func Convert\_ignite\_VMStatus\_To\_v1alpha1\_VMStatus(in + *ignite.VMStatus, out *VMStatus, s conversion.Scope) + error](#Convert_ignite_VMStatus_To_v1alpha1_VMStatus) - [func Convert\_v1alpha1\_VMSpec\_To\_ignite\_VMSpec(in *VMSpec, out *ignite.VMSpec, s conversion.Scope) error](#Convert_v1alpha1_VMSpec_To_ignite_VMSpec) + - [func Convert\_v1alpha1\_VMStatus\_To\_ignite\_VMStatus(in + *VMStatus, out *ignite.VMStatus, s conversion.Scope) + error](#Convert_v1alpha1_VMStatus_To_ignite_VMStatus) - [func SetDefaults\_OCIImageClaim(obj \*OCIImageClaim)](#SetDefaults_OCIImageClaim) - [func SetDefaults\_PoolSpec(obj \*PoolSpec)](#SetDefaults_PoolSpec) @@ -118,6 +124,15 @@ func Convert_ignite_VMSpec_To_v1alpha1_VMSpec(in *ignite.VMSpec, out *VMSpec, s Convert\_ignite\_VMSpec\_To\_v1alpha1\_VMSpec calls the autogenerated conversion function along with custom conversion logic +## func [Convert\_ignite\_VMStatus\_To\_v1alpha1\_VMStatus](https://github.com/weaveworks/ignite/tree/master/pkg/apis/ignite/v1alpha1/conversion.go?s=1038:1149#L21) + +``` go +func Convert_ignite_VMStatus_To_v1alpha1_VMStatus(in *ignite.VMStatus, out *VMStatus, s conversion.Scope) error +``` + +Convert\_ignite\_VMStatus\_To\_v1alpha1\_VMStatus calls the +autogenerated conversion function along with custom conversion logic + ## func [Convert\_v1alpha1\_VMSpec\_To\_ignite\_VMSpec](https://github.com/weaveworks/ignite/tree/master/pkg/apis/ignite/v1alpha1/conversion.go?s=637:740#L15) ``` go @@ -127,6 +142,15 @@ func Convert_v1alpha1_VMSpec_To_ignite_VMSpec(in *VMSpec, out *ignite.VMSpec, s Convert\_ignite\_VMSpec\_To\_v1alpha1\_VMSpec calls the autogenerated conversion function along with custom conversion logic +## func [Convert\_v1alpha1\_VMStatus\_To\_ignite\_VMStatus](https://github.com/weaveworks/ignite/tree/master/pkg/apis/ignite/v1alpha1/conversion.go?s=1522:1633#L37) + +``` go +func Convert_v1alpha1_VMStatus_To_ignite_VMStatus(in *VMStatus, out *ignite.VMStatus, s conversion.Scope) error +``` + +Convert\_v1alpha1\_VMStatus\_To\_ignite\_VMStatus calls the +autogenerated conversion function along with custom conversion logic + ## func [SetDefaults\_OCIImageClaim](https://github.com/weaveworks/ignite/tree/master/pkg/apis/ignite/v1alpha1/defaults.go?s=263:313#L13) ``` go diff --git a/docs/api/ignite_v1alpha2.md b/docs/api/ignite_v1alpha2.md index fb386a366..b3b38ebab 100644 --- a/docs/api/ignite_v1alpha2.md +++ b/docs/api/ignite_v1alpha2.md @@ -1,4 +1,4 @@ -# v1alpha2 +t# v1alpha2 `import "github.com/weaveworks/ignite/pkg/apis/ignite/v1alpha2"` @@ -23,7 +23,6 @@ - [func SetDefaults\_VMNetworkSpec(obj \*VMNetworkSpec)](#SetDefaults_VMNetworkSpec) - [func SetDefaults\_VMSpec(obj \*VMSpec)](#SetDefaults_VMSpec) - - [func SetDefaults\_VMStatus(obj \*VMStatus)](#SetDefaults_VMStatus) - [type BlockDeviceVolume](#BlockDeviceVolume) - [type FileMapping](#FileMapping) - [type Image](#Image) @@ -52,7 +51,6 @@ - [type VMKernelSpec](#VMKernelSpec) - [type VMNetworkSpec](#VMNetworkSpec) - [type VMSpec](#VMSpec) - - [type VMState](#VMState) - [type VMStatus](#VMStatus) - [type VMStorageSpec](#VMStorageSpec) - [type Volume](#Volume) @@ -136,12 +134,6 @@ func SetDefaults_VMNetworkSpec(obj *VMNetworkSpec) func SetDefaults_VMSpec(obj *VMSpec) ``` -## func [SetDefaults\_VMStatus](https://github.com/weaveworks/ignite/tree/master/pkg/apis/ignite/v1alpha2/defaults.go?s=1641:1681#L70) - -``` go -func SetDefaults_VMStatus(obj *VMStatus) -``` - ## type [BlockDeviceVolume](https://github.com/weaveworks/ignite/tree/master/pkg/apis/ignite/v1alpha2/types.go?s=8095:8155#L218) ``` go @@ -493,27 +485,11 @@ type VMSpec struct { VMSpec describes the configuration of a VM -## type [VMState](https://github.com/weaveworks/ignite/tree/master/pkg/apis/ignite/v1alpha2/types.go?s=9336:9355#L261) - -``` go -type VMState string -``` - -VMState defines different states a VM can be in - -``` go -const ( - VMStateCreated VMState = "Created" - VMStateRunning VMState = "Running" - VMStateStopped VMState = "Stopped" -) -``` - -## type [VMStatus](https://github.com/weaveworks/ignite/tree/master/pkg/apis/ignite/v1alpha2/types.go?s=9515:9736#L270) +## type [VMStatus](https://github.com/weaveworks/ignite/tree/master/pkg/apis/ignite/v1alpha2/types.go?s=9324:9547#L261) ``` go type VMStatus struct { - State VMState `json:"state"` + Running bool `json:"running"` IPAddresses meta.IPAddresses `json:"ipAddresses,omitempty"` Image OCIImageSource `json:"image"` Kernel OCIImageSource `json:"kernel"` diff --git a/go.mod b/go.mod index 1a7d47b57..530cc20f6 100644 --- a/go.mod +++ b/go.mod @@ -16,7 +16,6 @@ require ( github.com/firecracker-microvm/firecracker-go-sdk v0.15.2-0.20190627223500-b2e8284e890c github.com/freddierice/go-losetup v0.0.0-20170407175016-fc9adea44124 github.com/go-openapi/spec v0.19.2 - github.com/gogo/protobuf v1.2.2-0.20190723190241-65acae22fc9d // indirect github.com/goombaio/namegenerator v0.0.0-20181006234301-989e774b106e github.com/gorilla/mux v1.7.2 // indirect github.com/krolaw/dhcp4 v0.0.0-20190531080455-7b64900047ae @@ -45,6 +44,7 @@ require ( gopkg.in/alessio/shellescape.v1 v1.0.0-20170105083845-52074bc9df61 gotest.tools v2.2.0+incompatible // indirect k8s.io/apimachinery v0.0.0-20190612205821-1799e75a0719 + k8s.io/code-generator v0.0.0-20190807220449-91311fc7abe8 // indirect k8s.io/kube-openapi v0.0.0-20190709113604-33be087ad058 sigs.k8s.io/yaml v1.1.0 ) diff --git a/go.sum b/go.sum index b2525b635..e47b8a78e 100644 --- a/go.sum +++ b/go.sum @@ -4,6 +4,7 @@ cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMT github.com/Azure/go-ansiterm v0.0.0-20170929234023-d6e3b3328b78 h1:w+iIsaOQNcT7OZ575w+acHgRric5iCyQh+xv+KJ4HB8= github.com/Azure/go-ansiterm v0.0.0-20170929234023-d6e3b3328b78/go.mod h1:LmzpDX56iTiv29bbRTIsUNlaFfuhWRQBWjQdVyAevI8= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= +github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= github.com/Microsoft/go-winio v0.4.12 h1:xAfWHN1IrQ0NJ9TBC0KBZoqLjzDTr1ML+4MywiUOryc= github.com/Microsoft/go-winio v0.4.12/go.mod h1:VhR8bwka0BXejwEJY73c50VrPtXAaKcyvVC4A4RozmA= github.com/NYTimes/gziphandler v0.0.0-20170623195520-56545f4a5d46/go.mod h1:3wb06e3pkSAbeQ52E9H9iFoQsEEwGN64994WTCIhntQ= @@ -52,6 +53,7 @@ github.com/docker/go-units v0.3.3/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDD github.com/docker/spdystream v0.0.0-20160310174837-449fdfce4d96/go.mod h1:Qh8CwZgvJUkLughtfhJv5dyTYa91l1fOUCrgjqmcifM= github.com/elazarl/goproxy v0.0.0-20170405201442-c4fc26588b6e/go.mod h1:/Zj4wYkgs4iZTTu3o/KG3Itv/qCCa8VVMlb3i9OVuzc= github.com/emicklei/go-restful v0.0.0-20170410110728-ff4f55a20633/go.mod h1:otzb+WCGbkyDHkqmQmT5YD2WR4BBwUdeQoFo8l/7tVs= +github.com/emicklei/go-restful v2.9.5+incompatible/go.mod h1:otzb+WCGbkyDHkqmQmT5YD2WR4BBwUdeQoFo8l/7tVs= github.com/emicklei/go-restful v2.9.6+incompatible h1:tfrHha8zJ01ywiOEC1miGY8st1/igzWB8OmvPgoYX7w= github.com/emicklei/go-restful v2.9.6+incompatible/go.mod h1:otzb+WCGbkyDHkqmQmT5YD2WR4BBwUdeQoFo8l/7tVs= github.com/evanphx/json-patch v0.0.0-20190203023257-5858425f7550/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= @@ -223,6 +225,7 @@ github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y8 github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.2 h1:6LJUbpNm42llc4HRCuvApCSWB/WfhuNo9K98Q9sNGfs= github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= +github.com/remyoudompheng/bigfft v0.0.0-20170806203942-52369c62f446/go.mod h1:uYEyJGbgTkfkS4+E/PavXkNJcbFIpEtjt2B0KDQ5+9M= github.com/rjeczalik/notify v0.9.2 h1:MiTWrPj55mNDHEiIX5YUSKefw/+lCQVoAFmD6oQm5w8= github.com/rjeczalik/notify v0.9.2/go.mod h1:aErll2f0sUX9PXZnVNyeiObbmTlk5jnMoCa4QEjJeqM= github.com/russross/blackfriday v1.5.2 h1:HyvC0ARfnZBqnXwABFeSZHpKvJHJJfPz81GNueLj0oo= @@ -263,7 +266,11 @@ golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACk golang.org/x/crypto v0.0.0-20190611184440-5c40567a22f8/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190701094942-4def268fd1a4 h1:HuIa8hRrWRSrqYzx1qI49NNxhdi2PrY7gxVSq1JjLDc= golang.org/x/crypto v0.0.0-20190701094942-4def268fd1a4/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/exp v0.0.0-20190125153040-c74c464bbbf2/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= +golang.org/x/exp v0.0.0-20190312203227-4b39c73a6495/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= +golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6/go.mod h1:z+o9i4GpDbdi3rU15maQ/Ox0txvL9dWGYEHz965HBQE= golang.org/x/net v0.0.0-20170114055629-f2499483f923/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20181005035420-146acd28ed58/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -309,9 +316,14 @@ golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxb golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20181011042414-1f849cf54d09/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20181030221726-6c7e314b6563/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20190206041539-40960b6deb8e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190312151545-0bb0c0a6e846/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190614205625-5aca471b1d59 h1:QjA/9ArTfVTLfEhClDCG7SGrZkZixxWpwNCDiwJfh88= golang.org/x/tools v0.0.0-20190614205625-5aca471b1d59/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= +gonum.org/v1/gonum v0.0.0-20190331200053-3d26580ed485/go.mod h1:2ltnJ7xHfj0zHS40VVPYEAAMTa3ZGguvHGBSJeRWqE0= +gonum.org/v1/netlib v0.0.0-20190313105609-8cb42192e0e0/go.mod h1:wa6Ws7BG/ESfp6dHfk7C6KdzKA7wR7u/rKwOGE66zvw= +gonum.org/v1/netlib v0.0.0-20190331212654-76723241ea4e/go.mod h1:kS+toOQn6AQKjmKJ7gzohV1XkqsFehRA2FbsbkopSuQ= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8 h1:Nw54tB0rB7hY/N0NQvRW8DG4Yk3Q6T9cu9RcFQDu1tc= google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= @@ -338,6 +350,8 @@ gotest.tools v2.2.0+incompatible/go.mod h1:DsYFclhRJ6vuDpmuTbkuFWG+y2sxOXAzmJt81 honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= k8s.io/apimachinery v0.0.0-20190612205821-1799e75a0719 h1:uV4S5IB5g4Nvi+TBVNf3e9L4wrirlwYJ6w88jUQxTUw= k8s.io/apimachinery v0.0.0-20190612205821-1799e75a0719/go.mod h1:I4A+glKBHiTgiEjQiCCQfCAIcIMFGt291SmsvcrFzJA= +k8s.io/code-generator v0.0.0-20190807220449-91311fc7abe8 h1:rmrU+mkCD2lEOkmr+rAC6XmQoLqVPo3+t6uSYjai4BY= +k8s.io/code-generator v0.0.0-20190807220449-91311fc7abe8/go.mod h1:+ehOMJCZcDSNlbNnRAoe9wNEPwf0h03MUOmDkq6J1FE= k8s.io/gengo v0.0.0-20190128074634-0689ccc1d7d6 h1:4s3/R4+OYYYUKptXPhZKjQ04WJ6EhQQVFdjOFvCazDk= k8s.io/gengo v0.0.0-20190128074634-0689ccc1d7d6/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8IAqLxYwwyPxAX1Pzy0ii0= k8s.io/klog v0.0.0-20181102134211-b9b56d5dfc92/go.mod h1:Gq+BEi5rUBO/HRz0bTSXDUcqjScdoY3a9IHpCEIOOfk= @@ -347,6 +361,11 @@ k8s.io/kube-openapi v0.0.0-20190228160746-b3a7cee44a30 h1:TRb4wNWoBVrH9plmkp2q86 k8s.io/kube-openapi v0.0.0-20190228160746-b3a7cee44a30/go.mod h1:BXM9ceUBTj2QnfH2MK1odQs778ajze1RxcmP6S8RVVc= k8s.io/kube-openapi v0.0.0-20190709113604-33be087ad058 h1:di3XCwddOR9cWBNpfgXaskhh6cgJuwcK54rvtwUaC10= k8s.io/kube-openapi v0.0.0-20190709113604-33be087ad058/go.mod h1:nfDlWeOsu3pUf4yWGL+ERqohP4YsZcBJXWMK+gkzOA4= +modernc.org/cc v1.0.0/go.mod h1:1Sk4//wdnYJiUIxnW8ddKpaOJCF37yAdqYnkxUpaYxw= +modernc.org/golex v1.0.0/go.mod h1:b/QX9oBD/LhixY6NDh+IdGv17hgB+51fET1i2kPSmvk= +modernc.org/mathutil v1.0.0/go.mod h1:wU0vUrJsVWBZ4P6e7xtFJEhFSNsfRLJ8H458uRjg03k= +modernc.org/strutil v1.0.0/go.mod h1:lstksw84oURvj9y3tn8lGvRxyRC1S2+g5uuIzNfIOBs= +modernc.org/xc v1.0.0/go.mod h1:mRNCo0bvLjGhHO9WsyuKVU4q0ceiDDDoEeWDJHrNx8I= sigs.k8s.io/structured-merge-diff v0.0.0-20190525122527-15d366b2352e/go.mod h1:wWxsB5ozmmv/SG7nM11ayaAW51xMvak/t1r0CSlcokI= sigs.k8s.io/yaml v1.1.0 h1:4A07+ZFc2wgJwo8YNlQpr1rVlgUDlxXHhPJciaPY5gs= sigs.k8s.io/yaml v1.1.0/go.mod h1:UJmg0vDUVViEyp3mgSv9WPwZCDxu4rQW1olrI1uml+o= diff --git a/pkg/apis/ignite/helpers.go b/pkg/apis/ignite/helpers.go index 043dd87fd..8ab1344f6 100644 --- a/pkg/apis/ignite/helpers.go +++ b/pkg/apis/ignite/helpers.go @@ -21,15 +21,6 @@ func GetImageSourceTypes() []ImageSourceType { } } -// GetVMStates gets the list of available VM states -func GetVMStates() []VMState { - return []VMState{ - VMStateCreated, - VMStateRunning, - VMStateStopped, - } -} - // SetImage populates relevant fields to an Image on the VM object func (vm *VM) SetImage(image *Image) { vm.Spec.Image.OCIClaim = image.Spec.OCIClaim @@ -50,7 +41,7 @@ func (vm *VM) SnapshotDev() string { // Running returns true if the VM is running, otherwise false func (vm *VM) Running() bool { - return vm.Status.State == VMStateRunning + return vm.Status.Running } // OverlayFile returns the path to the overlay.dm file for the VM. diff --git a/pkg/apis/ignite/types.go b/pkg/apis/ignite/types.go index 05f3c1003..18dd3128f 100644 --- a/pkg/apis/ignite/types.go +++ b/pkg/apis/ignite/types.go @@ -257,18 +257,9 @@ const ( // Whenever updating this list, also update GetNetworkModes in helpers.go ) -// VMState defines different states a VM can be in -type VMState string - -const ( - VMStateCreated VMState = "Created" - VMStateRunning VMState = "Running" - VMStateStopped VMState = "Stopped" -) - // VMStatus defines the status of a VM type VMStatus struct { - State VMState `json:"state"` + Running bool `json:"running"` IPAddresses meta.IPAddresses `json:"ipAddresses,omitempty"` Image OCIImageSource `json:"image"` Kernel OCIImageSource `json:"kernel"` diff --git a/pkg/apis/ignite/v1alpha1/conversion.go b/pkg/apis/ignite/v1alpha1/conversion.go index 59f0191e5..bb9e02cac 100644 --- a/pkg/apis/ignite/v1alpha1/conversion.go +++ b/pkg/apis/ignite/v1alpha1/conversion.go @@ -16,3 +16,31 @@ func Convert_v1alpha1_VMSpec_To_ignite_VMSpec(in *VMSpec, out *ignite.VMSpec, s // VMSpecStorage is not supported by v1alpha1, so just ignore the warning by calling this manually return autoConvert_v1alpha1_VMSpec_To_ignite_VMSpec(in, out, s) } + +// Convert_ignite_VMStatus_To_v1alpha1_VMStatus calls the autogenerated conversion function along with custom conversion logic +func Convert_ignite_VMStatus_To_v1alpha1_VMStatus(in *ignite.VMStatus, out *VMStatus, s conversion.Scope) error { + if err := autoConvert_ignite_VMStatus_To_v1alpha1_VMStatus(in, out, s); err != nil { + return err + } + + // Convert in.Running to out.State + if in.Running { + out.State = VMStateRunning + } else { + out.State = VMStateStopped + } + + return nil +} + +// Convert_v1alpha1_VMStatus_To_ignite_VMStatus calls the autogenerated conversion function along with custom conversion logic +func Convert_v1alpha1_VMStatus_To_ignite_VMStatus(in *VMStatus, out *ignite.VMStatus, s conversion.Scope) error { + if err := autoConvert_v1alpha1_VMStatus_To_ignite_VMStatus(in, out, s); err != nil { + return err + } + + // Convert in.State to out.Running + out.Running = in.State == VMStateRunning + + return nil +} diff --git a/pkg/apis/ignite/v1alpha1/zz_generated.conversion.go b/pkg/apis/ignite/v1alpha1/zz_generated.conversion.go index 39fdb7f19..475f32084 100644 --- a/pkg/apis/ignite/v1alpha1/zz_generated.conversion.go +++ b/pkg/apis/ignite/v1alpha1/zz_generated.conversion.go @@ -225,11 +225,21 @@ func RegisterConversions(s *runtime.Scheme) error { }); err != nil { return err } + if err := s.AddConversionFunc((*ignite.VMStatus)(nil), (*VMStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_ignite_VMStatus_To_v1alpha1_VMStatus(a.(*ignite.VMStatus), b.(*VMStatus), scope) + }); err != nil { + return err + } if err := s.AddConversionFunc((*VMSpec)(nil), (*ignite.VMSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { return Convert_v1alpha1_VMSpec_To_ignite_VMSpec(a.(*VMSpec), b.(*ignite.VMSpec), scope) }); err != nil { return err } + if err := s.AddConversionFunc((*VMStatus)(nil), (*ignite.VMStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha1_VMStatus_To_ignite_VMStatus(a.(*VMStatus), b.(*ignite.VMStatus), scope) + }); err != nil { + return err + } return nil } @@ -739,7 +749,7 @@ func autoConvert_ignite_VMSpec_To_v1alpha1_VMSpec(in *ignite.VMSpec, out *VMSpec } func autoConvert_v1alpha1_VMStatus_To_ignite_VMStatus(in *VMStatus, out *ignite.VMStatus, s conversion.Scope) error { - out.State = ignite.VMState(in.State) + // WARNING: in.State requires manual conversion: does not exist in peer-type out.IPAddresses = *(*metav1alpha1.IPAddresses)(unsafe.Pointer(&in.IPAddresses)) if err := Convert_v1alpha1_OCIImageSource_To_ignite_OCIImageSource(&in.Image, &out.Image, s); err != nil { return err @@ -750,13 +760,8 @@ func autoConvert_v1alpha1_VMStatus_To_ignite_VMStatus(in *VMStatus, out *ignite. return nil } -// Convert_v1alpha1_VMStatus_To_ignite_VMStatus is an autogenerated conversion function. -func Convert_v1alpha1_VMStatus_To_ignite_VMStatus(in *VMStatus, out *ignite.VMStatus, s conversion.Scope) error { - return autoConvert_v1alpha1_VMStatus_To_ignite_VMStatus(in, out, s) -} - func autoConvert_ignite_VMStatus_To_v1alpha1_VMStatus(in *ignite.VMStatus, out *VMStatus, s conversion.Scope) error { - out.State = VMState(in.State) + // WARNING: in.Running requires manual conversion: does not exist in peer-type out.IPAddresses = *(*metav1alpha1.IPAddresses)(unsafe.Pointer(&in.IPAddresses)) if err := Convert_ignite_OCIImageSource_To_v1alpha1_OCIImageSource(&in.Image, &out.Image, s); err != nil { return err @@ -766,8 +771,3 @@ func autoConvert_ignite_VMStatus_To_v1alpha1_VMStatus(in *ignite.VMStatus, out * } return nil } - -// Convert_ignite_VMStatus_To_v1alpha1_VMStatus is an autogenerated conversion function. -func Convert_ignite_VMStatus_To_v1alpha1_VMStatus(in *ignite.VMStatus, out *VMStatus, s conversion.Scope) error { - return autoConvert_ignite_VMStatus_To_v1alpha1_VMStatus(in, out, s) -} diff --git a/pkg/apis/ignite/v1alpha2/defaults.go b/pkg/apis/ignite/v1alpha2/defaults.go index 4f2f95a3d..e96f85e2e 100644 --- a/pkg/apis/ignite/v1alpha2/defaults.go +++ b/pkg/apis/ignite/v1alpha2/defaults.go @@ -67,12 +67,6 @@ func SetDefaults_VMNetworkSpec(obj *VMNetworkSpec) { } } -func SetDefaults_VMStatus(obj *VMStatus) { - if obj.State == "" { - obj.State = VMStateCreated - } -} - func calcMetadataDevSize(obj *PoolSpec) meta.Size { // The minimum size is 2 MB and the maximum size is 16 GB minSize := meta.NewSizeFromBytes(2 * constants.MB) diff --git a/pkg/apis/ignite/v1alpha2/types.go b/pkg/apis/ignite/v1alpha2/types.go index 73864b604..8a168821d 100644 --- a/pkg/apis/ignite/v1alpha2/types.go +++ b/pkg/apis/ignite/v1alpha2/types.go @@ -257,18 +257,9 @@ const ( // Whenever updating this list, also update GetNetworkModes in helpers.go ) -// VMState defines different states a VM can be in -type VMState string - -const ( - VMStateCreated VMState = "Created" - VMStateRunning VMState = "Running" - VMStateStopped VMState = "Stopped" -) - // VMStatus defines the status of a VM type VMStatus struct { - State VMState `json:"state"` + Running bool `json:"running"` IPAddresses meta.IPAddresses `json:"ipAddresses,omitempty"` Image OCIImageSource `json:"image"` Kernel OCIImageSource `json:"kernel"` diff --git a/pkg/apis/ignite/v1alpha2/zz_generated.conversion.go b/pkg/apis/ignite/v1alpha2/zz_generated.conversion.go index b5284e011..a53f4708e 100644 --- a/pkg/apis/ignite/v1alpha2/zz_generated.conversion.go +++ b/pkg/apis/ignite/v1alpha2/zz_generated.conversion.go @@ -804,7 +804,7 @@ func Convert_ignite_VMSpec_To_v1alpha2_VMSpec(in *ignite.VMSpec, out *VMSpec, s } func autoConvert_v1alpha2_VMStatus_To_ignite_VMStatus(in *VMStatus, out *ignite.VMStatus, s conversion.Scope) error { - out.State = ignite.VMState(in.State) + out.Running = in.Running out.IPAddresses = *(*v1alpha1.IPAddresses)(unsafe.Pointer(&in.IPAddresses)) if err := Convert_v1alpha2_OCIImageSource_To_ignite_OCIImageSource(&in.Image, &out.Image, s); err != nil { return err @@ -821,7 +821,7 @@ func Convert_v1alpha2_VMStatus_To_ignite_VMStatus(in *VMStatus, out *ignite.VMSt } func autoConvert_ignite_VMStatus_To_v1alpha2_VMStatus(in *ignite.VMStatus, out *VMStatus, s conversion.Scope) error { - out.State = VMState(in.State) + out.Running = in.Running out.IPAddresses = *(*v1alpha1.IPAddresses)(unsafe.Pointer(&in.IPAddresses)) if err := Convert_ignite_OCIImageSource_To_v1alpha2_OCIImageSource(&in.Image, &out.Image, s); err != nil { return err diff --git a/pkg/apis/ignite/v1alpha2/zz_generated.defaults.go b/pkg/apis/ignite/v1alpha2/zz_generated.defaults.go index 61a02be9a..d93a73274 100644 --- a/pkg/apis/ignite/v1alpha2/zz_generated.defaults.go +++ b/pkg/apis/ignite/v1alpha2/zz_generated.defaults.go @@ -37,5 +37,4 @@ func SetObjectDefaults_VM(in *VM) { SetDefaults_VMKernelSpec(&in.Spec.Kernel) SetDefaults_OCIImageClaim(&in.Spec.Kernel.OCIClaim) SetDefaults_VMNetworkSpec(&in.Spec.Network) - SetDefaults_VMStatus(&in.Status) } diff --git a/pkg/apis/ignite/validation/validation.go b/pkg/apis/ignite/validation/validation.go index 619be5e97..5ea530f4d 100644 --- a/pkg/apis/ignite/validation/validation.go +++ b/pkg/apis/ignite/validation/validation.go @@ -17,7 +17,6 @@ func ValidateVM(obj *api.VM) (allErrs field.ErrorList) { 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, ValidateVMStorage(&obj.Spec.Storage, field.NewPath(".spec.storage"))...) - allErrs = append(allErrs, ValidateVMState(obj.Status.State, field.NewPath(".status.state"))...) // TODO: Add vCPU, memory, disk max and min sizes return } @@ -94,18 +93,3 @@ func ValidateImageSourceType(t api.ImageSourceType, fldPath *field.Path) (allErr } 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/filter/vm.go b/pkg/filter/vm.go index 3c90ae145..ed3790b18 100644 --- a/pkg/filter/vm.go +++ b/pkg/filter/vm.go @@ -38,7 +38,7 @@ func (f *VMFilter) Filter(object meta.Object) (filterer.Match, error) { return nil, fmt.Errorf("invalid Object type for VMFilter: %T", object) } - if vm.Status.State != api.VMStateRunning { + if !vm.Running() { return nil, nil } } diff --git a/pkg/openapi/openapi_generated.go b/pkg/openapi/openapi_generated.go index ab686f44c..d0511d33c 100644 --- a/pkg/openapi/openapi_generated.go +++ b/pkg/openapi/openapi_generated.go @@ -1350,9 +1350,9 @@ func schema_pkg_apis_ignite_v1alpha2_VMStatus(ref common.ReferenceCallback) comm Description: "VMStatus defines the status of a VM", Type: []string{"object"}, Properties: map[string]spec.Schema{ - "state": { + "running": { SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, + Type: []string{"boolean"}, Format: "", }, }, @@ -1380,7 +1380,7 @@ func schema_pkg_apis_ignite_v1alpha2_VMStatus(ref common.ReferenceCallback) comm }, }, }, - Required: []string{"state", "image", "kernel"}, + Required: []string{"running", "image", "kernel"}, }, }, Dependencies: []string{ diff --git a/pkg/openapi/violations.txt b/pkg/openapi/violations.txt index 6f9b171d4..f83625dc8 100644 --- a/pkg/openapi/violations.txt +++ b/pkg/openapi/violations.txt @@ -1,11 +1,3 @@ -API rule violation: list_type_missing,github.com/weaveworks/ignite/pkg/apis/ignite/v1alpha1,OCIImageSource,RepoDigests -API rule violation: list_type_missing,github.com/weaveworks/ignite/pkg/apis/ignite/v1alpha1,PoolStatus,Devices -API rule violation: list_type_missing,github.com/weaveworks/ignite/pkg/apis/ignite/v1alpha1,VMSpec,CopyFiles -API rule violation: list_type_missing,github.com/weaveworks/ignite/pkg/apis/ignite/v1alpha2,OCIImageSource,RepoDigests -API rule violation: list_type_missing,github.com/weaveworks/ignite/pkg/apis/ignite/v1alpha2,PoolStatus,Devices -API rule violation: list_type_missing,github.com/weaveworks/ignite/pkg/apis/ignite/v1alpha2,VMSpec,CopyFiles -API rule violation: list_type_missing,github.com/weaveworks/ignite/pkg/apis/ignite/v1alpha2,VMStorageSpec,VolumeMounts -API rule violation: list_type_missing,github.com/weaveworks/ignite/pkg/apis/ignite/v1alpha2,VMStorageSpec,Volumes API rule violation: names_match,github.com/weaveworks/ignite/pkg/apis/ignite/v1alpha1,VMSpec,CPUs API rule violation: names_match,github.com/weaveworks/ignite/pkg/apis/ignite/v1alpha2,VMSpec,CPUs API rule violation: names_match,github.com/weaveworks/ignite/pkg/apis/meta/v1alpha1,DMID,index diff --git a/pkg/operations/reconcile/reconcile.go b/pkg/operations/reconcile/reconcile.go index 747461d6d..67d797da0 100644 --- a/pkg/operations/reconcile/reconcile.go +++ b/pkg/operations/reconcile/reconcile.go @@ -39,7 +39,7 @@ func ReconcileManifests(s *manifest.ManifestStorage) { TypeMeta: *upd.APIType.GetTypeMeta(), ObjectMeta: *upd.APIType.GetObjectMeta(), Status: api.VMStatus{ - State: api.VMStateRunning, // TODO: Fix this in StopVM + Running: true, // TODO: Fix this in StopVM }, } } else { @@ -61,11 +61,7 @@ func ReconcileManifests(s *manifest.ManifestStorage) { // TODO: Parallelization switch upd.Event { - case update.ObjectEventCreate: - runHandle(func() error { - return handleCreate(vm) - }) - case update.ObjectEventModify: + case update.ObjectEventCreate, update.ObjectEventModify: runHandle(func() error { return handleChange(vm) }) @@ -81,45 +77,20 @@ func ReconcileManifests(s *manifest.ManifestStorage) { } } -// TODO: Maybe paralellize these commands? +// TODO: Maybe parallelize these commands? func runHandle(fn func() error) { if err := fn(); err != nil { log.Errorf("An error occurred when processing a VM update: %v\n", err) } } -func handleCreate(vm *api.VM) error { - var err error - - switch vm.Status.State { - case api.VMStateCreated: - err = create(vm) - case api.VMStateRunning: - err = start(vm) - case api.VMStateStopped: - log.Infof("VM %q was added to git with status Stopped, nothing to do\n", vm.GetUID()) - default: - log.Infof("Unknown state of VM %q: %s", vm.GetUID().String(), vm.Status.State) - } - - return err -} - func handleChange(vm *api.VM) error { var err error - // Newly generated VMs that haven't been started yet are loaded via handleChange - // with VMStateCreated, so permit changing into the created state for now - // TODO: Fix this - switch vm.Status.State { - case api.VMStateCreated: - // err = fmt.Errorf("VM %q cannot change into the Created state", vm.GetUID()) - case api.VMStateRunning: + if vm.Status.Running { err = start(vm) - case api.VMStateStopped: + } else { err = stop(vm) - default: - log.Infof("Unknown state of VM %q: %s", vm.GetUID().String(), vm.Status.State) } return err From 5f2770276b3efe95fb33394e9ef7d984106aef97 Mon Sep 17 00:00:00 2001 From: Dennis Marttinen Date: Thu, 8 Aug 2019 13:18:02 +0300 Subject: [PATCH 2/4] Remove Docker containers after documentation builds --- Makefile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index db7a1e5f1..6c1ccdf44 100644 --- a/Makefile +++ b/Makefile @@ -127,7 +127,7 @@ api-doc: mv bin/tmp/${GROUPVERSION}/*.go $(shell pwd)/pkg/apis/${GROUPVERSION}/ rm -r bin/tmp/${GROUPVERSION} # Format the docs with pandoc - docker run -it \ + docker run -it --rm \ -v $(shell pwd):/data \ -u $(shell id -u):$(shell id -g) \ pandoc/core \ @@ -211,8 +211,8 @@ build-docs: bin/docs/builder-image.tar docker build -t ignite-docs docs test-docs: build-docs - docker run -it ignite-docs /usr/bin/linkchecker _build/html/index.html + docker run -it --rm ignite-docs /usr/bin/linkchecker _build/html/index.html serve-docs: build-docs @echo Stating docs website on http://localhost:${DOCS_PORT}/_build/html/index.html - @docker run -i -p ${DOCS_PORT}:8000 -e USER_ID=$$UID ignite-docs + @docker run -i --rm -p ${DOCS_PORT}:8000 -e USER_ID=$$UID ignite-docs From 5bb0f04f4c0881e0552cc4978d83dfab0c7204e5 Mon Sep 17 00:00:00 2001 From: Dennis Marttinen Date: Thu, 8 Aug 2019 13:30:45 +0300 Subject: [PATCH 3/4] make tidy autogen --- docs/api/ignite_v1alpha2.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/api/ignite_v1alpha2.md b/docs/api/ignite_v1alpha2.md index b3b38ebab..c26bdbeee 100644 --- a/docs/api/ignite_v1alpha2.md +++ b/docs/api/ignite_v1alpha2.md @@ -1,4 +1,4 @@ -t# v1alpha2 +# v1alpha2 `import "github.com/weaveworks/ignite/pkg/apis/ignite/v1alpha2"` From b0b85e22cf9ed9e297c41920df044727c0a6016d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucas=20K=C3=A4ldstr=C3=B6m?= Date: Thu, 8 Aug 2019 13:41:43 +0300 Subject: [PATCH 4/4] make tidy autogen --- go.mod | 2 +- go.sum | 19 ------------------- pkg/openapi/violations.txt | 8 ++++++++ 3 files changed, 9 insertions(+), 20 deletions(-) diff --git a/go.mod b/go.mod index 530cc20f6..1a7d47b57 100644 --- a/go.mod +++ b/go.mod @@ -16,6 +16,7 @@ require ( github.com/firecracker-microvm/firecracker-go-sdk v0.15.2-0.20190627223500-b2e8284e890c github.com/freddierice/go-losetup v0.0.0-20170407175016-fc9adea44124 github.com/go-openapi/spec v0.19.2 + github.com/gogo/protobuf v1.2.2-0.20190723190241-65acae22fc9d // indirect github.com/goombaio/namegenerator v0.0.0-20181006234301-989e774b106e github.com/gorilla/mux v1.7.2 // indirect github.com/krolaw/dhcp4 v0.0.0-20190531080455-7b64900047ae @@ -44,7 +45,6 @@ require ( gopkg.in/alessio/shellescape.v1 v1.0.0-20170105083845-52074bc9df61 gotest.tools v2.2.0+incompatible // indirect k8s.io/apimachinery v0.0.0-20190612205821-1799e75a0719 - k8s.io/code-generator v0.0.0-20190807220449-91311fc7abe8 // indirect k8s.io/kube-openapi v0.0.0-20190709113604-33be087ad058 sigs.k8s.io/yaml v1.1.0 ) diff --git a/go.sum b/go.sum index e47b8a78e..b2525b635 100644 --- a/go.sum +++ b/go.sum @@ -4,7 +4,6 @@ cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMT github.com/Azure/go-ansiterm v0.0.0-20170929234023-d6e3b3328b78 h1:w+iIsaOQNcT7OZ575w+acHgRric5iCyQh+xv+KJ4HB8= github.com/Azure/go-ansiterm v0.0.0-20170929234023-d6e3b3328b78/go.mod h1:LmzpDX56iTiv29bbRTIsUNlaFfuhWRQBWjQdVyAevI8= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= -github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= github.com/Microsoft/go-winio v0.4.12 h1:xAfWHN1IrQ0NJ9TBC0KBZoqLjzDTr1ML+4MywiUOryc= github.com/Microsoft/go-winio v0.4.12/go.mod h1:VhR8bwka0BXejwEJY73c50VrPtXAaKcyvVC4A4RozmA= github.com/NYTimes/gziphandler v0.0.0-20170623195520-56545f4a5d46/go.mod h1:3wb06e3pkSAbeQ52E9H9iFoQsEEwGN64994WTCIhntQ= @@ -53,7 +52,6 @@ github.com/docker/go-units v0.3.3/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDD github.com/docker/spdystream v0.0.0-20160310174837-449fdfce4d96/go.mod h1:Qh8CwZgvJUkLughtfhJv5dyTYa91l1fOUCrgjqmcifM= github.com/elazarl/goproxy v0.0.0-20170405201442-c4fc26588b6e/go.mod h1:/Zj4wYkgs4iZTTu3o/KG3Itv/qCCa8VVMlb3i9OVuzc= github.com/emicklei/go-restful v0.0.0-20170410110728-ff4f55a20633/go.mod h1:otzb+WCGbkyDHkqmQmT5YD2WR4BBwUdeQoFo8l/7tVs= -github.com/emicklei/go-restful v2.9.5+incompatible/go.mod h1:otzb+WCGbkyDHkqmQmT5YD2WR4BBwUdeQoFo8l/7tVs= github.com/emicklei/go-restful v2.9.6+incompatible h1:tfrHha8zJ01ywiOEC1miGY8st1/igzWB8OmvPgoYX7w= github.com/emicklei/go-restful v2.9.6+incompatible/go.mod h1:otzb+WCGbkyDHkqmQmT5YD2WR4BBwUdeQoFo8l/7tVs= github.com/evanphx/json-patch v0.0.0-20190203023257-5858425f7550/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= @@ -225,7 +223,6 @@ github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y8 github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.2 h1:6LJUbpNm42llc4HRCuvApCSWB/WfhuNo9K98Q9sNGfs= github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= -github.com/remyoudompheng/bigfft v0.0.0-20170806203942-52369c62f446/go.mod h1:uYEyJGbgTkfkS4+E/PavXkNJcbFIpEtjt2B0KDQ5+9M= github.com/rjeczalik/notify v0.9.2 h1:MiTWrPj55mNDHEiIX5YUSKefw/+lCQVoAFmD6oQm5w8= github.com/rjeczalik/notify v0.9.2/go.mod h1:aErll2f0sUX9PXZnVNyeiObbmTlk5jnMoCa4QEjJeqM= github.com/russross/blackfriday v1.5.2 h1:HyvC0ARfnZBqnXwABFeSZHpKvJHJJfPz81GNueLj0oo= @@ -266,11 +263,7 @@ golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACk golang.org/x/crypto v0.0.0-20190611184440-5c40567a22f8/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190701094942-4def268fd1a4 h1:HuIa8hRrWRSrqYzx1qI49NNxhdi2PrY7gxVSq1JjLDc= golang.org/x/crypto v0.0.0-20190701094942-4def268fd1a4/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/exp v0.0.0-20190125153040-c74c464bbbf2/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= -golang.org/x/exp v0.0.0-20190312203227-4b39c73a6495/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= -golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= -golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6/go.mod h1:z+o9i4GpDbdi3rU15maQ/Ox0txvL9dWGYEHz965HBQE= golang.org/x/net v0.0.0-20170114055629-f2499483f923/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20181005035420-146acd28ed58/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -316,14 +309,9 @@ golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxb golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20181011042414-1f849cf54d09/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20181030221726-6c7e314b6563/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20190206041539-40960b6deb8e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190312151545-0bb0c0a6e846/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190614205625-5aca471b1d59 h1:QjA/9ArTfVTLfEhClDCG7SGrZkZixxWpwNCDiwJfh88= golang.org/x/tools v0.0.0-20190614205625-5aca471b1d59/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= -gonum.org/v1/gonum v0.0.0-20190331200053-3d26580ed485/go.mod h1:2ltnJ7xHfj0zHS40VVPYEAAMTa3ZGguvHGBSJeRWqE0= -gonum.org/v1/netlib v0.0.0-20190313105609-8cb42192e0e0/go.mod h1:wa6Ws7BG/ESfp6dHfk7C6KdzKA7wR7u/rKwOGE66zvw= -gonum.org/v1/netlib v0.0.0-20190331212654-76723241ea4e/go.mod h1:kS+toOQn6AQKjmKJ7gzohV1XkqsFehRA2FbsbkopSuQ= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8 h1:Nw54tB0rB7hY/N0NQvRW8DG4Yk3Q6T9cu9RcFQDu1tc= google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= @@ -350,8 +338,6 @@ gotest.tools v2.2.0+incompatible/go.mod h1:DsYFclhRJ6vuDpmuTbkuFWG+y2sxOXAzmJt81 honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= k8s.io/apimachinery v0.0.0-20190612205821-1799e75a0719 h1:uV4S5IB5g4Nvi+TBVNf3e9L4wrirlwYJ6w88jUQxTUw= k8s.io/apimachinery v0.0.0-20190612205821-1799e75a0719/go.mod h1:I4A+glKBHiTgiEjQiCCQfCAIcIMFGt291SmsvcrFzJA= -k8s.io/code-generator v0.0.0-20190807220449-91311fc7abe8 h1:rmrU+mkCD2lEOkmr+rAC6XmQoLqVPo3+t6uSYjai4BY= -k8s.io/code-generator v0.0.0-20190807220449-91311fc7abe8/go.mod h1:+ehOMJCZcDSNlbNnRAoe9wNEPwf0h03MUOmDkq6J1FE= k8s.io/gengo v0.0.0-20190128074634-0689ccc1d7d6 h1:4s3/R4+OYYYUKptXPhZKjQ04WJ6EhQQVFdjOFvCazDk= k8s.io/gengo v0.0.0-20190128074634-0689ccc1d7d6/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8IAqLxYwwyPxAX1Pzy0ii0= k8s.io/klog v0.0.0-20181102134211-b9b56d5dfc92/go.mod h1:Gq+BEi5rUBO/HRz0bTSXDUcqjScdoY3a9IHpCEIOOfk= @@ -361,11 +347,6 @@ k8s.io/kube-openapi v0.0.0-20190228160746-b3a7cee44a30 h1:TRb4wNWoBVrH9plmkp2q86 k8s.io/kube-openapi v0.0.0-20190228160746-b3a7cee44a30/go.mod h1:BXM9ceUBTj2QnfH2MK1odQs778ajze1RxcmP6S8RVVc= k8s.io/kube-openapi v0.0.0-20190709113604-33be087ad058 h1:di3XCwddOR9cWBNpfgXaskhh6cgJuwcK54rvtwUaC10= k8s.io/kube-openapi v0.0.0-20190709113604-33be087ad058/go.mod h1:nfDlWeOsu3pUf4yWGL+ERqohP4YsZcBJXWMK+gkzOA4= -modernc.org/cc v1.0.0/go.mod h1:1Sk4//wdnYJiUIxnW8ddKpaOJCF37yAdqYnkxUpaYxw= -modernc.org/golex v1.0.0/go.mod h1:b/QX9oBD/LhixY6NDh+IdGv17hgB+51fET1i2kPSmvk= -modernc.org/mathutil v1.0.0/go.mod h1:wU0vUrJsVWBZ4P6e7xtFJEhFSNsfRLJ8H458uRjg03k= -modernc.org/strutil v1.0.0/go.mod h1:lstksw84oURvj9y3tn8lGvRxyRC1S2+g5uuIzNfIOBs= -modernc.org/xc v1.0.0/go.mod h1:mRNCo0bvLjGhHO9WsyuKVU4q0ceiDDDoEeWDJHrNx8I= sigs.k8s.io/structured-merge-diff v0.0.0-20190525122527-15d366b2352e/go.mod h1:wWxsB5ozmmv/SG7nM11ayaAW51xMvak/t1r0CSlcokI= sigs.k8s.io/yaml v1.1.0 h1:4A07+ZFc2wgJwo8YNlQpr1rVlgUDlxXHhPJciaPY5gs= sigs.k8s.io/yaml v1.1.0/go.mod h1:UJmg0vDUVViEyp3mgSv9WPwZCDxu4rQW1olrI1uml+o= diff --git a/pkg/openapi/violations.txt b/pkg/openapi/violations.txt index f83625dc8..6f9b171d4 100644 --- a/pkg/openapi/violations.txt +++ b/pkg/openapi/violations.txt @@ -1,3 +1,11 @@ +API rule violation: list_type_missing,github.com/weaveworks/ignite/pkg/apis/ignite/v1alpha1,OCIImageSource,RepoDigests +API rule violation: list_type_missing,github.com/weaveworks/ignite/pkg/apis/ignite/v1alpha1,PoolStatus,Devices +API rule violation: list_type_missing,github.com/weaveworks/ignite/pkg/apis/ignite/v1alpha1,VMSpec,CopyFiles +API rule violation: list_type_missing,github.com/weaveworks/ignite/pkg/apis/ignite/v1alpha2,OCIImageSource,RepoDigests +API rule violation: list_type_missing,github.com/weaveworks/ignite/pkg/apis/ignite/v1alpha2,PoolStatus,Devices +API rule violation: list_type_missing,github.com/weaveworks/ignite/pkg/apis/ignite/v1alpha2,VMSpec,CopyFiles +API rule violation: list_type_missing,github.com/weaveworks/ignite/pkg/apis/ignite/v1alpha2,VMStorageSpec,VolumeMounts +API rule violation: list_type_missing,github.com/weaveworks/ignite/pkg/apis/ignite/v1alpha2,VMStorageSpec,Volumes API rule violation: names_match,github.com/weaveworks/ignite/pkg/apis/ignite/v1alpha1,VMSpec,CPUs API rule violation: names_match,github.com/weaveworks/ignite/pkg/apis/ignite/v1alpha2,VMSpec,CPUs API rule violation: names_match,github.com/weaveworks/ignite/pkg/apis/meta/v1alpha1,DMID,index