/
conversion.go
29 lines (25 loc) · 1.04 KB
/
conversion.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
package v1beta1
import (
"github.com/luxas/sample-config/pkg/apis/config"
"k8s.io/apimachinery/pkg/conversion"
)
func Convert_v1beta1_MyAppConfiguration_To_config_MyAppConfiguration(in *MyAppConfiguration, out *config.MyAppConfiguration, s conversion.Scope) error {
if err := autoConvert_v1beta1_MyAppConfiguration_To_config_MyAppConfiguration(in, out, s); err != nil {
return err
}
out.Server.Address = in.ServerAddress
out.Server.Port = in.HTTPSPort
out.Server.TLSCertFile = in.TLSConfig.TLSCertFile
out.Server.TLSPrivateKeyFile = in.TLSConfig.TLSPrivateKeyFile
return nil
}
func Convert_config_MyAppConfiguration_To_v1beta1_MyAppConfiguration(in *config.MyAppConfiguration, out *MyAppConfiguration, s conversion.Scope) error {
if err := autoConvert_config_MyAppConfiguration_To_v1beta1_MyAppConfiguration(in, out, s); err != nil {
return err
}
out.ServerAddress = in.Server.Address
out.HTTPSPort = in.Server.Port
out.TLSConfig.TLSCertFile = in.Server.TLSCertFile
out.TLSConfig.TLSPrivateKeyFile = in.Server.TLSPrivateKeyFile
return nil
}