mirror of
https://github.com/rancher/types.git
synced 2025-08-30 19:32:18 +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:
parent
b8afaefbb6
commit
e339722678
@ -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",
|
||||
|
@ -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
|
||||
}
|
Loading…
Reference in New Issue
Block a user