Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion cmd/build.go
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,7 @@ func (c buildConfig) Configure(f fn.Function) fn.Function {
func (c buildConfig) Prompt() (buildConfig, error) {
// If there is no registry nor explicit image name defined, the
// Registry prompt is shown whether or not we are in confirm mode.
// Otherwise, it is only showin if in confirm mode
// Otherwise, it is only shown if in confirm mode
// NOTE: the default in this latter situation will ignore the current function
// value and will always use the value from the config (flag or env variable).
// This is not strictly correct and will be fixed when Global Config: Function
Expand Down
2 changes: 1 addition & 1 deletion cmd/client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (

// Test_NewTestClient ensures that the convenience method for
// constructing a mocked client for testing properly considers options:
// options provided to the factory constructor are considered exaustive,
// options provided to the factory constructor are considered exhaustive,
// such that the test can force the user of the factory to use specific mocks.
// In other words, options provided when invoking the factory (such as by
// a command implementation) are ignored.
Expand Down
4 changes: 2 additions & 2 deletions cmd/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ func newCreateConfig(cmd *cobra.Command, args []string, newClient ClientFactory)
//
// If this were to provide more complexity or unreasonable maintainability
// in the future, we can move to ValidateFunctionName() function which will
// print effectively "Note: func names cant start with '-\..." on errors
// print effectively "Note: func names can't start with '-\..." on errors
if err := detectPrefixHyphen(cmd); err != nil {
return cfg, err
}
Expand Down Expand Up @@ -310,7 +310,7 @@ func (c createConfig) Validate(client *fn.Client) (err error) {
// Validate Runtime and Template Name
//
// Perhaps additional validation would be of use here in the CLI, but
// the client libray itself is ultimately responsible for validating all input
// the client library itself is ultimately responsible for validating all input
// prior to exeuting any requests.
// Client validates both language runtime and template exist, with language runtime
// being a mandatory flag while defaulting template if not present to 'http'.
Expand Down
2 changes: 1 addition & 1 deletion cmd/delete_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ func TestDelete_ByName(t *testing.T) {
}
}

// TestDelete_Namespace ensures that remover is envoked when --namespace flag is
// TestDelete_Namespace ensures that remover is invoked when --namespace flag is
// given --> func delete myfunc --namespace myns
func TestDelete_Namespace(t *testing.T) {
var (
Expand Down
2 changes: 1 addition & 1 deletion cmd/deploy.go
Original file line number Diff line number Diff line change
Expand Up @@ -452,7 +452,7 @@ func ValidateBuilder(name string) (err error) {
// for use in flags and help text.
func KnownBuilders() builders.Known {
// The set of builders supported by this CLI will likely always equate to
// the set of builders enumerated in the builders pacakage.
// the set of builders enumerated in the builders package.
// However, future third-party integrations may support less than, or more
// builders, and certain environmental considerations may alter this list.

Expand Down
10 changes: 5 additions & 5 deletions cmd/deploy_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -399,7 +399,7 @@ func TestDeploy_Envs(t *testing.T) {
t.Fatalf("Expected envs '%v', got '%v'", expected, f.Run.Envs)
}

// Deploy the function with an additinal environment variable.
// Deploy the function with an additional environment variable.
cmd = NewDeployCmd(NewTestClient())
cmd.SetArgs([]string{"--env=ENV3=VAL3"})
if err = cmd.Execute(); err != nil {
Expand Down Expand Up @@ -851,7 +851,7 @@ func TestDeploy_ImageWithDigestErrors(t *testing.T) {
// just be deployed as is (since it already has digest)
func TestDeploy_ImageWithDigestDoesntPopulateBuild(t *testing.T) {
root := FromTempDirectory(t)
// image with digest (well almost, atleast in length and syntax)
// image with digest (well almost, at least in length and syntax)
const img = "example.com/username@sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"
// Create a new Function in the temp directory
_, err := fn.New().Init(fn.Function{Runtime: "go", Root: root})
Expand Down Expand Up @@ -1101,7 +1101,7 @@ func TestDeploy_NamespaceDefaultsToK8sContext(t *testing.T) {
// NOTE: The below logic is expected of all deployers at this time,
// but is not necessary for this test.
// Deployer implementations should have integration tests which confirm
// this minimim namespace resolution logic is respected:
// this minimum namespace resolution logic is respected:
/*
if f.Namespace != "" {
// We deployed to the requested namespace
Expand Down Expand Up @@ -1580,7 +1580,7 @@ func testRegistryOrImageRequired(cmdFn commandConstructor, t *testing.T) {
// are properly respected for all permutations, including empty.
func TestDeploy_RemoteBuildURLPermutations(t *testing.T) {
// Valid flag permutations (empty indicates flag should be omitted)
// and a functon which will convert a permutation into flags for use
// and a function which will convert a permutation into flags for use
// by the subtests.
// The empty string indicates the case in which the flag is not provided.
var (
Expand Down Expand Up @@ -1957,7 +1957,7 @@ func TestDeploy_NoErrorOnOldFunctionNotFound(t *testing.T) {
// if it received an apiErrors.IsNotFound(err) and if so returns
// a fn.ErrFunctionNotFound. This test implementation is dependent
// on that. This is a change from the original implementation which
// directly returned a knative erorr with:
// directly returned a knative error with:
// return apiErrors.NewNotFound(schema.GroupResource{Group: "", Resource: "Namespace"}, nsOne)
if ns == nsOne {
// Fabricate a not-found error. For example if the function
Expand Down
2 changes: 1 addition & 1 deletion cmd/func-util/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ func (d deployDecorator) UpdateLabels(function fn.Function, labels map[string]st

func sh(ctx context.Context) error {
if !slices.Equal(os.Args[1:], []string{"-c", "umask 0000 && exec tar -xmf -"}) {
return fmt.Errorf("this is a fake sh (only for backward compatiblility purposes)")
return fmt.Errorf("this is a fake sh (only for backward compatibility purposes)")
}

wd, err := os.Getwd()
Expand Down
2 changes: 1 addition & 1 deletion cmd/func-util/socat.go
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ func tryCloseWriteSide(c connection) {
if wc, ok := c.(writeCloser); ok {
err := wc.CloseWrite()
if err != nil {
fmt.Fprintf(os.Stderr, "waring: cannot close write side: %+v\n", err)
fmt.Fprintf(os.Stderr, "warning: cannot close write side: %+v\n", err)
}
}
}
2 changes: 1 addition & 1 deletion cmd/list_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ func TestList_Namespace(t *testing.T) {
err bool // expected error
}{
{
name: "default (none specififed)",
name: "default (none specified)",
namespace: "",
all: false,
allShort: false,
Expand Down
8 changes: 4 additions & 4 deletions cmd/repository.go
Original file line number Diff line number Diff line change
Expand Up @@ -344,7 +344,7 @@ func runRepositoryAdd(_ *cobra.Command, args []string, newClient ClientFactory)
// Create a client instance which utilizes the given repositories path.
// Note that this MAY not be in the config structure if the environment
// variable to override said path was provided explicitly.
// TODO: rectify this inconsitency: the config default path structure will
// TODO: rectify this inconsistency: the config default path structure will
// be created in XDG_CONFIG_HOME/func even if the repo path environment
// was set to some other location on disk.
client, done := newClient(ClientConfig{Verbose: cfg.Verbose})
Expand Down Expand Up @@ -514,7 +514,7 @@ func runRepositoryRemove(_ *cobra.Command, args []string, newClient ClientFactor
params.Name = args[0]
}
// "Are you sure" confirmation flag
// (not using name 'Confirm' to avoid confustion with cfg.Confirm)
// (not using name 'Confirm' to avoid confusion with cfg.Confirm)
// defaults to Yes. This is debatable, but I don't want to choose the repo
// to remove and then have to see a prompt and then have to hit 'y'. Just
// prompting once to make sure, which requires another press of enter, seems
Expand Down Expand Up @@ -587,7 +587,7 @@ func runRepositoryRemove(_ *cobra.Command, args []string, newClient ClientFactor
// Installed repositories
// All repositories which have been installed (does not include builtin)
func installedRepositories(client *fn.Client) ([]string, error) {
// Client API contract stipulates the list always lists the defeault builtin
// Client API contract stipulates the list always lists the default builtin
// repo, and always lists it at index 0
repositories, err := client.Repositories().List()
if err != nil {
Expand Down Expand Up @@ -635,7 +635,7 @@ func newRepositoryConfig() (cfg repositoryConfig, err error) {
return
}

// prompt returns a config with values populated from interactivly prompting
// prompt returns a config with values populated from interactively prompting
// the user.
func (c repositoryConfig) prompt() (repositoryConfig, error) {
// These prompts are overly verbose, as the user calling --confirm likely
Expand Down
2 changes: 1 addition & 1 deletion cmd/repository_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ func TestRepository_List(t *testing.T) {
t.Fatal(err)
}

// Assert the output matches expectd (whitespace trimmed)
// Assert the output matches expected (whitespace trimmed)
expect := "default"
output := stdout()
if output != expect {
Expand Down
2 changes: 1 addition & 1 deletion cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -360,7 +360,7 @@ func cwd() (cwd string) {
// Summary:
//
// This protects against an incorrectly initialized survey.Select when the user
// has provided a nonexistant option (validation is handled elsewhere) or
// has provided a nonexistent option (validation is handled elsewhere) or
// when a value is required but there exists no defaults (no default value on
// the associated flag).
//
Expand Down
2 changes: 1 addition & 1 deletion cmd/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,7 @@ func newRunConfig(cmd *cobra.Command) (c runConfig) {
}

// Configure the given function. Updates a function struct with all
// configurable values. Note that the config alrady includes function's
// configurable values. Note that the config already includes function's
// current state, as they were passed through via flag defaults.
func (c runConfig) Configure(f fn.Function) (fn.Function, error) {
var err error
Expand Down
6 changes: 3 additions & 3 deletions cmd/run_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ func TestRun_Run(t *testing.T) {
},
{
name: "run and build on auto",
desc: "Should run and buil when build flag set to auto",
desc: "Should run and build when build flag set to auto",
args: []string{"--build=auto"}, // can be any truthy value: 0, 'false' etc.
buildInvoked: true,
runInvoked: true,
Expand All @@ -84,7 +84,7 @@ func TestRun_Run(t *testing.T) {
name: "image existence builds",
desc: "Should build when image tag exists",
// The existence of an image tag value does not mean the function
// is built; that is the purvew of the buld stamp staleness check.
// is built; that is the purview of the build stamp staleness check.
setup: func(f fn.Function, t *testing.T) error {
f.Image = "exampleimage"
return f.Write()
Expand Down Expand Up @@ -184,7 +184,7 @@ func TestRun_Run(t *testing.T) {
}
}

// TestRun_Images ensures that runnning 'func run' with --image
// TestRun_Images ensures that running 'func run' with --image
// (and additional flags) works as intended
func TestRun_Images(t *testing.T) {
tests := []struct {
Expand Down
4 changes: 2 additions & 2 deletions cmd/templates_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ typescript cloudevents
typescript http`

if d := cmp.Diff(expected, buf()); d != "" {
t.Error("output missmatch (-want, +got):", d)
t.Error("output mismatch (-want, +got):", d)
}
}

Expand Down Expand Up @@ -86,7 +86,7 @@ func TestTemplates_JSON(t *testing.T) {
}`

if d := cmp.Diff(expected, buf()); d != "" {
t.Error("output missmatch (-want, +got):", d)
t.Error("output mismatch (-want, +got):", d)
}
}

Expand Down
2 changes: 1 addition & 1 deletion cmd/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ func runVersion(cmd *cobra.Command, v Version) error {
v.Verbose = verbose

// Initialize the default value to the zero semver with a descriptive
// metadta tag indicating this must have been built from source if
// metadata tag indicating this must have been built from source if
// undefined:
if v.Vers == "" {
v.Vers = DefaultVersion
Expand Down
2 changes: 1 addition & 1 deletion docs/building-functions/podman.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ For macOS and Windows we recommend [Podman Desktop](https://podman-desktop.io/).

It's recommended to run podman machine in rootful mode (`podman machine set --rootful`).

The docs will guide you trough `podman machine` setup.
The docs will guide you through `podman machine` setup.
The `podman machine start` command it will output path to API socket.

Example output:
Expand Down
4 changes: 2 additions & 2 deletions docs/function-templates/typescript.md
Original file line number Diff line number Diff line change
Expand Up @@ -329,8 +329,8 @@ in your functions. Usage for these types is described in the previous
sections.

```typescript
// Invokable is the expected Function signature for user functions
export interface Invokable {
// Invocable is the expected Function signature for user functions
export interface Invocable {
(context: Context, cloudevent?: CloudEvent): any
}

Expand Down
6 changes: 3 additions & 3 deletions docs/language-packs/language-pack-contract.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ A Language Pack is the basis for what is written to the filesystem when a Functi

## Purpose

Knative Function Language Packs are meant to drastically reduce the code required for developers to be productive on Knative, and in concert with the `func` CLI make deploying event driven, container-based Knative Services simple and straightfoward. Language Packs and the `func` CLI streamline a Knative developer's experience by eliminating or reducing developer tasks that are not directly related to solving their business problems.
Knative Function Language Packs are meant to drastically reduce the code required for developers to be productive on Knative, and in concert with the `func` CLI make deploying event driven, container-based Knative Services simple and straightforward. Language Packs and the `func` CLI streamline a Knative developer's experience by eliminating or reducing developer tasks that are not directly related to solving their business problems.

All of the built-in templates used by `func create` are considered together to be the `default` Language Pack. Vendors, development shops and even individuals may also provide "external" Language Packs of their own in order to augment and extend the `func` CLI.

Expand Down Expand Up @@ -47,7 +47,7 @@ A Knative Function Language Pack provides runtime and invocation capabilities fo

- A Language Pack must be accessible as a git repository or a path to a location on disk.
- A Language Pack must provide one or more code templates generated via `func create`.
- A Language Pack must expose an invokable function interface for function developers in the code template.
- A Language Pack must expose an invocable function interface for function developers in the code template.
- A Language Pack project must be buildable in the form of an OCI container image via `func build`.
- A Language Pack OCI container image must be runnable via `func run`.
- A Language Pack may provide create, build, runtime and invocation metadata with a `manifest.yaml` file.
Expand Down Expand Up @@ -174,7 +174,7 @@ runtimes:
- `build` The Function project is converted into a runnable OCI container image using the `func build` command with metadata provided by the Language Pack's `manifest.yaml` if provided. Any dependencies declared by the Function are installed onto the image filesystem, and the Function invocation code is applied.
- `run` Using the `func run` command to start the image, a controlling process loads the function project into memory and listens on port 8080 for incoming HTTP requests. The process is determined by the Language Pack. For example, a Node.js Language Pack may use `npm start` as the controlling process, while a Go Language Pack may invoke a binary compiled during the `build` phase.
- `invoke` When an incoming HTTP request is received by the controlling process, the CloudEvent, if sent, is unmarshalled and the Function invoked with the payload.
- `response` After a Function has been invoked by the invocation framework, the return value is sent to the caller. If the Function returns a CloudEvent, the invocation framework should respond to the caller with the CloudEvent unchanged. If the Function returns any other data, it is sent to the caller. Function invocation frameworks may each provide their own APIs and specifications to augment a Function developer's experience. For example, the Function developer may be able to return a structure containing a numeric HTTP response code, HTTP headers, and response data. These APIs and specifications are typically unique to the runtime environment and language, and as such are left to Language Pack implementors to provide and document. API capabilities for built-in `default` Language Pack runtimes are documented in the Function templates themselves.
- `response` After a Function has been invoked by the invocation framework, the return value is sent to the caller. If the Function returns a CloudEvent, the invocation framework should respond to the caller with the CloudEvent unchanged. If the Function returns any other data, it is sent to the caller. Function invocation frameworks may each provide their own APIs and specifications to augment a Function developer's experience. For example, the Function developer may be able to return a structure containing a numeric HTTP response code, HTTP headers, and response data. These APIs and specifications are typically unique to the runtime environment and language, and as such are left to Language Pack implementers to provide and document. API capabilities for built-in `default` Language Pack runtimes are documented in the Function templates themselves.

## Execution Scope

Expand Down
2 changes: 1 addition & 1 deletion docs/language-packs/templates.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ When a function is created, an example implementation and a function metadata fi

These embedded templates are minimal by design. The function contains a minimum of external dependencies, and the `func.yaml` file defines a final environment within which the function will execute that is devoid of any extraneous packages or services.

To make use of more complex initial function implementions, or to define runtime environments with arbitrarily complex requirements, the templates system is fully pluggable.
To make use of more complex initial function implementations, or to define runtime environments with arbitrarily complex requirements, the templates system is fully pluggable.

## External Git Repositories

Expand Down
2 changes: 1 addition & 1 deletion e2e/e2e_core_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ func TestCore_Deploy_Template(t *testing.T) {
// func deploy --git-url={url} --git-ref={ref}
// func deploy --git-url={url} --git-ref={ref} --git-dir={subdir}
func TestCore_Deploy_Source(t *testing.T) {
t.Log("Not Implemeted: running a local deploy from source code in a remote repo is not currently an implemented feature because this can be easily accomplished with `git clone ... && func deploy`")
t.Log("Not Implemented: running a local deploy from source code in a remote repo is not currently an implemented feature because this can be easily accomplished with `git clone ... && func deploy`")
// Should this be a feature implemented in the future (mostly just a
// convenience command), the test would be as follows:
// resetEnv(t)
Expand Down
2 changes: 1 addition & 1 deletion e2e/e2e_remote_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ func TestRemote_Source(t *testing.T) {
}

// TestRemote_Ref ensures a remote build can be triggered which pulls
// sourece from a specific reference (branch/tag) of a remote repository.
// source from a specific reference (branch/tag) of a remote repository.
func TestRemote_Ref(t *testing.T) {
name := "func-e2e-test-remote-ref"
_ = fromCleanEnv(t, name)
Expand Down
4 changes: 2 additions & 2 deletions e2e/e2e_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ var (
Bin string

// Clean instructs the system to remove resources created during testing.
// Defaults to tru. Can be disabled with FUNC_E2E_CLEAN to speed up tests,
// Defaults to true. Can be disabled with FUNC_E2E_CLEAN to speed up tests,
// if the cluster is expected to be removed upon completion (such as in CI)
Clean bool

Expand Down Expand Up @@ -1155,7 +1155,7 @@ func toCSV(ss []string) string {
}

// chooseOpenAddress for use with things like running local functions.
// Always uses the looback interface; OS-chosen port.
// Always uses the loopback interface; OS-chosen port.
func chooseOpenAddress(t *testing.T) (address string, err error) {
t.Helper()
var l net.Listener
Expand Down
Loading
Loading