-
Notifications
You must be signed in to change notification settings - Fork 48
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #487 from akutz/fix/issue-485
- Loading branch information
Showing
34 changed files
with
1,926 additions
and
169 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
// Copyright (c) 2024 VMware, Inc. All Rights Reserved. | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
package v1alpha2_test | ||
|
||
func ptrOf[T any](v T) *T { | ||
return &v | ||
} |
33 changes: 33 additions & 0 deletions
33
api/v1alpha2/sysprep/conversion/v1alpha2/sysprep_conversion.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
// Copyright (c) 2024 VMware, Inc. All Rights Reserved. | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
package v1alpha2 | ||
|
||
import ( | ||
"unsafe" | ||
|
||
apiconversion "k8s.io/apimachinery/pkg/conversion" | ||
|
||
vmopv1a2sysprep "github.com/vmware-tanzu/vm-operator/api/v1alpha2/sysprep" | ||
vmopv1sysprep "github.com/vmware-tanzu/vm-operator/api/v1alpha3/sysprep" | ||
) | ||
|
||
// Please see https://github.com/kubernetes/code-generator/issues/172 for why | ||
// this function exists in this directory structure. | ||
func Convert_sysprep_Sysprep_To_sysprep_Sysprep( | ||
in *vmopv1a2sysprep.Sysprep, out *vmopv1sysprep.Sysprep, s apiconversion.Scope) error { | ||
|
||
out.GUIRunOnce = (*vmopv1sysprep.GUIRunOnce)(unsafe.Pointer(&in.GUIRunOnce)) | ||
out.GUIUnattended = (*vmopv1sysprep.GUIUnattended)(unsafe.Pointer(in.GUIUnattended)) | ||
out.LicenseFilePrintData = (*vmopv1sysprep.LicenseFilePrintData)(unsafe.Pointer(in.LicenseFilePrintData)) | ||
out.UserData = (*vmopv1sysprep.UserData)(unsafe.Pointer(in.UserData)) | ||
if id := in.Identification; id != nil { | ||
out.Identification = &vmopv1sysprep.Identification{ | ||
DomainAdmin: id.DomainAdmin, | ||
DomainAdminPassword: (*vmopv1sysprep.DomainPasswordSecretKeySelector)(unsafe.Pointer(id.DomainAdminPassword)), | ||
JoinWorkgroup: id.JoinWorkgroup, | ||
} | ||
} | ||
|
||
return nil | ||
} |
33 changes: 33 additions & 0 deletions
33
api/v1alpha2/sysprep/conversion/v1alpha3/sysprep_conversion.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
// Copyright (c) 2024 VMware, Inc. All Rights Reserved. | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
package v1alpha3 | ||
|
||
import ( | ||
"unsafe" | ||
|
||
apiconversion "k8s.io/apimachinery/pkg/conversion" | ||
|
||
vmopv1a2sysprep "github.com/vmware-tanzu/vm-operator/api/v1alpha2/sysprep" | ||
vmopv1sysprep "github.com/vmware-tanzu/vm-operator/api/v1alpha3/sysprep" | ||
) | ||
|
||
// Please see https://github.com/kubernetes/code-generator/issues/172 for why | ||
// this function exists in this directory structure. | ||
func Convert_sysprep_Sysprep_To_sysprep_Sysprep( | ||
in *vmopv1sysprep.Sysprep, out *vmopv1a2sysprep.Sysprep, s apiconversion.Scope) error { | ||
|
||
out.GUIRunOnce = *(*vmopv1a2sysprep.GUIRunOnce)(unsafe.Pointer(in.GUIRunOnce)) | ||
out.GUIUnattended = (*vmopv1a2sysprep.GUIUnattended)(unsafe.Pointer(in.GUIUnattended)) | ||
out.LicenseFilePrintData = (*vmopv1a2sysprep.LicenseFilePrintData)(unsafe.Pointer(in.LicenseFilePrintData)) | ||
out.UserData = (*vmopv1a2sysprep.UserData)(unsafe.Pointer(in.UserData)) | ||
if id := in.Identification; id != nil { | ||
out.Identification = &vmopv1a2sysprep.Identification{ | ||
DomainAdmin: id.DomainAdmin, | ||
DomainAdminPassword: (*vmopv1a2sysprep.DomainPasswordSecretKeySelector)(unsafe.Pointer(id.DomainAdminPassword)), | ||
JoinWorkgroup: id.JoinWorkgroup, | ||
} | ||
} | ||
|
||
return nil | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.