// ListWithDetailedStatus lists all the deployed services and additionally provides a "smart" status for each one of them
// The smart status takes into account how Services are used in odo.
// So when a secret has been created as a result of the created ServiceBinding, we set the appropriate status
// Same for when the secret has been "linked" into the deploymentconfig
ListWithDetailedStatus lists all the deployed services and additionally provides a "smart" status for each one of them
The smart status takes into account how Services are used in odo.
So when a secret has been created as a result of the created ServiceBinding, we set the appropriate status
Same for when the secret has been "linked" into the deploymentconfig
// ListWithDetailedStatus lists all the deployed services and additionally provides a " smart " status for each one of them // The smart status takes into account how Services are used in odo . // So when a secret has been created as a result of the created ServiceBinding we set the appropriate status // Same for when the secret has been " linked " into the deploymentconfig
func ListWithDetailedStatus(client *occlient.Client, applicationName string) ([]ServiceInfo, error) {
	services, err := List(client, applicationName)
	if err != nil {
		return nil, err
	}
	secrets, err := client.ListSecrets("")
	if err != nil {
		return nil, errors.Wrapf(err, "unable to list secrets as part of the bindings check")
	}
	labels := map[string]string{
		applabels.ApplicationLabel: applicationName,
	}
	applicationSelector := util.ConvertLabelsToSelector(labels)
	deploymentConfigs, err := client.GetDeploymentConfigsFromSelector(applicationSelector)
	if err != nil {
		return nil, err
	}
	for i, service := range services {
		for _, secret := range secrets {
			if secret.Name == service.Name {
				services[i].Status = provisionedAndBoundStatus
				updateStatusIfMatchingDeploymentExists(deploymentConfigs, secret.Name, services, i)
				break
			}
		}
	}
	return services, nil
}
func ListWithDetailedStatus ( client * occlient . Client , applicationName string ) ( [ ] ServiceInfo , error ) { services , err := List ( client , applicationName ) if err != nil { return nil , err } secrets , err := client . ListSecrets ( " " ) if err != nil { return nil , errors . Wrapf ( err , " " ) } labels := map [ string ] string { applabels . ApplicationLabel : applicationName , } applicationSelector := util . ConvertLabelsToSelector ( labels ) deploymentConfigs , err := client . GetDeploymentConfigsFromSelector ( applicationSelector ) if err != nil { return nil , err } for i , service := range services { for _ , secret := range secrets { if secret . Name == service . Name { services [ i ] . Status = provisionedAndBoundStatus updateStatusIfMatchingDeploymentExists ( deploymentConfigs , secret . Name , services , i ) break } } } return services , nil }
ListWithDetailedStatus lists all the deployed services and additionally provides a "smart" status for each one of them
The smart status takes into account how Services are used in odo.
ListWithDetailedStatus lists all the deployed services and additionally provides a " smart " status for each one of them The smart status takes into account how Services are used in odo .
// retrieve secrets in order to set status // use the standard selector to retrieve DeploymentConfigs // these are used in order to update the status of a service // because if a DeploymentConfig contains a secret with the service name // then it has been successfully linked // go through each service and see if there is a secret that has been created // if so, update the status of the service // this is the default status when the secret exists // if we find that the dc contains a link to the secret // we update the status to be even more specific