Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add update cmd for Pulsar Functions #33

Merged
merged 11 commits into from
Sep 5, 2019
10 changes: 8 additions & 2 deletions pkg/ctl/functions/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ func createFunctionsCmd(vc *cmdutils.VerbCmd) {
var out []pulsar.Output
successOut := pulsar.Output{
Desc: "normal output",
Out: "Created successfully",
Out: "Created <the name of a Pulsar Function> successfully",
}

out = append(out, successOut)
Expand Down Expand Up @@ -382,7 +382,7 @@ func createFunctionsCmd(vc *cmdutils.VerbCmd) {
flagSet.BoolVar(
&functionData.AutoAck,
"auto-ack",
false,
true,
"Whether or not the framework acknowledges messages automatically")

flagSet.Int64Var(
Expand Down Expand Up @@ -412,6 +412,12 @@ func doCreateFunctions(vc *cmdutils.VerbCmd, funcData *pulsar.FunctionData) erro
return err
}

err = validateFunctionConfigs(funcData.FuncConf)
if err != nil {
vc.Command.Help()
return err
}

admin := cmdutils.NewPulsarClientWithApiVersion(pulsar.V3)

if isFunctionPackageUrlSupported(funcData.Jar) {
Expand Down
2 changes: 1 addition & 1 deletion pkg/ctl/functions/delete.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ func deleteFunctionsCmd(vc *cmdutils.VerbCmd) {
var out []pulsar.Output
successOut := pulsar.Output{
Desc: "normal output",
Out: "Deleted successfully",
Out: "Deleted <the name of a Pulsar Function> successfully",
}

failOut := pulsar.Output{
Expand Down
1 change: 1 addition & 0 deletions pkg/ctl/functions/functions.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ func Command(flagGrouping *cmdutils.FlagGrouping) *cobra.Command {
cmdutils.AddVerbCmd(flagGrouping, resourceCmd, restartFunctionsCmd)
cmdutils.AddVerbCmd(flagGrouping, resourceCmd, listFunctionsCmd)
cmdutils.AddVerbCmd(flagGrouping, resourceCmd, getFunctionsCmd)
cmdutils.AddVerbCmd(flagGrouping, resourceCmd, updateFunctionsCmd)

return resourceCmd
}
2 changes: 1 addition & 1 deletion pkg/ctl/functions/restart.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ func restartFunctionsCmd(vc *cmdutils.VerbCmd) {
var out []pulsar.Output
successOut := pulsar.Output{
Desc: "normal output",
Out: "Restarted successfully",
Out: "Restarted <the name of a Pulsar Function> successfully",
}

failOut := pulsar.Output{
Expand Down
2 changes: 1 addition & 1 deletion pkg/ctl/functions/start.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ func startFunctionsCmd(vc *cmdutils.VerbCmd) {
var out []pulsar.Output
successOut := pulsar.Output{
Desc: "normal output",
Out: "Started successfully",
Out: "Started <the name of a Pulsar Function> successfully",
}

failOut := pulsar.Output{
Expand Down
2 changes: 1 addition & 1 deletion pkg/ctl/functions/stop.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ func stopFunctionsCmd(vc *cmdutils.VerbCmd) {
var out []pulsar.Output
successOut := pulsar.Output{
Desc: "normal output",
Out: "Stopped successfully",
Out: "Stopped <the name of a Pulsar Function> successfully",
}

failOut := pulsar.Output{
Expand Down
Loading