-
Notifications
You must be signed in to change notification settings - Fork 772
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Generic service type handler for kompose #277
Conversation
@cdrage I would like your view on the test function being modified and moved to new place, with less checks? Jump to https://github.com/kubernetes-incubator/kompose/pull/277/files#diff-8aba3d6a079386eaab47ed176d32d43cR23 |
@@ -207,6 +207,15 @@ func (c *Compose) LoadFile(file string) kobject.KomposeObject { | |||
} | |||
} | |||
|
|||
// canonical custom label handler |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
mind adding another comment as to what this actually does, other than "custom label handler"? example?
switch strings.ToLower(ServiceType) { | ||
case "nodeport": | ||
return string(api.ServiceTypeNodePort) | ||
case "", "clusterip": |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this should be first since it has "". (clusterip, nodeport then loadbalancer)
case "loadbalancer": | ||
return string(api.ServiceTypeLoadBalancer) | ||
default: | ||
logrus.Fatalf("Unknown value '%s', supported values are 'NodePort, ClusterIP and LoadBalancer' ", ServiceType) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
or, not and. Should be: NodePort, ClusterIP or LoadBalancer
t.Errorf("Expected %q, got %q", tt.serviceType, result) | ||
} | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
} | ||
} | ||
|
||
svc.Spec.Type = api.ServiceType(service.ServiceType) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
Moved label handling code from Transformer to loader, to make it generic to handle creating service types. Added new attribute to ServiceConfig which gets populated in loader. Fixes kubernetes#273
e12bf09
to
bb9e4fb
Compare
@cdrage addressed all your concerns! |
@kadel thanks 👍 |
Moved label handling code from Transformer to loader, to make it generic to handle creating service types.
Added new attribute to ServiceConfig which gets populated in loader.
Fixes #273