Skip to content

Commit

Permalink
building
Browse files Browse the repository at this point in the history
  • Loading branch information
gauron99 committed Oct 10, 2023

Verified

This commit was signed with the committer’s verified signature.
aymanbagabas Ayman Bagabas
1 parent 38ff02e commit ef82418
Showing 2 changed files with 7 additions and 8 deletions.
9 changes: 3 additions & 6 deletions cmd/deploy.go
Original file line number Diff line number Diff line change
@@ -261,9 +261,6 @@ func runDeploy(cmd *cobra.Command, newClient ClientFactory) (err error) {
defer doneOld()
oldClient.Remove(cmd.Context(), oldF, true)

// TODO: this has to be done in image re-calculation
// f.Image = ""
// f.Registry = ""
}

// Deploy
@@ -472,7 +469,7 @@ type deployConfig struct {
// environment variables; in that precedence.
func newDeployConfig(cmd *cobra.Command) (c deployConfig) {
c = deployConfig{
buildConfig: newBuildConfig(cmd),
buildConfig: newBuildConfig(),
Build: viper.GetString("build"),
Env: viper.GetStringSlice("env"),
Domain: viper.GetString("domain"),
@@ -530,12 +527,12 @@ func (c deployConfig) Configure(f fn.Function) (fn.Function, error) {
// ImageDigest
// Parsed off f.Image if provided. Deploying adds the ability to specify a
// digest on the associated image (not available on build as nonsensical).
newDigest, err := imageDigest(f.Image)
newDigest, err := imageDigest(f.Deploy.Image)
if err != nil {
return f, err
}
if newDigest != "" {
f.ImageDigest = newDigest
f.Deploy.ImageDigest = newDigest
}

// Envs
6 changes: 4 additions & 2 deletions pkg/functions/function_unit_test.go
Original file line number Diff line number Diff line change
@@ -119,8 +119,10 @@ func TestFunction_ImageWithDigest(t *testing.T) {
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
f := Function{
Image: tt.fields.Image,
ImageDigest: tt.fields.ImageDigest,
Image: tt.fields.Image,
Deploy: DeploySpec{
ImageDigest: tt.fields.ImageDigest,
},
}
if got := f.ImageWithDigest(); got != tt.want {
t.Errorf("ImageWithDigest() = %v, want %v", got, tt.want)

0 comments on commit ef82418

Please sign in to comment.