-
Notifications
You must be signed in to change notification settings - Fork 119
/
zz_generated.conversion_spokes.go
executable file
·34 lines (29 loc) · 1.31 KB
/
zz_generated.conversion_spokes.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
// SPDX-FileCopyrightText: 2024 The Crossplane Authors <https://crossplane.io>
//
// SPDX-License-Identifier: Apache-2.0
// Code generated by upjet. DO NOT EDIT.
package v1beta1
import (
ujconversion "github.com/crossplane/upjet/pkg/controller/conversion"
"github.com/crossplane/upjet/pkg/resource"
"github.com/pkg/errors"
"sigs.k8s.io/controller-runtime/pkg/conversion"
)
// ConvertTo converts this DeliveryStream to the hub type.
func (tr *DeliveryStream) ConvertTo(dstRaw conversion.Hub) error {
spokeVersion := tr.GetObjectKind().GroupVersionKind().Version
hubVersion := dstRaw.GetObjectKind().GroupVersionKind().Version
if err := ujconversion.RoundTrip(dstRaw.(resource.Terraformed), tr); err != nil {
return errors.Wrapf(err, "cannot convert from the spoke version %q to the hub version %q", spokeVersion, hubVersion)
}
return nil
}
// ConvertFrom converts from the hub type to the DeliveryStream type.
func (tr *DeliveryStream) ConvertFrom(srcRaw conversion.Hub) error {
spokeVersion := tr.GetObjectKind().GroupVersionKind().Version
hubVersion := srcRaw.GetObjectKind().GroupVersionKind().Version
if err := ujconversion.RoundTrip(tr, srcRaw.(resource.Terraformed)); err != nil {
return errors.Wrapf(err, "cannot convert from the hub version %q to the spoke version %q", hubVersion, spokeVersion)
}
return nil
}