@@ -97,20 +97,40 @@ func printDeployment(deployment composeAPI.Deployment) {
9797 fmt .Printf ("%15s: %s... (Use --fullca for certificate)\n " , "CA Certificate" , deployment .CACertificateBase64 [0 :32 ])
9898 }
9999 }
100- fmt .Printf ("%15s: %s\n " , "Web UI Link" , getLink (deployment .Links .ComposeWebUILink ))
101- fmt .Printf ("%15s: %s\n " , "Health" , deployment .Connection .Health )
102- fmt .Printf ("%15s: %s\n " , "SSH" , deployment .Connection .SSH )
103- fmt .Printf ("%15s: %s\n " , "Admin" , deployment .Connection .Admin )
104- fmt .Printf ("%15s: %s\n " , "SSHAdmin" , deployment .Connection .SSHAdmin )
105- fmt .Printf ("%15s: %s\n " , "CLI Connect" , deployment .Connection .CLI )
106- fmt .Printf ("%15s: %s\n " , "Direct Connect" , deployment .Connection .Direct )
107100
108- // Format the Misc connection as a JSON object
109- miscbuf , err := json .MarshalIndent (deployment .Connection .Misc , "" , " " )
110- if err != nil {
111- fmt .Printf ("%15s: %#v\n " , "Misc Error" , err )
112- } else {
113- fmt .Printf ("%15s: %s\n " , "Misc" , string (miscbuf ))
101+ if showLinks {
102+ fmt .Printf ("%15s: %s\n " , "Web UI Link" , getLink (deployment .Links .ComposeWebUILink ))
103+ fmt .Printf ("%15s: %s\n " , "Alerts Link" , getLink (deployment .Links .AlertsLink ))
104+ fmt .Printf ("%15s: %s\n " , "Cluster Link" , getLink (deployment .Links .ClusterLink ))
105+ fmt .Printf ("%15s: %s\n " , "Scalings Link" , getLink (deployment .Links .ScalingsLink ))
106+ }
107+
108+ if len (deployment .Connection .Health ) > 0 {
109+ fmt .Printf ("%15s: %s\n " , "Health" , deployment .Connection .Health )
110+ }
111+ if len (deployment .Connection .SSH ) > 0 {
112+ fmt .Printf ("%15s: %s\n " , "SSH" , deployment .Connection .SSH )
113+ }
114+ if len (deployment .Connection .Admin ) > 0 {
115+ fmt .Printf ("%15s: %s\n " , "Admin" , deployment .Connection .Admin )
116+ }
117+ if len (deployment .Connection .SSHAdmin ) > 0 {
118+ fmt .Printf ("%15s: %s\n " , "SSHAdmin" , deployment .Connection .SSHAdmin )
119+ }
120+ if len (deployment .Connection .CLI ) > 0 {
121+ fmt .Printf ("%15s: %s\n " , "CLI Connect" , deployment .Connection .CLI )
122+ }
123+ if len (deployment .Connection .Direct ) > 0 {
124+ fmt .Printf ("%15s: %s\n " , "Direct Connect" , deployment .Connection .Direct )
125+ }
126+ if len (deployment .Connection .Misc .(map [string ]interface {})) > 0 {
127+ // Format the Misc connection as a JSON object
128+ miscbuf , err := json .MarshalIndent (deployment .Connection .Misc , "" , " " )
129+ if err != nil {
130+ fmt .Printf ("%15s: %#v\n " , "Misc Error" , err )
131+ } else {
132+ fmt .Printf ("%15s: %s\n " , "Misc" , string (miscbuf ))
133+ }
114134 }
115135
116136}
0 commit comments