Update route without providing function reference (#718)
This commit is contained in:
+3
-10
@@ -148,23 +148,16 @@ func htUpdate(c *cli.Context) error {
|
||||
}
|
||||
triggerNamespace := c.String("triggerNamespace")
|
||||
|
||||
// update function ref
|
||||
newFn := c.String("function")
|
||||
if len(newFn) == 0 {
|
||||
log.Fatal("Nothing to update. Use --function to specify a new function.")
|
||||
}
|
||||
|
||||
checkFunctionExistence(client, newFn, triggerNamespace)
|
||||
|
||||
ht, err := client.HTTPTriggerGet(&metav1.ObjectMeta{
|
||||
Name: htName,
|
||||
Namespace: triggerNamespace,
|
||||
})
|
||||
checkErr(err, "get HTTP trigger")
|
||||
|
||||
if len(newFn) > 0 {
|
||||
ht.Spec.FunctionReference.Name = newFn
|
||||
if c.IsSet("function") {
|
||||
ht.Spec.FunctionReference.Name = c.String("function")
|
||||
}
|
||||
checkFunctionExistence(client, ht.Spec.FunctionReference.Name, triggerNamespace)
|
||||
|
||||
if c.IsSet("createingress") {
|
||||
ht.Spec.CreateIngress = c.Bool("createingress")
|
||||
|
||||
Reference in New Issue
Block a user