Skip to content
This repository was archived by the owner on Feb 11, 2025. It is now read-only.

Commit 89f2b16

Browse files
committed
add metro based provisioning for VLAN resources
Signed-off-by: Marques Johansson <mjohansson@equinix.com>
1 parent f514bae commit 89f2b16

File tree

3 files changed

+12
-12
lines changed

3 files changed

+12
-12
lines changed

apis/vlan/v1alpha1/virtualnetwork_types.go

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,7 @@ type VirtualNetworkStatus struct {
3939
// +kubebuilder:printcolumn:name="READY",type="string",JSONPath=".status.conditions[?(@.type=='Ready')].status"
4040
// +kubebuilder:printcolumn:name="SYNCED",type="string",JSONPath=".status.conditions[?(@.type=='Synced')].status"
4141
// +kubebuilder:printcolumn:name="ID",type="string",JSONPath=".status.atProvider.id"
42-
// +kubebuilder:printcolumn:name="HOSTNAME",type="string",JSONPath=".spec.forProvider.hostname"
43-
// +kubebuilder:printcolumn:name="FACILITY",type="string",JSONPath=".status.atProvider.facility"
42+
// +kubebuilder:printcolumn:name="FACILITY",type="string",JSONPath=".status.atProvider.facilityCode"
4443
// +kubebuilder:printcolumn:name="RECLAIM-POLICY",type="string",JSONPath=".spec.reclaimPolicy"
4544
// +kubebuilder:printcolumn:name="AGE",type="date",JSONPath=".metadata.creationTimestamp"
4645
// +kubebuilder:subresource:status
@@ -69,8 +68,11 @@ type VirtualNetworkList struct {
6968
// LateInitialization should update the parameter after creation.
7069
type VirtualNetworkParameters struct {
7170
// +immutable
72-
// +required
73-
Facility string `json:"facility"`
71+
// +optional
72+
Facility string `json:"facility,omitempty"`
73+
74+
// +optional
75+
Metro string `json:"metro,omitempty"`
7476

7577
// +optional
7678
Description *string `json:"description,omitempty"`
@@ -82,6 +84,6 @@ type VirtualNetworkObservation struct {
8284
ID string `json:"id"`
8385
Href string `json:"href,omitempty"`
8486
VXLAN int `json:"vxlan,omitempty"`
85-
FacilityCode string `json:"facility_code,omitempty"`
87+
FacilityCode string `json:"facilityCode,omitempty"`
8688
CreatedAt *metav1.Time `json:"createdAt,omitempty"`
8789
}

package/crds/vlan.metal.equinix.com_virtualnetworks.yaml

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,7 @@ spec:
1616
- JSONPath: .status.atProvider.id
1717
name: ID
1818
type: string
19-
- JSONPath: .spec.forProvider.hostname
20-
name: HOSTNAME
21-
type: string
22-
- JSONPath: .status.atProvider.facility
19+
- JSONPath: .status.atProvider.facilityCode
2320
name: FACILITY
2421
type: string
2522
- JSONPath: .spec.reclaimPolicy
@@ -69,8 +66,8 @@ spec:
6966
type: string
7067
facility:
7168
type: string
72-
required:
73-
- facility
69+
metro:
70+
type: string
7471
type: object
7572
providerConfigRef:
7673
description: ProviderConfigReference specifies how the provider that will be used to create, observe, update, and delete this managed resource should be configured.
@@ -115,7 +112,7 @@ spec:
115112
createdAt:
116113
format: date-time
117114
type: string
118-
facility_code:
115+
facilityCode:
119116
type: string
120117
href:
121118
type: string

pkg/clients/vlan/virtualnetwork.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ func NewClient(ctx context.Context, config *clients.Credentials) (ClientWithDefa
7676
func CreateFromVirtualNetwork(d *v1alpha1.VirtualNetwork, projectID string) *packngo.VirtualNetworkCreateRequest {
7777
return &packngo.VirtualNetworkCreateRequest{
7878
Facility: d.Spec.ForProvider.Facility,
79+
Metro: d.Spec.ForProvider.Metro,
7980
Description: emptyIfNil(d.Spec.ForProvider.Description),
8081
ProjectID: projectID,
8182
}

0 commit comments

Comments
 (0)