@@ -16,6 +16,7 @@ package cfutil
1616
1717import (
1818 v1alpha1 "github.com/google/kf/v2/pkg/apis/kf/v1alpha1"
19+ "k8s.io/apimachinery/pkg/util/sets"
1920)
2021
2122const (
@@ -30,9 +31,9 @@ func CreateVcapApplication(app *v1alpha1.App) map[string]interface{} {
3031 // You can find a list of values here:
3132 // https://docs.run.pivotal.io/devguide/deploy-apps/environment-variable.html
3233
33- urls := [] string {}
34+ urls := sets . NewString ()
3435 for _ , r := range app .Status .Routes {
35- urls = append ( urls , r .URL )
36+ urls . Insert ( r .URL )
3637 }
3738
3839 values := map [string ]interface {}{
@@ -41,7 +42,7 @@ func CreateVcapApplication(app *v1alpha1.App) map[string]interface{} {
4142 // application_name The name assigned to the app when it was pushed.
4243 "application_name" : app .Name ,
4344 // application_uris The URIs assigned to the app.
44- "application_uris" : urls ,
45+ "application_uris" : urls . List () ,
4546 // name Identical to application_name.
4647 "name" : app .Name ,
4748 // process_id The UID identifying the process. Only present in running app containers.
@@ -51,7 +52,7 @@ func CreateVcapApplication(app *v1alpha1.App) map[string]interface{} {
5152 // space_name Human-readable name of the space where the app is deployed.
5253 "space_name" : app .Namespace ,
5354 // uris Identical to application_uris.
54- "uris" : urls ,
55+ "uris" : urls . List () ,
5556 }
5657
5758 return values
0 commit comments