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
1 parent 38ff02e commit ef82418
Show file tree
Hide file tree
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
Expand Up @@ -261,9 +261,6 @@ func runDeploy(cmd *cobra.Command, newClient ClientFactory) (err error) {
defer doneOld()
oldClient.Remove(cmd.Context(), oldF, true)

Check failure on line 262 in cmd/deploy.go

View workflow job for this annotation

GitHub Actions / Check Source (1.20.2, ubuntu-latest)

Error return value of `oldClient.Remove` is not checked (errcheck)

Check failure on line 262 in cmd/deploy.go

View workflow job for this annotation

GitHub Actions / style / Golang / Lint

Error return value of `oldClient.Remove` is not checked (errcheck)

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

// Deploy
Expand Down Expand Up @@ -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"),
Expand Down Expand Up @@ -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
Expand Down
6 changes: 4 additions & 2 deletions pkg/functions/function_unit_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit ef82418

Please sign in to comment.