Skip to content

Commit

Permalink
instancetype: Switch over to v1beta1
Browse files Browse the repository at this point in the history
This changes moves the project to the v1beta1 instance type API and CRDs
by default. All unit and functional tests are also moved to the new
version.

Co-authored-by: Felix Matouschek <[email protected]>
Signed-off-by: Lee Yarwood <[email protected]>
  • Loading branch information
lyarwood and 0xFelix committed May 30, 2023
1 parent 155d0bb commit fa7172e
Show file tree
Hide file tree
Showing 72 changed files with 1,199 additions and 1,180 deletions.
1,082 changes: 541 additions & 541 deletions api/openapi-spec/swagger.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion examples/clarge.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
apiVersion: instancetype.kubevirt.io/v1alpha2
apiVersion: instancetype.kubevirt.io/v1beta1
kind: VirtualMachineInstancetype
metadata:
name: clarge
Expand Down
2 changes: 1 addition & 1 deletion examples/cluster-csmall.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
apiVersion: instancetype.kubevirt.io/v1alpha2
apiVersion: instancetype.kubevirt.io/v1beta1
kind: VirtualMachineClusterInstancetype
metadata:
name: cluster-csmall
Expand Down
2 changes: 1 addition & 1 deletion examples/csmall.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
apiVersion: instancetype.kubevirt.io/v1alpha2
apiVersion: instancetype.kubevirt.io/v1beta1
kind: VirtualMachineInstancetype
metadata:
name: csmall
Expand Down
2 changes: 1 addition & 1 deletion examples/virtio.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
apiVersion: instancetype.kubevirt.io/v1alpha2
apiVersion: instancetype.kubevirt.io/v1beta1
kind: VirtualMachinePreference
metadata:
name: virtio
Expand Down
2 changes: 1 addition & 1 deletion examples/windows.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
apiVersion: instancetype.kubevirt.io/v1alpha2
apiVersion: instancetype.kubevirt.io/v1beta1
kind: VirtualMachinePreference
metadata:
name: windows
Expand Down
2 changes: 1 addition & 1 deletion pkg/controller/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ go_library(
"//staging/src/kubevirt.io/api/core/v1:go_default_library",
"//staging/src/kubevirt.io/api/export/v1alpha1:go_default_library",
"//staging/src/kubevirt.io/api/instancetype:go_default_library",
"//staging/src/kubevirt.io/api/instancetype/v1alpha2:go_default_library",
"//staging/src/kubevirt.io/api/instancetype/v1beta1:go_default_library",
"//staging/src/kubevirt.io/api/migrations:go_default_library",
"//staging/src/kubevirt.io/api/migrations/v1alpha1:go_default_library",
"//staging/src/kubevirt.io/api/pool/v1alpha1:go_default_library",
Expand Down
10 changes: 5 additions & 5 deletions pkg/controller/virtinformers.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ import (
kubev1 "kubevirt.io/api/core/v1"
exportv1 "kubevirt.io/api/export/v1alpha1"
instancetypeapi "kubevirt.io/api/instancetype"
instancetypev1alpha2 "kubevirt.io/api/instancetype/v1alpha2"
instancetypev1beta1 "kubevirt.io/api/instancetype/v1beta1"
"kubevirt.io/api/migrations"
migrationsv1 "kubevirt.io/api/migrations/v1alpha1"
poolv1 "kubevirt.io/api/pool/v1alpha1"
Expand Down Expand Up @@ -727,28 +727,28 @@ func (f *kubeInformerFactory) VirtualMachineClone() cache.SharedIndexInformer {
func (f *kubeInformerFactory) VirtualMachineInstancetype() cache.SharedIndexInformer {
return f.getInformer("vmInstancetypeInformer", func() cache.SharedIndexInformer {
lw := cache.NewListWatchFromClient(f.clientSet.GeneratedKubeVirtClient().InstancetypeV1alpha2().RESTClient(), instancetypeapi.PluralResourceName, k8sv1.NamespaceAll, fields.Everything())
return cache.NewSharedIndexInformer(lw, &instancetypev1alpha2.VirtualMachineInstancetype{}, f.defaultResync, cache.Indexers{})
return cache.NewSharedIndexInformer(lw, &instancetypev1beta1.VirtualMachineInstancetype{}, f.defaultResync, cache.Indexers{})
})
}

func (f *kubeInformerFactory) VirtualMachineClusterInstancetype() cache.SharedIndexInformer {
return f.getInformer("vmClusterInstancetypeInformer", func() cache.SharedIndexInformer {
lw := cache.NewListWatchFromClient(f.clientSet.GeneratedKubeVirtClient().InstancetypeV1alpha2().RESTClient(), instancetypeapi.ClusterPluralResourceName, k8sv1.NamespaceAll, fields.Everything())
return cache.NewSharedIndexInformer(lw, &instancetypev1alpha2.VirtualMachineClusterInstancetype{}, f.defaultResync, cache.Indexers{})
return cache.NewSharedIndexInformer(lw, &instancetypev1beta1.VirtualMachineClusterInstancetype{}, f.defaultResync, cache.Indexers{})
})
}

func (f *kubeInformerFactory) VirtualMachinePreference() cache.SharedIndexInformer {
return f.getInformer("vmPreferenceInformer", func() cache.SharedIndexInformer {
lw := cache.NewListWatchFromClient(f.clientSet.GeneratedKubeVirtClient().InstancetypeV1alpha2().RESTClient(), instancetypeapi.PluralPreferenceResourceName, k8sv1.NamespaceAll, fields.Everything())
return cache.NewSharedIndexInformer(lw, &instancetypev1alpha2.VirtualMachinePreference{}, f.defaultResync, cache.Indexers{})
return cache.NewSharedIndexInformer(lw, &instancetypev1beta1.VirtualMachinePreference{}, f.defaultResync, cache.Indexers{})
})
}

func (f *kubeInformerFactory) VirtualMachineClusterPreference() cache.SharedIndexInformer {
return f.getInformer("vmClusterPreferenceInformer", func() cache.SharedIndexInformer {
lw := cache.NewListWatchFromClient(f.clientSet.GeneratedKubeVirtClient().InstancetypeV1alpha2().RESTClient(), instancetypeapi.ClusterPluralPreferenceResourceName, k8sv1.NamespaceAll, fields.Everything())
return cache.NewSharedIndexInformer(lw, &instancetypev1alpha2.VirtualMachineClusterPreference{}, f.defaultResync, cache.Indexers{})
return cache.NewSharedIndexInformer(lw, &instancetypev1beta1.VirtualMachineClusterPreference{}, f.defaultResync, cache.Indexers{})
})
}

Expand Down
5 changes: 3 additions & 2 deletions pkg/instancetype/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ go_library(
"//staging/src/kubevirt.io/api/instancetype:go_default_library",
"//staging/src/kubevirt.io/api/instancetype/v1alpha1:go_default_library",
"//staging/src/kubevirt.io/api/instancetype/v1alpha2:go_default_library",
"//staging/src/kubevirt.io/api/instancetype/v1beta1:go_default_library",
"//staging/src/kubevirt.io/client-go/generated/kubevirt/clientset/versioned/scheme:go_default_library",
"//staging/src/kubevirt.io/client-go/kubecli:go_default_library",
"//staging/src/kubevirt.io/client-go/log:go_default_library",
Expand Down Expand Up @@ -46,10 +47,10 @@ go_test(
"//staging/src/kubevirt.io/api/core/v1:go_default_library",
"//staging/src/kubevirt.io/api/instancetype:go_default_library",
"//staging/src/kubevirt.io/api/instancetype/v1alpha1:go_default_library",
"//staging/src/kubevirt.io/api/instancetype/v1alpha2:go_default_library",
"//staging/src/kubevirt.io/api/instancetype/v1beta1:go_default_library",
"//staging/src/kubevirt.io/client-go/api:go_default_library",
"//staging/src/kubevirt.io/client-go/generated/kubevirt/clientset/versioned/fake:go_default_library",
"//staging/src/kubevirt.io/client-go/generated/kubevirt/clientset/versioned/typed/instancetype/v1alpha2:go_default_library",
"//staging/src/kubevirt.io/client-go/generated/kubevirt/clientset/versioned/typed/instancetype/v1beta1:go_default_library",
"//staging/src/kubevirt.io/client-go/kubecli:go_default_library",
"//staging/src/kubevirt.io/client-go/testutils:go_default_library",
"//vendor/github.com/golang/mock/gomock:go_default_library",
Expand Down
Loading

0 comments on commit fa7172e

Please sign in to comment.