Skip to content

Commit

Permalink
Delete unused serverless_types fields, tests dir
Browse files Browse the repository at this point in the history
  • Loading branch information
MichalKalke committed Apr 5, 2024
1 parent b1d8867 commit 0b40eac
Show file tree
Hide file tree
Showing 93 changed files with 14 additions and 6,944 deletions.
16 changes: 0 additions & 16 deletions components/operator/api/v1alpha1/serverless_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,24 +39,8 @@ type ServerlessSpec struct {
// Used Eventing endpoint
Eventing *Endpoint `json:"eventing,omitempty"`
DockerRegistry *DockerRegistry `json:"dockerRegistry,omitempty"`
// Sets a custom CPU utilization threshold for scaling Function Pods
TargetCPUUtilizationPercentage string `json:"targetCPUUtilizationPercentage,omitempty"`
// Sets the requeue duration for Function. By default, the Function associated with the default configuration is requeued every 5 minutes
FunctionRequeueDuration string `json:"functionRequeueDuration,omitempty"`
// Specifies the arguments passed to the Function build executor
FunctionBuildExecutorArgs string `json:"functionBuildExecutorArgs,omitempty"`
// A number of simultaneous jobs that can run at the same time. The default value is `5`
FunctionBuildMaxSimultaneousJobs string `json:"functionBuildMaxSimultaneousJobs,omitempty"`
// Sets the timeout for the Function health check. The default value in seconds is `10`
HealthzLivenessTimeout string `json:"healthzLivenessTimeout,omitempty"`
// Used to configure the maximum size limit for the request body of a Function. The default value is `1` megabyte
FunctionRequestBodyLimitMb string `json:"functionRequestBodyLimitMb,omitempty"`
// Sets the maximum execution time limit for a Function. By default, the value is `180` seconds
FunctionTimeoutSec string `json:"functionTimeoutSec,omitempty"`
// Configures the default build Job preset to be used
DefaultBuildJobPreset string `json:"defaultBuildJobPreset,omitempty"`
// Configures the default runtime Pod preset to be used
DefaultRuntimePodPreset string `json:"defaultRuntimePodPreset,omitempty"`
}

type State string
Expand Down
20 changes: 0 additions & 20 deletions components/operator/internal/state/controller_configuration.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,29 +35,9 @@ func sFnControllerConfiguration(ctx context.Context, r *reconciler, s *systemSta
}

