1
0
mirror of https://github.com/rancher/types.git synced 2025-08-31 12:48:45 +00:00

Remove setting clusterIP type for dnsRecord from Schema

Related issue https://github.com/rancher/rancher/issues/14650
This logic is moved to store for now.
This commit is contained in:
orangedeng
2018-09-06 15:14:34 +08:00
committed by Alena Prokharchyk
parent b8afaefbb6
commit e339722678
2 changed files with 0 additions and 33 deletions

View File

@@ -584,7 +584,6 @@ func addServiceOrDNSRecord(dns bool) types.SchemasInitFunc {
schemas = schemas.
AddMapperForType(&Version, v1.ServiceSpec{},
&m.Move{From: "externalName", To: "hostname"},
&ServiceSpecMapper{},
&m.Move{From: "type", To: "serviceKind"},
&m.SetValue{
Field: "clusterIP",

View File

@@ -1,32 +0,0 @@
package schema
import (
"github.com/rancher/norman/types"
"github.com/rancher/norman/types/convert"
)
type ServiceSpecMapper struct {
}
func (e ServiceSpecMapper) FromInternal(data map[string]interface{}) {
}
func (e ServiceSpecMapper) ToInternal(data map[string]interface{}) error {
if data == nil {
return nil
}
if convert.IsAPIObjectEmpty(data["hostname"]) {
data["type"] = "ClusterIP"
data["clusterIP"] = "None"
} else {
data["type"] = "ExternalName"
data["clusterIP"] = ""
}
return nil
}
func (e ServiceSpecMapper) ModifySchema(schema *types.Schema, schemas *types.Schemas) error {
return nil
}