* spelling: adopted

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

* spelling: aliased

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

* spelling: apierrs

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

* spelling: assignment

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

* spelling: available

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

* spelling: coexistence

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

* spelling: commit

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

* spelling: conversions

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

* spelling: creates

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

* spelling: custom

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

* spelling: determine

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

* spelling: different

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

* spelling: distribution

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

* spelling: duplicate

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

* spelling: editing

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

* spelling: endpoint

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

* spelling: environment

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

* spelling: generate

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

* spelling: implementation

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

* spelling: identified

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

* spelling: ignore

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

* spelling: indicates

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

* spelling: interface

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

* spelling: interleaved

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

* spelling: labels

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

* spelling: label

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

* spelling: mimic

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

* spelling: namespaced

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

* spelling: necessary

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

* spelling: organization

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

* spelling: populatable

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

* spelling: prometheus

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

* spelling: refer

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

* spelling: reference

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

* spelling: repetitive

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

* spelling: response

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

* spelling: something

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

* spelling: specable

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

* spelling: spoofing

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

* spelling: synchronized

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

* spelling: this

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

* spelling: trailing

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

* spelling: unsupported

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

* spelling: validation

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

* chore: reviewdog go header boilerplate

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>
This commit is contained in:
Josh Soref 2020-10-18 17:22:57 -04:00 committed by GitHub
parent c1a8664276
commit b39d5da935
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
45 changed files with 58 additions and 56 deletions

View File

@ -6,7 +6,7 @@ three duck types that are used throughout Knative: `Addressable`, `Binding`, and
`Source`. `Source`.
For APIs leveraging `ObjectReference`, the context of the resource in question For APIs leveraging `ObjectReference`, the context of the resource in question
identifies the duck-type. To enable the case where no `ObjectRefrence` is used, identifies the duck-type. To enable the case where no `ObjectReference` is used,
we have labeled the Custom Resource Definition with the duck-type. Those labels we have labeled the Custom Resource Definition with the duck-type. Those labels
are as follows: are as follows:

View File

