operator: implement roundtripping conversion of v1alpha3#892
operator: implement roundtripping conversion of v1alpha3#892
Conversation
68351e9 to
3f2854a
Compare
3f2854a to
7d306eb
Compare
|
This PR is stale because it has been open 5 days with no activity. Remove stale label or comment or this will be closed in 5 days. |
7d306eb to
b329522
Compare
| // TODO does rpk redpanda tune read from redpanda.yaml? | ||
| // Arguments to be passed to rpk redpanda tune | ||
| // https://docs.redpanda.com/current/reference/rpk/rpk-redpanda/rpk-redpanda-tune/ | ||
| // Tuning []string `json:"tuning"` |
There was a problem hiding this comment.
@r-vasquez As far as I remember the rpk redpanda start command will not do anything with tuning configuration inside redpanda.yaml.
@chrisseto Those tuning option could take effect when the init container named tuning runs.
Reference:
redpanda-operator/charts/redpanda/statefulset.go
Lines 358 to 389 in 3153bc8
| return nil, false | ||
| } | ||
|
|
||
| // TODO Handle all cases here |
There was a problem hiding this comment.
Those Handle all cases here means follow up PR? Or when we discover problems during cloud migration? Or something completely different?
| Memory: nil, | ||
| }, | ||
|
|
||
| // TODO Audit this list. |
There was a problem hiding this comment.
By audit you mean handle them in next PR or leave them as nil?
| AdditionalRedpandaCmdFlags: nil, | ||
| AdditionalSelectorsLabels: nil, | ||
| Annotations: nil, | ||
| Budget: nil, | ||
| ExtraVolumeMounts: nil, | ||
| ExtraVolumes: nil, | ||
| InitContainerImage: nil, | ||
| LivenessProbe: nil, | ||
| NodeSelector: nil, | ||
| PodAffinity: nil, | ||
| PodAntiAffinity: nil, | ||
| PriorityClassName: nil, | ||
| ReadinessProbe: nil, | ||
| SecurityContext: nil, | ||
| SideCars: nil, | ||
| SkipChown: nil, | ||
| StartupProbe: nil, | ||
| TerminationGracePeriodSeconds: nil, | ||
| Tolerations: nil, | ||
| TopologySpreadConstraints: nil, | ||
| UpdateStrategy: nil, |
There was a problem hiding this comment.
Should those fields have similar TODO Audit this list..
There was a problem hiding this comment.
I'm fine with this as a first pass since nothing is using it, but lots of questions before I hit approve. Also, WDYT about a rapid test that roundtrips v1alpha2 --> 3 --> 2 but with deprecated/unsupported fields ignored (as mentioned in the PR description, I'm fine doing this secondarily)? I'm assuming that was what the start of the commented test case is?
| // - addresses: Expr(srv_address('tcp', 'admin', 'redpanda.redpanda.cluster.svc.cluster.local')) | ||
| type Expr string | ||
|
|
||
| type ObjectMeta struct { |
There was a problem hiding this comment.
Is there a reason not to just use or alias metav1.ObjectMeta? I'm assuming b/c we don't want to pull in name/namespace fields?
| Enabled: ptr.To(false), | ||
| Cert: nil, | ||
| RequireClientAuth: nil, | ||
| SecretRef: nil, |
There was a problem hiding this comment.
Looks like this is unused. Was this slurped into Cert at some point but never dropped?
| SecretRef: &redpandav1alpha2.SecretRef{ | ||
| Name: ptr.To(tls.Secrets.SecretRef.Name), | ||
| }, | ||
| ApplyInternalDNSNames: nil, |
| ApplyInternalDNSNames: nil, | ||
| CAEnabled: nil, | ||
| ClientSecretRef: clientRef, | ||
| Duration: nil, |
| Name: ptr.To(tls.Secrets.SecretRef.Name), | ||
| }, | ||
| ApplyInternalDNSNames: nil, | ||
| CAEnabled: nil, |
There was a problem hiding this comment.
deprecated? all of the above appear unused. I just worry if we haven't explicitly deprecated these fields, we'll lose behavior roundtripping.
| } | ||
|
|
||
| var source CertificateSource | ||
| if cert.IssuerRef != nil { |
There was a problem hiding this comment.
again, mutually exclusive?
This commit adds the initial set of conversion routines to support roundtripping all valid configurations of the v1alpha3 CR through the v1alpha2 CR. To aid in the development and testing of the conversion routines, the `exhaustruct` linter has been enabled on files ending in `_conversion.go`. It requires all fields to be explicitly declared which will prevent future additions to either CR from causing regressions. It should be noted that v1alpha2 can NOT be roundtripped. Therefore the v1alpha3 CRD can not be _safely_ enabled. Future work will: - Improve user facing documentation of all fields - Support roundtripping v1alpha2 through v1alpha3 - (Potentially) refactor conversion to make use of the conversion-gen tool.
b329522 to
807d5c3
Compare
|
TFTRs! I realize this PR is a lot more half baked than I was remembering. I'm going to take a quick stab at the conversion-gen approach and adding both directions of round trips to see if I can make this feel less janky. There's so many TODOs that I will forget the context of if I merge it as is :/ |
|
This PR is stale because it has been open 5 days with no activity. Remove stale label or comment or this will be closed in 5 days. |
|
This PR is stale because it has been open 5 days with no activity. Remove stale label or comment or this will be closed in 5 days. |
|
This PR was closed because it has been stalled for 5 days with no activity. |
This commit adds the initial set of conversion routines to support roundtripping all valid configurations of the v1alpha3 CR through the v1alpha2 CR.
To aid in the development and testing of the conversion routines, the
exhaustructlinter has been enabled on files ending in_conversion.go. It requires all fields to be explicitly declared which will prevent future additions to either CR from causing regressions.It should be noted that v1alpha2 can NOT be roundtripped. Therefore the v1alpha3 CRD can not be safely enabled.
Future work will: