Skip to content

Commit

Permalink
Sync Gloo APIs. Destination Branch: gloo-main
Browse files Browse the repository at this point in the history
  • Loading branch information
soloio-bot committed Jan 12, 2025
1 parent 525d438 commit 54be030
Show file tree
Hide file tree
Showing 8 changed files with 316 additions and 168 deletions.
12 changes: 12 additions & 0 deletions api/gloo/gloo/v1/enterprise/options/ai/ai.proto
Original file line number Diff line number Diff line change
Expand Up @@ -431,6 +431,7 @@ message SemanticCache {
//
// +kubebuilder:validation:Minimum=0
// +kubebuilder:validation:Maximum=1
// Deprecated: Prefer setting the distance threshold in the RouteOptions.SemanticCache resource.
float score_threshold = 2;
}

Expand Down Expand Up @@ -474,6 +475,14 @@ message SemanticCache {
uint32 ttl = 3;
// The caching mode to use for the request and response lifecycle. Supported values include `READ_WRITE` or `READ_ONLY`.
Mode mode = 4;

// Distance score threshold value between 0.0 and 1.0 that determines how similar
// two queries must be in order to return a cached result.
// The lower the number, the more similar the queries must be for a cache hit.
//
// +kubebuilder:validation:Minimum=0
// +kubebuilder:validation:Maximum=1
float distance_threshold = 5;
}

// [Retrieval augmented generation (RAG)](https://research.ibm.com/blog/retrieval-augmented-generation-RAG)
Expand Down Expand Up @@ -646,6 +655,7 @@ message AIPromptGuard {
message HeaderMatch {
// The header string match type.
enum MatchType {
option allow_alias = true;
// The string must match exactly the specified string.
EXACT = 0;
// The string must have the specified prefix.
Expand All @@ -655,6 +665,8 @@ message AIPromptGuard {
// The header string must contain the specified string.
CONTAINS = 3;
// The string must match the specified [RE2-style regular expression](https://github.com/google/re2/wiki/) pattern.
REGEX = 4;
// Do not use. Use `REGEX` (fully capitalized) instead.
regex = 4;
}
// The header key string to match against.
Expand Down
14 changes: 14 additions & 0 deletions pkg/api/gateway.gloo.solo.io/v1alpha1/gateway_parameters_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,20 @@ type GatewayParametersSpec struct {
SelfManaged *SelfManagedGateway `json:"selfManaged,omitempty"`
}

func (in *GatewayParametersSpec) GetKube() *KubernetesProxyConfig {
if in == nil {
return nil
}
return in.Kube
}

func (in *GatewayParametersSpec) GetSelfManaged() *SelfManagedGateway {
if in == nil {
return nil
}
return in.SelfManaged
}

// The current conditions of the GatewayParameters. This is not currently implemented.
type GatewayParametersStatus struct {
}
Expand Down
52 changes: 52 additions & 0 deletions pkg/api/gateway.gloo.solo.io/v1alpha1/kube_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,17 @@ type Service struct {
//
// +kubebuilder:validation:Optional
ExtraAnnotations map[string]string `json:"extraAnnotations,omitempty"`

// Additional configuration for the service ports.
// The actual port numbers are specified in the Gateway resource.
//
// +optional
// +kubebuilder:validation:MaxItems=8
Ports []*Port `json:"ports"`
// External Traffic Policy on the Service object.
//
// +kubebuilder:validation:Optional
ExternalTrafficPolicy *corev1.ServiceExternalTrafficPolicy `json:"externalTrafficPolicy,omitempty"`
}

func (in *Service) GetType() *corev1.ServiceType {
Expand Down Expand Up @@ -126,6 +137,47 @@ func (in *Service) GetExtraAnnotations() map[string]string {
return in.ExtraAnnotations
}

func (in *Service) GetPorts() []*Port {
if in == nil {
return nil
}
return in.Ports
}

func (in *Service) GetExternalTrafficPolicy() *corev1.ServiceExternalTrafficPolicy {
if in == nil {
return nil
}
return in.ExternalTrafficPolicy
}

type Port struct {
// The port number to match on the Gateway
//
// +kubebuilder:validation:Required
Port uint16 `json:"port"`

// The NodePort to be used for the service. If not specified, a random port
// will be assigned by the Kubernetes API server.
//
// +kubebuilder:validation:Optional
NodePort *uint16 `json:"nodePort,omitempty"`
}

func (in *Port) GetPort() uint16 {
if in == nil {
return 0
}
return in.Port
}

func (in *Port) GetNodePort() *uint16 {
if in == nil {
return nil
}
return in.NodePort
}

type ServiceAccount struct {
// Additional labels to add to the ServiceAccount object metadata.
//
Expand Down
36 changes: 36 additions & 0 deletions pkg/api/gateway.gloo.solo.io/v1alpha1/zz_generated.deepcopy.go

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

2 changes: 2 additions & 0 deletions pkg/api/gloo.solo.io/v1/enterprise/options/ai/ai.pb.clone.go

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

4 changes: 4 additions & 0 deletions pkg/api/gloo.solo.io/v1/enterprise/options/ai/ai.pb.equal.go

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

Loading

0 comments on commit 54be030

Please sign in to comment.