Skip to content

feat: migration webhook for v1alpha1 to v1alpha2 - #339

Draft
gauravgahlot wants to merge 4 commits into
clastix:masterfrom
gauravgahlot:migration-webhook
Draft

feat: migration webhook for v1alpha1 to v1alpha2 #339
gauravgahlot wants to merge 4 commits into
clastix:masterfrom
gauravgahlot:migration-webhook

Conversation

@gauravgahlot

Copy link
Copy Markdown

No description provided.

Signed-off-by: Gaurav Gahlot <gaurav.gahlot@ionos.com>
Signed-off-by: Gaurav Gahlot <gaurav.gahlot@ionos.com>
Signed-off-by: Gaurav Gahlot <gaurav.gahlot@ionos.com>
Signed-off-by: Gaurav Gahlot <gaurav.gahlot@ionos.com>
}

if src.Gateway != nil {
v := v1alpha2.GatewayComponent(*src.Gateway)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not possible anymore due to the introduction of SectionName and Port in the GatewayComponent struct

errKCPTmplHubTypeMismatch = errors.New("cannot convert KamajiControlPlaneTemplate: hub is not *v1alpha2.KamajiControlPlaneTemplate")
)

func (src *KamajiControlPlane) ConvertTo(dstRaw conversion.Hub) error {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We are missing FailureReason and FailureMessage

Comment on lines +86 to +88
// availableReplicas — new in v1alpha2, dropped on round trip
// (controller repopulates on next reconcile)
src.Status.Conditions = hub.Status.Conditions

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe this is the case for more fields here, but if we want, we can calculate this before the reconciliation

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants