mirror of
https://github.com/hanzoai/functions.git
synced 2026-10-30 15:04:37 +00:00
Module github.com/fission/fission -> github.com/hanzoai/functions (288 files). CRD API group fission.io -> hanzo.ai (67 files): functions.hanzo.ai, environments.hanzo.ai, httptriggers.hanzo.ai, messagequeuetriggers.hanzo.ai, joining apps.hanzo.ai under the one house group. Doc URLs preserved. Builds green. Matches the cloud contract: clients/functions, /v1/functions, App CR role "function". Remaining: fork the env images + the live CRD-group migration (demo-only today, low risk).
30 lines
740 B
Go
30 lines
740 B
Go
package cli
|
|
|
|
import (
|
|
"bytes"
|
|
"context"
|
|
|
|
"go.uber.org/zap"
|
|
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
|
|
|
"github.com/hanzoai/functions/cmd/fission-cli/app"
|
|
"github.com/hanzoai/functions/pkg/fission-cli/cmd"
|
|
"github.com/hanzoai/functions/test/e2e/framework"
|
|
)
|
|
|
|
func ExecCommand(f *framework.Framework, ctx context.Context, args ...string) (string, error) {
|
|
f.Logger().Info("Executing command", zap.Strings("args", args))
|
|
cmd := app.App(cmd.ClientOptions{
|
|
RestConfig: f.RestConfig(),
|
|
Namespace: metav1.NamespaceDefault,
|
|
})
|
|
cmd.SilenceErrors = true // use our own error message printer
|
|
cmd.SetArgs(args)
|
|
buf := new(bytes.Buffer)
|
|
cmd.SetOut(buf)
|
|
cmd.SetErr(buf)
|
|
|
|
err := cmd.ExecuteContext(ctx)
|
|
return buf.String(), err
|
|
}
|