Skip to content

Commit

Permalink
fix: Set correct required fields within the CRD (#966)
Browse files Browse the repository at this point in the history
Signed-off-by: Jorge Turrado <[email protected]>
  • Loading branch information
JorTurFer authored Apr 5, 2024
1 parent e6896c2 commit d52daad
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 30 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ pre-commit: ## Run static-checks.

CONTROLLER_GEN = $(shell pwd)/bin/controller-gen
controller-gen: ## Download controller-gen locally if necessary.
GOBIN=$(shell pwd)/bin go install sigs.k8s.io/controller-tools/cmd/controller-gen@v0.12.0
GOBIN=$(shell pwd)/bin go install sigs.k8s.io/controller-tools/cmd/controller-gen@v0.14.0

KUSTOMIZE = $(shell pwd)/bin/kustomize
kustomize: ## Download kustomize locally if necessary.
Expand Down
40 changes: 22 additions & 18 deletions config/crd/bases/http.keda.sh_httpscaledobjects.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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: httpscaledobjects.http.keda.sh
spec:
group: http.keda.sh
Expand Down Expand Up @@ -41,36 +41,40 @@ spec:
description: HTTPScaledObject is the Schema for the httpscaledobjects 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
spec:
description: HTTPScaledObjectSpec defines the desired state of HTTPScaledObject
properties:
hosts:
description: The hosts to route. All requests which the "Host" header
matches any .spec.hosts and the Request Target matches any .spec.pathPrefixes
will be routed to the Service and Port specified in the scaleTargetRef.
The .spec.hosts field is mutually exclusive with the .spec.host
field.
description: |-
The hosts to route. All requests which the "Host" header
matches any .spec.hosts (and the Request Target matches any
.spec.pathPrefixes) will be routed to the Service and Port specified in
the scaleTargetRef.
items:
type: string
type: array
pathPrefixes:
description: (optional) The paths to route. All requests which the
Request Target matches any .spec.pathPrefixes and the "Host" header
matches any .spec.hosts will be routed to the Service and Port specified
in the scaleTargetRef. The .spec.hosts field is mutually exclusive
with the .spec.host field. When this field is null, any path is
matched.
description: |-
The paths to route. All requests which the Request Target matches any
.spec.pathPrefixes (and the "Host" header matches any .spec.hosts)
will be routed to the Service and Port specified in
the scaleTargetRef.
items:
type: string
type: array
Expand Down
17 changes: 7 additions & 10 deletions operator/apis/http/v1alpha1/httpscaledobject_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,17 +48,14 @@ type ReplicaStruct struct {
// HTTPScaledObjectSpec defines the desired state of HTTPScaledObject
type HTTPScaledObjectSpec struct {
// The hosts to route. All requests which the "Host" header
// matches any .spec.hosts and the Request Target matches any
// .spec.pathPrefixes will be routed to the Service and Port specified in
// the scaleTargetRef. The .spec.hosts field is mutually exclusive with the
// .spec.host field.
// +optional
// matches any .spec.hosts (and the Request Target matches any
// .spec.pathPrefixes) will be routed to the Service and Port specified in
// the scaleTargetRef.
Hosts []string `json:"hosts,omitempty"`
// (optional) The paths to route. All requests which the Request Target
// matches any .spec.pathPrefixes and the "Host" header matches any
// .spec.hosts will be routed to the Service and Port specified in the
// scaleTargetRef. The .spec.hosts field is mutually exclusive with the
// .spec.host field. When this field is null, any path is matched.
// The paths to route. All requests which the Request Target matches any
// .spec.pathPrefixes (and the "Host" header matches any .spec.hosts)
// will be routed to the Service and Port specified in
// the scaleTargetRef.
// +optional
PathPrefixes []string `json:"pathPrefixes,omitempty"`
// The name of the deployment to route HTTP requests to (and to autoscale).
Expand Down
1 change: 0 additions & 1 deletion operator/apis/http/v1alpha1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit d52daad

Please sign in to comment.