Fixed typos across fission repo (#1832)

Co-authored-by: Vishal <vishal-biyani@users.noreply.github.com>
This commit is contained in:
Gaurav Gahlot
2020-10-16 17:25:11 +05:30
committed by GitHub
co-authored by Vishal
parent 6e3c42f238
commit fca0a60e5b
49 changed files with 157 additions and 172 deletions
+5 -5
View File
@@ -222,7 +222,7 @@ type (
URL string `json:"url,omitempty"`
// Checksum ensures the integrity of packages
// refereced by URL. Ignored for literals.
// referenced by URL. Ignored for literals.
Checksum Checksum `json:"checksum,omitempty"`
}
@@ -377,7 +377,7 @@ type (
// ExecutionStrategy specifies low-level parameters for function execution,
// such as the number of instances.
//
// MinScale affects the cold start behaviour for a function. If MinScale is 0 then the
// MinScale affects the cold start behavior for a function. If MinScale is 0 then the
// deployment is created on first invocation of function and is good for requests of
// asynchronous nature. If MinScale is greater than 0 then MinScale number of pods are
// created at the time of creation of function. This ensures faster response during first
@@ -679,7 +679,7 @@ type (
MqtKind string `json:"mqtkind,omitempty"`
}
// TimeTrigger invokes the specific function at a time or
// TimeTriggerSpec invokes the specific function at a time or
// times specified by a cron string.
TimeTriggerSpec struct {
// Cron schedule
@@ -691,7 +691,7 @@ type (
FailureType string
// Canary Config Spec
// CanaryConfigSpec defines the canary configuration spec
CanaryConfigSpec struct {
// HTTP trigger that this config references
Trigger string `json:"trigger"`
@@ -713,7 +713,7 @@ type (
FailureType FailureType `json:"failureType"`
}
// CanaryConfig Status
// CanaryConfigStatus represents canary config status
CanaryConfigStatus struct {
Status string `json:"status"`
}
+2 -2
View File
@@ -153,7 +153,7 @@ func (pkgw *packageWatcher) build(buildCache *cache.Cache, srcpkg *fv1.Package)
}
// Add the package getter rolebinding to builder sa
// we continue here if role binding was not setup succeesffully. 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 wont be able to fetch the source pkg into the container and
// the build will fail eventually
err := utils.SetupRoleBinding(pkgw.logger, pkgw.k8sClient, fv1.PackageGetterRB, pkg.ObjectMeta.Namespace, fv1.PackageGetterCR, fv1.ClusterRole, fv1.FissionBuilderSA, builderNs)
if err != nil {
@@ -264,7 +264,7 @@ func (pkgw *packageWatcher) watchPackages() {
// TODO: Once enable "/status", check generation for spec changed instead.
// Before "/status" is enabled, the generation and resource version will be changed
// if we update the status of a package, hence we are not able to differentiate
// the spec change or status change. So we only build package which's status
// the spec change or status change. So we only build package which has status
// us "pending" and user have to use "kubectl replace" to update a package.
if oldPkg.ResourceVersion == pkg.ResourceVersion &&
pkg.Status.BuildStatus != fv1.BuildStatusPending {
+1 -1
View File
@@ -337,7 +337,7 @@ func (canaryCfgMgr *canaryConfigMgr) RollForwardOrBack(canaryConfig *fv1.CanaryC
if doneProcessingCanaryConfig {
ticker.Stop()
// update the status of canary config as done processing, we dont care if we arent able to update because
// update the status of canary config as done processing, we don't care if we aren't able to update because
// resync takes care of the update
err = canaryCfgMgr.updateCanaryConfigStatusWithRetries(canaryConfig.ObjectMeta.Name, canaryConfig.ObjectMeta.Namespace,
fv1.CanaryConfigStatusSucceeded)
+1 -1
View File
@@ -130,7 +130,7 @@ func (api *API) extractQueryParamFromRequest(r *http.Request, queryParam string)
// check if namespace exists, if not create it.
func (api *API) createNsIfNotExists(ns string) error {
if ns == metav1.NamespaceDefault {
// we dont have to create default ns
// we don't have to create default ns
return nil
}
@@ -19,6 +19,7 @@ package v1
import (
"encoding/json"
"fmt"
"github.com/fission/fission/pkg/controller/client/rest"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
@@ -105,7 +106,7 @@ func (c *KubeWatcher) Get(m *metav1.ObjectMeta) (*fv1.KubernetesWatchTrigger, er
}
func (c *KubeWatcher) Update(w *fv1.KubernetesWatchTrigger) (*metav1.ObjectMeta, error) {
return nil, ferror.MakeError(ferror.ErrorNotImplmented, "watch update not implemented")
return nil, ferror.MakeError(ferror.ErrorNotImplemented, "watch update not implemented")
}
func (c *KubeWatcher) Delete(m *metav1.ObjectMeta) error {
+1 -1
View File
@@ -182,7 +182,7 @@ func (a *API) WatchApiGet(w http.ResponseWriter, r *http.Request) {
}
func (a *API) WatchApiUpdate(w http.ResponseWriter, r *http.Request) {
a.respondWithError(w, ferror.MakeError(ferror.ErrorNotImplmented,
a.respondWithError(w, ferror.MakeError(ferror.ErrorNotImplemented,
"Not implemented"))
}
+1 -1
View File
@@ -131,7 +131,7 @@ const (
ErrorNameExists
ErrorInvalidArgument
ErrorNoSpace
ErrorNotImplmented
ErrorNotImplemented
ErrorChecksumFail
ErrorSizeLimitExceeded
ErrorRequestTimeout
+1 -1
View File
@@ -78,7 +78,7 @@ func (executor *Executor) getServiceForFunctionApi(w http.ResponseWriter, r *htt
}
if t == fv1.ExecutorTypePoolmgr && et.GetTotalAvailable(fn) >= conncurrency {
errMsg := fmt.Sprintf("max concurrency reached for %v. All %v instance are active", fn.ObjectMeta.Name, fn.Spec.Concurrency)
executor.logger.Error("error occured", zap.String("error", errMsg))
executor.logger.Error("error occurred", zap.String("error", errMsg))
http.Error(w, errMsg, http.StatusTooManyRequests)
return
}
@@ -558,8 +558,8 @@ func (deploy *NewDeploy) cleanupNewdeploy(ns string, name string) error {
// referencedResourcesRVSum returns the sum of resource version of all resources the function references to.
// We used to update timestamp in the deployment environment field in order to trigger a rolling update when
// the function referenced resources get updated. However, use timestamp means we are not able to avoid tri-
// ggering a rolling update when executor tries to adopt orphaned deployment due to timestamp changed which
// the function referenced resources get updated. However, use timestamp means we are not able to avoid
// triggering a rolling update when executor tries to adopt orphaned deployment due to timestamp changed which
// is unwanted. In order to let executor adopt deployment without triggering a rolling update, we need an
// identical way to get a value that can reflect resources changed without affecting by the time.
// To achieve this goal, the sum of the resource version of all referenced resources is a good fit for our
@@ -70,7 +70,7 @@ func (gpm *GenericPoolManager) makeFuncController(fissionClient *crd.FissionClie
}
// TODO : Just bring to your attention during review :
// setup rolebinding is tried, if it fails, we dont return. we just log an error and move on, because :
// setup rolebinding is tried, if it fails, we don't return. we just log an error and move on, because :
// 1. not all functions have secrets and/or configmaps, so things will work without this rolebinding in that case.
// 2. on the contrary, when the route is tried, the env fetcher logs will show a 403 forbidden message and same will be relayed to executor.
err := utils.SetupRoleBinding(gpm.logger, kubernetesClient, fv1.SecretConfigMapGetterRB, fn.ObjectMeta.Namespace, fv1.SecretConfigMapGetterCR, fv1.ClusterRole, fv1.FissionFetcherSA, envNs)
+2 -2
View File
@@ -253,7 +253,7 @@ func (fetcher *Fetcher) Fetch(ctx context.Context, pkg *fv1.Package, req Functio
}
archive = &pkg.Spec.Deployment
} else {
return http.StatusBadRequest, fmt.Errorf("unkonwn fetch type: %v", req.FetchType)
return http.StatusBadRequest, fmt.Errorf("unknown fetch type: %v", req.FetchType)
}
// get package data as literal or by url
@@ -297,7 +297,7 @@ func (fetcher *Fetcher) Fetch(ctx context.Context, pkg *fv1.Package, req Functio
tmpUnarchivePath := filepath.Join(fetcher.sharedVolumePath, uuid.NewV4().String())
err := fetcher.unarchive(tmpPath, tmpUnarchivePath)
if err != nil {
fetcher.logger.Error("error unarchiving",
fetcher.logger.Error("error unarchive",
zap.Error(err),
zap.String("archive_location", tmpPath),
zap.String("target_location", tmpUnarchivePath))
+1 -1
View File
@@ -64,7 +64,7 @@ func (opts *UpdateSubCommand) complete(input cli.Input) error {
envName := input.String(flagkey.FnEnvironmentName)
envNamespace := input.String(flagkey.NamespaceEnvironment)
// if the new env specified is the same as the old one, no need to update package
// same is true for all update parameters, but, for now, we dont check all of them - because, its ok to
// same is true for all update parameters, but, for now, we don't check all of them - because, its ok to
// re-write the object with same old values, we just end up getting a new resource version for the object.
if len(envName) > 0 && envName == function.Spec.Environment.Name {
envName = ""
+1 -1
View File
@@ -53,7 +53,7 @@ func (opts *ListSubCommand) complete(input cli.Input) error {
func (opts *ListSubCommand) run(input cli.Input) error {
ws, err := opts.Client().V1().KubeWatcher().List(opts.namespace)
if err != nil {
return errors.Wrap(err, "error listing kubewatches")
return errors.Wrap(err, "error listing kubewatchers")
}
w := tabwriter.NewWriter(os.Stdout, 0, 0, 1, ' ', 0)
+1 -1
View File
@@ -88,7 +88,7 @@ func (influx InfluxDB) GetLogs(filter LogFilter) ([]LogEntry, error) {
for _, r := range response.Results {
for _, series := range r.Series {
//create map of columns to row indeces
//create map of columns to row indices
indexMap := makeIndexMap(series.Columns)
// TODO: Remove fallback indexes. Some of index's name changed in fluent-bit, here we add extra fallbackIndexes to address compatibility problem.
+1 -1
View File
@@ -96,7 +96,7 @@ func (c *Cache) service() {
}
}
if !found {
resp.error = ferror.MakeError(ferror.ErrorNotFound, fmt.Sprintf("funtion '%v' No inactive function found", req.function))
resp.error = ferror.MakeError(ferror.ErrorNotFound, fmt.Sprintf("function '%v' No inactive function found", req.function))
}
req.responseChannel <- resp
case listAvailableValue:
+1 -1
View File
@@ -123,7 +123,7 @@ func functionCallCompleted(f *functionLabels, h *httpLabels, overhead, duration
l := labelsToStrings(f, h)
// overhead: time from request ingress into router upto proxing into function pod
// overhead: time from request ingress into router up to proxing into function pod
functionCallOverhead.WithLabelValues(l...).Observe(float64(overhead.Nanoseconds()) / 1e9)
// total function call counter
+1 -1
View File
@@ -29,7 +29,7 @@ const (
HEADERS_FISSION_FUNCTION_PREFIX = "Fission-Function"
)
// setFunctionMetadataToHeaders set function metadatas to request header
// setFunctionMetadataToHeaders set function metadata to request header
func setFunctionMetadataToHeader(meta *metav1.ObjectMeta, request *http.Request) {
request.Header.Set(fmt.Sprintf("X-%s-Uid", HEADERS_FISSION_FUNCTION_PREFIX), string(meta.UID))
request.Header.Set(fmt.Sprintf("X-%s-Name", HEADERS_FISSION_FUNCTION_PREFIX), meta.Name)
+2 -2
View File
@@ -115,7 +115,7 @@ func TestS3StorageService(t *testing.T) {
}
// This is to ensure container is up. Just getting minioClient
// isn't suffcient to assume container is up.
// isn't sufficient to assume container is up.
_, err = minioClient.ListBuckets()
if err != nil {
return err
@@ -148,7 +148,7 @@ func TestS3StorageService(t *testing.T) {
time.Sleep(10 * time.Second)
// Retrive file trhough minioClient
// Retrive file through minioClient
reader, err := minioClient.GetObject(bucketName, fileID, minio.GetObjectOptions{})
panicIf(err)
defer reader.Close()
+2 -2
View File
@@ -84,7 +84,7 @@ func makeRoleBindingObj(roleBinding, roleBindingNs, role, roleKind, sa, saNamesp
}
}
// isSAInRoleBinding checkis if a service account is present in the rolebinding object
// isSAInRoleBinding checks if a service account is present in the rolebinding object
func isSAInRoleBinding(rbObj *rbac.RoleBinding, sa, ns string) bool {
for _, subject := range rbObj.Subjects {
if subject.Name == sa && subject.Namespace == ns {
@@ -281,7 +281,7 @@ func SetupRoleBinding(logger *zap.Logger, k8sClient *kubernetes.Clientset, roleB
// returns silently.
func DeleteRoleBinding(k8sClient *kubernetes.Clientset, roleBinding, roleBindingNs string) error {
// if deleteRoleBinding is invoked by 2 fission services at the same time for the same rolebinding,
// the first call will succeed while the 2nd will fail with isNotFound. but we dont want to error out then.
// the first call will succeed while the 2nd will fail with isNotFound. but we don't want to error out then.
err := k8sClient.RbacV1beta1().RoleBindings(roleBindingNs).Delete(roleBinding, &metav1.DeleteOptions{})
if err == nil || k8serrors.IsNotFound(err) {
return nil