diff --git a/pkg/devfile/adapters/kubernetes/component/adapter.go b/pkg/devfile/adapters/kubernetes/component/adapter.go index 38c4539da61..fb6809644ae 100644 --- a/pkg/devfile/adapters/kubernetes/component/adapter.go +++ b/pkg/devfile/adapters/kubernetes/component/adapter.go @@ -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") } @@ -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") diff --git a/pkg/service/service.go b/pkg/service/service.go index e5b9bd2f3e6..3e19c33a2d9 100644 --- a/pkg/service/service.go +++ b/pkg/service/service.go @@ -930,6 +930,7 @@ func PushServiceFromKubernetesInlineComponents(client *kclient.Client, k8sCompon if err != nil { return } + deleted = append(deleted, key) } return }