func updateControllerConfigurationStatus(ctx context.Context, r *reconciler, instance *v1alpha1.Serverless) error {
nodesLen, err := getNodesLen(ctx, r.client)
if err != nil {
return err
}

defaultBuildPreset := slowBuildPreset
defaultRuntimePreset := slowRuntimePreset
if nodesLen > 2 {
defaultBuildPreset = fastBuildPreset
defaultRuntimePreset = fastRuntimePreset
}

spec := instance.Spec
fields := fieldsToUpdate{
{spec.TargetCPUUtilizationPercentage, &instance.Status.CPUUtilizationPercentage, "CPU utilization", ""},
{spec.FunctionRequeueDuration, &instance.Status.RequeueDuration, "Function requeue duration", ""},
{spec.FunctionBuildExecutorArgs, &instance.Status.BuildExecutorArgs, "Function build executor args", ""},
{spec.FunctionBuildMaxSimultaneousJobs, &instance.Status.BuildMaxSimultaneousJobs, "Max number of simultaneous jobs", ""},
{spec.HealthzLivenessTimeout, &instance.Status.HealthzLivenessTimeout, "Duration of health check", ""},
{spec.FunctionRequestBodyLimitMb, &instance.Status.RequestBodyLimitMb, "Max size of request body", ""},
{spec.FunctionTimeoutSec, &instance.Status.TimeoutSec, "Timeout", ""},
{spec.DefaultBuildJobPreset, &instance.Status.DefaultBuildJobPreset, "Default build job preset", defaultBuildPreset},
{spec.DefaultRuntimePodPreset, &instance.Status.DefaultRuntimePodPreset, "Default runtime pod preset", defaultRuntimePreset},
}

updateStatusFields(r.k8s, instance, fields)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,15 +122,7 @@ func Test_sFnControllerConfiguration(t *testing.T) {
s := &systemState{
instance: v1alpha1.Serverless{
Spec: v1alpha1.ServerlessSpec{
TargetCPUUtilizationPercentage: cpuUtilizationTest,
FunctionRequeueDuration: requeueDurationTest,
FunctionBuildExecutorArgs: executorArgsTest,
FunctionBuildMaxSimultaneousJobs: maxSimultaneousJobsTest,
HealthzLivenessTimeout: healthzLivenessTimeoutTest,
FunctionRequestBodyLimitMb: requestBodyLimitMbTest,
FunctionTimeoutSec: timeoutSecTest,
DefaultBuildJobPreset: buildJobPresetTest,
DefaultRuntimePodPreset: runtimePodPresetTest,
HealthzLivenessTimeout: healthzLivenessTimeoutTest,
},
},
flagsBuilder: chart.NewFlagsBuilder(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,12 +55,6 @@ spec:
spec:
description: ServerlessSpec defines the desired state of Serverless
properties:
defaultBuildJobPreset:
description: Configures the default build Job preset to be used
type: string
defaultRuntimePodPreset:
description: Configures the default runtime Pod preset to be used
type: string
dockerRegistry:
properties:
enableInternal:
Expand All @@ -79,35 +73,10 @@ spec:
required:
- endpoint
type: object
functionBuildExecutorArgs:
description: Specifies the arguments passed to the Function build
executor
type: string
functionBuildMaxSimultaneousJobs:
description: A number of simultaneous jobs that can run at the same
time. The default value is `5`
type: string
functionRequestBodyLimitMb:
description: Used to configure the maximum size limit for the request
body of a Function. The default value is `1` megabyte
type: string
functionRequeueDuration:
description: Sets the requeue duration for Function. By default, the
Function associated with the default configuration is requeued every
5 minutes
type: string
functionTimeoutSec:
description: Sets the maximum execution time limit for a Function.
By default, the value is `180` seconds
type: string
healthzLivenessTimeout:
description: Sets the timeout for the Function health check. The default
value in seconds is `10`
type: string
targetCPUUtilizationPercentage:
description: Sets a custom CPU utilization threshold for scaling Function
Pods
type: string
tracing:
description: Used Tracing endpoint
properties:
Expand Down
49 changes: 13 additions & 36 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,44 +5,24 @@ go 1.21
toolchain go1.21.3

require (
github.com/avast/retry-go v3.0.0+incompatible
github.com/bmizerany/assert v0.0.0-20160611221934-b7ed37b82869
github.com/cloudevents/sdk-go/v2 v2.15.2
github.com/fsnotify/fsnotify v1.7.0
github.com/go-git/go-billy/v5 v5.5.0
github.com/go-git/go-git/v5 v5.11.0
github.com/go-logr/zapr v1.3.0
github.com/google/uuid v1.6.0
github.com/hashicorp/errwrap v1.1.0
github.com/hashicorp/go-multierror v1.1.1
github.com/libgit2/git2go/v34 v34.0.0
github.com/onsi/ginkgo/v2 v2.17.1
github.com/onsi/gomega v1.32.0
github.com/pkg/errors v0.9.1
github.com/prometheus/client_golang v1.19.0
github.com/sirupsen/logrus v1.9.3
github.com/spf13/pflag v1.0.5
github.com/stretchr/testify v1.9.0
github.com/vrischmann/envconfig v1.3.0
go.uber.org/zap v1.27.0
golang.org/x/crypto v0.21.0
golang.org/x/sync v0.6.0
golang.org/x/time v0.5.0
gopkg.in/yaml.v2 v2.4.0
gopkg.in/yaml.v3 v3.0.1
helm.sh/helm/v3 v3.14.3
k8s.io/api v0.29.0
k8s.io/apiextensions-apiserver v0.29.0
k8s.io/apimachinery v0.29.0
k8s.io/cli-runtime v0.29.0
k8s.io/client-go v0.29.0
k8s.io/klog/v2 v2.110.1
k8s.io/utils v0.0.0-20230726121419-3b25d923346b
sigs.k8s.io/controller-runtime v0.15.3
)

require (
dario.cat/mergo v1.0.0 // indirect
github.com/AdaLogics/go-fuzz-headers v0.0.0-20230811130428-ced1acdcaa24 // indirect
github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1 // indirect
github.com/BurntSushi/toml v1.3.2 // indirect
Expand All @@ -51,14 +31,11 @@ require (
github.com/Masterminds/semver/v3 v3.2.1 // indirect
github.com/Masterminds/sprig/v3 v3.2.3 // indirect
github.com/Masterminds/squirrel v1.5.4 // indirect
github.com/Microsoft/go-winio v0.6.1 // indirect
github.com/Microsoft/hcsshim v0.11.4 // indirect
github.com/ProtonMail/go-crypto v0.0.0-20230828082145-3c4c8a2d2371 // indirect
github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2 // indirect
github.com/beorn7/perks v1.0.1 // indirect
github.com/cespare/xxhash/v2 v2.2.0 // indirect
github.com/chai2010/gettext-go v1.0.2 // indirect
github.com/cloudflare/circl v1.3.7 // indirect
github.com/containerd/containerd v1.7.12 // indirect
github.com/containerd/log v0.1.0 // indirect
github.com/cyphar/filepath-securejoin v0.2.4 // indirect
Expand All @@ -71,17 +48,17 @@ require (
github.com/docker/go-metrics v0.0.1 // indirect
github.com/docker/go-units v0.5.0 // indirect
github.com/emicklei/go-restful/v3 v3.11.0 // indirect
github.com/emirpasic/gods v1.18.1 // indirect
github.com/evanphx/json-patch v5.7.0+incompatible // indirect
github.com/evanphx/json-patch/v5 v5.8.0 // indirect
github.com/exponent-io/jsonpath v0.0.0-20151013193312-d6023ce2651d // indirect
github.com/fatih/color v1.13.0 // indirect
github.com/felixge/httpsnoop v1.0.3 // indirect
github.com/fsnotify/fsnotify v1.7.0 // indirect
github.com/go-errors/errors v1.4.2 // indirect
github.com/go-git/gcfg v1.5.1-0.20230307220236-3a3c6141e376 // indirect
github.com/go-gorp/gorp/v3 v3.1.0 // indirect
github.com/go-logr/logr v1.4.1 // indirect
github.com/go-logr/stdr v1.2.2 // indirect
github.com/go-logr/zapr v1.3.0 // indirect
github.com/go-openapi/jsonpointer v0.19.6 // indirect
github.com/go-openapi/jsonreference v0.20.2 // indirect
github.com/go-openapi/swag v0.22.3 // indirect
Expand All @@ -96,21 +73,20 @@ require (
github.com/google/gofuzz v1.2.0 // indirect
github.com/google/pprof v0.0.0-20210720184732-4bb14d4b1be1 // indirect
github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 // indirect
github.com/google/uuid v1.6.0 // indirect
github.com/gorilla/mux v1.8.0 // indirect
github.com/gorilla/websocket v1.5.0 // indirect
github.com/gosuri/uitable v0.0.4 // indirect
github.com/gregjones/httpcache v0.0.0-20180305231024-9cad4c3443a7 // indirect
github.com/hashicorp/errwrap v1.1.0 // indirect
github.com/hashicorp/go-multierror v1.1.1 // indirect
github.com/huandu/xstrings v1.4.0 // indirect
github.com/imdario/mergo v0.3.13 // indirect
github.com/inconshreveable/mousetrap v1.1.0 // indirect
github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 // indirect
github.com/jmoiron/sqlx v1.3.5 // indirect
github.com/josharian/intern v1.0.0 // indirect
github.com/json-iterator/go v1.1.12 // indirect
github.com/kevinburke/ssh_config v1.2.0 // indirect
github.com/klauspost/compress v1.16.0 // indirect
github.com/kr/pretty v0.3.1 // indirect
github.com/kr/text v0.2.0 // indirect
github.com/lann/builder v0.0.0-20180802200727-47ae307949d0 // indirect
github.com/lann/ps v0.0.0-20150810152359-62de8c46ede0 // indirect
github.com/lib/pq v1.10.9 // indirect
Expand All @@ -134,21 +110,19 @@ require (
github.com/opencontainers/go-digest v1.0.0 // indirect
github.com/opencontainers/image-spec v1.1.0-rc5 // indirect
github.com/peterbourgon/diskv v2.0.1+incompatible // indirect
github.com/pjbgf/sha1cd v0.3.0 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/prometheus/client_golang v1.19.0 // indirect
github.com/prometheus/client_model v0.5.0 // indirect
github.com/prometheus/common v0.48.0 // indirect
github.com/prometheus/procfs v0.12.0 // indirect
github.com/rogpeppe/go-internal v1.12.0 // indirect
github.com/rubenv/sql-migrate v1.5.2 // indirect
github.com/russross/blackfriday/v2 v2.1.0 // indirect
github.com/sergi/go-diff v1.1.0 // indirect
github.com/shopspring/decimal v1.3.1 // indirect
github.com/skeema/knownhosts v1.2.1 // indirect
github.com/sirupsen/logrus v1.9.3 // indirect
github.com/spf13/cast v1.5.0 // indirect
github.com/spf13/cobra v1.8.0 // indirect
github.com/stretchr/objx v0.5.2 // indirect
github.com/xanzy/ssh-agent v0.3.3 // indirect
github.com/spf13/pflag v1.0.5 // indirect
github.com/xeipuuv/gojsonpointer v0.0.0-20190905194746-02993c407bfb // indirect
github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415 // indirect
github.com/xeipuuv/gojsonschema v1.2.0 // indirect
Expand All @@ -159,22 +133,25 @@ require (
go.opentelemetry.io/otel/trace v1.19.0 // indirect
go.starlark.net v0.0.0-20230525235612-a134d8f9ddca // indirect
go.uber.org/multierr v1.11.0 // indirect
golang.org/x/mod v0.14.0 // indirect
golang.org/x/crypto v0.21.0 // indirect
golang.org/x/net v0.21.0 // indirect
golang.org/x/oauth2 v0.16.0 // indirect
golang.org/x/sync v0.6.0 // indirect
golang.org/x/sys v0.18.0 // indirect
golang.org/x/term v0.18.0 // indirect
golang.org/x/text v0.14.0 // indirect
golang.org/x/time v0.5.0 // indirect
golang.org/x/tools v0.17.0 // indirect
gomodules.xyz/jsonpatch/v2 v2.4.0 // indirect
google.golang.org/appengine v1.6.7 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20230822172742-b8732ec3820d // indirect
google.golang.org/grpc v1.58.3 // indirect
google.golang.org/protobuf v1.33.0 // indirect
gopkg.in/inf.v0 v0.9.1 // indirect
gopkg.in/warnings.v0 v0.1.2 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
k8s.io/apiserver v0.29.0 // indirect
k8s.io/component-base v0.29.0 // indirect
k8s.io/klog/v2 v2.110.1 // indirect
k8s.io/kube-openapi v0.0.0-20231010175941-2dd684a91f00 // indirect
k8s.io/kubectl v0.29.0 // indirect
oras.land/oras-go v1.2.4 // indirect
Expand Down
Loading

0 comments on commit 0b40eac

Please sign in to comment.