Fix various misspellings and linter items (#1057)

* spelling: additional

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: bindings

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: blocked

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: bootstrap

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: channel

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: channel

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: commands

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: comparison

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: configuration

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: controller

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: convert

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: desired

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: dynamic

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: entry

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: execute

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: explicit

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: hardcoded

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: information

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: inject

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: item

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: kubectl

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: latest

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: message

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: namespace

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: namespaces

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: output

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: overriding

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: parameters

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: revision

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: separated

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: separator

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: service

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: specified

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: specifies

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: splitting

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: subscription

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: trigger

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: unknown

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: unstructured

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: workflow

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* chore: Address golinter complaint for (c *MockKnServingClient) GetBaseRevision

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* chore: update changelog for spelling fixes (#1057)
This commit is contained in:
Josh Soref 2020-10-13 00:24:30 -04:00 committed by GitHub
parent f7ddef522f
commit 4939c5ede3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
43 changed files with 68 additions and 63 deletions

View File

@ -17,7 +17,7 @@
Fixes #
<!--
Please add an entrty to CHANGELOG.adoc file, too, as part of your Pull Request.
Please add an entry to CHANGELOG.adoc file, too, as part of your Pull Request.
In the following cases, add a short description of PR to the unreleased section in CHANGELOG.adoc:

View File

@ -17,6 +17,11 @@
|===
| | Description | PR
| 🐛
| Fix various misspellings and linter items
| https://github.com/knative/client/pull/1057[#1057]
| 🎁
| Add Aliases to Help Command and Remove Aliases in Short
| https://github.com/knative/client/pull/1055[#1055]
@ -352,7 +357,7 @@
| https://github.com/knative/client/pull/819[#819]
| 🐛
| Update help messsage for `kn source apiserver` to reflect the new API
| Update help message for `kn source apiserver` to reflect the new API
| https://github.com/knative/client/pull/817[#817]
| 🐛

View File

@ -142,9 +142,9 @@ func TestUnknownCommands(t *testing.T) {
expectedError []string
}{
{
[]string{"service", "udpate", "test", "--scale-min=0"},
[]string{"service", "unknown", "test", "--scale-min=0"},
[]string{"service"},
[]string{"unknown sub-command", "udpate"},
[]string{"unknown sub-command", "unknown"},
},
{
[]string{"service", "--foo=bar"},

View File

@ -51,7 +51,7 @@ be used:
- `create` creates a resource.
- `update` updates a resource.
- `delete` deletes a resource.
- `apply` for an idempotent "create-or-update", much like `kubetl apply`
- `apply` for an idempotent "create-or-update", much like `kubectl apply`
For a given resource, create and update should use the same arguments as much as
possible and where it makes sense.

View File

@ -80,7 +80,7 @@ find the digest of the resolved image for the revision.
If an client does not set the revision name, the client may find the
`status.latestCreatedRevision` field useful, even though using it is subject to
a race condition, if the client compares the relevant informatin on the found
a race condition, if the client compares the relevant information on the found
revision to the template. For example, if the image on the template matches the
`latestCreatedRevision`'s image, the client is justified in using the
`status.imageDigest` field from the revision.

View File

@ -72,7 +72,7 @@ Below are the options you can specify in the `kn` config file.
plugins. It can be any directory that is visible to the user.
2. `lookupPluginsInPath` which is the same as the persistent flag
`--lookup-plugins-in-path` and specficies if `kn` should look for plugins
`--lookup-plugins-in-path` and specifies if `kn` should look for plugins
anywhere in the specified `PATH` environment variable. This is a boolean
configuration option and the default value is `false`.

View File

@ -60,7 +60,7 @@ kn service create NAME --image IMAGE
--async DEPRECATED: please use --no-wait instead. Do not wait for 'service create' operation to be completed.
--autoscale-window string Duration to look back for making auto-scaling decisions. The service is scaled to zero if no request was received in during that time. (eg: 10s)
--cluster-local Specify that the service be private. (--no-cluster-local will make the service publicly available)
--cmd string Specify command to be used as entrypoint instead of default one. Example: --cmd /app/start or --cmd /app/start --arg myArg to pass aditional arguments.
--cmd string Specify command to be used as entrypoint instead of default one. Example: --cmd /app/start or --cmd /app/start --arg myArg to pass additional arguments.
--concurrency-limit int Hard Limit of concurrent requests to be processed by a single replica.
--concurrency-target int Recommendation for when to scale up based on the concurrent number of incoming request. Defaults to --concurrency-limit when given.
--concurrency-utilization int Percentage of concurrent requests utilization before scaling up. (default 70)

View File

@ -45,7 +45,7 @@ kn service update NAME
--async DEPRECATED: please use --no-wait instead. Do not wait for 'service update' operation to be completed.
--autoscale-window string Duration to look back for making auto-scaling decisions. The service is scaled to zero if no request was received in during that time. (eg: 10s)
--cluster-local Specify that the service be private. (--no-cluster-local will make the service publicly available)
--cmd string Specify command to be used as entrypoint instead of default one. Example: --cmd /app/start or --cmd /app/start --arg myArg to pass aditional arguments.
--cmd string Specify command to be used as entrypoint instead of default one. Example: --cmd /app/start or --cmd /app/start --arg myArg to pass additional arguments.
--concurrency-limit int Hard Limit of concurrent requests to be processed by a single replica.
--concurrency-target int Recommendation for when to scale up based on the concurrent number of incoming request. Defaults to --concurrency-limit when given.
--concurrency-utilization int Percentage of concurrent requests utilization before scaling up. (default 70)

View File

@ -14,7 +14,7 @@ kn source binding list
```
# List all sink binidngs
# List all sink bindings
kn source binding list
# List all sink bindings in YAML format

View File

@ -2,7 +2,7 @@
The Knative Pod Autoscaler (KPA), provides fast, request-based autoscaling
capabilities. To correctly configure autoscaling to zero for revisions, you must
modify its paramenters.
modify its parameters.
`target` defines how many concurrent requests are wanted at a given time (soft
limit) and is the recommended configuration for autoscaling in Knative.

View File

@ -1,6 +1,6 @@
# Basic Workflow
In this basic worflow we show the CRUD (create, read, update, delete) operations
In this basic workflow we show the CRUD (create, read, update, delete) operations
on a service. We use a well known
[simple Hello World service](https://github.com/knative/docs/tree/master/docs/serving/samples/hello-world/helloworld-go)
that reads the environment variable `TARGET` and prints it as output.

View File

@ -21,7 +21,7 @@
// doSomeActionThatWritesToStdOutAndStdErr()
// stdOut, stdErr := capture.Close()
//
// CaptureOutpu() and capture.Close() should always come in pairs as Close() also
// CaptureOutput() and capture.Close() should always come in pairs as Close() also
// restores the old streams
package test

View File

@ -22,8 +22,8 @@ import (
)
const (
seperatorHeavy = "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
seperatorLight = "╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍"
separatorHeavy = "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
separatorLight = "╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍"
)
// Kn type
@ -159,10 +159,10 @@ func dumpService(namespace string, args []string) string {
// Service info
appendResourceInfo(&buffer, "ksvc", name, namespace)
fmt.Fprintf(&buffer, "%s\n", seperatorHeavy)
fmt.Fprintf(&buffer, "%s\n", separatorHeavy)
// Service's configuration
appendResourceInfo(&buffer, "configuration", name, namespace)
fmt.Fprintf(&buffer, "%s\n", seperatorHeavy)
fmt.Fprintf(&buffer, "%s\n", separatorHeavy)
// Get all revisions for this service
appendResourceInfoWithNameSelector(&buffer, "revision", name, namespace, "serving.knative.dev/service")
// Get all routes for this service
@ -218,7 +218,7 @@ func appendResourceInfoWithNameSelector(buffer *bytes.Buffer, kind string, name
out, err := RunKubectl(namespace, argsDescribe...)
appendCLIOutput(buffer, fmt.Sprintf("kubectl describe %s %s --namespace %s%s", kind, name, namespace, extra), out, err)
fmt.Fprintf(buffer, "%s\n", seperatorLight)
fmt.Fprintf(buffer, "%s\n", separatorLight)
out, err = RunKubectl(namespace, argsGet...)
appendCLIOutput(buffer, fmt.Sprintf("kubectl get %s %s --namespace %s -oyaml%s", kind, name, namespace, extra), out, err)
}

View File

@ -113,7 +113,7 @@ func GetNextServiceName(base string) string {
return base + strconv.Itoa(current)
}
// CreateNamespace creates and tests a namesspace creation invoking kubectl
// CreateNamespace creates and tests a namespace creation invoking kubectl
func CreateNamespace(namespace string) error {
expectedOutputRegexp := fmt.Sprintf("namespace?.+%s.+created", namespace)
out, err := createNamespaceWithRetry(namespace, MaxRetries)
@ -132,7 +132,7 @@ func CreateNamespace(namespace string) error {
return nil
}
// DeleteNamespace deletes and tests a namesspace deletion invoking kubectl
// DeleteNamespace deletes and tests a namespace deletion invoking kubectl
func DeleteNamespace(namespace string) error {
kubectl := Kubectl{namespace}
out, err := kubectl.Run("delete", "namespace", namespace)

View File

@ -134,7 +134,7 @@ func (c *KnRunResultCollector) printCommands(out io.Writer) {
for i, result := range c.results {
c.printCommand(out, result)
if i < len(c.results)-1 {
fmt.Fprintf(out, "┣━%s\n", seperatorHeavy)
fmt.Fprintf(out, "┣━%s\n", separatorHeavy)
}
}
}

View File

@ -254,7 +254,7 @@ func (c *knDynamicClient) ListChannelsUsingGVKs(gvks *[]schema.GroupVersionKind,
gvr := gvk.GroupVersion().WithResource(strings.ToLower(gvk.Kind) + "s")
// list objects of chaneel type with this GVR
// list objects of channel type with this GVR
cList, err := c.client.Resource(gvr).Namespace(namespace).List(context.TODO(), options)
if err != nil {
return nil, err

View File

@ -30,8 +30,8 @@ type MockKnDynamicClient struct {
recorder *ClientRecorder
}
// NewMockKnDyanmicClient returns a new mock instance which you need to record for
func NewMockKnDyanmicClient(t *testing.T, ns ...string) *MockKnDynamicClient {
// NewMockKnDynamicClient returns a new mock instance which you need to record for
func NewMockKnDynamicClient(t *testing.T, ns ...string) *MockKnDynamicClient {
namespace := "default"
if len(ns) > 0 {
namespace = ns[0]

View File

@ -25,7 +25,7 @@ import (
func TestMockKnDynamicClient(t *testing.T) {
client := NewMockKnDyanmicClient(t)
client := NewMockKnDynamicClient(t)
recorder := client.Recorder()

View File

@ -50,7 +50,7 @@ func (i *SinkFlags) AddWithFlagName(cmd *cobra.Command, fname, short string) {
"If a prefix is not provided, it is considered as a Knative service."
for _, p := range config.GlobalConfig.SinkMappings() {
//user configration might override the default configuration
//user configuration might override the default configuration
sinkMappings[p.Prefix] = schema.GroupVersionResource{
Resource: p.Resource,
Group: p.Group,

View File

@ -44,7 +44,7 @@ func AddNamespaceFlags(flags *pflag.FlagSet, allowAll bool) {
// GetNamespace returns namespace from command specified by flag
func (params *KnParams) GetNamespace(cmd *cobra.Command) (string, error) {
namespace := cmd.Flag("namespace").Value.String()
// check value of all-namepaces only if its defined
// check value of all-namespaces only if its defined
if cmd.Flags().Lookup("all-namespaces") != nil {
all, err := cmd.Flags().GetBool("all-namespaces")
if err != nil {
@ -54,7 +54,7 @@ func (params *KnParams) GetNamespace(cmd *cobra.Command) (string, error) {
return "", nil
}
}
// if all-namepaces=False or namespace not given, use default namespace
// if all-namespaces=False or namespace not given, use default namespace
if namespace == "" {
var err error
namespace, err = params.CurrentNamespace()

View File

@ -194,7 +194,7 @@ func constructServiceFromRevision(latestSvc *servingv1.Service, revision *servin
ObjectMeta: latestSvc.Spec.Template.ObjectMeta,
}
//ovrriding revision template annotations with revision annotations
//overriding revision template annotations with revision annotations
stripIgnoredAnnotationsFromRevision(revision)
exportedSvc.Spec.Template.ObjectMeta.Annotations = revision.ObjectMeta.Annotations

View File

@ -60,7 +60,7 @@ func printKServiceList(kServiceList *servingv1.ServiceList, options hprinters.Pr
func printKService(kService *servingv1.Service, options hprinters.PrintOptions) ([]metav1beta1.TableRow, error) {
name := kService.Name
url := kService.Status.URL
lastestRevision := kService.Status.ConfigurationStatusFields.LatestReadyRevisionName
latestRevision := kService.Status.ConfigurationStatusFields.LatestReadyRevisionName
age := commands.TranslateTimestampSince(kService.CreationTimestamp)
conditions := commands.ConditionsValue(kService.Status.Conditions)
ready := commands.ReadyCondition(kService.Status.Conditions)
@ -77,7 +77,7 @@ func printKService(kService *servingv1.Service, options hprinters.PrintOptions)
row.Cells = append(row.Cells,
name,
url,
lastestRevision,
latestRevision,
age,
conditions,
ready,

View File

@ -120,7 +120,7 @@ func fakeServiceUpdate(original *servingv1.Service, args []string) (
return
}
func TestServcieUpdateNoFlags(t *testing.T) {
func TestServiceUpdateNoFlags(t *testing.T) {
orig := newEmptyService()
action, _, _, err := fakeServiceUpdate(orig, []string{"service", "update", "foo"})

View File

@ -30,7 +30,7 @@ func NewBindingListCommand(p *commands.KnParams) *cobra.Command {
Use: "list",
Short: "List sink bindings",
Example: `
# List all sink binidngs
# List all sink bindings
kn source binding list
# List all sink bindings in YAML format

View File

@ -33,7 +33,7 @@ var sourceTypeDescription = map[string]string{
"ContainerSource": "Generate events by Container image and send to addressable",
// TODO: source plugin could bring the description that kn could look for based on the availability
// of the plugin and fetch the description from there, for now we dont have that capability in kn
// so we're shipping harcoded short description of the KafkaSource as below
// so we're shipping hardcoded short description of the KafkaSource as below
"KafkaSource": "Route events from Apache Kafka Server to addressable",
}

View File

@ -34,7 +34,7 @@ func ListHandlers(h hprinters.PrintHandler) {
subscriptionColumnDefinitions := []metav1beta1.TableColumnDefinition{
{Name: "Namespace", Type: "string", Description: "Namespace of the subscription", Priority: 0},
{Name: "Name", Type: "string", Description: "Name of the subscription", Priority: 1},
{Name: "Channel", Type: "string", Description: "Channel of the subcription", Priority: 1},
{Name: "Channel", Type: "string", Description: "Channel of the subscription", Priority: 1},
{Name: "Subscriber", Type: "string", Description: "Subscriber sink of the subscription", Priority: 1},
{Name: "Reply", Type: "string", Description: "Reply sink of the subscription", Priority: 1},
{Name: "Dead Letter Sink", Type: "string", Description: "DeadLetterSink of the subscription", Priority: 1},

View File

@ -67,7 +67,7 @@ func TestTriggerWithInjectCreate(t *testing.T) {
eventingRecorder.Validate()
}
func TestTriggetWithInjecError(t *testing.T) {
func TestTriggerWithInjectError(t *testing.T) {
eventingClient := clienteventingv1beta1.NewMockKnEventingClient(t)
dynamicClient := dynamicfake.CreateFakeKnDynamicClient("default", &servingv1.Service{
TypeMeta: metav1.TypeMeta{Kind: "Service", APIVersion: "serving.knative.dev/v1"},

View File

@ -58,7 +58,7 @@ func TestVersion(t *testing.T) {
BuildDate = fakeBuildDate
GitRevision = fakeGitRevision
knVersionObj = knVersion{fakeVersion, fakeBuildDate, fakeGitRevision, apiVersions}
expectedOutput = genVersionOuput(t, knVersionObj)
expectedOutput = genVersionOutput(t, knVersionObj)
knParams = &commands.KnParams{}
versionCmd = NewVersionCommand(knParams)
output = new(bytes.Buffer)
@ -114,7 +114,7 @@ func TestVersion(t *testing.T) {
}
func genVersionOuput(t *testing.T, obj knVersion) string {
func genVersionOutput(t *testing.T, obj knVersion) string {
tmpl, err := template.New("versionOutput").Parse(versionOutputTemplate)
assert.NilError(t, err)
buf := bytes.Buffer{}

View File

@ -97,7 +97,7 @@ var globalConfig = config{}
// GlobalConfig is the global configuration available for every sub-command
var GlobalConfig Config = &globalConfig
// bootstrapConfig reads in config file and boostrap options if set.
// BootstrapConfig reads in config file and bootstrap options if set.
func BootstrapConfig() error {
// Create a new FlagSet for the bootstrap flags and parse those. This will

View File

@ -59,7 +59,7 @@ func (i *ChannelTypeFlags) Add(f *pflag.FlagSet) {
"Examples: '--type messaging.knative.dev:v1alpha1:KafkaChannel' for specifying explicit Group:Version:Kind.")
for _, p := range config.GlobalConfig.ChannelTypeMappings() {
//user configration might override the default configuration
//user configuration might override the default configuration
ctypeMappings[p.Alias] = schema.GroupVersionKind{
Kind: p.Kind,
Group: p.Group,

View File

@ -102,7 +102,7 @@ func (p *PodSpecFlags) AddFlags(flagset *pflag.FlagSet) []string {
flagset.StringVarP(&p.Command, "cmd", "", "",
"Specify command to be used as entrypoint instead of default one. "+
"Example: --cmd /app/start or --cmd /app/start --arg myArg to pass aditional arguments.")
"Example: --cmd /app/start or --cmd /app/start --arg myArg to pass additional arguments.")
flagNames = append(flagNames, "cmd")
flagset.StringArrayVarP(&p.Arg, "arg", "", []string{},

View File

@ -93,7 +93,7 @@ func NewManager(pluginDir string, lookupInPath bool) *Manager {
// FindPlugin checks if a plugin for the given parts exist and return it.
// The args given must not contain any options and contain only
// the comands (like in [ "source", "github" ] for a plugin called 'kn-source-github'
// the commands (like in [ "source", "github" ] for a plugin called 'kn-source-github'
// The plugin with the most specific (longest) name is returned or nil if non is found.
// An error is returned if the lookup fails for some reason like an io error
func (manager *Manager) FindPlugin(parts []string) (Plugin, error) {

View File

@ -49,7 +49,7 @@ func newTarget(tag, revision string, percent int64, latestRevision bool) (target
if latestRevision {
target.LatestRevision = ptr.Bool(true)
} else {
// as LatestRevision and RevisionName can't be specfied together for a target
// as LatestRevision and RevisionName can't be specified together for a target
target.LatestRevision = ptr.Bool(false)
target.RevisionName = revision
}

View File

@ -186,7 +186,7 @@ func TestCompute(t *testing.T) {
} {
t.Run(testCase.name, func(t *testing.T) {
if lper, lrev, ltag := len(testCase.desiredPercents), len(testCase.desiredRevisions), len(testCase.desiredTags); lper != lrev || lper != ltag {
t.Fatalf("length of desird revisions, tags and percents is mismatched: got=(desiredPercents, desiredRevisions, desiredTags)=(%d, %d, %d)",
t.Fatalf("length of desired revisions, tags and percents is mismatched: got=(desiredPercents, desiredRevisions, desiredTags)=(%d, %d, %d)",
lper, lrev, ltag)
}
@ -225,7 +225,7 @@ func TestComputeErrMsg(t *testing.T) {
"expecting the value format in value1=value2, given @latest=",
},
{
"repeatedly spliting traffic to @latest revision",
"repeatedly splitting traffic to @latest revision",
append(newServiceTraffic([]servingv1.TrafficTarget{}), newTarget("", "", 100, true)),
[]string{"--traffic", "@latest=90,@latest=10"},
"repetition of identifier @latest is not allowed, use only once with --traffic flag",
@ -273,7 +273,7 @@ func TestComputeErrMsg(t *testing.T) {
"invalid value for traffic percent -100, expected 0 <= percent <= 100",
},
{
"repeatedly spliting traffic to the same revision",
"repeatedly splitting traffic to the same revision",
append(newServiceTraffic([]servingv1.TrafficTarget{}), newTarget("", "", 100, true)),
[]string{"--traffic", "echo-v1=40", "--traffic", "echo-v1=60"},
"repetition of revision reference echo-v1 is not allowed, use only once with --traffic flag",

View File

@ -25,7 +25,7 @@ import (
)
// KnMessagingClient to Eventing Messaging. All methods are relative to
// the namespace specificied during construction
// the namespace specified during construction
type KnMessagingClient interface {
// Get the Channels client
ChannelsClient() KnChannelsClient

View File

@ -181,7 +181,7 @@ func (sr *ServingRecorder) GetConfiguration(name string, config *servingv1.Confi
}
// Check for the base reviision
// GetBaseRevision returns the base revision
func (c *MockKnServingClient) GetBaseRevision(service *servingv1.Service) (*servingv1.Revision, error) {
return getBaseRevision(c, service)
}

View File

@ -22,7 +22,7 @@ import (
)
// ContainsAll is a comparison utility, compares given substrings against
// target string and returns the gotest.tools/assert/cmp.Comaprison function.
// target string and returns the gotest.tools/assert/cmp.Comparison function.
// Provide target string as first arg, followed by any number of substring as args
func ContainsAll(target string, substrings ...string) cmp.Comparison {
return func() cmp.Result {
@ -57,7 +57,7 @@ func ContainsAllIgnoreCase(target string, substrings ...string) cmp.Comparison {
}
// ContainsNone is a comparison utility, compares given substrings against
// target string and returns the gotest.tools/assert/cmp.Comaprison function.
// target string and returns the gotest.tools/assert/cmp.Comparison function.
// Provide target string as first arg, followed by any number of substring as args
func ContainsNone(target string, substrings ...string) cmp.Comparison {
return func() cmp.Result {

View File

@ -22,7 +22,7 @@ import (
"k8s.io/apimachinery/pkg/runtime"
)
// ToUnstructuredList is to converts an object to unstructured.UnstructuredList.
// ToUnstructuredList is to convert an object to unstructured.UnstructuredList.
// If the object is not a list type, it will convert to a single item UnstructuredList.
func ToUnstructuredList(obj runtime.Object) (*unstructured.UnstructuredList, error) {
unstructuredList := &unstructured.UnstructuredList{}
@ -32,8 +32,8 @@ func ToUnstructuredList(obj runtime.Object) (*unstructured.UnstructuredList, err
if err != nil {
return nil, err
}
for _, obji := range items {
ud, err := toUnstructured(obji)
for _, item := range items {
ud, err := toUnstructured(item)
if err != nil {
return nil, err
}

View File

@ -38,16 +38,16 @@ func TestToUnstructuredList(t *testing.T) {
},
}
expectedList.Items = []unstructured.Unstructured{createUnstructured("s1"), createUnstructured("s2")}
unstructedList, err := ToUnstructuredList(&serviceList)
unstructuredList, err := ToUnstructuredList(&serviceList)
assert.NilError(t, err)
assert.DeepEqual(t, unstructedList, expectedList)
assert.DeepEqual(t, unstructuredList, expectedList)
service1 := createService("s3")
expectedList = &unstructured.UnstructuredList{}
expectedList.Items = []unstructured.Unstructured{createUnstructured("s3")}
unstructedList, err = ToUnstructuredList(&service1)
unstructuredList, err = ToUnstructuredList(&service1)
assert.NilError(t, err)
assert.DeepEqual(t, unstructedList, expectedList)
assert.DeepEqual(t, unstructuredList, expectedList)
}
func createService(name string) servingv1.Service {

View File

@ -42,7 +42,7 @@ func NewFakeWatch(events []watch.Event) *FakeWatch {
}
}
// Stop the watch challend
// Stop the watch channel
func (f *FakeWatch) Stop() {
f.StopCalled++
}

View File

@ -466,7 +466,7 @@ function start_release_eventing_sugar_controller() {
start_knative_eventing_extension "https://storage.googleapis.com/knative-releases/eventing/previous/v$1/eventing-sugar-controller.yaml" "knative-eventing"
}
# Install the sugar cotroller eventing extension
# Install the sugar controller eventing extension
function start_latest_eventing_sugar_controller() {
start_knative_eventing_extension "${KNATIVE_EVENTING_SUGAR_CONTROLLER_RELEASE}" "knative-eventing"
}

View File

@ -136,7 +136,7 @@ function reconcile_benchmark_clusters() {
# can be as long as <update_clusters interval>.
}
# Parse flags and excute the command.
# Parse flags and execute the command.
function main() {
if (( ! IS_PROW )); then
abort "this script should only be run by Prow since it needs secrets created on Prow cluster"

View File

@ -32,7 +32,7 @@ var targetsSeparator = "|"
var targetFieldsSeparator = ","
var targetFieldsLength = 4
// returns deployed service targets separated by '|' and each target fields seprated by comma
// returns deployed service targets separated by '|' and each target fields separated by comma
var targetsJsonPath = "jsonpath={range .status.traffic[*]}{.tag}{','}{.revisionName}{','}{.percent}{','}{.latestRevision}{'|'}{end}"
// TargetFields are used in e2e to store expected fields per traffic target
@ -254,7 +254,7 @@ func TestTrafficSplit(t *testing.T) {
test.ServiceDelete(r, serviceName)
},
)
// test reducing number of targets from traffic blockdd
// test reducing number of targets from traffic blocked
t.Run("RemoveTag",
func(t *testing.T) {
t.Log("remove a revision with tag old from traffic block entirely")
@ -401,7 +401,7 @@ func TestTrafficSplit(t *testing.T) {
expectedTargets := []TargetFields{newTargetFields("", rev2, 100, true),
newTargetFields("old", rev1, 0, false),
// Tagging by revision name adds a new target even though latestReadyRevision==rev2,
// because we didn't refer @latest reference, but explcit name of revision.
// because we didn't refer @latest reference, but explicit name of revision.
// In spec of traffic block (not status) either latestReadyRevision:true or revisionName can be given per target
newTargetFields("latest", rev2, 0, false)}