Don't use pointers for session affinity

This commit is contained in:
Tim Hockin
2014-12-29 14:39:09 -08:00
parent 7dec65f535
commit ca27fb259c
7 changed files with 15 additions and 17 deletions

View File

@@ -134,9 +134,10 @@ func (rs *REST) Create(ctx api.Context, obj runtime.Object) (<-chan apiserver.RE
if err != nil {
return nil, err
}
var affinityType api.AffinityType = api.AffinityTypeNone
if service.Spec.SessionAffinity != nil {
affinityType = *service.Spec.SessionAffinity
// TODO: We should be able to rely on valid input, and not do defaulting here.
var affinityType api.AffinityType = service.Spec.SessionAffinity
if affinityType == "" {
affinityType = api.AffinityTypeNone
}
if len(service.Spec.PublicIPs) > 0 {
for _, publicIP := range service.Spec.PublicIPs {