diff --git a/cmd/fetcher/app/server.go b/cmd/fetcher/app/server.go index d17f5f59..a1225a7c 100644 --- a/cmd/fetcher/app/server.go +++ b/cmd/fetcher/app/server.go @@ -42,7 +42,7 @@ var ( func Run(ctx context.Context, logger *zap.Logger) { flag.Usage = fetcherUsage collectorEndpoint := flag.String("jaeger-collector-endpoint", "", "") - specializeOnStart := flag.Bool("specialize-on-startup", false, "Flag to activate specialize process at pod starup") + specializeOnStart := flag.Bool("specialize-on-startup", false, "Flag to activate specialize process at pod startup") specializePayload := flag.String("specialize-request", "", "JSON payload for specialize request") secretDir := flag.String("secret-dir", "", "Path to shared secrets directory") configDir := flag.String("cfgmap-dir", "", "Path to shared configmap directory") diff --git a/pkg/apis/core/v1/validation.go b/pkg/apis/core/v1/validation.go index caf10033..6de27292 100644 --- a/pkg/apis/core/v1/validation.go +++ b/pkg/apis/core/v1/validation.go @@ -457,7 +457,7 @@ func (config IngressConfig) Validate() error { // In Ingress, to accept requests from all host, the host field will // be an empty string instead of "*" shown in kubectl. The router replaces - // the asterisk with "" when creating/updateing the Ingress, so here we + // the asterisk with "" when creating/updating the Ingress, so here we // skip the check if the Host is equal to "*". if len(config.Host) > 0 && config.Host != "*" { if strings.Contains(config.Host, "*") { diff --git a/pkg/buildermgr/pkgwatcher.go b/pkg/buildermgr/pkgwatcher.go index fd0eb463..c509d892 100644 --- a/pkg/buildermgr/pkgwatcher.go +++ b/pkg/buildermgr/pkgwatcher.go @@ -165,7 +165,7 @@ func (pkgw *packageWatcher) build(ctx context.Context, srcpkg *fv1.Package) { } // Add the package getter rolebinding to builder sa - // we continue here if role binding was not setup successfully. this is because without this, the fetcher wont be able to fetch the source pkg into the container and + // we continue here if role binding was not setup successfully. this is because without this, the fetcher won't be able to fetch the source pkg into the container and // the build will fail eventually err := utils.SetupRoleBinding(ctx, pkgw.logger, pkgw.k8sClient, fv1.PackageGetterRB, pkg.ObjectMeta.Namespace, fv1.PackageGetterCR, fv1.ClusterRole, fv1.FissionBuilderSA, builderNs) if err != nil { diff --git a/pkg/canaryconfigmgr/canaryConfigMgr.go b/pkg/canaryconfigmgr/canaryConfigMgr.go index 60835bc1..a285895f 100644 --- a/pkg/canaryconfigmgr/canaryConfigMgr.go +++ b/pkg/canaryconfigmgr/canaryConfigMgr.go @@ -77,7 +77,7 @@ func MakeCanaryConfigMgr(logger *zap.Logger, fissionClient *crd.FissionClient, k _, err := url.Parse(prometheusSvc) if err != nil { - return nil, errors.Errorf("prometheus service url not found/invalid, cant create canary config manager: %v", prometheusSvc) + return nil, errors.Errorf("prometheus service url not found/invalid, can't create canary config manager: %v", prometheusSvc) } promClient, err := MakePrometheusClient(logger, prometheusSvc) @@ -140,7 +140,7 @@ func (canaryCfgMgr *canaryConfigMgr) addCanaryConfig(canaryConfig *fv1.CanaryCon // for each canary config, create a ticker with increment interval interval, err := time.ParseDuration(canaryConfig.Spec.WeightIncrementDuration) if err != nil { - canaryCfgMgr.logger.Error("error parsing duration - cant proceed with this canaryConfig", + canaryCfgMgr.logger.Error("error parsing duration - can't proceed with this canaryConfig", zap.Error(err), zap.String("duration", canaryConfig.Spec.WeightIncrementDuration), zap.String("name", canaryConfig.ObjectMeta.Name), @@ -351,7 +351,7 @@ func (canaryCfgMgr *canaryConfigMgr) RollForwardOrBack(canaryConfig *fv1.CanaryC err = canaryCfgMgr.updateCanaryConfigStatusWithRetries(canaryConfig.ObjectMeta.Name, canaryConfig.ObjectMeta.Namespace, fv1.CanaryConfigStatusSucceeded) if err != nil { - // cant do much after max retries other than logging it. + // can't do much after max retries other than logging it. canaryCfgMgr.logger.Error("error updating canary config after max retries", zap.Error(err), zap.String("name", canaryConfig.ObjectMeta.Name), diff --git a/pkg/controller/watchApi.go b/pkg/controller/watchApi.go index 4151ddac..9477fba3 100644 --- a/pkg/controller/watchApi.go +++ b/pkg/controller/watchApi.go @@ -134,7 +134,7 @@ func (a *API) WatchApiCreate(w http.ResponseWriter, r *http.Request) { } // TODO check for duplicate watches - // TODO check for duplicate watches -> we probably wont need it? + // TODO check for duplicate watches -> we probably won't need it? // check if namespace exists, if not create it. err = a.createNsIfNotExists(r.Context(), watch.ObjectMeta.Namespace) if err != nil { diff --git a/pkg/executor/executor.go b/pkg/executor/executor.go index 6145d5d5..b14a341b 100644 --- a/pkg/executor/executor.go +++ b/pkg/executor/executor.go @@ -299,7 +299,7 @@ func StartExecutor(ctx context.Context, logger *zap.Logger, functionNamespace st funcInformer, pkgInformer, envInformer, gpmPodInformer, gpmRsInformer) if err != nil { - return errors.Wrap(err, "pool manager creation faied") + return errors.Wrap(err, "pool manager creation failed") } ndmInformerFactory, err := utils.GetInformerFactoryByExecutor(kubernetesClient, fv1.ExecutorTypeNewdeploy, time.Minute*30) @@ -315,7 +315,7 @@ func StartExecutor(ctx context.Context, logger *zap.Logger, functionNamespace st funcInformer, envInformer, ndmDeplInformer, ndmSvcInformer) if err != nil { - return errors.Wrap(err, "new deploy manager creation faied") + return errors.Wrap(err, "new deploy manager creation failed") } cnmInformerFactory, err := utils.GetInformerFactoryByExecutor(kubernetesClient, fv1.ExecutorTypeContainer, time.Minute*30) @@ -330,7 +330,7 @@ func StartExecutor(ctx context.Context, logger *zap.Logger, functionNamespace st functionNamespace, executorInstanceID, funcInformer, cnmDeplInformer, cnmSvcInformer) if err != nil { - return errors.Wrap(err, "container manager creation faied") + return errors.Wrap(err, "container manager creation failed") } executorTypes := make(map[fv1.ExecutorType]executortype.ExecutorType) diff --git a/pkg/executor/executortype/container/containermgr.go b/pkg/executor/executortype/container/containermgr.go index 33485fb2..168b63ba 100644 --- a/pkg/executor/executortype/container/containermgr.go +++ b/pkg/executor/executortype/container/containermgr.go @@ -664,7 +664,7 @@ func (caaf *Container) getObjName(fn *fv1.Function) string { functionMetadata = functionMetadata + "-" + fn.ObjectMeta.Namespace } } - // contructed name should be 63 characters long, as it is a valid k8s name + // constructed name should be 63 characters long, as it is a valid k8s name // functionMetadata should be 35 characters long, as we take 17 characters from functionUid // with newdeploy 10 character prefix return strings.ToLower(fmt.Sprintf("container-%s-%s", functionMetadata, uid)) diff --git a/pkg/executor/executortype/container/deployment.go b/pkg/executor/executortype/container/deployment.go index e8d4623d..068c4485 100644 --- a/pkg/executor/executortype/container/deployment.go +++ b/pkg/executor/executortype/container/deployment.go @@ -123,7 +123,7 @@ func (cn *Container) updateDeployment(ctx context.Context, deployment *appsv1.De func (cn *Container) deleteDeployment(ctx context.Context, ns string, name string) error { // DeletePropagationBackground deletes the object immediately and dependent are deleted later - // DeletePropagationForeground not advisable; it marks for deleteion and API can still serve those objects + // DeletePropagationForeground not advisable; it marks for deletion and API can still serve those objects deletePropagation := metav1.DeletePropagationBackground return cn.kubernetesClient.AppsV1().Deployments(ns).Delete(ctx, name, metav1.DeleteOptions{ PropagationPolicy: &deletePropagation, diff --git a/pkg/executor/executortype/newdeploy/newdeploy.go b/pkg/executor/executortype/newdeploy/newdeploy.go index f74877d9..81d67144 100644 --- a/pkg/executor/executortype/newdeploy/newdeploy.go +++ b/pkg/executor/executortype/newdeploy/newdeploy.go @@ -174,7 +174,7 @@ func (deploy *NewDeploy) updateDeployment(ctx context.Context, deployment *appsv func (deploy *NewDeploy) deleteDeployment(ctx context.Context, ns string, name string) error { // DeletePropagationBackground deletes the object immediately and dependent are deleted later - // DeletePropagationForeground not advisable; it marks for deleteion and API can still serve those objects + // DeletePropagationForeground not advisable; it marks for deletion and API can still serve those objects deletePropagation := metav1.DeletePropagationBackground return deploy.kubernetesClient.AppsV1().Deployments(ns).Delete(ctx, name, metav1.DeleteOptions{ PropagationPolicy: &deletePropagation, diff --git a/pkg/executor/executortype/newdeploy/newdeploymgr.go b/pkg/executor/executortype/newdeploy/newdeploymgr.go index 2908ac59..6104f6b3 100644 --- a/pkg/executor/executortype/newdeploy/newdeploymgr.go +++ b/pkg/executor/executortype/newdeploy/newdeploymgr.go @@ -712,7 +712,7 @@ func (deploy *NewDeploy) getObjName(fn *fv1.Function) string { functionMetadata = functionMetadata + "-" + fn.ObjectMeta.Namespace } } - // contructed name should be 63 characters long, as it is a valid k8s name + // constructed name should be 63 characters long, as it is a valid k8s name // functionMetadata should be 35 characters long, as we take 17 characters from functionUid // with newdeploy 10 character prefix return strings.ToLower(fmt.Sprintf("newdeploy-%s-%s", functionMetadata, uid)) diff --git a/pkg/executor/executortype/poolmgr/gp.go b/pkg/executor/executortype/poolmgr/gp.go index 4071ac6b..7ed07899 100644 --- a/pkg/executor/executortype/poolmgr/gp.go +++ b/pkg/executor/executortype/poolmgr/gp.go @@ -174,7 +174,7 @@ func (gp *GenericPool) getDeployAnnotations(env *fv1.Environment) map[string]str func (gp *GenericPool) checkMetricsApi() bool { apiGroups, err := gp.metricsClient.DiscoveryClient.ServerGroups() if err != nil { - gp.logger.Error("faied to discover API groups", zap.Error(err)) + gp.logger.Error("failed to discover API groups", zap.Error(err)) return false } return utils.SupportedMetricsAPIVersionAvailable(apiGroups) diff --git a/pkg/executor/executortype/poolmgr/gpm.go b/pkg/executor/executortype/poolmgr/gpm.go index 8af2a5eb..a718a361 100644 --- a/pkg/executor/executortype/poolmgr/gpm.go +++ b/pkg/executor/executortype/poolmgr/gpm.go @@ -690,7 +690,7 @@ func (gpm *GenericPoolManager) WebsocketStartEventChecker(kubeClient *kubernetes if fsvc, ok := gpm.fsCache.PodToFsvc.Load(strings.TrimSuffix(podName[0], ".")); ok { fsvc, ok := fsvc.(*fscache.FuncSvc) if !ok { - gpm.logger.Error("could not covert item from PodToFsvc") + gpm.logger.Error("could not convert item from PodToFsvc") return } gpm.fsCache.WebsocketFsvc.Store(fsvc.Name, true) @@ -731,7 +731,7 @@ func (gpm *GenericPoolManager) NoActiveConnectionEventChecker(kubeClient *kubern if fsvc, ok := gpm.fsCache.PodToFsvc.Load(strings.TrimSuffix(podName[0], ".")); ok { fsvc, ok := fsvc.(*fscache.FuncSvc) if !ok { - gpm.logger.Error("could not covert value from PodToFsvc") + gpm.logger.Error("could not convert value from PodToFsvc") return } ctx := context.Background() diff --git a/pkg/executor/executortype/poolmgr/poolpodcontroller.go b/pkg/executor/executortype/poolmgr/poolpodcontroller.go index bcb41a20..37199bf5 100644 --- a/pkg/executor/executortype/poolmgr/poolpodcontroller.go +++ b/pkg/executor/executortype/poolmgr/poolpodcontroller.go @@ -174,7 +174,7 @@ func (p *PoolPodController) handleRSDelete(obj interface{}) { if !ok { tombstone, ok := obj.(k8sCache.DeletedFinalStateUnknown) if !ok { - p.logger.Error("couldnt get object from tombstone", zap.Any("obj", obj)) + p.logger.Error("couldn't get object from tombstone", zap.Any("obj", obj)) return } rs, ok = tombstone.Obj.(*apps.ReplicaSet) @@ -411,7 +411,7 @@ func (p *PoolPodController) spCleanupPodQueueProcessFunc() bool { p.gpm.fsCache.DeleteFunctionSvc(ctx, fsvc) p.gpm.fsCache.DeleteEntry(fsvc) } else { - p.logger.Error("could not covert item from PodToFsvc", zap.String("key", key)) + p.logger.Error("could not convert item from PodToFsvc", zap.String("key", key)) } } err = p.kubernetesClient.CoreV1().Pods(p.namespace).Delete(context.TODO(), pod.Name, metav1.DeleteOptions{}) diff --git a/pkg/executor/fscache/functionServiceCache.go b/pkg/executor/fscache/functionServiceCache.go index 61a65e19..6a62f03a 100644 --- a/pkg/executor/fscache/functionServiceCache.go +++ b/pkg/executor/fscache/functionServiceCache.go @@ -401,7 +401,7 @@ func (fsc *FunctionServiceCache) ListOld(age time.Duration) ([]*FuncSvc, error) return resp.objects, resp.error } -// ListOldForPool returns a list of aged function serices in cache for pooling. +// ListOldForPool returns a list of aged function services in cache for pooling. func (fsc *FunctionServiceCache) ListOldForPool(age time.Duration) ([]*FuncSvc, error) { responseChannel := make(chan *fscResponse) fsc.requestChannel <- &fscRequest{ diff --git a/pkg/fetcher/config/config.go b/pkg/fetcher/config/config.go index 50270d38..5ca10553 100644 --- a/pkg/fetcher/config/config.go +++ b/pkg/fetcher/config/config.go @@ -113,7 +113,7 @@ func (cfg *Config) NewSpecializeRequest(fn *fv1.Function, env *fv1.Environment) if env.Spec.AllowedFunctionsPerContainer == fv1.AllowedFunctionsPerContainerInfinite { // workflow loads multiple functions into one function pod, // we have to use a Function UID to separate the function code - // to avoid overwritting. + // to avoid overwriting. targetFilename = string(fn.ObjectMeta.UID) } else { // set target file name to fix pattern for diff --git a/pkg/fetcher/types.go b/pkg/fetcher/types.go index 1dd1e551..67f77a04 100644 --- a/pkg/fetcher/types.go +++ b/pkg/fetcher/types.go @@ -62,7 +62,7 @@ type ( // to "/". URL string `json:"url"` - // Metatdata + // Metadata FunctionMetadata *metav1.ObjectMeta EnvVersion int `json:"envVersion"` diff --git a/pkg/fission-cli/flag/flag.go b/pkg/fission-cli/flag/flag.go index 2f99eb26..70e2b0df 100644 --- a/pkg/fission-cli/flag/flag.go +++ b/pkg/fission-cli/flag/flag.go @@ -45,7 +45,7 @@ type ( Usage string DefaultValue interface{} - // If a flag is marked as deprecated, it will hided from + // If a flag is marked as deprecated, it will hidden from // the help message automatically. Hence, a flag cannot be // marked as hidden and deprecated at the same time. Hidden bool @@ -200,7 +200,7 @@ var ( SpecDelete = Flag{Type: Bool, Name: flagkey.SpecDelete, Usage: "Allow apply to delete resources that no longer exist in the specification"} SpecDry = Flag{Type: Bool, Name: flagkey.SpecDry, Usage: "View the generated specs"} SpecValidation = Flag{Type: String, Name: flagkey.SpecValidate, Usage: "Turns server side validations of Fission objects on/off"} - SpecIgnore = Flag{Type: String, Name: flagkey.SpecIgnore, Usage: fmt.Sprintf("File containing specs to be ingored inside --specdir, defaults to %v", util.SPEC_IGNORE_FILE)} + SpecIgnore = Flag{Type: String, Name: flagkey.SpecIgnore, Usage: fmt.Sprintf("File containing specs to be ignored inside --specdir, defaults to %v", util.SPEC_IGNORE_FILE)} SupportOutput = Flag{Type: String, Name: flagkey.SupportOutput, Short: "o", Usage: "Output directory to save dump archive/files", DefaultValue: flagkey.DefaultSpecOutputDir} SupportNoZip = Flag{Type: Bool, Name: flagkey.SupportNoZip, Usage: "Save dump information into multiple files instead of single zip file"} diff --git a/pkg/poolcache/poolcache.go b/pkg/poolcache/poolcache.go index a64f76af..d3ad1bc9 100644 --- a/pkg/poolcache/poolcache.go +++ b/pkg/poolcache/poolcache.go @@ -137,7 +137,7 @@ func (c *Cache) service() { } if value.activeRequests == 0 { if debugLevel { - otelUtils.LoggerWithTraceID(req.ctx, c.logger).Debug("Function service with no acitve requests", zap.String("function", key1.(string)), zap.String("address", key2.(string)), zap.Int("activeRequests", value.activeRequests)) + otelUtils.LoggerWithTraceID(req.ctx, c.logger).Debug("Function service with no active requests", zap.String("function", key1.(string)), zap.String("address", key2.(string)), zap.Int("activeRequests", value.activeRequests)) } vals = append(vals, value.val) } diff --git a/pkg/router/functionHandler.go b/pkg/router/functionHandler.go index 1ba2ac9b..b6f6340a 100644 --- a/pkg/router/functionHandler.go +++ b/pkg/router/functionHandler.go @@ -152,7 +152,7 @@ func (w *fakeCloseReadCloser) RealClose() error { // In such a case, the RoundTripper will retry requests against the new address and give up after maxRetries. // However, the subsequent http call for this function will ensure the cache is invalidated. // -// If GetServiceForFunction returns an error or if RoundTripper exits with an error, it get's translated into 502 +// If GetServiceForFunction returns an error or if RoundTripper exits with an error, it gets translated into 502 // inside ServeHttp function of the reverseProxy. // Earlier, GetServiceForFunction was called inside handler function and fission explicitly set http status code to 500 // if it returned an error. diff --git a/pkg/storagesvc/stowClient.go b/pkg/storagesvc/stowClient.go index 40cfc746..f1e43308 100644 --- a/pkg/storagesvc/stowClient.go +++ b/pkg/storagesvc/stowClient.go @@ -37,7 +37,7 @@ type ( storage Storage } - //StowClient is the wraper client for stow (Cloud storage abstraction package) + //StowClient is the wrapper client for stow (Cloud storage abstraction package) StowClient struct { logger *zap.Logger config *storageConfig diff --git a/pkg/utils/rbacutils.go b/pkg/utils/rbacutils.go index cdaea7e7..08e68f25 100644 --- a/pkg/utils/rbacutils.go +++ b/pkg/utils/rbacutils.go @@ -211,7 +211,7 @@ func RemoveSAFromRoleBindingWithRetries(ctx context.Context, logger *zap.Logger, rbObj.Subjects = newSubjects - // cant use patch for deletes, the results become in-deterministic, so using update. + // can't use patch for deletes, the results become in-deterministic, so using update. _, err = k8sClient.RbacV1().RoleBindings(rbObj.Namespace).Update(ctx, rbObj, metav1.UpdateOptions{}) switch { case err == nil: diff --git a/test/tests/test_obj_create_in_diff_ns.sh b/test/tests/test_obj_create_in_diff_ns.sh index 9d20ac94..5a291632 100755 --- a/test/tests/test_obj_create_in_diff_ns.sh +++ b/test/tests/test_obj_create_in_diff_ns.sh @@ -218,7 +218,7 @@ pool_mgr_test_1() { main() { # extract the test-id generated for this CI test run, so that they can be suffixed to namespaces created as part of - # this test and namespaces wont clash when fission CI tests are run in parallel in the future. + # this test and namespaces won't clash when fission CI tests are run in parallel in the future. id=`echo $FISSION_NAMESPACE| cut -d"-" -f2` echo "test_id : $id" diff --git a/tools/cmd-docs/main.go b/tools/cmd-docs/main.go index d751826c..19992be6 100644 --- a/tools/cmd-docs/main.go +++ b/tools/cmd-docs/main.go @@ -41,7 +41,7 @@ func main() { Short: "Generate docs for fission-cli", Long: "Generate docs for fission-cli", Run: func(cmd *cobra.Command, args []string) { - log.Printf("Generting docs in directory %s", outdir) + log.Printf("Generating docs in directory %s", outdir) fissionApp := app.App() fissionApp.DisableAutoGenTag = true fissionApp.Short = "Serverless framework for Kubernetes"