Skip to content

Commit

Permalink
Rename tunnel to service, LightHouse to Lighthouse
Browse files Browse the repository at this point in the history
  • Loading branch information
adracus committed Nov 2, 2021
1 parent 1644253 commit 89aece6
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 18 deletions.
14 changes: 8 additions & 6 deletions apis/compute/v1alpha1/console_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ type ConsoleSpec struct {
Type ConsoleType `json:"type"`
// MachineRef references the machine to open a console to.
MachineRef corev1.LocalObjectReference `json:"machineRef"`
// LightHouseClientConfig is the ConsoleClientConfig for the machine to connect to a common lighthouse.
LightHouseClientConfig *ConsoleClientConfig `json:"lightHouseClientConfig,omitempty"`
// LighthouseClientConfig is the ConsoleClientConfig for the machine to connect to a common lighthouse.
LighthouseClientConfig *ConsoleClientConfig `json:"lighthouseClientConfig,omitempty"`
}

type ConsoleClientConfig struct {
Expand Down Expand Up @@ -58,11 +58,13 @@ type ServiceReference struct {
Port *int32 `json:"port,omitempty"`
}

// ConsoleType represents the type of console.
// +kubebuilder:validation:Enum=Service;Lighthouse
type ConsoleType string

const (
ConsoleTypeTunnel ConsoleType = "Tunnel"
ConsoleTypeLightHouse ConsoleType = "LightHouse"
ConsoleTypeService ConsoleType = "Service"
ConsoleTypeLightHouse ConsoleType = "Lighthouse"
)

type ConsoleState string
Expand All @@ -75,8 +77,8 @@ const (

// ConsoleStatus defines the observed state of Console
type ConsoleStatus struct {
State ConsoleState `json:"state,omitempty"`
TunnelClientConfig *ConsoleClientConfig `json:"tunnelClientConfig,omitempty"`
State ConsoleState `json:"state,omitempty"`
ServiceClientConfig *ConsoleClientConfig `json:"serviceClientConfig,omitempty"`
}

//+kubebuilder:object:root=true
Expand Down
8 changes: 4 additions & 4 deletions apis/compute/v1alpha1/zz_generated.deepcopy.go

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

13 changes: 8 additions & 5 deletions config/crd/bases/compute.onmetal.de_consoles.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ spec:
spec:
description: ConsoleSpec defines the desired state of Console
properties:
lightHouseClientConfig:
description: LightHouseClientConfig is the ConsoleClientConfig for
lighthouseClientConfig:
description: LighthouseClientConfig is the ConsoleClientConfig for
the machine to connect to a common lighthouse.
properties:
caBundle:
Expand Down Expand Up @@ -93,6 +93,9 @@ spec:
type: object
type:
description: Type is the ConsoleType to use.
enum:
- Service
- Lighthouse
type: string
required:
- machineRef
Expand All @@ -101,9 +104,7 @@ spec:
status:
description: ConsoleStatus defines the observed state of Console
properties:
state:
type: string
tunnelClientConfig:
serviceClientConfig:
properties:
caBundle:
description: CABundle is a PEM encoded CA bundle which will be
Expand Down Expand Up @@ -148,6 +149,8 @@ spec:
description: URL is the url to connect to.
type: string
type: object
state:
type: string
type: object
type: object
served: true
Expand Down
6 changes: 3 additions & 3 deletions config/samples/compute_v1alpha1_console.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ kind: Console
metadata:
name: console-sample
spec:
type: Tunnel
type: Service
machineRef:
name: my-machine
#status:
Expand All @@ -19,10 +19,10 @@ kind: Console
metadata:
name: console-sample
spec:
type: LightHouse
type: Lighthouse
machineRef:
name: my-machine
lightHouseClientConfig:
lighthouseClientConfig:
url: https://my-lighthouse.example.org
caBundle: |
my-ca-bundle
Expand Down

0 comments on commit 89aece6

Please sign in to comment.