Skip to content

Commit

Permalink
v1alpha3
Browse files Browse the repository at this point in the history
This patch introduces schema version v1alpha3. This patch
only includes plumbing changes for the API definitions, which,
at this time, are a one-for-one copy of v1alpha2. This change
allows developers to make updates to the API on main without
impacting v1alpha2, which is locked.
  • Loading branch information
akutz committed Apr 15, 2024
1 parent 7a2dd16 commit a029ed1
Show file tree
Hide file tree
Showing 388 changed files with 16,683 additions and 2,904 deletions.
4 changes: 4 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@ linters-settings:
- pkg: k8s.io/api/core/v1
alias: corev1
- pkg: github.com/vmware-tanzu/vm-operator/api/v1alpha1
alias: vmopv1a1
- pkg: github.com/vmware-tanzu/vm-operator/api/v1alpha2
alias: vmopv1a2
- pkg: github.com/vmware-tanzu/vm-operator/api/v1alpha3
alias: vmopv1
- pkg: "github.com/vmware-tanzu/vm-operator/pkg/config"
alias: pkgconfig
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -328,7 +328,7 @@ endif

generate-go-conversions:
$(CONVERSION_GEN) \
--input-dirs=./api/v1alpha1 \
--input-dirs='./api/v1alpha1,./api/v1alpha2' \
--output-file-base=zz_generated.conversion \
--go-header-file=./hack/boilerplate/boilerplate.generatego.txt

Expand Down
10 changes: 9 additions & 1 deletion api/v1alpha1/conversion_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import (
"github.com/vmware-tanzu/vm-operator/pkg/constants/testlabels"

"github.com/vmware-tanzu/vm-operator/api/v1alpha1"
nextver "github.com/vmware-tanzu/vm-operator/api/v1alpha2"
nextver "github.com/vmware-tanzu/vm-operator/api/v1alpha3"
)

var _ = Describe("FuzzyConversion", Label(testlabels.API, testlabels.Fuzz), func() {
Expand Down Expand Up @@ -310,6 +310,14 @@ func overrideVirtualMachineImageFieldsFuncs(codecs runtimeserializer.CodecFactor
// TODO: Need to save serialized object to support lossless conversions.
imageStatus.Capabilities = nil
},
func(imageSpec *nextver.VirtualMachineImageSpec, c fuzz.Continue) {
c.Fuzz(imageSpec)
if pr := imageSpec.ProviderRef; pr != nil {
if pr.APIVersion == "" && pr.Kind == "" && pr.Name == "" {
imageSpec.ProviderRef = nil
}
}
},
}
}

Expand Down
4 changes: 2 additions & 2 deletions api/v1alpha1/doc.go
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
// Copyright (c) 2020 VMware, Inc. All Rights Reserved.
// Copyright (c) 2020-2024 VMware, Inc. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0

// Package v1alpha1 contains the VM Operator v1alpha1 APIs.
//
// +k8s:openapi-gen=true
// +kubebuilder:object:generate=true
// +groupName=vmoperator.vmware.com
// +k8s:conversion-gen=github.com/vmware-tanzu/vm-operator/api/v1alpha2
// +k8s:conversion-gen=github.com/vmware-tanzu/vm-operator/api/v1alpha3
package v1alpha1
Loading

0 comments on commit a029ed1

Please sign in to comment.