mirror of
https://github.com/rancher/types.git
synced 2025-07-05 09:46:13 +00:00
Set clusterIP field in all cases
This commit is contained in:
parent
fdeee128f6
commit
7b23a3c49c
@ -2,6 +2,7 @@ package schema
|
||||
|
||||
import (
|
||||
"github.com/rancher/norman/types"
|
||||
"github.com/rancher/norman/types/convert"
|
||||
)
|
||||
|
||||
type ServiceSpecMapper struct {
|
||||
@ -15,8 +16,13 @@ func (e ServiceSpecMapper) ToInternal(data map[string]interface{}) {
|
||||
return
|
||||
}
|
||||
|
||||
data["clusterIp"] = "None"
|
||||
data["type"] = "ClusterIP"
|
||||
if convert.IsEmpty(data["hostname"]) {
|
||||
data["type"] = "ClusterIP"
|
||||
data["clusterIp"] = "None"
|
||||
} else {
|
||||
data["type"] = "ExternalName"
|
||||
data["clusterIp"] = ""
|
||||
}
|
||||
}
|
||||
|
||||
func (e ServiceSpecMapper) ModifySchema(schema *types.Schema, schemas *types.Schemas) error {
|
||||
|
Loading…
Reference in New Issue
Block a user