Skip to content

Commit

Permalink
feat(api): add meshexternalservice TargetRefKind and changed int to P…
Browse files Browse the repository at this point in the history
…ort (#10444)

Signed-off-by: Lukasz Dziedziak <lukidzi@gmail.com>
  • Loading branch information
lukidzi authored Jun 12, 2024
1 parent 3b26205 commit aab380b
Show file tree
Hide file tree
Showing 73 changed files with 344 additions and 14 deletions.
28 changes: 15 additions & 13 deletions api/common/v1alpha1/ref.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,21 +13,23 @@ import (
type TargetRefKind string

var (
Mesh TargetRefKind = "Mesh"
MeshSubset TargetRefKind = "MeshSubset"
MeshGateway TargetRefKind = "MeshGateway"
MeshService TargetRefKind = "MeshService"
MeshServiceSubset TargetRefKind = "MeshServiceSubset"
MeshHTTPRoute TargetRefKind = "MeshHTTPRoute"
Mesh TargetRefKind = "Mesh"
MeshSubset TargetRefKind = "MeshSubset"
MeshGateway TargetRefKind = "MeshGateway"
MeshService TargetRefKind = "MeshService"
MeshExternalService TargetRefKind = "MeshExternalService"
MeshServiceSubset TargetRefKind = "MeshServiceSubset"
MeshHTTPRoute TargetRefKind = "MeshHTTPRoute"
)

var order = map[TargetRefKind]int{
Mesh: 1,
MeshSubset: 2,
MeshGateway: 3,
MeshService: 4,
MeshServiceSubset: 5,
MeshHTTPRoute: 6,
Mesh: 1,
MeshSubset: 2,
MeshGateway: 3,
MeshService: 4,
MeshExternalService: 5,
MeshServiceSubset: 6,
MeshHTTPRoute: 7,
}

// +kubebuilder:validation:Enum=Sidecar;Gateway
Expand Down Expand Up @@ -57,7 +59,7 @@ func (x TargetRefKindSlice) Swap(i, j int) { x[i], x[j] = x[j], x[i] }
// TargetRef defines structure that allows attaching policy to various objects
type TargetRef struct {
// Kind of the referenced resource
// +kubebuilder:validation:Enum=Mesh;MeshSubset;MeshGateway;MeshService;MeshServiceSubset;MeshHTTPRoute
// +kubebuilder:validation:Enum=Mesh;MeshSubset;MeshGateway;MeshService;MeshExternalService;MeshServiceSubset;MeshHTTPRoute
Kind TargetRefKind `json:"kind,omitempty"`
// Name of the referenced resource. Can only be used with kinds: `MeshService`,
// `MeshServiceSubset` and `MeshGatewayRoute`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -330,6 +330,8 @@ spec:
properties:
port:
description: Port defines a port to which a user does request.
maximum: 65535
minimum: 1
type: integer
protocol:
default: tcp
Expand Down Expand Up @@ -719,6 +721,7 @@ spec:
- MeshSubset
- MeshGateway
- MeshService
- MeshExternalService
- MeshServiceSubset
- MeshHTTPRoute
type: string
Expand Down Expand Up @@ -784,6 +787,7 @@ spec:
- MeshSubset
- MeshGateway
- MeshService
- MeshExternalService
- MeshServiceSubset
- MeshHTTPRoute
type: string
Expand Down Expand Up @@ -929,6 +933,7 @@ spec:
- MeshSubset
- MeshGateway
- MeshService
- MeshExternalService
- MeshServiceSubset
- MeshHTTPRoute
type: string
Expand Down Expand Up @@ -1737,6 +1742,7 @@ spec:
- MeshSubset
- MeshGateway
- MeshService
- MeshExternalService
- MeshServiceSubset
- MeshHTTPRoute
type: string
Expand Down Expand Up @@ -1996,6 +2002,7 @@ spec:
- MeshSubset
- MeshGateway
- MeshService
- MeshExternalService
- MeshServiceSubset
- MeshHTTPRoute
type: string
Expand Down Expand Up @@ -2117,6 +2124,7 @@ spec:
- MeshSubset
- MeshGateway
- MeshService
- MeshExternalService
- MeshServiceSubset
- MeshHTTPRoute
type: string
Expand Down Expand Up @@ -2202,6 +2210,7 @@ spec:
- MeshSubset
- MeshGateway
- MeshService
- MeshExternalService
- MeshServiceSubset
- MeshHTTPRoute
type: string
Expand Down Expand Up @@ -2326,6 +2335,7 @@ spec:
- MeshSubset
- MeshGateway
- MeshService
- MeshExternalService
- MeshServiceSubset
- MeshHTTPRoute
type: string
Expand Down Expand Up @@ -2660,6 +2670,7 @@ spec:
- MeshSubset
- MeshGateway
- MeshService
- MeshExternalService
- MeshServiceSubset
- MeshHTTPRoute
type: string
Expand Down Expand Up @@ -2878,6 +2889,7 @@ spec:
- MeshSubset
- MeshGateway
- MeshService
- MeshExternalService
- MeshServiceSubset
- MeshHTTPRoute
type: string
Expand Down Expand Up @@ -3326,6 +3338,7 @@ spec:
- MeshSubset
- MeshGateway
- MeshService
- MeshExternalService
- MeshServiceSubset
- MeshHTTPRoute
type: string
Expand Down Expand Up @@ -3622,6 +3635,7 @@ spec:
- MeshSubset
- MeshGateway
- MeshService
- MeshExternalService
- MeshServiceSubset
- MeshHTTPRoute
type: string
Expand Down Expand Up @@ -3784,6 +3798,7 @@ spec:
- MeshSubset
- MeshGateway
- MeshService
- MeshExternalService
- MeshServiceSubset
- MeshHTTPRoute
type: string
Expand Down Expand Up @@ -4342,6 +4357,7 @@ spec:
- MeshSubset
- MeshGateway
- MeshService
- MeshExternalService
- MeshServiceSubset
- MeshHTTPRoute
type: string
Expand Down Expand Up @@ -4584,6 +4600,7 @@ spec:
- MeshSubset
- MeshGateway
- MeshService
- MeshExternalService
- MeshServiceSubset
- MeshHTTPRoute
type: string
Expand Down Expand Up @@ -4649,6 +4666,7 @@ spec:
- MeshSubset
- MeshGateway
- MeshService
- MeshExternalService
- MeshServiceSubset
- MeshHTTPRoute
type: string
Expand Down Expand Up @@ -4834,6 +4852,7 @@ spec:
- MeshSubset
- MeshGateway
- MeshService
- MeshExternalService
- MeshServiceSubset
- MeshHTTPRoute
type: string
Expand Down Expand Up @@ -4955,6 +4974,7 @@ spec:
- MeshSubset
- MeshGateway
- MeshService
- MeshExternalService
- MeshServiceSubset
- MeshHTTPRoute
type: string
Expand Down Expand Up @@ -5339,6 +5359,7 @@ spec:
- MeshSubset
- MeshGateway
- MeshService
- MeshExternalService
- MeshServiceSubset
- MeshHTTPRoute
type: string
Expand Down Expand Up @@ -5641,6 +5662,7 @@ spec:
- MeshSubset
- MeshGateway
- MeshService
- MeshExternalService
- MeshServiceSubset
- MeshHTTPRoute
type: string
Expand Down Expand Up @@ -5718,6 +5740,7 @@ spec:
- MeshSubset
- MeshGateway
- MeshService
- MeshExternalService
- MeshServiceSubset
- MeshHTTPRoute
type: string
Expand Down Expand Up @@ -5797,6 +5820,7 @@ spec:
- MeshSubset
- MeshGateway
- MeshService
- MeshExternalService
- MeshServiceSubset
- MeshHTTPRoute
type: string
Expand Down Expand Up @@ -5975,6 +5999,7 @@ spec:
- MeshSubset
- MeshGateway
- MeshService
- MeshExternalService
- MeshServiceSubset
- MeshHTTPRoute
type: string
Expand Down Expand Up @@ -6040,6 +6065,7 @@ spec:
- MeshSubset
- MeshGateway
- MeshService
- MeshExternalService
- MeshServiceSubset
- MeshHTTPRoute
type: string
Expand Down Expand Up @@ -6157,6 +6183,7 @@ spec:
- MeshSubset
- MeshGateway
- MeshService
- MeshExternalService
- MeshServiceSubset
- MeshHTTPRoute
type: string
Expand Down Expand Up @@ -6444,6 +6471,7 @@ spec:
- MeshSubset
- MeshGateway
- MeshService
- MeshExternalService
- MeshServiceSubset
- MeshHTTPRoute
type: string
Expand Down Expand Up @@ -6650,6 +6678,7 @@ spec:
- MeshSubset
- MeshGateway
- MeshService
- MeshExternalService
- MeshServiceSubset
- MeshHTTPRoute
type: string
Expand Down Expand Up @@ -6715,6 +6744,7 @@ spec:
- MeshSubset
- MeshGateway
- MeshService
- MeshExternalService
- MeshServiceSubset
- MeshHTTPRoute
type: string
Expand Down Expand Up @@ -8015,6 +8045,7 @@ spec:
- MeshSubset
- MeshGateway
- MeshService
- MeshExternalService
- MeshServiceSubset
- MeshHTTPRoute
type: string
Expand Down Expand Up @@ -8080,6 +8111,7 @@ spec:
- MeshSubset
- MeshGateway
- MeshService
- MeshExternalService
- MeshServiceSubset
- MeshHTTPRoute
type: string
Expand Down Expand Up @@ -8294,6 +8326,7 @@ spec:
- MeshSubset
- MeshGateway
- MeshService
- MeshExternalService
- MeshServiceSubset
- MeshHTTPRoute
type: string
Expand Down Expand Up @@ -8659,6 +8692,7 @@ spec:
- MeshSubset
- MeshGateway
- MeshService
- MeshExternalService
- MeshServiceSubset
- MeshHTTPRoute
type: string
Expand Down Expand Up @@ -8724,6 +8758,7 @@ spec:
- MeshSubset
- MeshGateway
- MeshService
- MeshExternalService
- MeshServiceSubset
- MeshHTTPRoute
type: string
Expand Down Expand Up @@ -9029,6 +9064,7 @@ spec:
- MeshSubset
- MeshGateway
- MeshService
- MeshExternalService
- MeshServiceSubset
- MeshHTTPRoute
type: string
Expand Down
Loading

0 comments on commit aab380b

Please sign in to comment.