Skip to content

Commit

Permalink
new .deploy.image field
Browse files Browse the repository at this point in the history
Signed-off-by: gauron99 <[email protected]>
  • Loading branch information
gauron99 committed Sep 4, 2023
1 parent 8bef442 commit b610d49
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
9 changes: 7 additions & 2 deletions cmd/deploy.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 3 additions & 0 deletions pkg/functions/function.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"`
Expand Down

0 comments on commit b610d49

Please sign in to comment.