-
Notifications
You must be signed in to change notification settings - Fork 642
Add support for IP Family Policy and IP Families #4076
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
Changes from 11 commits
01913ec
8900ba8
f8d3112
0bdcb71
82a0cd6
b0c8385
6eecd0b
c39bc04
08bff2a
dbd60a1
f3784b3
1249fe7
1cec5eb
4c4ec0c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -20,8 +20,12 @@ type SchemalessObject map[string]any | |||||||||||
| // DeepCopy creates a new SchemalessObject by copying the receiver. | ||||||||||||
| func (in SchemalessObject) DeepCopy() SchemalessObject { | ||||||||||||
| return runtime.DeepCopyJSON(in) | ||||||||||||
|
|
||||||||||||
| } | ||||||||||||
|
|
||||||||||||
| // +kubebuilder:validation:Enum=IPv4;IPv6 | ||||||||||||
| type IPFamily string | ||||||||||||
|
|
||||||||||||
| type ServiceSpec struct { | ||||||||||||
| // +optional | ||||||||||||
| Metadata *Metadata `json:"metadata,omitempty"` | ||||||||||||
|
|
@@ -44,6 +48,15 @@ type ServiceSpec struct { | |||||||||||
| // +kubebuilder:validation:Enum={ClusterIP,NodePort,LoadBalancer} | ||||||||||||
| Type string `json:"type"` | ||||||||||||
|
|
||||||||||||
| // More info: https://kubernetes.io/docs/reference/kubernetes-api/service-resources/service-v1/ | ||||||||||||
| // --- | ||||||||||||
| // +optional | ||||||||||||
| // +kubebuilder:validation:Enum=SingleStack;PreferDualStack;RequireDualStack | ||||||||||||
| IPFamilyPolicy string `json:"ipFamilyPolicy,omitempty"` | ||||||||||||
|
||||||||||||
| IPFamilyPolicy string `json:"ipFamilyPolicy,omitempty"` | |
| IPFamilyPolicy *corev1.IPFamilyPolicy `json:"ipFamilyPolicy,omitempty"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes it does - thanks - refactoring
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
❓ We should be able to use the upstream type and add the enum validation from here. Does this generate the same YAML?
| // +optional | |
| IPFamilies []IPFamily `json:"ipFamilies,omitempty"` | |
| // +optional | |
| // +kubebuilder:validation:items:Enum={IPv4,IPv6} | |
| IPFamilies []corev1.IPFamily `json:"ipFamilies,omitempty"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes it does - thanks - refactoring
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
📝 If the Go types in the CRD structs can change, these assignments might reduce to
service.Spec... = spec....There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes - this one simplified also - thanks for the suggestion