Skip to content

Commit

Permalink
Add type of service (micro#1385)
Browse files Browse the repository at this point in the history
  • Loading branch information
asim committed Mar 20, 2020
1 parent e49be1d commit d2f153d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions runtime/kubernetes/kubernetes.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
2 changes: 2 additions & 0 deletions runtime/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit d2f153d

Please sign in to comment.