Skip to content

Commit

Permalink
fix apis
Browse files Browse the repository at this point in the history
  • Loading branch information
aleoli committed Oct 10, 2023
1 parent 4695feb commit 835cefb
Show file tree
Hide file tree
Showing 15 changed files with 2,568 additions and 24 deletions.
2 changes: 1 addition & 1 deletion apis/networking/v1alpha1/gatewayclient_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ type GatewayClientSpec struct {
// MTU specifies the MTU of the tunnel.
MTU int `json:"mtu,omitempty"`
// Endpoint specifies the endpoint of the tunnel.
Endpoint Endpoint `json:"endpoint,omitempty"`
Endpoint EndpointStatus `json:"endpoint,omitempty"`
}

// GatewayClientStatus defines the observed state of GatewayClient.
Expand Down
2 changes: 2 additions & 0 deletions apis/networking/v1alpha1/wggatewayclient_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ var WgGatewayClientGroupVersionResource = GroupVersion.WithResource(WgGatewayCli
type WgGatewayClientSpec struct {
// Deployment specifies the deployment template for the client.
Deployment DeploymentTemplate `json:"deployment"`
// Metrics specifies the metrics configuration for the client.
Metrics *Metrics `json:"metrics,omitempty"`
}

// WgGatewayClientStatus defines the observed state of WgGatewayClient.
Expand Down
20 changes: 20 additions & 0 deletions apis/networking/v1alpha1/wggatewayserver_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
package v1alpha1

import (
monitoringv1 "github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring/v1"
appsv1 "k8s.io/api/apps/v1"
corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
Expand Down Expand Up @@ -52,12 +53,31 @@ type DeploymentTemplate struct {
Spec appsv1.DeploymentSpec `json:"spec,omitempty"`
}

type ServiceMonitorTemplate struct {

Check warning on line 56 in apis/networking/v1alpha1/wggatewayserver_types.go

View workflow job for this annotation

GitHub Actions / Lint golang files

exported: exported type ServiceMonitorTemplate should have comment or be unexported (revive)
// Metadata of the service monitor.
Metadata metav1.ObjectMeta `json:"metadata,omitempty"`
// Spec of the service monitor.
Spec monitoringv1.ServiceMonitorSpec `json:"spec,omitempty"`
}

// Metrics defines the metrics configuration.
type Metrics struct {
// Enabled specifies whether the metrics are enabled.
Enabled bool `json:"enabled"`
// Service specifies the service template for the metrics.
Service *ServiceTemplate `json:"service,omitempty"`
// ServiceMonitor specifies the service monitor template for the metrics.
ServiceMonitor *ServiceMonitorTemplate `json:"serviceMonitor,omitempty"`
}

// WgGatewayServerSpec defines the desired state of WgGatewayServer.
type WgGatewayServerSpec struct {
// Service specifies the service template for the server.
Service ServiceTemplate `json:"service"`
// Deployment specifies the deployment template for the server.
Deployment DeploymentTemplate `json:"deployment"`
// Metrics specifies the metrics configuration for the server.
Metrics *Metrics `json:"metrics,omitempty"`
}

// WgGatewayServerStatus defines the observed state of WgGatewayServer.
Expand Down
56 changes: 54 additions & 2 deletions apis/networking/v1alpha1/zz_generated.deepcopy.go

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

Original file line number Diff line number Diff line change
Expand Up @@ -78,18 +78,21 @@ spec:
endpoint:
description: Endpoint specifies the endpoint of the tunnel.
properties:
addresses:
description: Addresses specifies the addresses of the endpoint.
items:
type: string
type: array
port:
description: Port specifies the port of the endpoint.
format: int32
type: integer
serviceType:
default: ClusterIP
description: ServiceType specifies the type of the service.
protocol:
default: TCP
description: Protocol specifies the protocol of the endpoint.
enum:
- ClusterIP
- NodePort
- LoadBalancer
- ExternalName
- TCP
- UDP
type: string
type: object
mtu:
Expand Down
Loading

0 comments on commit 835cefb

Please sign in to comment.