From d79ce2aacc5f3e480eef3bca5edb64a1b0e5e884 Mon Sep 17 00:00:00 2001 From: Dmitry Rakitin Date: Thu, 21 Mar 2024 13:11:54 +0100 Subject: [PATCH] fix(vmcpu): resolved conflicts Signed-off-by: Isteb4k --- .../fake/fake_virtualmachinecpumodel.go | 3 +- .../core/v1alpha2/virtualmachinecpumodel.go | 5 +- .../core/v1alpha2/virtualmachinecpumodel.go | 9 +- .../core/v1alpha2/virtualmachinecpumodel.go | 3 +- .../generated/openapi/zz_generated.openapi.go | 235 +++++++++++++++++- .../pkg/controller/cpu/cpu_controller.go | 2 +- .../pkg/controller/cpu/cpu_reconciler.go | 2 +- .../controller/cpu/cpu_reconciler_state.go | 2 +- .../pkg/controller/cpu/cpu_webhook.go | 2 +- 9 files changed, 246 insertions(+), 17 deletions(-) diff --git a/api/client/generated/clientset/versioned/typed/core/v1alpha2/fake/fake_virtualmachinecpumodel.go b/api/client/generated/clientset/versioned/typed/core/v1alpha2/fake/fake_virtualmachinecpumodel.go index 241c56673..0f0f3f897 100644 --- a/api/client/generated/clientset/versioned/typed/core/v1alpha2/fake/fake_virtualmachinecpumodel.go +++ b/api/client/generated/clientset/versioned/typed/core/v1alpha2/fake/fake_virtualmachinecpumodel.go @@ -13,7 +13,6 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ - // Code generated by client-gen. DO NOT EDIT. package fake @@ -21,7 +20,7 @@ package fake import ( "context" - v1alpha2 "github.com/deckhouse/virtualization-controller/api/core/v1alpha2" + v1alpha2 "github.com/deckhouse/virtualization/api/core/v1alpha2" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" labels "k8s.io/apimachinery/pkg/labels" types "k8s.io/apimachinery/pkg/types" diff --git a/api/client/generated/clientset/versioned/typed/core/v1alpha2/virtualmachinecpumodel.go b/api/client/generated/clientset/versioned/typed/core/v1alpha2/virtualmachinecpumodel.go index 35a3758fe..4618b7d50 100644 --- a/api/client/generated/clientset/versioned/typed/core/v1alpha2/virtualmachinecpumodel.go +++ b/api/client/generated/clientset/versioned/typed/core/v1alpha2/virtualmachinecpumodel.go @@ -13,7 +13,6 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ - // Code generated by client-gen. DO NOT EDIT. package v1alpha2 @@ -22,8 +21,8 @@ import ( "context" "time" - scheme "github.com/deckhouse/virtualization-controller/api/client/generated/clientset/versioned/scheme" - v1alpha2 "github.com/deckhouse/virtualization-controller/api/core/v1alpha2" + scheme "github.com/deckhouse/virtualization/api/client/generated/clientset/versioned/scheme" + v1alpha2 "github.com/deckhouse/virtualization/api/core/v1alpha2" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" diff --git a/api/client/generated/informers/externalversions/core/v1alpha2/virtualmachinecpumodel.go b/api/client/generated/informers/externalversions/core/v1alpha2/virtualmachinecpumodel.go index fbc9ee70f..e0ab953f4 100644 --- a/api/client/generated/informers/externalversions/core/v1alpha2/virtualmachinecpumodel.go +++ b/api/client/generated/informers/externalversions/core/v1alpha2/virtualmachinecpumodel.go @@ -13,7 +13,6 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ - // Code generated by informer-gen. DO NOT EDIT. package v1alpha2 @@ -22,10 +21,10 @@ import ( "context" time "time" - versioned "github.com/deckhouse/virtualization-controller/api/client/generated/clientset/versioned" - internalinterfaces "github.com/deckhouse/virtualization-controller/api/client/generated/informers/externalversions/internalinterfaces" - v1alpha2 "github.com/deckhouse/virtualization-controller/api/client/generated/listers/core/v1alpha2" - corev1alpha2 "github.com/deckhouse/virtualization-controller/api/core/v1alpha2" + versioned "github.com/deckhouse/virtualization/api/client/generated/clientset/versioned" + internalinterfaces "github.com/deckhouse/virtualization/api/client/generated/informers/externalversions/internalinterfaces" + v1alpha2 "github.com/deckhouse/virtualization/api/client/generated/listers/core/v1alpha2" + corev1alpha2 "github.com/deckhouse/virtualization/api/core/v1alpha2" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" watch "k8s.io/apimachinery/pkg/watch" diff --git a/api/client/generated/listers/core/v1alpha2/virtualmachinecpumodel.go b/api/client/generated/listers/core/v1alpha2/virtualmachinecpumodel.go index 521d84ab6..c24435df2 100644 --- a/api/client/generated/listers/core/v1alpha2/virtualmachinecpumodel.go +++ b/api/client/generated/listers/core/v1alpha2/virtualmachinecpumodel.go @@ -13,13 +13,12 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ - // Code generated by lister-gen. DO NOT EDIT. package v1alpha2 import ( - v1alpha2 "github.com/deckhouse/virtualization-controller/api/core/v1alpha2" + v1alpha2 "github.com/deckhouse/virtualization/api/core/v1alpha2" "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" "k8s.io/client-go/tools/cache" diff --git a/api/pkg/apiserver/api/generated/openapi/zz_generated.openapi.go b/api/pkg/apiserver/api/generated/openapi/zz_generated.openapi.go index e6283a695..f89a99a6d 100644 --- a/api/pkg/apiserver/api/generated/openapi/zz_generated.openapi.go +++ b/api/pkg/apiserver/api/generated/openapi/zz_generated.openapi.go @@ -74,6 +74,11 @@ func GetOpenAPIDefinitions(ref common.ReferenceCallback) map[string]common.OpenA "github.com/deckhouse/virtualization/api/core/v1alpha2.VirtualMachineBlockDeviceAttachmentList": schema_virtualization_api_core_v1alpha2_VirtualMachineBlockDeviceAttachmentList(ref), "github.com/deckhouse/virtualization/api/core/v1alpha2.VirtualMachineBlockDeviceAttachmentSpec": schema_virtualization_api_core_v1alpha2_VirtualMachineBlockDeviceAttachmentSpec(ref), "github.com/deckhouse/virtualization/api/core/v1alpha2.VirtualMachineBlockDeviceAttachmentStatus": schema_virtualization_api_core_v1alpha2_VirtualMachineBlockDeviceAttachmentStatus(ref), + "github.com/deckhouse/virtualization/api/core/v1alpha2.VirtualMachineCPUModel": schema_virtualization_api_core_v1alpha2_VirtualMachineCPUModel(ref), + "github.com/deckhouse/virtualization/api/core/v1alpha2.VirtualMachineCPUModelList": schema_virtualization_api_core_v1alpha2_VirtualMachineCPUModelList(ref), + "github.com/deckhouse/virtualization/api/core/v1alpha2.VirtualMachineCPUModelSpec": schema_virtualization_api_core_v1alpha2_VirtualMachineCPUModelSpec(ref), + "github.com/deckhouse/virtualization/api/core/v1alpha2.VirtualMachineCPUModelStatus": schema_virtualization_api_core_v1alpha2_VirtualMachineCPUModelStatus(ref), + "github.com/deckhouse/virtualization/api/core/v1alpha2.VirtualMachineCPUModelStatusFeatures": schema_virtualization_api_core_v1alpha2_VirtualMachineCPUModelStatusFeatures(ref), "github.com/deckhouse/virtualization/api/core/v1alpha2.VirtualMachineDisk": schema_virtualization_api_core_v1alpha2_VirtualMachineDisk(ref), "github.com/deckhouse/virtualization/api/core/v1alpha2.VirtualMachineDiskList": schema_virtualization_api_core_v1alpha2_VirtualMachineDiskList(ref), "github.com/deckhouse/virtualization/api/core/v1alpha2.VirtualMachineDiskSpec": schema_virtualization_api_core_v1alpha2_VirtualMachineDiskSpec(ref), @@ -771,6 +776,13 @@ func schema_virtualization_api_core_v1alpha2_CPUSpec(ref common.ReferenceCallbac SchemaProps: spec.SchemaProps{ Type: []string{"object"}, Properties: map[string]spec.Schema{ + "model": { + SchemaProps: spec.SchemaProps{ + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, "cores": { SchemaProps: spec.SchemaProps{ Default: 0, @@ -786,7 +798,7 @@ func schema_virtualization_api_core_v1alpha2_CPUSpec(ref common.ReferenceCallbac }, }, }, - Required: []string{"cores", "coreFraction"}, + Required: []string{"model", "cores", "coreFraction"}, }, }, } @@ -2132,6 +2144,227 @@ func schema_virtualization_api_core_v1alpha2_VirtualMachineBlockDeviceAttachment } } +func schema_virtualization_api_core_v1alpha2_VirtualMachineCPUModel(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "VirtualMachineCPUModel an immutable resource describing the processor that will be used in the VM.", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "kind": { + SchemaProps: spec.SchemaProps{ + Description: "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", + Type: []string{"string"}, + Format: "", + }, + }, + "apiVersion": { + SchemaProps: spec.SchemaProps{ + Description: "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources", + Type: []string{"string"}, + Format: "", + }, + }, + "metadata": { + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"), + }, + }, + "spec": { + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("github.com/deckhouse/virtualization/api/core/v1alpha2.VirtualMachineCPUModelSpec"), + }, + }, + "status": { + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("github.com/deckhouse/virtualization/api/core/v1alpha2.VirtualMachineCPUModelStatus"), + }, + }, + }, + Required: []string{"spec", "status"}, + }, + }, + Dependencies: []string{ + "github.com/deckhouse/virtualization/api/core/v1alpha2.VirtualMachineCPUModelSpec", "github.com/deckhouse/virtualization/api/core/v1alpha2.VirtualMachineCPUModelStatus", "k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"}, + } +} + +func schema_virtualization_api_core_v1alpha2_VirtualMachineCPUModelList(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "VirtualMachineCPUModelList contains a list of VirtualMachineCPUModel", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "kind": { + SchemaProps: spec.SchemaProps{ + Description: "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", + Type: []string{"string"}, + Format: "", + }, + }, + "apiVersion": { + SchemaProps: spec.SchemaProps{ + Description: "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources", + Type: []string{"string"}, + Format: "", + }, + }, + "metadata": { + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"), + }, + }, + "items": { + SchemaProps: spec.SchemaProps{ + Description: "Items provides a list of CDIs", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("github.com/deckhouse/virtualization/api/core/v1alpha2.VirtualMachineCPUModel"), + }, + }, + }, + }, + }, + }, + Required: []string{"metadata", "items"}, + }, + }, + Dependencies: []string{ + "github.com/deckhouse/virtualization/api/core/v1alpha2.VirtualMachineCPUModel", "k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"}, + } +} + +func schema_virtualization_api_core_v1alpha2_VirtualMachineCPUModelSpec(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "type": { + SchemaProps: spec.SchemaProps{ + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "model": { + SchemaProps: spec.SchemaProps{ + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "features": { + SchemaProps: spec.SchemaProps{ + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + }, + }, + }, + }, + Required: []string{"type", "model", "features"}, + }, + }, + } +} + +func schema_virtualization_api_core_v1alpha2_VirtualMachineCPUModelStatus(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "features": { + SchemaProps: spec.SchemaProps{ + Ref: ref("github.com/deckhouse/virtualization/api/core/v1alpha2.VirtualMachineCPUModelStatusFeatures"), + }, + }, + "nodes": { + SchemaProps: spec.SchemaProps{ + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + }, + }, + }, + "phase": { + SchemaProps: spec.SchemaProps{ + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + }, + Required: []string{"phase"}, + }, + }, + Dependencies: []string{ + "github.com/deckhouse/virtualization/api/core/v1alpha2.VirtualMachineCPUModelStatusFeatures"}, + } +} + +func schema_virtualization_api_core_v1alpha2_VirtualMachineCPUModelStatusFeatures(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "enabled": { + SchemaProps: spec.SchemaProps{ + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + }, + }, + }, + "notEnabledCommon": { + SchemaProps: spec.SchemaProps{ + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + }, + }, + }, + }, + Required: []string{"enabled", "notEnabledCommon"}, + }, + }, + } +} + func schema_virtualization_api_core_v1alpha2_VirtualMachineDisk(ref common.ReferenceCallback) common.OpenAPIDefinition { return common.OpenAPIDefinition{ Schema: spec.Schema{ diff --git a/images/virtualization-artifact/pkg/controller/cpu/cpu_controller.go b/images/virtualization-artifact/pkg/controller/cpu/cpu_controller.go index c63fec887..2be644f37 100644 --- a/images/virtualization-artifact/pkg/controller/cpu/cpu_controller.go +++ b/images/virtualization-artifact/pkg/controller/cpu/cpu_controller.go @@ -8,8 +8,8 @@ import ( "sigs.k8s.io/controller-runtime/pkg/controller" "sigs.k8s.io/controller-runtime/pkg/manager" - "github.com/deckhouse/virtualization-controller/api/core/v1alpha2" "github.com/deckhouse/virtualization-controller/pkg/sdk/framework/two_phase_reconciler" + "github.com/deckhouse/virtualization/api/core/v1alpha2" ) const VMCPUControllerName = "vmcpu-controller" diff --git a/images/virtualization-artifact/pkg/controller/cpu/cpu_reconciler.go b/images/virtualization-artifact/pkg/controller/cpu/cpu_reconciler.go index 446d1663a..80c10c530 100644 --- a/images/virtualization-artifact/pkg/controller/cpu/cpu_reconciler.go +++ b/images/virtualization-artifact/pkg/controller/cpu/cpu_reconciler.go @@ -18,10 +18,10 @@ import ( "sigs.k8s.io/controller-runtime/pkg/reconcile" "sigs.k8s.io/controller-runtime/pkg/source" - virtv2 "github.com/deckhouse/virtualization-controller/api/core/v1alpha2" "github.com/deckhouse/virtualization-controller/pkg/controller/common" "github.com/deckhouse/virtualization-controller/pkg/controller/vmattachee" "github.com/deckhouse/virtualization-controller/pkg/sdk/framework/two_phase_reconciler" + virtv2 "github.com/deckhouse/virtualization/api/core/v1alpha2" ) type VMCPUReconciler struct { diff --git a/images/virtualization-artifact/pkg/controller/cpu/cpu_reconciler_state.go b/images/virtualization-artifact/pkg/controller/cpu/cpu_reconciler_state.go index b2dffaa17..4aeec6a1e 100644 --- a/images/virtualization-artifact/pkg/controller/cpu/cpu_reconciler_state.go +++ b/images/virtualization-artifact/pkg/controller/cpu/cpu_reconciler_state.go @@ -11,9 +11,9 @@ import ( "sigs.k8s.io/controller-runtime/pkg/client" "sigs.k8s.io/controller-runtime/pkg/reconcile" - virtv2 "github.com/deckhouse/virtualization-controller/api/core/v1alpha2" "github.com/deckhouse/virtualization-controller/pkg/controller/vmattachee" "github.com/deckhouse/virtualization-controller/pkg/sdk/framework/helper" + virtv2 "github.com/deckhouse/virtualization/api/core/v1alpha2" ) type VMCPUReconcilerState struct { diff --git a/images/virtualization-artifact/pkg/controller/cpu/cpu_webhook.go b/images/virtualization-artifact/pkg/controller/cpu/cpu_webhook.go index 63856e4d9..67defd73d 100644 --- a/images/virtualization-artifact/pkg/controller/cpu/cpu_webhook.go +++ b/images/virtualization-artifact/pkg/controller/cpu/cpu_webhook.go @@ -10,7 +10,7 @@ import ( "k8s.io/utils/strings/slices" "sigs.k8s.io/controller-runtime/pkg/webhook/admission" - "github.com/deckhouse/virtualization-controller/api/core/v1alpha2" + "github.com/deckhouse/virtualization/api/core/v1alpha2" ) func NewVMCPUValidator(log logr.Logger) *VMCPUValidator {