mirror of
https://github.com/rancher/types.git
synced 2025-06-25 21:21:32 +00:00
Merge pull request #263 from alena1108/feb28
Service type to ExternalName when hostname is set
This commit is contained in:
commit
9eba3c1e08
@ -2,6 +2,7 @@ package schema
|
||||
|
||||
import (
|
||||
"github.com/rancher/norman/types"
|
||||
"github.com/rancher/norman/types/convert"
|
||||
)
|
||||
|
||||
type ServiceSpecMapper struct {
|
||||
@ -14,9 +15,12 @@ func (e ServiceSpecMapper) ToInternal(data map[string]interface{}) {
|
||||
if data == nil {
|
||||
return
|
||||
}
|
||||
|
||||
data["clusterIp"] = "None"
|
||||
data["type"] = "ClusterIP"
|
||||
if convert.IsEmpty(data["hostname"]) {
|
||||
data["type"] = "ClusterIP"
|
||||
data["clusterIp"] = "None"
|
||||
} else {
|
||||
data["type"] = "ExternalName"
|
||||
}
|
||||
}
|
||||
|
||||
func (e ServiceSpecMapper) ModifySchema(schema *types.Schema, schemas *types.Schemas) error {
|
||||
|
Loading…
Reference in New Issue
Block a user