Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
feloy committed Jun 4, 2021
1 parent dff6f1a commit 13be133
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
8 changes: 7 additions & 1 deletion pkg/devfile/adapters/kubernetes/component/adapter.go
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ func (a Adapter) Push(parameters common.PushParameters) (err error) {
}
labels := componentlabels.GetLabels(a.ComponentName, a.AppName, true)
// create the Kubernetes objects from the manifest and delete the ones not in the devfile
createdServices, _, err := service.PushServiceFromKubernetesInlineComponents(a.Client.GetKubeClient(), k8sComponents, labels)
createdServices, deletedServices, err := service.PushServiceFromKubernetesInlineComponents(a.Client.GetKubeClient(), k8sComponents, labels)
if err != nil {
return errors.Wrap(err, "failed to create service(s) associated with the component")
}
Expand All @@ -195,6 +195,12 @@ func (a Adapter) Push(parameters common.PushParameters) (err error) {
log.Infof("Created services %q on the cluster; refer %q to know how to link them to the component", strings.Join(createdServices, ", "), "odo link -h")
}

if len(deletedServices) == 1 {
log.Infof("Deleted service %q from the cluster", deletedServices[0])
} else if len(deletedServices) > 1 {
log.Infof("Deleted services %q from the cluster", strings.Join(deletedServices, ", "))
}

deployment, err := a.Client.GetKubeClient().WaitForDeploymentRollout(a.ComponentName)
if err != nil {
return errors.Wrap(err, "error while waiting for deployment rollout")
Expand Down
1 change: 1 addition & 0 deletions pkg/service/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -930,6 +930,7 @@ func PushServiceFromKubernetesInlineComponents(client *kclient.Client, k8sCompon
if err != nil {
return
}
deleted = append(deleted, key)
}
return
}
Expand Down

0 comments on commit 13be133

Please sign in to comment.