Skip to content

Commit

Permalink
[WIP] update vm->virtualmachine
Browse files Browse the repository at this point in the history
  • Loading branch information
stu-gott committed Sep 21, 2017
1 parent 8c0c0c3 commit d613b30
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 16 deletions.
6 changes: 3 additions & 3 deletions pkg/virt-apiserver/apiserver/apiserver.go
Expand Up @@ -44,8 +44,8 @@ func init() {

metav1.AddToGroupVersion(Scheme, v1.GroupVersion)
Scheme.AddKnownTypes(v1.GroupVersion,
&v1.VM{},
&v1.VMList{},
&v1.VirtualMachine{},
&v1.VirtualMachineList{},
&metav1.ListOptions{},
&metav1.DeleteOptions{},
&v1.Spice{},
Expand Down Expand Up @@ -84,7 +84,7 @@ func (c completedConfig) New() (*VirtApiServer, error) {
if err != nil {
return nil, err
}
storage["vms"] = vms
storage["virtualmachines"] = vms

migrations, err := migration.NewREST(Scheme, c.GenericConfig.RESTOptionsGetter)
if err != nil {
Expand Down
1 change: 0 additions & 1 deletion pkg/virt-apiserver/apiserver/install.go
Expand Up @@ -16,7 +16,6 @@ func Install(groupFactoryRegistry announced.APIGroupFactoryRegistry, registry *r
GroupName: v1.GroupName,
RootScopedKinds: sets.NewString("APIService"),
VersionPreferenceOrder: []string{v1.SchemeGroupVersion.Version},
ImportPrefix: "kubevirt.io/kubevirt/pkg/api",
AddInternalObjectsToScheme: v1.AddToScheme,
},
announced.VersionToSchemeFunc{
Expand Down
10 changes: 5 additions & 5 deletions pkg/virt-apiserver/registry/migration/etcd.go
Expand Up @@ -20,11 +20,11 @@ func NewREST(scheme *runtime.Scheme, optsGetter generic.RESTOptionsGetter) (*RES
strategy := NewStrategy(scheme)

store := &genericregistry.Store{
Copier: scheme,
NewFunc: func() runtime.Object { return &v1.Migration{} },
NewListFunc: func() runtime.Object { return &v1.MigrationList{} },
PredicateFunc: MatchMigration,
QualifiedResource: v1.Resource("migrations"),
Copier: scheme,
NewFunc: func() runtime.Object { return &v1.Migration{} },
NewListFunc: func() runtime.Object { return &v1.MigrationList{} },
PredicateFunc: MatchMigration,
DefaultQualifiedResource: v1.Resource("migrations"),

CreateStrategy: strategy,
UpdateStrategy: strategy,
Expand Down
10 changes: 5 additions & 5 deletions pkg/virt-apiserver/registry/vm/etcd.go
Expand Up @@ -20,11 +20,11 @@ func NewREST(scheme *runtime.Scheme, optsGetter generic.RESTOptionsGetter) (*RES
strategy := NewStrategy(scheme)

store := &genericregistry.Store{
Copier: scheme,
NewFunc: func() runtime.Object { return &v1.VM{} },
NewListFunc: func() runtime.Object { return &v1.VMList{} },
PredicateFunc: MatchVM,
QualifiedResource: v1.Resource("vms"),
Copier: scheme,
NewFunc: func() runtime.Object { return &v1.VirtualMachine{} },
NewListFunc: func() runtime.Object { return &v1.VirtualMachineList{} },
PredicateFunc: MatchVM,
DefaultQualifiedResource: v1.Resource("virtualmachines"),

CreateStrategy: strategy,
UpdateStrategy: strategy,
Expand Down
4 changes: 2 additions & 2 deletions pkg/virt-apiserver/registry/vm/strategy.go
Expand Up @@ -20,7 +20,7 @@ func NewStrategy(typer runtime.ObjectTyper) kubevirtStrategy {
}

func GetAttrs(obj runtime.Object) (labels.Set, fields.Set, bool, error) {
vm, ok := obj.(*v1.VM)
vm, ok := obj.(*v1.VirtualMachine)
if !ok {
return nil, nil, false, fmt.Errorf("given object is not a VM.")
}
Expand All @@ -38,7 +38,7 @@ func MatchVM(label labels.Selector, field fields.Selector) storage.SelectionPred
}

// vmToSelectableFields returns a field set that represents the object.
func vmToSelectableFields(obj *v1.VM) fields.Set {
func vmToSelectableFields(obj *v1.VirtualMachine) fields.Set {
return generic.ObjectMetaFieldsSet(&obj.ObjectMeta, true)
}

Expand Down

0 comments on commit d613b30

Please sign in to comment.