@ -361,7 +361,7 @@ func (f *String) Populate() {
var emptyStringable Stringable var emptyStringable Stringable
// For testing this doubles as the 'Implementable' // For testing this doubles as the 'Implementable'
// and 'Populataable' // and 'Populatable'
type UnableToMarshal struct{} type UnableToMarshal struct{}
var _ Implementable = (*UnableToMarshal)(nil) var _ Implementable = (*UnableToMarshal)(nil)

View File

@ -317,7 +317,7 @@ func ErrDisallowedUpdateDeprecatedFields(fieldPaths ...string) *FieldError {
} }
} }
// ErrInvalidArrayValue constructs a FieldError for a repetetive `field` // ErrInvalidArrayValue constructs a FieldError for a repetitive `field`
// at `index` that has received an invalid value. // at `index` that has received an invalid value.
func ErrInvalidArrayValue(value interface{}, field string, index int) *FieldError { func ErrInvalidArrayValue(value interface{}, field string, index int) *FieldError {
return ErrInvalidValue(value, CurrentField).ViaFieldIndex(field, index) return ErrInvalidValue(value, CurrentField).ViaFieldIndex(field, index)

View File

@ -179,7 +179,7 @@ func (r *reconcilerImpl) Reconcile(ctx context.Context, key string) error {
logger := logging.FromContext(ctx) logger := logging.FromContext(ctx)
// Initialize the reconciler state. This will convert the namespace/name // Initialize the reconciler state. This will convert the namespace/name
// string into a distinct namespace and name, determin if this instance of // string into a distinct namespace and name, determine if this instance of
// the reconciler is the leader, and any additional interfaces implemented // the reconciler is the leader, and any additional interfaces implemented
// by the reconciler. Returns an error is the resource key is invalid. // by the reconciler. Returns an error is the resource key is invalid.
s, err := newState(key, r) s, err := newState(key, r)

View File

@ -179,7 +179,7 @@ func (r *reconcilerImpl) Reconcile(ctx context.Context, key string) error {
logger := logging.FromContext(ctx) logger := logging.FromContext(ctx)
// Initialize the reconciler state. This will convert the namespace/name // Initialize the reconciler state. This will convert the namespace/name
// string into a distinct namespace and name, determin if this instance of // string into a distinct namespace and name, determine if this instance of
// the reconciler is the leader, and any additional interfaces implemented // the reconciler is the leader, and any additional interfaces implemented
// by the reconciler. Returns an error is the resource key is invalid. // by the reconciler. Returns an error is the resource key is invalid.
s, err := newState(key, r) s, err := newState(key, r)

View File

@ -179,7 +179,7 @@ func (r *reconcilerImpl) Reconcile(ctx context.Context, key string) error {
logger := logging.FromContext(ctx) logger := logging.FromContext(ctx)
// Initialize the reconciler state. This will convert the namespace/name // Initialize the reconciler state. This will convert the namespace/name
// string into a distinct namespace and name, determin if this instance of // string into a distinct namespace and name, determine if this instance of
// the reconciler is the leader, and any additional interfaces implemented // the reconciler is the leader, and any additional interfaces implemented
// by the reconciler. Returns an error is the resource key is invalid. // by the reconciler. Returns an error is the resource key is invalid.
s, err := newState(key, r) s, err := newState(key, r)

View File

@ -178,7 +178,7 @@ func (r *reconcilerImpl) Reconcile(ctx context.Context, key string) error {
logger := logging.FromContext(ctx) logger := logging.FromContext(ctx)
// Initialize the reconciler state. This will convert the namespace/name // Initialize the reconciler state. This will convert the namespace/name
// string into a distinct namespace and name, determin if this instance of // string into a distinct namespace and name, determine if this instance of
// the reconciler is the leader, and any additional interfaces implemented // the reconciler is the leader, and any additional interfaces implemented
// by the reconciler. Returns an error is the resource key is invalid. // by the reconciler. Returns an error is the resource key is invalid.
s, err := newState(key, r) s, err := newState(key, r)

View File

@ -363,7 +363,7 @@ func (r *reconcilerImpl) Reconcile(ctx {{.contextContext|raw}}, key string) erro
logger := {{.loggingFromContext|raw}}(ctx) logger := {{.loggingFromContext|raw}}(ctx)
// Initialize the reconciler state. This will convert the namespace/name // Initialize the reconciler state. This will convert the namespace/name
// string into a distinct namespace and name, determin if this instance of // string into a distinct namespace and name, determine if this instance of
// the reconciler is the leader, and any additional interfaces implemented // the reconciler is the leader, and any additional interfaces implemented
// by the reconciler. Returns an error is the resource key is invalid. // by the reconciler. Returns an error is the resource key is invalid.
s, err := newState(key, r) s, err := newState(key, r)

View File

@ -270,7 +270,7 @@ func (c *Impl) EnqueueSlowKey(key types.NamespacedName) {
safeKey(key), c.workQueue.Len(), c.workQueue.SlowLane().Len()) safeKey(key), c.workQueue.Len(), c.workQueue.SlowLane().Len())
} }
// EnqueueSlow extracts namesspeced name from the object and enqueues it on the slow // EnqueueSlow extracts namespaced name from the object and enqueues it on the slow
// work queue. // work queue.
func (c *Impl) EnqueueSlow(obj interface{}) { func (c *Impl) EnqueueSlow(obj interface{}) {
object, err := kmeta.DeletionHandlingAccessor(obj) object, err := kmeta.DeletionHandlingAccessor(obj)

View File

@ -122,7 +122,7 @@ func (tlq *twoLaneQueue) runConsumer() {
} }
} }
// Shutdown implements workqueue.Interace. // Shutdown implements workqueue.Interface.
// Shutdown shuts down both queues. // Shutdown shuts down both queues.
func (tlq *twoLaneQueue) ShutDown() { func (tlq *twoLaneQueue) ShutDown() {
tlq.RateLimitingInterface.ShutDown() tlq.RateLimitingInterface.ShutDown()

View File

@ -21,7 +21,7 @@ limitations under the License.
// target. // target.
// - BucketSet is a bucketer library which uses ChooseSubset under the // - BucketSet is a bucketer library which uses ChooseSubset under the
// the hood in order to implement consistent mapping between keys and // the hood in order to implement consistent mapping between keys and
// set of buckets, indentified by unique names. Compared to basic bucket // set of buckets, identified by unique names. Compared to basic bucket
// implementtion which just does hash%num_buckets, when the number of // implementation which just does hash%num_buckets, when the number of
// buckets change only a small subset of keys are supposed to migrate. // buckets change only a small subset of keys are supposed to migrate.
package hash package hash

View File

@ -38,10 +38,10 @@ func ExampleChooseSubset_selectOne() {
ret := ChooseSubset(tasks, 1, "my-key1") ret := ChooseSubset(tasks, 1, "my-key1")
fmt.Println(ret.UnsortedList()[0]) fmt.Println(ret.UnsortedList()[0])
ret = ChooseSubset(tasks, 1, "somthing/another-key") ret = ChooseSubset(tasks, 1, "something/another-key")
fmt.Println(ret.UnsortedList()[0]) fmt.Println(ret.UnsortedList()[0])
// Output: task3 // Output: task3
// task1 // task2
} }
func ExampleChooseSubset_selectMany() { func ExampleChooseSubset_selectMany() {

View File

@ -202,7 +202,7 @@ func MainWithConfig(ctx context.Context, component string, cfg *rest.Config, cto
eg.Go(profilingServer.ListenAndServe) eg.Go(profilingServer.ListenAndServe)
// Many of the webhooks rely on configuration, e.g. configurable defaults, feature flags. // Many of the webhooks rely on configuration, e.g. configurable defaults, feature flags.
// So make sure that we have synchonized our configuration state before launching the // So make sure that we have synchronized our configuration state before launching the
// webhooks, so that things are properly initialized. // webhooks, so that things are properly initialized.
logger.Info("Starting configuration manager...") logger.Info("Starting configuration manager...")
if err := cmw.Start(ctx.Done()); err != nil { if err := cmw.Start(ctx.Done()); err != nil {

View File

@ -13,10 +13,11 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
*/ */
package kmeta package kmeta
// OwnerRefableAccessor is a combination of OwnerRefable interface and Accessor interface // OwnerRefableAccessor is a combination of OwnerRefable interface and Accessor interface
// which inidcates that it has 1) sufficient information to produce a metav1.OwnerReference to an object, // which indicates that it has 1) sufficient information to produce a metav1.OwnerReference to an object,
// 2) and a collection of interfaces from metav1.TypeMeta runtime.Object and metav1.Object that Kubernetes API types // 2) and a collection of interfaces from metav1.TypeMeta runtime.Object and metav1.Object that Kubernetes API types
// registered with runtime.Scheme must support. // registered with runtime.Scheme must support.
type OwnerRefableAccessor interface { type OwnerRefableAccessor interface {

View File

@ -13,6 +13,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
*/ */
package kmeta package kmeta
import ( import (

View File

@ -198,7 +198,7 @@ type statefulSetBuilder struct {
func (b *statefulSetBuilder) buildElector(ctx context.Context, la reconciler.LeaderAware, enq func(reconciler.Bucket, types.NamespacedName)) (Elector, error) { func (b *statefulSetBuilder) buildElector(ctx context.Context, la reconciler.LeaderAware, enq func(reconciler.Bucket, types.NamespacedName)) (Elector, error) {
logger := logging.FromContext(ctx) logger := logging.FromContext(ctx)
logger.Infof("%s will run in StatefulSet ordinal assignement mode with bucket name %s", logger.Infof("%s will run in StatefulSet ordinal assignment mode with bucket name %s",
b.lec.Component, b.bkt.Name()) b.lec.Component, b.bkt.Name())
return &unopposedElector{ return &unopposedElector{

View File

@ -69,10 +69,10 @@ func NewLogger(configJSON string, levelOverride string, opts ...zap.Option) (*za
} }
func enrichLoggerWithCommitID(logger *zap.Logger) *zap.SugaredLogger { func enrichLoggerWithCommitID(logger *zap.Logger) *zap.SugaredLogger {
commmitID, err := changeset.Get() commitID, err := changeset.Get()
if err == nil { if err == nil {
// Enrich logs with GitHub commit ID. // Enrich logs with GitHub commit ID.
return logger.With(zap.String(logkey.GitHubCommitID, commmitID)).Sugar() return logger.With(zap.String(logkey.GitHubCommitID, commitID)).Sugar()
} }
logger.Info("Fetch GitHub commit ID from kodata failed", zap.Error(err)) logger.Info("Fetch GitHub commit ID from kodata failed", zap.Error(err))

View File

@ -196,7 +196,7 @@ func newMetricsExporter(config *metricsConfig, logger *zap.SugaredLogger) (view.
// If there is a Prometheus Exporter server running, stop it. // If there is a Prometheus Exporter server running, stop it.
resetCurPromSrv() resetCurPromSrv()
// TODO(https://github.com/knative/pkg/issues/866): Move Stackdriver and Promethus // TODO(https://github.com/knative/pkg/issues/866): Move Stackdriver and Prometheus
// operations before stopping to an interface. // operations before stopping to an interface.
if se, ok := curMetricsExporter.(stoppable); ok { if se, ok := curMetricsExporter.(stoppable); ok {
se.StopMetricsExporter() se.StopMetricsExporter()
@ -213,7 +213,7 @@ func newMetricsExporter(config *metricsConfig, logger *zap.SugaredLogger) (view.
ff := factory[config.backendDestination] ff := factory[config.backendDestination]
if ff == nil { if ff == nil {
return nil, nil, fmt.Errorf("unsuppored metrics backend %v", config.backendDestination) return nil, nil, fmt.Errorf("unsupported metrics backend %v", config.backendDestination)
} }
return ff(config, logger) return ff(config, logger)
} }

View File

@ -197,7 +197,7 @@ func TestMetricsExporter(t *testing.T) {
} }
} }
func TestInterlevedExporters(t *testing.T) { func TestInterleavedExporters(t *testing.T) {
// Disabling this test as it fails intermittently. // Disabling this test as it fails intermittently.
// Refer to https://github.com/knative/pkg/issues/406 // Refer to https://github.com/knative/pkg/issues/406
t.Skip() t.Skip()

View File

@ -42,8 +42,8 @@ type Value struct {
Float64 *float64 Float64 *float64
Distribution *metricdata.Distribution Distribution *metricdata.Distribution
// VerifyDistributionCountOnly makes Equal compare the Distribution with the // VerifyDistributionCountOnly makes Equal compare the Distribution with the
// field Count only, and ingore all other fields of Distribution. // field Count only, and ignore all other fields of Distribution.
// This is ingored when the value is not a Distribution. // This is ignored when the value is not a Distribution.
VerifyDistributionCountOnly bool VerifyDistributionCountOnly bool
} }
@ -161,7 +161,7 @@ func FloatMetric(name string, value float64, tags map[string]string) Metric {
} }
} }
// DistributionCountOnlyMetric creates a distrubtion metric for test, and verifying only the count. // DistributionCountOnlyMetric creates a distribution metric for test, and verifying only the count.
func DistributionCountOnlyMetric(name string, count int64, tags map[string]string) Metric { func DistributionCountOnlyMetric(name string, count int64, tags map[string]string) Metric {
return Metric{ return Metric{
Name: name, Name: name,

View File

@ -26,7 +26,7 @@ const (
// DefaultConnTimeout specifies a short default connection timeout // DefaultConnTimeout specifies a short default connection timeout
// to avoid hitting the issue fixed in // to avoid hitting the issue fixed in
// https://github.com/kubernetes/kubernetes/pull/72534 but only // https://github.com/kubernetes/kubernetes/pull/72534 but only
// avalailable after Kubernetes 1.14. // available after Kubernetes 1.14.
// //
// Our connections are usually between pods in the same cluster // Our connections are usually between pods in the same cluster
// like activator <-> queue-proxy, or even between containers // like activator <-> queue-proxy, or even between containers

View File

@ -97,7 +97,7 @@ func TestGenerateNameReactor(t *testing.T) {
} }
if !lastHandlerInvoked { if !lastHandlerInvoked {
t.Error("GenreateNameReactor should not interfere with the fake's ReactionChain") t.Error("GenerateNameReactor should not interfere with the fake's ReactionChain")
} }
}) })
} }

View File

@ -24,15 +24,15 @@ import (
func TestLabels(t *testing.T) { func TestLabels(t *testing.T) {
sourceLabeles := Labels("foo", "foo-source-controller") sourceLabels := Labels("foo", "foo-source-controller")
wantTags := map[string]string{ wantTags := map[string]string{
sourceControllerName: "foo-source-controller", sourceControllerName: "foo-source-controller",
sourceName: "foo", sourceName: "foo",
} }
eq := cmp.Equal(sourceLabeles, wantTags) eq := cmp.Equal(sourceLabels, wantTags)
if !eq { if !eq {
t.Fatalf("%v is not equal to %v", sourceLabeles, wantTags) t.Fatalf("%v is not equal to %v", sourceLabels, wantTags)
} }
} }

View File

@ -164,7 +164,7 @@ func (g *GCSClient) ListChildrenFiles(ctx context.Context, bucketName, dirPath s
func (g *GCSClient) ListDirectChildren(ctx context.Context, bucketName, dirPath string) ([]string, error) { func (g *GCSClient) ListDirectChildren(ctx context.Context, bucketName, dirPath string) ([]string, error) {
// If there are 2 directories named "foo" and "foobar", // If there are 2 directories named "foo" and "foobar",
// then given storagePath "foo" will get files both under "foo" and "foobar". // then given storagePath "foo" will get files both under "foo" and "foobar".
// Add trailling slash to storagePath, so that only gets children under given directory. // Add trailing slash to storagePath, so that only gets children under given directory.
return g.listChildren(ctx, bucketName, dirPath, "/") return g.listChildren(ctx, bucketName, dirPath, "/")
} }

View File

@ -27,8 +27,8 @@ import (
) )
// I don't know if it is easier or not to use go mock, but we really only need two things: // I don't know if it is easier or not to use go mock, but we really only need two things:
// 1) Ability to mimick creation of buckets and objects // 1) Ability to mimic creation of buckets and objects
// 2) Ability to mimick returning errors // 2) Ability to mimic returning errors
// //
// We don't need arbitrary return values, so generators like go mock or testify might be // We don't need arbitrary return values, so generators like go mock or testify might be
// overkill and doesn't give us the flexibility we need (e.g., will have to specify and // overkill and doesn't give us the flexibility we need (e.g., will have to specify and

View File

@ -278,7 +278,7 @@ func (gih *IssueHandler) addComment(issueNumber int, commentBody string) error {
// editComment will edit the comment to the new body. // editComment will edit the comment to the new body.
func (gih *IssueHandler) editComment(issueNumber int, commentID int64, commentBody string) error { func (gih *IssueHandler) editComment(issueNumber int, commentID int64, commentBody string) error {
return helpers.Run( return helpers.Run(
fmt.Sprintf("editting comment to %q for issue %d in %q", commentBody, issueNumber, gih.config.repo), fmt.Sprintf("editing comment to %q for issue %d in %q", commentBody, issueNumber, gih.config.repo),
func() error { func() error {
return gih.client.EditComment(gih.config.org, gih.config.repo, commentID, commentBody) return gih.client.EditComment(gih.config.org, gih.config.repo, commentID, commentBody)
}, },

View File

@ -37,7 +37,7 @@ type Config struct {
// Repository holds the name of the repository that runs the benchmarks. // Repository holds the name of the repository that runs the benchmarks.
Repository string Repository string
// Environment holds the name of the environement, // Environment holds the name of the environment,
// where the test runs, e.g. `dev`. // where the test runs, e.g. `dev`.
Environment string Environment string

View File

@ -44,7 +44,7 @@ const (
// assorted preprocessing. // assorted preprocessing.
sidecarAddress = "localhost:9813" sidecarAddress = "localhost:9813"
// org is the orgnization name that is used by Github client // org is the organization name that is used by Github client
org = "knative" org = "knative"
// slackUserName is the slack user name that is used by Slack client // slackUserName is the slack user name that is used by Slack client
@ -85,7 +85,7 @@ func EscapeTag(tag string) string {
} }
// SetupHelper sets up the mako client for the provided benchmarkKey. // SetupHelper sets up the mako client for the provided benchmarkKey.
// It will add a few common tags and allow each benchmark to add custm tags as well. // It will add a few common tags and allow each benchmark to add custom tags as well.
// It returns the mako client handle to store metrics, a method to close the connection // It returns the mako client handle to store metrics, a method to close the connection
// to mako server once done and error in case of failures. // to mako server once done and error in case of failures.
func SetupHelper(ctx context.Context, benchmarkKey *string, benchmarkName *string, extraTags ...string) (*Client, error) { func SetupHelper(ctx context.Context, benchmarkKey *string, benchmarkName *string, extraTags ...string) (*Client, error) {

View File

@ -24,7 +24,7 @@ import (
"net/http" "net/http"
"strings" "strings"
"github.com/golang/protobuf/jsonpb" //nolint: the newer package has differnet interface. "github.com/golang/protobuf/jsonpb" //nolint: the newer package has different interface.
mako "github.com/google/mako/spec/proto/mako_go_proto" mako "github.com/google/mako/spec/proto/mako_go_proto"
"log" "log"

View File

@ -22,7 +22,7 @@ This package exposes following methods:
CheckPortAvailability(port int) error CheckPortAvailability(port int) error
Checks if the given port is available Checks if the given port is available
GetPods(kubeClientset kubernetes.Interface, app string) (*v1.PodList, error) GetPods(kubeClientset kubernetes.Interface, app string) (*v1.PodList, error)
Gets the list of pods that satisfy the lable selector app=<app> Gets the list of pods that satisfy the label selector app=<app>
Cleanup(pid int) error Cleanup(pid int) error
Kill the current port forwarding process running in the background Kill the current port forwarding process running in the background
PortForward(logf logging.FormatLogger, podList *v1.PodList, localPort, remotePort int) (int, error) PortForward(logf logging.FormatLogger, podList *v1.PodList, localPort, remotePort int) (int, error)

View File

@ -56,7 +56,7 @@ func (r *Response) String() string {
// https://medium.com/stupid-gopher-tricks/ensuring-go-interface-satisfaction-at-compile-time-1ed158e8fa17 // https://medium.com/stupid-gopher-tricks/ensuring-go-interface-satisfaction-at-compile-time-1ed158e8fa17
var dialContext = (&net.Dialer{}).DialContext var dialContext = (&net.Dialer{}).DialContext
// ResponseChecker is used to determine when SpoofinClient.Poll is done polling. // ResponseChecker is used to determine when SpoofingClient.Poll is done polling.
// This allows you to predicate wait.PollImmediate on the request's http.Response. // This allows you to predicate wait.PollImmediate on the request's http.Response.
// //
// See the apimachinery wait package: // See the apimachinery wait package:

View File

@ -16,7 +16,7 @@ limitations under the License.
// Defines an interface of commonality between testing.T and logging.TLogger // Defines an interface of commonality between testing.T and logging.TLogger
// Allows most library functions to be shared // Allows most library functions to be shared
// Simplifies coexistance with TLogger // Simplifies coexistence with TLogger
package test package test

View File

@ -13,4 +13,4 @@
# limitations under the License. # limitations under the License.
# This file is added for testing the scenario when cluster.yaml does not exist in the benchmark folder. # This file is added for testing the scenario when cluster.yaml does not exist in the benchmark folder.
# It's necesssary since empty directory will be ignored when we push it to Github. # It's necessary since empty directory will be ignored when we push it to Github.

View File

@ -122,7 +122,7 @@ func WithExporter(name string, logger *zap.SugaredLogger) ConfigOption {
// the host name must be able to be resolved. // the host name must be able to be resolved.
// e.g) // e.g)
// "name" is a service name like activator-service. // "name" is a service name like activator-service.
// "host" is a endpoint IP like activator-service's endpint IP. // "host" is a endpoint IP like activator-service's endpoint IP.
func WithExporterFull(name, host string, logger *zap.SugaredLogger) ConfigOption { func WithExporterFull(name, host string, logger *zap.SugaredLogger) ConfigOption {
return func(cfg *config.Config) error { return func(cfg *config.Config) error {
var ( var (

View File

@ -58,7 +58,7 @@ func TestHappyPathsExact(t *testing.T) {
thing2 := &Resource{ thing2 := &Resource{
TypeMeta: metav1.TypeMeta{ TypeMeta: metav1.TypeMeta{
APIVersion: "reffer.knative.dev/v1alpha1", APIVersion: "refer.knative.dev/v1alpha1",
Kind: "Thing2", Kind: "Thing2",
}, },
ObjectMeta: metav1.ObjectMeta{ ObjectMeta: metav1.ObjectMeta{
@ -489,7 +489,7 @@ func TestHappyPathsInexact(t *testing.T) {
thing2 := &Resource{ thing2 := &Resource{
TypeMeta: metav1.TypeMeta{ TypeMeta: metav1.TypeMeta{
APIVersion: "reffer.knative.dev/v1alpha1", APIVersion: "refer.knative.dev/v1alpha1",
Kind: "Thing2", Kind: "Thing2",
}, },
ObjectMeta: metav1.ObjectMeta{ ObjectMeta: metav1.ObjectMeta{
@ -700,7 +700,7 @@ func TestHappyPathsByBoth(t *testing.T) {
thing2 := &Resource{ thing2 := &Resource{
TypeMeta: metav1.TypeMeta{ TypeMeta: metav1.TypeMeta{
APIVersion: "reffer.knative.dev/v1alpha1", APIVersion: "refer.knative.dev/v1alpha1",
Kind: "Thing2", Kind: "Thing2",
}, },
ObjectMeta: metav1.ObjectMeta{ ObjectMeta: metav1.ObjectMeta{

View File

@ -284,7 +284,7 @@ func TestAdmissionInvalidResponseForResource(t *testing.T) {
var respPatch []jsonpatch.JsonPatchOperation var respPatch []jsonpatch.JsonPatchOperation
err = json.Unmarshal(reviewResponse.Response.Patch, &respPatch) err = json.Unmarshal(reviewResponse.Response.Patch, &respPatch)
if err == nil { if err == nil {
t.Fatalf("Expected to fail JSON unmarshal of resposnse") t.Fatalf("Expected to fail JSON unmarshal of response")
} }
if got, want := reviewResponse.Response.Result.Status, "Failure"; got != want { if got, want := reviewResponse.Response.Result.Status, "Failure"; got != want {

View File

@ -393,7 +393,7 @@ func (r *BaseReconciler) ReconcileSubject(ctx context.Context, fb Bindable, muta
for _, ps := range referents { for _, ps := range referents {
ps := ps ps := ps
eg.Go(func() error { eg.Go(func() error {
// Do the binding to the pod speccable. // Do the binding to the pod specable.
orig := ps.DeepCopy() orig := ps.DeepCopy()
mutation(ctx, ps) mutation(ctx, ps)

View File

@ -1518,7 +1518,7 @@ func TestBaseReconcile(t *testing.T) {
Type: "Ready", Type: "Ready",
Status: "False", Status: "False",
Reason: "SubjectUnavailable", Reason: "SubjectUnavailable",
// prefix comes from apiserrs.NewForbidden // prefix comes from apierrs.NewForbidden
Message: "forbidden: some-error", Message: "forbidden: some-error",
}}, }},
}, },

View File

@ -62,7 +62,7 @@ type GroupKindConversion struct {
DefinitionName string DefinitionName string
// HubVersion specifies which version of the CustomResource supports // HubVersion specifies which version of the CustomResource supports
// convertions to and from all types // conversions to and from all types
// //
// It is expected that the Zygotes map contains an entry for the // It is expected that the Zygotes map contains an entry for the
// specified HubVersion // specified HubVersion

View File

@ -52,7 +52,7 @@ func NewAdmissionController(
// This not ideal, we are using a variadic argument to effectively make callbacks optional // This not ideal, we are using a variadic argument to effectively make callbacks optional
// This allows this addition to be non-breaking to consumers of /pkg // This allows this addition to be non-breaking to consumers of /pkg
// TODO: once all sub-repos have adoped this, we might move this back to a traditional param. // TODO: once all sub-repos have adopted this, we might move this back to a traditional param.
var unwrappedCallbacks map[schema.GroupVersionKind]Callback var unwrappedCallbacks map[schema.GroupVersionKind]Callback
switch len(callbacks) { switch len(callbacks) {
case 0: case 0:

View File

@ -374,7 +374,7 @@ func TestNew(t *testing.T) {
t.Error("Promote() =", err) t.Error("Promote() =", err)
} }
// Queue has async moving parts so if we check at the wrong moment, thist might still be 0. // Queue has async moving parts so if we check at the wrong moment, this might still be 0.
if wait.PollImmediate(10*time.Millisecond, 250*time.Millisecond, func() (bool, error) { if wait.PollImmediate(10*time.Millisecond, 250*time.Millisecond, func() (bool, error) {
return c.WorkQueue().Len() == 1, nil return c.WorkQueue().Len() == 1, nil
}) != nil { }) != nil {

View File

@ -157,7 +157,7 @@ func (ac *reconciler) decodeRequestAndPrepareContext(
func validate(ctx context.Context, resource resourcesemantics.GenericCRD, req *admissionv1.AdmissionRequest) error { func validate(ctx context.Context, resource resourcesemantics.GenericCRD, req *admissionv1.AdmissionRequest) error {
logger := logging.FromContext(ctx) logger := logging.FromContext(ctx)
// Only run validation for supported create and update validaiton. // Only run validation for supported create and update validation.
switch req.Operation { switch req.Operation {
case admissionv1.Create, admissionv1.Update: case admissionv1.Create, admissionv1.Update:
// Supported verbs // Supported verbs

View File

@ -605,7 +605,7 @@ func TestNewResourceAdmissionController(t *testing.T) {
invalidSecondCallback) invalidSecondCallback)
} }
func TestNewResourceAdmissionControllerDuplciateVerb(t *testing.T) { func TestNewResourceAdmissionControllerDuplicateVerb(t *testing.T) {
ctx, _ := SetupFakeContext(t) ctx, _ := SetupFakeContext(t)
defer func() { defer func() {

View File

@ -69,7 +69,7 @@ type reporter struct {
ctx context.Context ctx context.Context
} }
// NewStatsReporter creaters a reporter for webhook metrics // NewStatsReporter creates a reporter for webhook metrics
func NewStatsReporter() (StatsReporter, error) { func NewStatsReporter() (StatsReporter, error) {
ctx, err := tag.New( ctx, err := tag.New(
context.Background(), context.Background(),

View File

@ -63,7 +63,7 @@ type Options struct {
} }
// Operation is the verb being operated on // Operation is the verb being operated on
// it is aliasde in Validation from the k8s admission package // it is aliased in Validation from the k8s admission package
type Operation = admissionv1.Operation type Operation = admissionv1.Operation
// Operation types // Operation types