From daa88a326f5fa74dd3fd1e15521dba120a2b07a4 Mon Sep 17 00:00:00 2001 From: Piotr Halama Date: Fri, 8 Mar 2024 13:10:35 +0100 Subject: [PATCH 1/3] Bump controller-gen --- .../api/v1alpha1/zz_generated.deepcopy.go | 1 - ...operator.kyma-project.io_serverlesses.yaml | 91 ++++++++++--------- hack/tools.mk | 2 +- 3 files changed, 51 insertions(+), 43 deletions(-) diff --git a/components/operator/api/v1alpha1/zz_generated.deepcopy.go b/components/operator/api/v1alpha1/zz_generated.deepcopy.go index cfa8f5997..dee358ae1 100644 --- a/components/operator/api/v1alpha1/zz_generated.deepcopy.go +++ b/components/operator/api/v1alpha1/zz_generated.deepcopy.go @@ -1,5 +1,4 @@ //go:build !ignore_autogenerated -// +build !ignore_autogenerated /* Copyright 2022. diff --git a/config/operator/base/crd/bases/operator.kyma-project.io_serverlesses.yaml b/config/operator/base/crd/bases/operator.kyma-project.io_serverlesses.yaml index ead01f169..0232ead03 100644 --- a/config/operator/base/crd/bases/operator.kyma-project.io_serverlesses.yaml +++ b/config/operator/base/crd/bases/operator.kyma-project.io_serverlesses.yaml @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: - controller-gen.kubebuilder.io/version: v0.12.0 + controller-gen.kubebuilder.io/version: v0.14.0 name: serverlesses.operator.kyma-project.io spec: group: operator.kyma-project.io @@ -36,14 +36,19 @@ spec: description: Serverless is the Schema for the serverlesses API properties: apiVersion: - description: 'APIVersion defines the versioned schema of this representation - of an object. Servers should convert recognized schemas to the latest - internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' + description: |- + APIVersion defines the versioned schema of this representation of an object. + Servers should convert recognized schemas to the latest internal value, and + may reject unrecognized values. + More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources type: string kind: - description: 'Kind is a string value representing the REST resource this - object represents. Servers may infer this from the endpoint the client - submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' + description: |- + Kind is a string value representing the REST resource this object represents. + Servers may infer this from the endpoint the client submits requests to. + Cannot be updated. + In CamelCase. + More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds type: string metadata: type: object @@ -118,42 +123,42 @@ spec: description: Conditions associated with CustomStatus. items: description: "Condition contains details for one aspect of the current - state of this API Resource. --- This struct is intended for direct - use as an array at the field path .status.conditions. For example, - \n type FooStatus struct{ // Represents the observations of a - foo's current state. // Known .status.conditions.type are: \"Available\", - \"Progressing\", and \"Degraded\" // +patchMergeKey=type // +patchStrategy=merge - // +listType=map // +listMapKey=type Conditions []metav1.Condition - `json:\"conditions,omitempty\" patchStrategy:\"merge\" patchMergeKey:\"type\" - protobuf:\"bytes,1,rep,name=conditions\"` \n // other fields }" + state of this API Resource.\n---\nThis struct is intended for + direct use as an array at the field path .status.conditions. For + example,\n\n\n\ttype FooStatus struct{\n\t // Represents the + observations of a foo's current state.\n\t // Known .status.conditions.type + are: \"Available\", \"Progressing\", and \"Degraded\"\n\t // + +patchMergeKey=type\n\t // +patchStrategy=merge\n\t // +listType=map\n\t + \ // +listMapKey=type\n\t Conditions []metav1.Condition `json:\"conditions,omitempty\" + patchStrategy:\"merge\" patchMergeKey:\"type\" protobuf:\"bytes,1,rep,name=conditions\"`\n\n\n\t + \ // other fields\n\t}" properties: lastTransitionTime: - description: lastTransitionTime is the last time the condition - transitioned from one status to another. This should be when - the underlying condition changed. If that is not known, then - using the time when the API field changed is acceptable. + description: |- + lastTransitionTime is the last time the condition transitioned from one status to another. + This should be when the underlying condition changed. If that is not known, then using the time when the API field changed is acceptable. format: date-time type: string message: - description: message is a human readable message indicating - details about the transition. This may be an empty string. + description: |- + message is a human readable message indicating details about the transition. + This may be an empty string. maxLength: 32768 type: string observedGeneration: - description: observedGeneration represents the .metadata.generation - that the condition was set based upon. For instance, if .metadata.generation - is currently 12, but the .status.conditions[x].observedGeneration - is 9, the condition is out of date with respect to the current - state of the instance. + description: |- + observedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. format: int64 minimum: 0 type: integer reason: - description: reason contains a programmatic identifier indicating - the reason for the condition's last transition. Producers - of specific condition types may define expected values and - meanings for this field, and whether the values are considered - a guaranteed API. The value should be a CamelCase string. + description: |- + reason contains a programmatic identifier indicating the reason for the condition's last transition. + Producers of specific condition types may define expected values and meanings for this field, + and whether the values are considered a guaranteed API. + The value should be a CamelCase string. This field may not be empty. maxLength: 1024 minLength: 1 @@ -167,11 +172,12 @@ spec: - Unknown type: string type: - description: type of condition in CamelCase or in foo.example.com/CamelCase. - --- Many .condition.type values are consistent across resources - like Available, but because arbitrary conditions can be useful - (see .node.status.conditions), the ability to deconflict is - important. The regex it matches is (dns1123SubdomainFmt/)?(qualifiedNameFmt) + description: |- + type of condition in CamelCase or in foo.example.com/CamelCase. + --- + Many .condition.type values are consistent across resources like Available, but because arbitrary conditions can be + useful (see .node.status.conditions), the ability to deconflict is important. + The regex it matches is (dns1123SubdomainFmt/)?(qualifiedNameFmt) maxLength: 316 pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$ type: string @@ -188,8 +194,9 @@ spec: defaultRuntimePodPreset: type: string dockerRegistry: - description: Used registry configuration. Contains registry URL or - "internal" + description: |- + Used registry configuration. + Contains registry URL or "internal" type: string eventingEndpoint: description: Used the Eventing endpoint and the Tracing endpoint. @@ -207,15 +214,17 @@ spec: healthzLivenessTimeout: type: string served: - description: Served signifies that current Serverless is managed. + description: |- + Served signifies that current Serverless is managed. Value can be one of ("True", "False"). enum: - "True" - "False" type: string state: - description: State signifies current state of Serverless. Value can - be one of ("Ready", "Processing", "Error", "Deleting"). + description: |- + State signifies current state of Serverless. + Value can be one of ("Ready", "Processing", "Error", "Deleting"). enum: - Processing - Deleting diff --git a/hack/tools.mk b/hack/tools.mk index 7685a74b4..24ba4ac1d 100644 --- a/hack/tools.mk +++ b/hack/tools.mk @@ -40,7 +40,7 @@ $(KUSTOMIZE): $(LOCALBIN) test -s $(LOCALBIN)/kustomize || { curl -Ss $(KUSTOMIZE_INSTALL_SCRIPT) | bash -s -- $(subst v,,$(KUSTOMIZE_VERSION)) $(LOCALBIN); } ########## Controller-Gen ########### -CONTROLLER_TOOLS_VERSION ?= v0.12.0 +CONTROLLER_TOOLS_VERSION ?= v0.14.0 CONTROLLER_GEN ?= $(LOCALBIN)/controller-gen .PHONY: controller-gen From ad3f62bd8da8b5442e3018768c6bc25114088df9 Mon Sep 17 00:00:00 2001 From: Piotr Halama Date: Fri, 8 Mar 2024 13:22:56 +0100 Subject: [PATCH 2/3] run make amnifests --- .../serverless.kyma-project.io_functions.yaml | 257 ++++++++++-------- components/serverless/config/rbac/role.yaml | 1 - .../v1alpha2/zz_generated.deepcopy.go | 1 - config/serverless/templates/crds.yaml | 257 ++++++++++-------- 4 files changed, 278 insertions(+), 238 deletions(-) diff --git a/components/serverless/config/crd/bases/serverless.kyma-project.io_functions.yaml b/components/serverless/config/crd/bases/serverless.kyma-project.io_functions.yaml index 4aee60767..7c5ffb593 100644 --- a/components/serverless/config/crd/bases/serverless.kyma-project.io_functions.yaml +++ b/components/serverless/config/crd/bases/serverless.kyma-project.io_functions.yaml @@ -3,8 +3,7 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: - controller-gen.kubebuilder.io/version: v0.9.2 - creationTimestamp: null + controller-gen.kubebuilder.io/version: v0.14.0 name: functions.serverless.kyma-project.io spec: group: serverless.kyma-project.io @@ -37,24 +36,29 @@ spec: name: v1alpha2 schema: openAPIV3Schema: - description: A simple code snippet that you can run without provisioning or - managing servers. It implements the exact business logic you define. A Function - is based on the Function custom resource (CR) and can be written in either - Node.js or Python. A Function can perform a business logic of its own. You - can also bind it to an instance of a service and configure it to be triggered - whenever it receives a particular event type from the service or a call - is made to the service's API. Functions are executed only if they are triggered - by an event or an API call. + description: |- + A simple code snippet that you can run without provisioning or managing servers. + It implements the exact business logic you define. + A Function is based on the Function custom resource (CR) and can be written in either Node.js or Python. + A Function can perform a business logic of its own. You can also bind it to an instance of a service + and configure it to be triggered whenever it receives a particular event type from the service + or a call is made to the service's API. + Functions are executed only if they are triggered by an event or an API call. properties: apiVersion: - description: 'APIVersion defines the versioned schema of this representation - of an object. Servers should convert recognized schemas to the latest - internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' + description: |- + APIVersion defines the versioned schema of this representation of an object. + Servers should convert recognized schemas to the latest internal value, and + may reject unrecognized values. + More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources type: string kind: - description: 'Kind is a string value representing the REST resource this - object represents. Servers may infer this from the endpoint the client - submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' + description: |- + Kind is a string value representing the REST resource this object represents. + Servers may infer this from the endpoint the client submits requests to. + Cannot be updated. + In CamelCase. + More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds type: string metadata: type: object @@ -72,10 +76,10 @@ spec: which is not allowed rule: '!(self.exists(e, e.startsWith(''serverless.kyma-project.io/'')))' env: - description: Specifies an array of key-value pairs to be used as environment - variables for the Function. You can define values as static strings - or reference values from ConfigMaps or Secrets. For configuration - details, see the [official Kubernetes documentation](https://kubernetes.io/docs/tasks/inject-data-application/define-environment-variable-container/). + description: |- + Specifies an array of key-value pairs to be used as environment variables for the Function. + You can define values as static strings or reference values from ConfigMaps or Secrets. + For configuration details, see the [official Kubernetes documentation](https://kubernetes.io/docs/tasks/inject-data-application/define-environment-variable-container/). items: description: EnvVar represents an environment variable present in a Container. @@ -84,15 +88,16 @@ spec: description: Name of the environment variable. Must be a C_IDENTIFIER. type: string value: - description: 'Variable references $(VAR_NAME) are expanded using - the previously defined environment variables in the container - and any service environment variables. If a variable cannot - be resolved, the reference in the input string will be unchanged. - Double $$ are reduced to a single $, which allows for escaping - the $(VAR_NAME) syntax: i.e. "$$(VAR_NAME)" will produce the - string literal "$(VAR_NAME)". Escaped references will never - be expanded, regardless of whether the variable exists or - not. Defaults to "".' + description: |- + Variable references $(VAR_NAME) are expanded + using the previously defined environment variables in the container and + any service environment variables. If a variable cannot be resolved, + the reference in the input string will be unchanged. Double $$ are reduced + to a single $, which allows for escaping the $(VAR_NAME) syntax: i.e. + "$$(VAR_NAME)" will produce the string literal "$(VAR_NAME)". + Escaped references will never be expanded, regardless of whether the variable + exists or not. + Defaults to "". type: string valueFrom: description: Source for the environment variable's value. Cannot @@ -105,8 +110,10 @@ spec: description: The key to select. type: string name: - description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names - TODO: Add other useful fields. apiVersion, kind, uid?' + description: |- + Name of the referent. + More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + TODO: Add other useful fields. apiVersion, kind, uid? type: string optional: description: Specify whether the ConfigMap or its key @@ -117,10 +124,9 @@ spec: type: object x-kubernetes-map-type: atomic fieldRef: - description: 'Selects a field of the pod: supports metadata.name, - metadata.namespace, `metadata.labels['''']`, `metadata.annotations['''']`, - spec.nodeName, spec.serviceAccountName, status.hostIP, - status.podIP, status.podIPs.' + description: |- + Selects a field of the pod: supports metadata.name, metadata.namespace, `metadata.labels['']`, `metadata.annotations['']`, + spec.nodeName, spec.serviceAccountName, status.hostIP, status.podIP, status.podIPs. properties: apiVersion: description: Version of the schema the FieldPath is @@ -135,10 +141,9 @@ spec: type: object x-kubernetes-map-type: atomic resourceFieldRef: - description: 'Selects a resource of the container: only - resources limits and requests (limits.cpu, limits.memory, - limits.ephemeral-storage, requests.cpu, requests.memory - and requests.ephemeral-storage) are currently supported.' + description: |- + Selects a resource of the container: only resources limits and requests + (limits.cpu, limits.memory, limits.ephemeral-storage, requests.cpu, requests.memory and requests.ephemeral-storage) are currently supported. properties: containerName: description: 'Container name: required for volumes, @@ -167,8 +172,10 @@ spec: be a valid secret key. type: string name: - description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names - TODO: Add other useful fields. apiVersion, kind, uid?' + description: |- + Name of the referent. + More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + TODO: Add other useful fields. apiVersion, kind, uid? type: string optional: description: Specify whether the Secret or its key must @@ -200,11 +207,10 @@ spec: rule: self.all(e, size(e)<64) replicas: default: 1 - description: Defines the exact number of Function's Pods to run at - a time. If **ScaleConfig** is configured, or if the Function is - targeted by an external scaler, then the **Replicas** field is used - by the relevant HorizontalPodAutoscaler to control the number of - active replicas. + description: |- + Defines the exact number of Function's Pods to run at a time. + If **ScaleConfig** is configured, or if the Function is targeted by an external scaler, + then the **Replicas** field is used by the relevant HorizontalPodAutoscaler to control the number of active replicas. format: int32 minimum: 0 type: integer @@ -217,27 +223,34 @@ spec: Pod. properties: profile: - description: Defines the name of the predefined set of values - of the resource. Can't be used together with **Resources**. + description: |- + Defines the name of the predefined set of values of the resource. + Can't be used together with **Resources**. type: string resources: - description: Defines the amount of resources available for - the Pod. Can't be used together with **Profile**. For configuration - details, see the [official Kubernetes documentation](https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/). + description: |- + Defines the amount of resources available for the Pod. + Can't be used together with **Profile**. + For configuration details, see the [official Kubernetes documentation](https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/). properties: claims: - description: "Claims lists the names of resources, defined - in spec.resourceClaims, that are used by this container. - \n This is an alpha field and requires enabling the - DynamicResourceAllocation feature gate. \n This field - is immutable. It can only be set for containers." + description: |- + Claims lists the names of resources, defined in spec.resourceClaims, + that are used by this container. + + + This is an alpha field and requires enabling the + DynamicResourceAllocation feature gate. + + + This field is immutable. It can only be set for containers. items: description: ResourceClaim references one entry in PodSpec.ResourceClaims. properties: name: - description: Name must match the name of one entry - in pod.spec.resourceClaims of the Pod where this - field is used. It makes that resource available + description: |- + Name must match the name of one entry in pod.spec.resourceClaims of + the Pod where this field is used. It makes that resource available inside a container. type: string required: @@ -254,8 +267,9 @@ spec: - type: string pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ x-kubernetes-int-or-string: true - description: 'Limits describes the maximum amount of compute - resources allowed. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/' + description: |- + Limits describes the maximum amount of compute resources allowed. + More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/ type: object requests: additionalProperties: @@ -264,11 +278,11 @@ spec: - type: string pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ x-kubernetes-int-or-string: true - description: 'Requests describes the minimum amount of - compute resources required. If Requests is omitted for - a container, it defaults to Limits if that is explicitly - specified, otherwise to an implementation-defined value. - Requests cannot exceed Limits. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/' + description: |- + Requests describes the minimum amount of compute resources required. + If Requests is omitted for a container, it defaults to Limits if that is explicitly specified, + otherwise to an implementation-defined value. Requests cannot exceed Limits. + More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/ type: object type: object type: object @@ -282,27 +296,34 @@ spec: description: Specifies resources requested by the Function's Pod. properties: profile: - description: Defines the name of the predefined set of values - of the resource. Can't be used together with **Resources**. + description: |- + Defines the name of the predefined set of values of the resource. + Can't be used together with **Resources**. type: string resources: - description: Defines the amount of resources available for - the Pod. Can't be used together with **Profile**. For configuration - details, see the [official Kubernetes documentation](https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/). + description: |- + Defines the amount of resources available for the Pod. + Can't be used together with **Profile**. + For configuration details, see the [official Kubernetes documentation](https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/). properties: claims: - description: "Claims lists the names of resources, defined - in spec.resourceClaims, that are used by this container. - \n This is an alpha field and requires enabling the - DynamicResourceAllocation feature gate. \n This field - is immutable. It can only be set for containers." + description: |- + Claims lists the names of resources, defined in spec.resourceClaims, + that are used by this container. + + + This is an alpha field and requires enabling the + DynamicResourceAllocation feature gate. + + + This field is immutable. It can only be set for containers. items: description: ResourceClaim references one entry in PodSpec.ResourceClaims. properties: name: - description: Name must match the name of one entry - in pod.spec.resourceClaims of the Pod where this - field is used. It makes that resource available + description: |- + Name must match the name of one entry in pod.spec.resourceClaims of + the Pod where this field is used. It makes that resource available inside a container. type: string required: @@ -319,8 +340,9 @@ spec: - type: string pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ x-kubernetes-int-or-string: true - description: 'Limits describes the maximum amount of compute - resources allowed. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/' + description: |- + Limits describes the maximum amount of compute resources allowed. + More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/ type: object requests: additionalProperties: @@ -329,11 +351,11 @@ spec: - type: string pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ x-kubernetes-int-or-string: true - description: 'Requests describes the minimum amount of - compute resources required. If Requests is omitted for - a container, it defaults to Limits if that is explicitly - specified, otherwise to an implementation-defined value. - Requests cannot exceed Limits. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/' + description: |- + Requests describes the minimum amount of compute resources required. + If Requests is omitted for a container, it defaults to Limits if that is explicitly specified, + otherwise to an implementation-defined value. Requests cannot exceed Limits. + More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/ type: object type: object type: object @@ -359,10 +381,10 @@ spec: one. type: string scaleConfig: - description: Defines the minimum and maximum number of Function's - Pods to run at a time. When it is configured, a HorizontalPodAutoscaler - will be deployed and will control the **Replicas** field to scale - the Function based on the CPU utilisation. + description: |- + Defines the minimum and maximum number of Function's Pods to run at a time. + When it is configured, a HorizontalPodAutoscaler will be deployed and will control the **Replicas** field + to scale the Function based on the CPU utilisation. properties: maxReplicas: description: Defines the maximum number of Function's Pods to @@ -416,19 +438,18 @@ spec: for SSH. properties: secretName: - description: Specifies the name of the Secret with credentials - used by the Function Controller to authenticate to the - Git repository in order to fetch the Function's source - code and dependencies. This Secret must be stored in - the same Namespace as the Function CR. + description: |- + Specifies the name of the Secret with credentials used by the Function Controller + to authenticate to the Git repository in order to fetch the Function's source code and dependencies. + This Secret must be stored in the same Namespace as the Function CR. type: string x-kubernetes-validations: - message: SecretName is required and cannot be empty rule: self.trim().size() != 0 type: - description: Defines the repository authentication method. - The value is either `basic` if you use a password or - token, or `key` if you use an SSH key. + description: |- + Defines the repository authentication method. The value is either `basic` if you use a password or token, + or `key` if you use an SSH key. enum: - basic - key @@ -438,21 +459,20 @@ spec: - type type: object baseDir: - description: Specifies the relative path to the Git directory - that contains the source code from which the Function is - built. + description: |- + Specifies the relative path to the Git directory that contains the source code + from which the Function is built. type: string reference: - description: Specifies either the branch name, tag or commit - revision from which the Function Controller automatically - fetches the changes in the Function's code and dependencies. + description: |- + Specifies either the branch name, tag or commit revision from which the Function Controller + automatically fetches the changes in the Function's code and dependencies. type: string url: - description: Specifies the URL of the Git repository with - the Function's code and dependencies. Depending on whether - the repository is public or private and what authentication - method is used to access it, the URL must start with the - `http(s)`, `git`, or `ssh` prefix. + description: |- + Specifies the URL of the Git repository with the Function's code and dependencies. + Depending on whether the repository is public or private and what authentication method is used to access it, + the URL must start with the `http(s)`, `git`, or `ssh` prefix. type: string required: - url @@ -511,8 +531,9 @@ spec: description: FunctionStatus defines the observed state of the Function properties: baseDir: - description: Specifies the relative path to the Git directory that - contains the source code from which the Function is built. + description: |- + Specifies the relative path to the Git directory that contains the source code + from which the Function is built. type: string buildResourceProfile: description: Specifies the preset used for the build job @@ -556,9 +577,9 @@ spec: Function's Deployment. type: string reference: - description: Specifies either the branch name, tag or commit revision - from which the Function Controller automatically fetches the changes - in the Function's code and dependencies. + description: |- + Specifies either the branch name, tag or commit revision from which the Function Controller + automatically fetches the changes in the Function's code and dependencies. type: string replicas: description: Specifies the total number of non-terminated Pods targeted @@ -573,10 +594,10 @@ spec: Function's Pods. type: string runtimeImageOverride: - description: 'Deprecated: Specifies the runtime image version which - overrides the **RuntimeImage** status parameter. **RuntimeImageOverride** - exists for historical compatibility and should be removed with v1alpha3 - version.' + description: |- + Deprecated: Specifies the runtime image version which overrides the **RuntimeImage** status parameter. + **RuntimeImageOverride** exists for historical compatibility + and should be removed with v1alpha3 version. type: string type: object type: object diff --git a/components/serverless/config/rbac/role.yaml b/components/serverless/config/rbac/role.yaml index 2aa3b4905..143f77885 100644 --- a/components/serverless/config/rbac/role.yaml +++ b/components/serverless/config/rbac/role.yaml @@ -2,7 +2,6 @@ apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRole metadata: - creationTimestamp: null name: serverless rules: - apiGroups: diff --git a/components/serverless/pkg/apis/serverless/v1alpha2/zz_generated.deepcopy.go b/components/serverless/pkg/apis/serverless/v1alpha2/zz_generated.deepcopy.go index fe730d971..7b07a7469 100644 --- a/components/serverless/pkg/apis/serverless/v1alpha2/zz_generated.deepcopy.go +++ b/components/serverless/pkg/apis/serverless/v1alpha2/zz_generated.deepcopy.go @@ -1,5 +1,4 @@ //go:build !ignore_autogenerated -// +build !ignore_autogenerated // Code generated by controller-gen. DO NOT EDIT. diff --git a/config/serverless/templates/crds.yaml b/config/serverless/templates/crds.yaml index e4c7c7739..8ab0536aa 100644 --- a/config/serverless/templates/crds.yaml +++ b/config/serverless/templates/crds.yaml @@ -2,8 +2,7 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: - controller-gen.kubebuilder.io/version: v0.9.2 - creationTimestamp: null + controller-gen.kubebuilder.io/version: v0.14.0 name: functions.serverless.kyma-project.io spec: group: serverless.kyma-project.io @@ -36,24 +35,29 @@ spec: name: v1alpha2 schema: openAPIV3Schema: - description: A simple code snippet that you can run without provisioning or - managing servers. It implements the exact business logic you define. A Function - is based on the Function custom resource (CR) and can be written in either - Node.js or Python. A Function can perform a business logic of its own. You - can also bind it to an instance of a service and configure it to be triggered - whenever it receives a particular event type from the service or a call - is made to the service's API. Functions are executed only if they are triggered - by an event or an API call. + description: |- + A simple code snippet that you can run without provisioning or managing servers. + It implements the exact business logic you define. + A Function is based on the Function custom resource (CR) and can be written in either Node.js or Python. + A Function can perform a business logic of its own. You can also bind it to an instance of a service + and configure it to be triggered whenever it receives a particular event type from the service + or a call is made to the service's API. + Functions are executed only if they are triggered by an event or an API call. properties: apiVersion: - description: 'APIVersion defines the versioned schema of this representation - of an object. Servers should convert recognized schemas to the latest - internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' + description: |- + APIVersion defines the versioned schema of this representation of an object. + Servers should convert recognized schemas to the latest internal value, and + may reject unrecognized values. + More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources type: string kind: - description: 'Kind is a string value representing the REST resource this - object represents. Servers may infer this from the endpoint the client - submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' + description: |- + Kind is a string value representing the REST resource this object represents. + Servers may infer this from the endpoint the client submits requests to. + Cannot be updated. + In CamelCase. + More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds type: string metadata: type: object @@ -71,10 +75,10 @@ spec: which is not allowed rule: '!(self.exists(e, e.startsWith(''serverless.kyma-project.io/'')))' env: - description: Specifies an array of key-value pairs to be used as environment - variables for the Function. You can define values as static strings - or reference values from ConfigMaps or Secrets. For configuration - details, see the [official Kubernetes documentation](https://kubernetes.io/docs/tasks/inject-data-application/define-environment-variable-container/). + description: |- + Specifies an array of key-value pairs to be used as environment variables for the Function. + You can define values as static strings or reference values from ConfigMaps or Secrets. + For configuration details, see the [official Kubernetes documentation](https://kubernetes.io/docs/tasks/inject-data-application/define-environment-variable-container/). items: description: EnvVar represents an environment variable present in a Container. @@ -83,15 +87,16 @@ spec: description: Name of the environment variable. Must be a C_IDENTIFIER. type: string value: - description: 'Variable references $(VAR_NAME) are expanded using - the previously defined environment variables in the container - and any service environment variables. If a variable cannot - be resolved, the reference in the input string will be unchanged. - Double $$ are reduced to a single $, which allows for escaping - the $(VAR_NAME) syntax: i.e. "$$(VAR_NAME)" will produce the - string literal "$(VAR_NAME)". Escaped references will never - be expanded, regardless of whether the variable exists or - not. Defaults to "".' + description: |- + Variable references $(VAR_NAME) are expanded + using the previously defined environment variables in the container and + any service environment variables. If a variable cannot be resolved, + the reference in the input string will be unchanged. Double $$ are reduced + to a single $, which allows for escaping the $(VAR_NAME) syntax: i.e. + "$$(VAR_NAME)" will produce the string literal "$(VAR_NAME)". + Escaped references will never be expanded, regardless of whether the variable + exists or not. + Defaults to "". type: string valueFrom: description: Source for the environment variable's value. Cannot @@ -104,8 +109,10 @@ spec: description: The key to select. type: string name: - description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names - TODO: Add other useful fields. apiVersion, kind, uid?' + description: |- + Name of the referent. + More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + TODO: Add other useful fields. apiVersion, kind, uid? type: string optional: description: Specify whether the ConfigMap or its key @@ -116,10 +123,9 @@ spec: type: object x-kubernetes-map-type: atomic fieldRef: - description: 'Selects a field of the pod: supports metadata.name, - metadata.namespace, `metadata.labels['''']`, `metadata.annotations['''']`, - spec.nodeName, spec.serviceAccountName, status.hostIP, - status.podIP, status.podIPs.' + description: |- + Selects a field of the pod: supports metadata.name, metadata.namespace, `metadata.labels['']`, `metadata.annotations['']`, + spec.nodeName, spec.serviceAccountName, status.hostIP, status.podIP, status.podIPs. properties: apiVersion: description: Version of the schema the FieldPath is @@ -134,10 +140,9 @@ spec: type: object x-kubernetes-map-type: atomic resourceFieldRef: - description: 'Selects a resource of the container: only - resources limits and requests (limits.cpu, limits.memory, - limits.ephemeral-storage, requests.cpu, requests.memory - and requests.ephemeral-storage) are currently supported.' + description: |- + Selects a resource of the container: only resources limits and requests + (limits.cpu, limits.memory, limits.ephemeral-storage, requests.cpu, requests.memory and requests.ephemeral-storage) are currently supported. properties: containerName: description: 'Container name: required for volumes, @@ -166,8 +171,10 @@ spec: be a valid secret key. type: string name: - description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names - TODO: Add other useful fields. apiVersion, kind, uid?' + description: |- + Name of the referent. + More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + TODO: Add other useful fields. apiVersion, kind, uid? type: string optional: description: Specify whether the Secret or its key must @@ -199,11 +206,10 @@ spec: rule: self.all(e, size(e)<64) replicas: default: 1 - description: Defines the exact number of Function's Pods to run at - a time. If **ScaleConfig** is configured, or if the Function is - targeted by an external scaler, then the **Replicas** field is used - by the relevant HorizontalPodAutoscaler to control the number of - active replicas. + description: |- + Defines the exact number of Function's Pods to run at a time. + If **ScaleConfig** is configured, or if the Function is targeted by an external scaler, + then the **Replicas** field is used by the relevant HorizontalPodAutoscaler to control the number of active replicas. format: int32 minimum: 0 type: integer @@ -216,27 +222,34 @@ spec: Pod. properties: profile: - description: Defines the name of the predefined set of values - of the resource. Can't be used together with **Resources**. + description: |- + Defines the name of the predefined set of values of the resource. + Can't be used together with **Resources**. type: string resources: - description: Defines the amount of resources available for - the Pod. Can't be used together with **Profile**. For configuration - details, see the [official Kubernetes documentation](https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/). + description: |- + Defines the amount of resources available for the Pod. + Can't be used together with **Profile**. + For configuration details, see the [official Kubernetes documentation](https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/). properties: claims: - description: "Claims lists the names of resources, defined - in spec.resourceClaims, that are used by this container. - \n This is an alpha field and requires enabling the - DynamicResourceAllocation feature gate. \n This field - is immutable. It can only be set for containers." + description: |- + Claims lists the names of resources, defined in spec.resourceClaims, + that are used by this container. + + + This is an alpha field and requires enabling the + DynamicResourceAllocation feature gate. + + + This field is immutable. It can only be set for containers. items: description: ResourceClaim references one entry in PodSpec.ResourceClaims. properties: name: - description: Name must match the name of one entry - in pod.spec.resourceClaims of the Pod where this - field is used. It makes that resource available + description: |- + Name must match the name of one entry in pod.spec.resourceClaims of + the Pod where this field is used. It makes that resource available inside a container. type: string required: @@ -253,8 +266,9 @@ spec: - type: string pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ x-kubernetes-int-or-string: true - description: 'Limits describes the maximum amount of compute - resources allowed. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/' + description: |- + Limits describes the maximum amount of compute resources allowed. + More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/ type: object requests: additionalProperties: @@ -263,11 +277,11 @@ spec: - type: string pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ x-kubernetes-int-or-string: true - description: 'Requests describes the minimum amount of - compute resources required. If Requests is omitted for - a container, it defaults to Limits if that is explicitly - specified, otherwise to an implementation-defined value. - Requests cannot exceed Limits. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/' + description: |- + Requests describes the minimum amount of compute resources required. + If Requests is omitted for a container, it defaults to Limits if that is explicitly specified, + otherwise to an implementation-defined value. Requests cannot exceed Limits. + More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/ type: object type: object type: object @@ -281,27 +295,34 @@ spec: description: Specifies resources requested by the Function's Pod. properties: profile: - description: Defines the name of the predefined set of values - of the resource. Can't be used together with **Resources**. + description: |- + Defines the name of the predefined set of values of the resource. + Can't be used together with **Resources**. type: string resources: - description: Defines the amount of resources available for - the Pod. Can't be used together with **Profile**. For configuration - details, see the [official Kubernetes documentation](https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/). + description: |- + Defines the amount of resources available for the Pod. + Can't be used together with **Profile**. + For configuration details, see the [official Kubernetes documentation](https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/). properties: claims: - description: "Claims lists the names of resources, defined - in spec.resourceClaims, that are used by this container. - \n This is an alpha field and requires enabling the - DynamicResourceAllocation feature gate. \n This field - is immutable. It can only be set for containers." + description: |- + Claims lists the names of resources, defined in spec.resourceClaims, + that are used by this container. + + + This is an alpha field and requires enabling the + DynamicResourceAllocation feature gate. + + + This field is immutable. It can only be set for containers. items: description: ResourceClaim references one entry in PodSpec.ResourceClaims. properties: name: - description: Name must match the name of one entry - in pod.spec.resourceClaims of the Pod where this - field is used. It makes that resource available + description: |- + Name must match the name of one entry in pod.spec.resourceClaims of + the Pod where this field is used. It makes that resource available inside a container. type: string required: @@ -318,8 +339,9 @@ spec: - type: string pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ x-kubernetes-int-or-string: true - description: 'Limits describes the maximum amount of compute - resources allowed. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/' + description: |- + Limits describes the maximum amount of compute resources allowed. + More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/ type: object requests: additionalProperties: @@ -328,11 +350,11 @@ spec: - type: string pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ x-kubernetes-int-or-string: true - description: 'Requests describes the minimum amount of - compute resources required. If Requests is omitted for - a container, it defaults to Limits if that is explicitly - specified, otherwise to an implementation-defined value. - Requests cannot exceed Limits. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/' + description: |- + Requests describes the minimum amount of compute resources required. + If Requests is omitted for a container, it defaults to Limits if that is explicitly specified, + otherwise to an implementation-defined value. Requests cannot exceed Limits. + More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/ type: object type: object type: object @@ -358,10 +380,10 @@ spec: one. type: string scaleConfig: - description: Defines the minimum and maximum number of Function's - Pods to run at a time. When it is configured, a HorizontalPodAutoscaler - will be deployed and will control the **Replicas** field to scale - the Function based on the CPU utilisation. + description: |- + Defines the minimum and maximum number of Function's Pods to run at a time. + When it is configured, a HorizontalPodAutoscaler will be deployed and will control the **Replicas** field + to scale the Function based on the CPU utilisation. properties: maxReplicas: description: Defines the maximum number of Function's Pods to @@ -415,19 +437,18 @@ spec: for SSH. properties: secretName: - description: Specifies the name of the Secret with credentials - used by the Function Controller to authenticate to the - Git repository in order to fetch the Function's source - code and dependencies. This Secret must be stored in - the same Namespace as the Function CR. + description: |- + Specifies the name of the Secret with credentials used by the Function Controller + to authenticate to the Git repository in order to fetch the Function's source code and dependencies. + This Secret must be stored in the same Namespace as the Function CR. type: string x-kubernetes-validations: - message: SecretName is required and cannot be empty rule: self.trim().size() != 0 type: - description: Defines the repository authentication method. - The value is either `basic` if you use a password or - token, or `key` if you use an SSH key. + description: |- + Defines the repository authentication method. The value is either `basic` if you use a password or token, + or `key` if you use an SSH key. enum: - basic - key @@ -437,21 +458,20 @@ spec: - type type: object baseDir: - description: Specifies the relative path to the Git directory - that contains the source code from which the Function is - built. + description: |- + Specifies the relative path to the Git directory that contains the source code + from which the Function is built. type: string reference: - description: Specifies either the branch name, tag or commit - revision from which the Function Controller automatically - fetches the changes in the Function's code and dependencies. + description: |- + Specifies either the branch name, tag or commit revision from which the Function Controller + automatically fetches the changes in the Function's code and dependencies. type: string url: - description: Specifies the URL of the Git repository with - the Function's code and dependencies. Depending on whether - the repository is public or private and what authentication - method is used to access it, the URL must start with the - `http(s)`, `git`, or `ssh` prefix. + description: |- + Specifies the URL of the Git repository with the Function's code and dependencies. + Depending on whether the repository is public or private and what authentication method is used to access it, + the URL must start with the `http(s)`, `git`, or `ssh` prefix. type: string required: - url @@ -510,8 +530,9 @@ spec: description: FunctionStatus defines the observed state of the Function properties: baseDir: - description: Specifies the relative path to the Git directory that - contains the source code from which the Function is built. + description: |- + Specifies the relative path to the Git directory that contains the source code + from which the Function is built. type: string buildResourceProfile: description: Specifies the preset used for the build job @@ -555,9 +576,9 @@ spec: Function's Deployment. type: string reference: - description: Specifies either the branch name, tag or commit revision - from which the Function Controller automatically fetches the changes - in the Function's code and dependencies. + description: |- + Specifies either the branch name, tag or commit revision from which the Function Controller + automatically fetches the changes in the Function's code and dependencies. type: string replicas: description: Specifies the total number of non-terminated Pods targeted @@ -572,10 +593,10 @@ spec: Function's Pods. type: string runtimeImageOverride: - description: 'Deprecated: Specifies the runtime image version which - overrides the **RuntimeImage** status parameter. **RuntimeImageOverride** - exists for historical compatibility and should be removed with v1alpha3 - version.' + description: |- + Deprecated: Specifies the runtime image version which overrides the **RuntimeImage** status parameter. + **RuntimeImageOverride** exists for historical compatibility + and should be removed with v1alpha3 version. type: string type: object type: object From 1aa47a2d55386929888a09a9c36dcdfd4b50fae3 Mon Sep 17 00:00:00 2001 From: Piotr Halama Date: Fri, 8 Mar 2024 13:23:13 +0100 Subject: [PATCH 3/3] test if correct version of controller-gen is installed --- hack/tools.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hack/tools.mk b/hack/tools.mk index 24ba4ac1d..751d843f2 100644 --- a/hack/tools.mk +++ b/hack/tools.mk @@ -46,7 +46,7 @@ CONTROLLER_GEN ?= $(LOCALBIN)/controller-gen .PHONY: controller-gen controller-gen: $(CONTROLLER_GEN) ## Download controller-gen locally if necessary. $(CONTROLLER_GEN): $(LOCALBIN) - test -s $(LOCALBIN)/controller-gen || GOBIN=$(LOCALBIN) go install sigs.k8s.io/controller-tools/cmd/controller-gen@$(CONTROLLER_TOOLS_VERSION) + test "$(${LOCALBIN}/controller-gen --version)" = "Version: ${CONTROLLER_TOOLS_VERSION}" || GOBIN=$(LOCALBIN) go install sigs.k8s.io/controller-tools/cmd/controller-gen@$(CONTROLLER_TOOLS_VERSION) ########## Envtest ########### ENVTEST ?= $(LOCALBIN)/setup-envtest