Skip to content

Commit

Permalink
remove prints, comment
Browse files Browse the repository at this point in the history
Signed-off-by: David Fridrich <[email protected]>
  • Loading branch information
gauron99 committed Aug 27, 2024
1 parent d095a39 commit 4c3bbb4
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 36 deletions.
36 changes: 0 additions & 36 deletions cmd/deploy.go
Original file line number Diff line number Diff line change
Expand Up @@ -334,14 +334,11 @@ func runDeploy(cmd *cobra.Command, newClient ClientFactory) (err error) {
// TODO: gauron99 - temporary fix for undigested image direct deploy
// (w/out build) This might be more complex to do than leaving like this
// image digests are created via the registry on push.
fmt.Printf("justBuilt '%v'; justPushed '%v'\n", justBuilt, justPushed)
fmt.Printf("builtImage '%v'; deployimage '%v'\n", f.Build.Image, f.Deploy.Image)
if (justBuilt || justPushed) && f.Build.Image != "" {
// f.Build.Image is set in Push for now, just set it as a deployed image
f.Deploy.Image = f.Build.Image
}
}
fmt.Printf("builtImage '%v'; deployimage '%v'\n", f.Build.Image, f.Deploy.Image)
if f, err = client.Deploy(cmd.Context(), f, fn.WithDeploySkipBuildCheck(cfg.Build == "false")); err != nil {
return
}
Expand Down Expand Up @@ -787,39 +784,6 @@ func printDeployMessages(out io.Writer, f fn.Function) {
}
}

// isUndigested returns true if provided image string 'v' is valid ( by
// by acceptable standards -- tagged, untagged -> assuming :latest) and false if
// not. It is lenient in validating - does not always throw an error, just
// returning false in some scenarios.
// func isUndigested(v string) (validTag bool, err error) {
// if v == "" {
// // specif image was not given
// err = fmt.Errorf("provided image is empty")
// return
// }
// if strings.Contains(v, "@") {
// // digest has been processed separately
// return
// }
// vv := strings.Split(v, ":")
// if len(vv) < 2 {
// // assume user knows what hes doing
// validTag = true
// return
// } else if len(vv) > 2 {
// err = fmt.Errorf("image '%v' contains an invalid tag (extra ':')", v)
// return
// }
// tag := vv[1]
// if tag == "" {
// err = fmt.Errorf("image '%v' has an empty tag", v)
// return
// }

// validTag = true
// return
// }

// isDigested returns true if provided image string 'v' has digest and false if not.
// Includes basic validation that a provided digest is correctly formatted.
// Given that image is not digested, image will still be validated and return
Expand Down
4 changes: 4 additions & 0 deletions pkg/docker/runner_int_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,10 @@ func TestRunDigested(t *testing.T) {
ctx, cancel := context.WithTimeout(context.Background(), time.Minute*10)
t.Cleanup(cancel)

// TODO: gauron99 - if image-digest-on-build is implemented, rework this
// to fit this schema -- build image (get digest) then run from temporary dir
// such that its .func stamp is not considered. All of this to remove the
// external pre-built container dependency
image := testImageWithDigest
prePullTestImages(t, image)

Expand Down

0 comments on commit 4c3bbb4

Please sign in to comment.