Skip to content
This repository has been archived by the owner on Oct 12, 2023. It is now read-only.

Commit

Permalink
feat: add Virtual Machine, VMSS and NetworkInterfaces (#115)
Browse files Browse the repository at this point in the history
* feat: add Virtual Machine, VMSS and NetworkInterfaces

* feat: add ability to transform nested slices
  • Loading branch information
devigned committed Jun 4, 2020
1 parent 52c1c1f commit 14105b1
Show file tree
Hide file tree
Showing 63 changed files with 11,927 additions and 515 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ generate: manifests $(CONTROLLER_GEN) $(CONVERSION_GEN) ## Generate code
$(CONTROLLER_GEN) object:headerFile=./hack/boilerplate.go.txt paths="./..."

$(CONVERSION_GEN) \
--input-dirs=./apis/microsoft.network/v20191101,./apis/microsoft.resources/v20191001,./apis/microsoft.resources/v20150101 \
--input-dirs=./apis/microsoft.network/v20191101,./apis/microsoft.resources/v20191001,./apis/microsoft.compute/v20191201,./apis/microsoft.resources/v20150101 \
--output-file-base=zz_generated.conversion \
--output-base=$(ROOT_DIR) \
--go-header-file=./hack/boilerplate.go.txt
Expand Down
18 changes: 18 additions & 0 deletions PROJECT
Original file line number Diff line number Diff line change
Expand Up @@ -89,4 +89,22 @@ resources:
- group: microsoft.network
kind: Subnet
version: v20191101
- group: microsoft.compute
kind: VirtualMachine
version: v20191201
- group: microsoft.compute
kind: VirtualMachine
version: v1
- group: microsoft.compute
kind: VirtualMachineScaleSet
version: v1
- group: microsoft.compute
kind: VirtualMachineScaleSet
version: v20191201
- group: microsoft.network
kind: NetworkInterface
version: v1
- group: microsoft.network
kind: NetworkInterface
version: v20191101
version: "2"
9 changes: 9 additions & 0 deletions apis/microsoft.compute/v1/conversion.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
/*
Copyright (c) Microsoft Corporation.
Licensed under the MIT license.
*/

package v1

func (*VirtualMachine) Hub() {}
func (*VirtualMachineScaleSet) Hub() {}
6 changes: 6 additions & 0 deletions apis/microsoft.compute/v1/doc.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
/*
Copyright (c) Microsoft Corporation.
Licensed under the MIT license.
*/

package v1
25 changes: 25 additions & 0 deletions apis/microsoft.compute/v1/groupversion_info.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
/*
Copyright (c) Microsoft Corporation.
Licensed under the MIT license.
*/

// Package v1 contains API Schema definitions for the microsoft.compute v1 API group
// +kubebuilder:object:generate=true
// +groupName=microsoft.compute.infra.azure.com
package v1

import (
"k8s.io/apimachinery/pkg/runtime/schema"
"sigs.k8s.io/controller-runtime/pkg/scheme"
)

var (
// GroupVersion is group version used to register these objects
GroupVersion = schema.GroupVersion{Group: "microsoft.compute.infra.azure.com", Version: "v1"}

// SchemeBuilder is used to add go types to the GroupVersionKind scheme
SchemeBuilder = &scheme.Builder{GroupVersion: GroupVersion}

// AddToScheme adds the types in this group-version to the given scheme.
AddToScheme = SchemeBuilder.AddToScheme
)
26 changes: 26 additions & 0 deletions apis/microsoft.compute/v1/resources.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
/*
Copyright (c) Microsoft Corporation.
Licensed under the MIT license.
*/

package v1

import (
azcorev1 "github.com/Azure/k8s-infra/apis/core/v1"
)

func (vm *VirtualMachine) GetResourceGroupObjectRef() *azcorev1.KnownTypeReference {
return vm.Spec.ResourceGroupRef
}

func (vmss *VirtualMachineScaleSet) GetResourceGroupObjectRef() *azcorev1.KnownTypeReference {
return vmss.Spec.ResourceGroupRef
}

func (*VirtualMachine) ResourceType() string {
return "Microsoft.Compute/virtualMachines"
}

func (*VirtualMachineScaleSet) ResourceType() string {
return "Microsoft.Compute/virtualMachineScaleSets"
}
260 changes: 260 additions & 0 deletions apis/microsoft.compute/v1/virtualmachine_types.go

Large diffs are not rendered by default.

373 changes: 373 additions & 0 deletions apis/microsoft.compute/v1/virtualmachinescaleset_types.go

Large diffs are not rendered by default.

0 comments on commit 14105b1

Please sign in to comment.