Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Backfill unit tests for peering dialler #1265

Merged
merged 1 commit into from
Jun 10, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions charts/consul/templates/crd-peeringacceptors.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -94,12 +94,12 @@ spec:
key:
description: Key is the key of the secret generated.
type: string
latestHash:
description: ResourceVersion is the resource version for the secret.
type: string
name:
description: Name is the name of the secret generated.
type: string
resourceVersion:
description: ResourceVersion is the resource version for the secret.
type: string
type: object
type: object
type: object
Expand Down
6 changes: 3 additions & 3 deletions charts/consul/templates/crd-peeringdialers.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -94,12 +94,12 @@ spec:
key:
description: Key is the key of the secret generated.
type: string
latestHash:
description: ResourceVersion is the resource version for the secret.
type: string
name:
description: Name is the name of the secret generated.
type: string
resourceVersion:
description: ResourceVersion is the resource version for the secret.
type: string
type: object
type: object
type: object
Expand Down
17 changes: 10 additions & 7 deletions control-plane/api/v1alpha1/peeringacceptor_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,12 +76,15 @@ type ReconcileErrorStatus struct {
}

type SecretRefStatus struct {
// Name is the name of the secret generated.
Name string `json:"name,omitempty"`
// Key is the key of the secret generated.
Key string `json:"key,omitempty"`
// Backend is where the generated secret is stored. Currently supports the value: "kubernetes".
Backend string `json:"backend,omitempty"`
Secret `json:",inline"`
thisisnotashwin marked this conversation as resolved.
Show resolved Hide resolved
// ResourceVersion is the resource version for the secret.
ResourceVersion string `json:"latestHash,omitempty"`
ResourceVersion string `json:"resourceVersion,omitempty"`
}

func (pa *PeeringAcceptor) Secret() *Secret {
return pa.Spec.Peer.Secret
}

func (pa *PeeringAcceptor) SecretRef() *SecretRefStatus {
return pa.Status.SecretRef
}
11 changes: 11 additions & 0 deletions control-plane/api/v1alpha1/peeringdialer_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,3 +53,14 @@ type PeeringDialerStatus struct {
// +optional
SecretRef *SecretRefStatus `json:"secret,omitempty"`
}

func (pd *PeeringDialer) Secret() *Secret {
if pd.Spec.Peer == nil {
return nil
}
return pd.Spec.Peer.Secret
}

func (pd *PeeringDialer) SecretRef() *SecretRefStatus {
return pd.Status.SecretRef
}
1 change: 1 addition & 0 deletions control-plane/api/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 @@ -87,12 +87,12 @@ spec:
key:
description: Key is the key of the secret generated.
type: string
latestHash:
description: ResourceVersion is the resource version for the secret.
type: string
name:
description: Name is the name of the secret generated.
type: string
resourceVersion:
description: ResourceVersion is the resource version for the secret.
type: string
type: object
type: object
type: object
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,12 +87,12 @@ spec:
key:
description: Key is the key of the secret generated.
type: string
latestHash:
description: ResourceVersion is the resource version for the secret.
type: string
name:
description: Name is the name of the secret generated.
type: string
resourceVersion:
description: ResourceVersion is the resource version for the secret.
type: string
type: object
type: object
type: object
Expand Down
Loading