Skip to content
Permalink
Browse files

[WIP] update vm->virtualmachine

  • Loading branch information
stu-gott committed Sep 21, 2017
1 parent 8c0c0c3 commit d613b30894b5a439191c9484fde46e45f5fcc56c
@@ -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{},
@@ -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 {
@@ -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{
@@ -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,
@@ -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,
@@ -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.")
}
@@ -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)
}

0 comments on commit d613b30

Please sign in to comment.
You can’t perform that action at this time.