Skip to content

Conversation

@welteki
Copy link
Member

@welteki welteki commented Jun 16, 2025

Description

This change adds a new method BuildWithStream to the function builder
client that returns a BuildResultStream which can be used to iterate
over build results in real time as the build progresses.

How has this been tested:

Unit test were added.

Verified E2E using the example described in the docs:

// Invoke the function builder with the tar archive containing the build config and context
// to build and push the function image.
stream, err := b.BuildWithStream(tarPath)
if err != nil {
	log.Fatal(err)
}
defer stream.Close()

for event, err := range stream.Results() {
	if err != nil {
		log.Fatal(err)
	}

	if event.Log != nil {
		for _, logMsg := range event.Log {
			fmt.Printf("%s\n", logMsg)
		}
	}

	if event.Status == "success" || event.Status == "failed" {
		fmt.Printf("Status: %s\n", event.Status)
		fmt.Printf("Image: %s\n", event.Image)

		if len(event.Error) > 0 {
			fmt.Printf("Error: %s\n", event.Error)
		}
	}
}

welteki added 3 commits June 16, 2025 12:17
This change adds a new method `BuildWithStream` to the function builder\
client that returns a `BuildResultStream` which can be used to iterate
over build results in real time as the build progresses.

Signed-off-by: Han Verstraete (OpenFaaS Ltd) <han@openfaas.com>
Signed-off-by: Han Verstraete (OpenFaaS Ltd) <han@openfaas.com>
Ensure dumpRequest prints out the headers in a consistent order.

Fixes an issue where unit test failed intermittenly because of the
inconsistent ordering.

Having a consistent order also improves the user experience when
debugging or exploring requests.

Signed-off-by: Han Verstraete (OpenFaaS Ltd) <han@openfaas.com>
@derek derek bot added the no-dco label Jun 16, 2025
@derek
Copy link

derek bot commented Jun 16, 2025

Thank you for your contribution. unfortunately, one or more of your commits are missing the required "Signed-off-by:" statement. Signing off is part of the Developer Certificate of Origin (DCO) which is used by this project.

Read the DCO and project contributing guide carefully, and amend your commits using the git CLI. Note that this does not require any cryptography, keys or special steps to be taken.

💡 Shall we fix this?

This will only take a few moments.

First, clone your fork and checkout this branch using the git CLI.

Next, set up your real name and email address:

git config --global user.name "Your Full Name"
git config --global user.email "you@domain.com"

Finally, run one of these commands to add the "Signed-off-by" line to your commits.

If you only have one commit so far then run: git commit --amend --signoff and then git push --force.
If you have multiple commits, watch this video.

Check that the message has been added properly by running "git log".

Signed-off-by: Han Verstraete (OpenFaaS Ltd) <han@openfaas.com>
@derek derek bot removed the no-dco label Jun 16, 2025
@alexellis alexellis merged commit 6fcb167 into openfaas:master Jun 17, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants