Skip to content

Commit

Permalink
✨ Add LoadBalancerProviderRef (ionos-cloud#169)
Browse files Browse the repository at this point in the history
**What is the purpose of this pull request/Why do we need it?**

**Issue #, if available:**

**Description of changes:**

**Special notes for your reviewer:**

**Checklist:**
- [ ] Documentation updated
- [ ] Unit Tests added
- [ ] E2E Tests added
- [x] Includes
[emojis](https://github.com/kubernetes-sigs/kubebuilder-release-tools?tab=readme-ov-file#kubebuilder-project-versioning)
  • Loading branch information
jriedel-ionos authored Jul 4, 2024
1 parent 52482df commit ee5a2b8
Show file tree
Hide file tree
Showing 5 changed files with 43 additions and 4 deletions.
4 changes: 4 additions & 0 deletions api/v1alpha1/ionoscloudcluster_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,10 @@ type IonosCloudClusterSpec struct {
// CredentialsRef is a reference to the secret containing the credentials to access the IONOS Cloud API.
//+kubebuilder:validation:XValidation:rule="has(self.name) && self.name != ''",message="credentialsRef.name must be provided"
CredentialsRef corev1.LocalObjectReference `json:"credentialsRef"`

// LoadBalancerProviderRef is a reference to the load balancer provider configuration.
// An empty loadBalancerProviderRef field is allowed and means to disable any load balancer logic.
LoadBalancerProviderRef *corev1.LocalObjectReference `json:"loadBalancerProviderRef,omitempty"`
}

// IonosCloudClusterStatus defines the observed state of IonosCloudCluster.
Expand Down
3 changes: 3 additions & 0 deletions api/v1alpha1/ionoscloudcluster_types_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,9 @@ func defaultCluster() *IonosCloudCluster {
},
Location: "de/txl",
CredentialsRef: corev1.LocalObjectReference{Name: "secret-name"},
LoadBalancerProviderRef: &corev1.LocalObjectReference{
Name: "fake-lb-provider",
},
},
}
}
Expand Down
14 changes: 10 additions & 4 deletions 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 @@ -96,6 +96,19 @@ spec:
x-kubernetes-validations:
- message: credentialsRef.name must be provided
rule: has(self.name) && self.name != ''
loadBalancerProviderRef:
description: |-
LoadBalancerProviderRef is a reference to the load balancer provider configuration.
An empty loadBalancerProviderRef field is allowed and means to disable any load balancer logic.
properties:
name:
description: |-
Name of the referent.
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
TODO: Add other useful fields. apiVersion, kind, uid?
type: string
type: object
x-kubernetes-map-type: atomic
location:
description: Location is the location where the data centers should
be located.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,19 @@ spec:
x-kubernetes-validations:
- message: credentialsRef.name must be provided
rule: has(self.name) && self.name != ''
loadBalancerProviderRef:
description: |-
LoadBalancerProviderRef is a reference to the load balancer provider configuration.
An empty loadBalancerProviderRef field is allowed and means to disable any load balancer logic.
properties:
name:
description: |-
Name of the referent.
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
TODO: Add other useful fields. apiVersion, kind, uid?
type: string
type: object
x-kubernetes-map-type: atomic
location:
description: Location is the location where the data centers
should be located.
Expand Down

0 comments on commit ee5a2b8

Please sign in to comment.