Skip to content

Commit

Permalink
Rename util package to mapper
Browse files Browse the repository at this point in the history
Now the util package only has mapper related code left. Rename it to
mapper.
  • Loading branch information
rmohr committed Jan 25, 2017
1 parent 666dc44 commit 1feb3dd
Show file tree
Hide file tree
Showing 6 changed files with 46 additions and 46 deletions.
10 changes: 5 additions & 5 deletions pkg/api/v1/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ import (
"k8s.io/client-go/pkg/runtime/schema"
"k8s.io/client-go/pkg/types"
"kubevirt.io/kubevirt/pkg/api"
"kubevirt.io/kubevirt/pkg/mapper"
"kubevirt.io/kubevirt/pkg/precond"
"kubevirt.io/kubevirt/pkg/util"
"reflect"
)

Expand Down Expand Up @@ -68,10 +68,10 @@ func init() {
return reflect.ValueOf(uuid.FromStringOrNil(in.String())), nil
})

util.AddConversion(&VMSpec{}, &api.VMSpec{})
util.AddConversion(&VMCondition{}, &api.VMCondition{})
util.AddConversion(&VMStatus{}, &api.VMStatus{})
util.AddConversion(&v1.ObjectMeta{}, &kubeapi.ObjectMeta{})
mapper.AddConversion(&VMSpec{}, &api.VMSpec{})
mapper.AddConversion(&VMCondition{}, &api.VMCondition{})
mapper.AddConversion(&VMStatus{}, &api.VMStatus{})
mapper.AddConversion(&v1.ObjectMeta{}, &kubeapi.ObjectMeta{})
}

