Skip to content

Commit

Permalink
Merge branch 'main' into multiple-nics
Browse files Browse the repository at this point in the history
  • Loading branch information
brianlieberman authored Jun 22, 2022
2 parents 5a45826 + 70a94ec commit 2a6e944
Show file tree
Hide file tree
Showing 105 changed files with 7,825 additions and 1,198 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# syntax=docker/dockerfile:1.1-experimental
# syntax=docker/dockerfile:1.4

# Copyright 2019 The Kubernetes Authors.
#
Expand Down
6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ KPROMO_VER := v3.3.0-beta.3
KPROMO_BIN := kpromo
KPROMO := $(TOOLS_BIN_DIR)/$(KPROMO_BIN)-$(KPROMO_VER)

GO_APIDIFF_VER := v0.1.0
GO_APIDIFF_VER := v0.4.0
GO_APIDIFF_BIN := go-apidiff
GO_APIDIFF := $(TOOLS_BIN_DIR)/$(GO_APIDIFF_BIN)

Expand All @@ -122,7 +122,7 @@ ETCD=$(TOOLS_BIN_DIR)/etcd
# Define Docker related variables. Releases should modify and double check these vars.
REGISTRY ?= gcr.io/$(shell gcloud config get-value project)
STAGING_REGISTRY := gcr.io/k8s-staging-cluster-api-azure
PROD_REGISTRY := us.gcr.io/k8s-artifacts-prod/cluster-api-azure
PROD_REGISTRY := registry.k8s.io/cluster-api-azure
IMAGE_NAME ?= cluster-api-azure-controller
CONTROLLER_IMG ?= $(REGISTRY)/$(IMAGE_NAME)
TAG ?= dev
Expand Down Expand Up @@ -333,7 +333,7 @@ delete-workload-cluster: ## Deletes the example workload Kubernetes cluster.

.PHONY: docker-pull-prerequisites
docker-pull-prerequisites: ## Pull prerequisites for building controller-manager.
docker pull docker/dockerfile:1.1-experimental
docker pull docker/dockerfile:1.4
docker pull docker.io/library/golang:1.17
docker pull gcr.io/distroless/static:latest

Expand Down
1 change: 1 addition & 0 deletions OWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,4 @@ emeritus_approvers:
- justaugustus
- nader-ziada
- ncdc
- shysank
3 changes: 1 addition & 2 deletions OWNERS_ALIASES
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,8 @@ aliases:
- alexeldeib
- CecileRobertMichon
- devigned
- jackfrancis
- mboersma
- shysank
cluster-api-azure-reviewers:
- jackfrancis
- Jont828
- jsturtevant
25 changes: 25 additions & 0 deletions api/v1alpha3/azuremachine_conversion.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,13 @@ func (src *AzureMachine) ConvertTo(dstRaw conversion.Hub) error {
dst.Spec.Image.SharedGallery.SKU = restored.Spec.Image.SharedGallery.SKU
}


if restored.Spec.NetworkInterfaces != nil {
dst.Spec.NetworkInterfaces = restored.Spec.NetworkInterfaces
}

if dst.Spec.Image != nil && restored.Spec.Image.ComputeGallery != nil {
dst.Spec.Image.ComputeGallery = restored.Spec.Image.ComputeGallery
}

dst.Spec.SubnetName = restored.Spec.SubnetName
Expand Down Expand Up @@ -148,3 +153,23 @@ func Convert_v1beta1_ManagedDiskParameters_To_v1alpha3_ManagedDisk(in *v1beta1.M
out.DiskEncryptionSet = (*DiskEncryptionSetParameters)(in.DiskEncryptionSet)
return nil
}

func Convert_v1beta1_AzureMarketplaceImage_To_v1alpha3_AzureMarketplaceImage(in *v1beta1.AzureMarketplaceImage, out *AzureMarketplaceImage, s apiconversion.Scope) error {
out.Offer = in.ImagePlan.Offer
out.Publisher = in.ImagePlan.Publisher
out.SKU = in.ImagePlan.SKU

return autoConvert_v1beta1_AzureMarketplaceImage_To_v1alpha3_AzureMarketplaceImage(in, out, s)
}

func Convert_v1alpha3_AzureMarketplaceImage_To_v1beta1_AzureMarketplaceImage(in *AzureMarketplaceImage, out *v1beta1.AzureMarketplaceImage, s apiconversion.Scope) error {
out.ImagePlan.Offer = in.Offer
out.ImagePlan.Publisher = in.Publisher
out.ImagePlan.SKU = in.SKU

return autoConvert_v1alpha3_AzureMarketplaceImage_To_v1beta1_AzureMarketplaceImage(in, out, s)
}

