Skip to content

Commit

Permalink
Add GatewayHostRoute to associate a Service to GatewayHost using a Route
Browse files Browse the repository at this point in the history
Fixes #77
  • Loading branch information
chintan8saaras committed Jul 18, 2022
1 parent e0d6a44 commit b98c09a
Show file tree
Hide file tree
Showing 18 changed files with 872 additions and 151 deletions.
34 changes: 34 additions & 0 deletions enroute-dp/apis/enroute/v1/gatewayhostroute.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
package v1

import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)

type GatewayHostRouteSpec struct {
// Fqdn of the GatewayHost
Fqdn string `json:"fqdn"`
// Route is the route for service
Route Route `json:"route"`
}

// +genclient
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object

// GatewayHostRoute can be used to provide Route Specification for a service
// +k8s:openapi-gen=true
// +kubebuilder:resource:scope=Namespaced,path=gatewayhostroutes,shortName=gwhostroute;gwhostroutes,singular=gatewayhostroute
type GatewayHostRoute struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata"`

Spec GatewayHostRouteSpec `json:"spec"`
}

// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object

// GatewayHostRouteList is a list of GatewayHostRoutes
type GatewayHostRouteList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata"`
Items []GatewayHostRoute `json:"items"`
}
2 changes: 2 additions & 0 deletions enroute-dp/apis/enroute/v1/register.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ func addKnownTypes(scheme *runtime.Scheme) error {
scheme.AddKnownTypes(SchemeGroupVersion,
&GatewayHost{},
&GatewayHostList{},
&GatewayHostRoute{},
&GatewayHostRouteList{},
&GlobalConfig{},
&GlobalConfigList{},
&HttpFilter{},
Expand Down
77 changes: 77 additions & 0 deletions enroute-dp/apis/enroute/v1/zz_generated.deepcopy.go

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

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

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

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

0 comments on commit b98c09a

Please sign in to comment.