Add type of service (#1385)

This commit is contained in:
Asim Aslam 2020-03-20 12:48:12 +00:00 committed by GitHub
parent e49be1da42
commit d2f153d795
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 0 deletions

View File

@ -84,6 +84,8 @@ func (k *kubernetes) getService(labels map[string]string) ([]*service, error) {
address := kservice.Spec.ClusterIP
port := kservice.Spec.Ports[0]
srv.Service.Metadata["address"] = fmt.Sprintf("%s:%d", address, port.Port)
// set the type of service
srv.Service.Metadata["type"] = kservice.Metadata.Labels["micro"]
// copy annotations metadata into service metadata
for k, v := range kservice.Metadata.Annotations {

View File

@ -125,6 +125,8 @@ func (s *service) Start() error {
s.running = true
// set status
s.Metadata["status"] = "running"
// set started
s.Metadata["started"] = time.Now().Format(time.RFC3339)
if s.output != nil {
s.streamOutput()