@@ -19,7 +19,7 @@ import (
19
19
func init () {
20
20
// Setup flags that are used by multiple commands (variables defined in faas.go)
21
21
readyCmd .Flags ().StringVarP (& gateway , "gateway" , "g" , defaultGateway , "Gateway URL starting with http(s)://" )
22
-
22
+ readyCmd . Flags (). StringVarP ( & functionNamespace , "namespace" , "n" , "" , "Namespace of the function" )
23
23
readyCmd .Flags ().BoolVar (& tlsInsecure , "tls-no-verify" , false , "Disable TLS validation" )
24
24
25
25
readyCmd .Flags ().Int ("attempts" , 60 , "Number of attempts to check the gateway" )
@@ -36,7 +36,12 @@ var readyCmd = &cobra.Command{
36
36
37
37
# Block until the env function is ready
38
38
faas-cli store deploy env && \
39
- faas-cli ready env` ,
39
+ faas-cli ready env
40
+
41
+ # Block until the env function is ready in staging-fn namespace
42
+ faas-cli store deploy env --namespace staging-fn && \
43
+ faas-cli ready env --namespace staging-fn
44
+ ` ,
40
45
RunE : runReadyCmd ,
41
46
}
42
47
@@ -125,7 +130,12 @@ func runReadyCmd(cmd *cobra.Command, args []string) error {
125
130
ctx := context .Background ()
126
131
127
132
for i := 0 ; i < attempts ; i ++ {
128
- fmt .Printf ("[%d/%d] Waiting for function %s\n " , i + 1 , attempts , functionName )
133
+ suffix := ""
134
+ if len (functionNamespace ) > 0 {
135
+ suffix = "." + functionNamespace
136
+ }
137
+
138
+ fmt .Printf ("[%d/%d] Waiting for function %s%s\n " , i + 1 , attempts , functionName , suffix )
129
139
130
140
function , err := cliClient .GetFunctionInfo (ctx , functionName , functionNamespace )
131
141
if err != nil {
0 commit comments