Skip to content

Commit f880152

Browse files
authored
fix: privateKeyRef case (#199)
1 parent 88dd510 commit f880152

File tree

2 files changed

+28
-28
lines changed

2 files changed

+28
-28
lines changed

config/crd/bases/vpn.wireguard-operator.io_wireguardpeers.yaml

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -39,33 +39,6 @@ spec:
3939
spec:
4040
description: The desired state of the peer.
4141
properties:
42-
PrivateKeyRef:
43-
description: The private key of the peer
44-
properties:
45-
secretKeyRef:
46-
description: SecretKeySelector selects a key of a Secret.
47-
properties:
48-
key:
49-
description: The key of the secret to select from. Must be
50-
a valid secret key.
51-
type: string
52-
name:
53-
description: |-
54-
Name of the referent.
55-
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
56-
TODO: Add other useful fields. apiVersion, kind, uid?
57-
type: string
58-
optional:
59-
description: Specify whether the Secret or its key must be
60-
defined
61-
type: boolean
62-
required:
63-
- key
64-
type: object
65-
x-kubernetes-map-type: atomic
66-
required:
67-
- secretKeyRef
68-
type: object
6942
address:
7043
description: |-
7144
INSERT ADDITIONAL SPEC FIELDS - desired state of cluster
@@ -127,6 +100,33 @@ spec:
127100
type: object
128101
type: object
129102
type: array
103+
privateKeyRef:
104+
description: The private key of the peer
105+
properties:
106+
secretKeyRef:
107+
description: SecretKeySelector selects a key of a Secret.
108+
properties:
109+
key:
110+
description: The key of the secret to select from. Must be
111+
a valid secret key.
112+
type: string
113+
name:
114+
description: |-
115+
Name of the referent.
116+
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
117+
TODO: Add other useful fields. apiVersion, kind, uid?
118+
type: string
119+
optional:
120+
description: Specify whether the Secret or its key must be
121+
defined
122+
type: boolean
123+
required:
124+
- key
125+
type: object
126+
x-kubernetes-map-type: atomic
127+
required:
128+
- secretKeyRef
129+
type: object
130130
publicKey:
131131
description: The key used by the peer to authenticate with the wg
132132
server.

pkg/api/v1alpha1/wireguardpeer_types.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ type WireguardPeerSpec struct {
4242
// The DNS configuration for the peer.
4343
Dns string `json:"dns,omitempty"`
4444
// The private key of the peer
45-
PrivateKey PrivateKey `json:"PrivateKeyRef,omitempty"`
45+
PrivateKey PrivateKey `json:"privateKeyRef,omitempty"`
4646
// The key used by the peer to authenticate with the wg server.
4747
PublicKey string `json:"publicKey,omitempty"`
4848
// The name of the Wireguard instance in k8s that the peer belongs to. The wg instance should be in the same namespace as the peer.

0 commit comments

Comments
 (0)