type VM struct {
Expand Down
2 changes: 1 addition & 1 deletion pkg/util/mapper.go → pkg/mapper/mapper.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package util
package mapper

import (
"github.com/jeevatkm/go-model"
Expand Down
2 changes: 1 addition & 1 deletion pkg/util/mapper_test.go → pkg/mapper/mapper_test.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package util
package mapper

import (
"github.com/jeevatkm/go-model"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package util
package mapper

import (
. "github.com/onsi/ginkgo"
Expand Down
74 changes: 37 additions & 37 deletions pkg/virt-handler/virtwrap/schema.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,50 +8,50 @@ import (
metav1 "k8s.io/client-go/pkg/apis/meta/v1"
"k8s.io/client-go/pkg/runtime/schema"
"kubevirt.io/kubevirt/pkg/api/v1"
"kubevirt.io/kubevirt/pkg/mapper"
"kubevirt.io/kubevirt/pkg/precond"
"kubevirt.io/kubevirt/pkg/util"
)

type LifeCycle string

func init() {
// TODO the whole mapping registration can be done be an automatic process with reflection
util.AddConversion(&Memory{}, &v1.Memory{})
util.AddConversion(&OS{}, &v1.OS{})
util.AddConversion(&Devices{}, &v1.Devices{})
util.AddConversion(&Devices{}, &v1.Devices{})
util.AddPtrConversion((**Clock)(nil), (**v1.Clock)(nil))
util.AddPtrConversion((**SysInfo)(nil), (**v1.SysInfo)(nil))
util.AddConversion(&Channel{}, &v1.Channel{})
util.AddConversion(&Interface{}, &v1.Interface{})
util.AddConversion(&Video{}, &v1.Video{})
util.AddConversion(&Graphics{}, &v1.Graphics{})
util.AddPtrConversion((**Ballooning)(nil), (**v1.Ballooning)(nil))
util.AddConversion(&Disk{}, &v1.Disk{})
util.AddConversion(&DiskSource{}, &v1.DiskSource{})
util.AddConversion(&DiskTarget{}, &v1.DiskTarget{})
util.AddPtrConversion((**DiskDriver)(nil), (**v1.DiskDriver)(nil))
util.AddPtrConversion((**ReadOnly)(nil), (**v1.ReadOnly)(nil))
util.AddPtrConversion((**Address)(nil), (**v1.Address)(nil))
util.AddConversion(&InterfaceSource{}, &v1.InterfaceSource{})
util.AddPtrConversion((**InterfaceTarget)(nil), (**v1.InterfaceTarget)(nil))
util.AddPtrConversion((**Model)(nil), (**v1.Model)(nil))
util.AddPtrConversion((**MAC)(nil), (**v1.MAC)(nil))
util.AddPtrConversion((**BandWidth)(nil), (**v1.BandWidth)(nil))
util.AddPtrConversion((**BootOrder)(nil), (**v1.BootOrder)(nil))
util.AddPtrConversion((**LinkState)(nil), (**v1.LinkState)(nil))
util.AddPtrConversion((**FilterRef)(nil), (**v1.FilterRef)(nil))
util.AddPtrConversion((**Alias)(nil), (**v1.Alias)(nil))
util.AddConversion(&OSType{}, &v1.OSType{})
util.AddPtrConversion((**SMBios)(nil), (**v1.SMBios)(nil))
util.AddConversion(&Boot{}, &v1.Boot{})
util.AddPtrConversion((**BootMenu)(nil), (**v1.BootMenu)(nil))
util.AddPtrConversion((**BIOS)(nil), (**v1.BIOS)(nil))
util.AddConversion(&Entry{}, &v1.Entry{})
util.AddConversion(&ChannelSource{}, &v1.ChannelSource{})
util.AddPtrConversion((**ChannelTarget)(nil), (**v1.ChannelTarget)(nil))
util.AddConversion(&VideoModel{}, &v1.VideoModel{})
util.AddConversion(&Listen{}, &v1.Listen{})
mapper.AddConversion(&Memory{}, &v1.Memory{})
mapper.AddConversion(&OS{}, &v1.OS{})
mapper.AddConversion(&Devices{}, &v1.Devices{})
mapper.AddConversion(&Devices{}, &v1.Devices{})
mapper.AddPtrConversion((**Clock)(nil), (**v1.Clock)(nil))
mapper.AddPtrConversion((**SysInfo)(nil), (**v1.SysInfo)(nil))
mapper.AddConversion(&Channel{}, &v1.Channel{})
mapper.AddConversion(&Interface{}, &v1.Interface{})
mapper.AddConversion(&Video{}, &v1.Video{})
mapper.AddConversion(&Graphics{}, &v1.Graphics{})
mapper.AddPtrConversion((**Ballooning)(nil), (**v1.Ballooning)(nil))
mapper.AddConversion(&Disk{}, &v1.Disk{})
mapper.AddConversion(&DiskSource{}, &v1.DiskSource{})
mapper.AddConversion(&DiskTarget{}, &v1.DiskTarget{})
mapper.AddPtrConversion((**DiskDriver)(nil), (**v1.DiskDriver)(nil))
mapper.AddPtrConversion((**ReadOnly)(nil), (**v1.ReadOnly)(nil))
mapper.AddPtrConversion((**Address)(nil), (**v1.Address)(nil))
mapper.AddConversion(&InterfaceSource{}, &v1.InterfaceSource{})
mapper.AddPtrConversion((**InterfaceTarget)(nil), (**v1.InterfaceTarget)(nil))
mapper.AddPtrConversion((**Model)(nil), (**v1.Model)(nil))
mapper.AddPtrConversion((**MAC)(nil), (**v1.MAC)(nil))
mapper.AddPtrConversion((**BandWidth)(nil), (**v1.BandWidth)(nil))
mapper.AddPtrConversion((**BootOrder)(nil), (**v1.BootOrder)(nil))
mapper.AddPtrConversion((**LinkState)(nil), (**v1.LinkState)(nil))
mapper.AddPtrConversion((**FilterRef)(nil), (**v1.FilterRef)(nil))
mapper.AddPtrConversion((**Alias)(nil), (**v1.Alias)(nil))
mapper.AddConversion(&OSType{}, &v1.OSType{})
mapper.AddPtrConversion((**SMBios)(nil), (**v1.SMBios)(nil))
mapper.AddConversion(&Boot{}, &v1.Boot{})
mapper.AddPtrConversion((**BootMenu)(nil), (**v1.BootMenu)(nil))
mapper.AddPtrConversion((**BIOS)(nil), (**v1.BIOS)(nil))
mapper.AddConversion(&Entry{}, &v1.Entry{})
mapper.AddConversion(&ChannelSource{}, &v1.ChannelSource{})
mapper.AddPtrConversion((**ChannelTarget)(nil), (**v1.ChannelTarget)(nil))
mapper.AddConversion(&VideoModel{}, &v1.VideoModel{})
mapper.AddConversion(&Listen{}, &v1.Listen{})
}

const (
Expand Down
2 changes: 1 addition & 1 deletion third_party/swagger-ui/lib/sanitize-html.min.js

Large diffs are not rendered by default.

0 comments on commit 1feb3dd

Please sign in to comment.