func Convert_v1beta1_Image_To_v1alpha3_Image(in *v1beta1.Image, out *Image, s apiconversion.Scope) error {
return autoConvert_v1beta1_Image_To_v1alpha3_Image(in, out, s)
}
3 changes: 3 additions & 0 deletions api/v1alpha3/azuremachinetemplate_conversion.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,9 @@ func (src *AzureMachineTemplate) ConvertTo(dstRaw conversion.Hub) error {

if restored.Spec.Template.Spec.NetworkInterfaces != nil {
dst.Spec.Template.Spec.NetworkInterfaces = restored.Spec.Template.Spec.NetworkInterfaces
}
if dst.Spec.Template.Spec.Image != nil && restored.Spec.Template.Spec.Image.ComputeGallery != nil {
dst.Spec.Template.Spec.Image.ComputeGallery = restored.Spec.Template.Spec.Image.ComputeGallery
}

dst.Spec.Template.Spec.SubnetName = restored.Spec.Template.Spec.SubnetName
Expand Down
76 changes: 38 additions & 38 deletions api/v1alpha3/zz_generated.conversion.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

38 changes: 33 additions & 5 deletions api/v1alpha4/azuremachine_conversion.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ limitations under the License.
package v1alpha4

import (
machineryConversion "k8s.io/apimachinery/pkg/conversion"
apiconversion "k8s.io/apimachinery/pkg/conversion"
"sigs.k8s.io/cluster-api-provider-azure/api/v1beta1"
utilconversion "sigs.k8s.io/cluster-api/util/conversion"
"sigs.k8s.io/controller-runtime/pkg/conversion"
Expand All @@ -26,19 +26,24 @@ import (
// ConvertTo converts this AzureMachine to the Hub version (v1beta1).
func (src *AzureMachine) ConvertTo(dstRaw conversion.Hub) error {
dst := dstRaw.(*v1beta1.AzureMachine)

if err := autoConvert_v1alpha4_AzureMachine_To_v1beta1_AzureMachine(src, dst, nil); err != nil {
if err := Convert_v1alpha4_AzureMachine_To_v1beta1_AzureMachine(src, dst, nil); err != nil {
return err
}

// Manually restore data from annotations
restored := &v1beta1.AzureMachine{}
if ok, err := utilconversion.UnmarshalData(src, restored); err != nil || !ok {
return err
}


if restored.Spec.NetworkInterfaces != nil {
dst.Spec.NetworkInterfaces = restored.Spec.NetworkInterfaces
}

if restored.Spec.Image != nil && restored.Spec.Image.ComputeGallery != nil {
dst.Spec.Image.ComputeGallery = restored.Spec.Image.ComputeGallery
}
return nil
}

Expand All @@ -48,10 +53,13 @@ func (dst *AzureMachine) ConvertFrom(srcRaw conversion.Hub) error {
if err := Convert_v1beta1_AzureMachine_To_v1alpha4_AzureMachine(src, dst, nil); err != nil {
return err
}

if err := utilconversion.MarshalData(src, dst); err != nil {
return err
}
return nil

// Preserve Hub data on down-conversion.
return utilconversion.MarshalData(src, dst)
}

// ConvertTo converts this AzureMachineList to the Hub version (v1beta1).
Expand All @@ -66,6 +74,26 @@ func (dst *AzureMachineList) ConvertFrom(srcRaw conversion.Hub) error {
return Convert_v1beta1_AzureMachineList_To_v1alpha4_AzureMachineList(src, dst, nil)
}

func Convert_v1beta1_AzureMachineSpec_To_v1alpha4_AzureMachineSpec(in *v1beta1.AzureMachineSpec, out *AzureMachineSpec, s machineryConversion.Scope) error {
func Convert_v1beta1_AzureMachineSpec_To_v1alpha4_AzureMachineSpec(in *v1beta1.AzureMachineSpec, out *AzureMachineSpec, s apiconversion.Scope) error {
return autoConvert_v1beta1_AzureMachineSpec_To_v1alpha4_AzureMachineSpec(in, out, s)
}

func Convert_v1beta1_AzureMarketplaceImage_To_v1alpha4_AzureMarketplaceImage(in *v1beta1.AzureMarketplaceImage, out *AzureMarketplaceImage, s apiconversion.Scope) error {
out.Offer = in.ImagePlan.Offer
out.Publisher = in.ImagePlan.Publisher
out.SKU = in.ImagePlan.SKU

return autoConvert_v1beta1_AzureMarketplaceImage_To_v1alpha4_AzureMarketplaceImage(in, out, s)
}

func Convert_v1alpha4_AzureMarketplaceImage_To_v1beta1_AzureMarketplaceImage(in *AzureMarketplaceImage, out *v1beta1.AzureMarketplaceImage, s apiconversion.Scope) error {
out.ImagePlan.Offer = in.Offer
out.ImagePlan.Publisher = in.Publisher
out.ImagePlan.SKU = in.SKU

return autoConvert_v1alpha4_AzureMarketplaceImage_To_v1beta1_AzureMarketplaceImage(in, out, s)
}

func Convert_v1beta1_Image_To_v1alpha4_Image(in *v1beta1.Image, out *Image, s apiconversion.Scope) error {
return autoConvert_v1beta1_Image_To_v1alpha4_Image(in, out, s)
}
6 changes: 6 additions & 0 deletions api/v1alpha4/azuremachinetemplate_conversion.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,15 @@ func (src *AzureMachineTemplate) ConvertTo(dstRaw conversion.Hub) error {
return err
}


if restored.Spec.Template.Spec.NetworkInterfaces != nil {
dst.Spec.Template.Spec.NetworkInterfaces = restored.Spec.Template.Spec.NetworkInterfaces
}

if dst.Spec.Template.Spec.Image != nil && restored.Spec.Template.Spec.Image.ComputeGallery != nil {
dst.Spec.Template.Spec.Image.ComputeGallery = restored.Spec.Template.Spec.Image.ComputeGallery
}

dst.Spec.Template.ObjectMeta = restored.Spec.Template.ObjectMeta

return nil
Expand Down
Loading

0 comments on commit 2a6e944

Please sign in to comment.