From b610d49466113923fdc1443bd4490de66ae1c942 Mon Sep 17 00:00:00 2001 From: gauron99 Date: Mon, 4 Sep 2023 15:15:19 +0200 Subject: [PATCH] new .deploy.image field Signed-off-by: gauron99 --- cmd/deploy.go | 9 +++++++-- pkg/functions/function.go | 3 +++ 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/cmd/deploy.go b/cmd/deploy.go index 08411814e7..a8054a5179 100644 --- a/cmd/deploy.go +++ b/cmd/deploy.go @@ -254,11 +254,16 @@ func runDeploy(cmd *cobra.Command, newClient ClientFactory) (err error) { // Undeploy dangling Function on forced namespace change (using --namespace flag) if cfg.Namespace != oldF.Deploy.Namespace && oldF.Deploy.Namespace != "" { - fmt.Fprintf(cmd.OutOrStdout(), "Info: Deleting old func in '%s' because the namespace has changed\n", oldF.Deploy.Namespace) + // TODO: when new prompt is implemented, add here a "are you sure?" check possibly + + // fmt.Fprintf(cmd.OutOrStdout(), "Info: Deleting old func in '%s' because the namespace has changed\n", oldF.Deploy.Namespace) oldClient, doneOld := newClient(ClientConfig{Namespace: oldF.Deploy.Namespace, Verbose: cfg.Verbose}, clientOptions...) defer doneOld() oldClient.Remove(cmd.Context(), oldF, true) - // fmt.Fprintf(cmd.OutOrStdout(), "Info: Undeployed in %s\n", oldF.Deploy.Namespace) + + // TODO: this has to be done in image re-calculation + // f.Image = "" + // f.Registry = "" } // Deploy diff --git a/pkg/functions/function.go b/pkg/functions/function.go index d7a09a7304..69a5642866 100644 --- a/pkg/functions/function.go +++ b/pkg/functions/function.go @@ -137,6 +137,9 @@ type DeploySpec struct { // Namespace into which the function is deployed on supported platforms. Namespace string `yaml:"namespace,omitempty"` + // Image which describes image name that's calculated or provided using --image + Image string `yaml:"image,omitempty"` + // Remote indicates the deployment (and possibly build) process are to // be triggered in a remote environment rather than run locally. Remote bool `yaml:"remote,omitempty"`