Skip to content
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

apis/v1alpha2: move ServiceImport spec fields #85

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

MrFreezeex
Copy link
Member

This PR is meant to supersedes #52, most commits are from this linked PR done by @mikemorris (kudos to him!) and with the few suggestions left applied and making sure everything generate well

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: MrFreezeex
Once this PR has been reviewed and has the lgtm label, please assign skitt for approval. For more information see the Kubernetes Code Review Process.

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. labels Dec 3, 2024
Signed-off-by: Arthur Outhenin-Chalandre <arthur.outhenin-chalandre@ledger.fr>
Signed-off-by: Arthur Outhenin-Chalandre <arthur.outhenin-chalandre@ledger.fr>
@MrFreezeex
Copy link
Member Author

MrFreezeex commented Dec 3, 2024

While this adds initial support for v1alpha2 in this repo the next step involves:

  • Updating the coredns/multicluster plugin to detect which version is installed and selectively watch one api or the other (so that new coredns version are still compatible with v1alpha1)
  • Update e2e tests (that depends on the coredns plugin) and storage version to v1alpha2
  • Possibly updating conformance tests to this versions (cc @tpantelis for opinion on this aspect?)
  • Figuring out the code/recommendation for implementations for the webhooks

@MrFreezeex
Copy link
Member Author

/test pull-mcs-api-e2e

@MrFreezeex MrFreezeex changed the title apis/v1alpha2: move ServiceImport spec fields to status apis/v1alpha2: move ServiceImport spec fields Dec 4, 2024
@@ -23,6 +23,8 @@ import (

// +genclient
// +kubebuilder:object:root=true
// +kubebuilder:storageversion
Copy link
Contributor

Choose a reason for hiding this comment

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

Shouldn't the new v1alpha2 be the stored version?

Copy link
Member Author

@MrFreezeex MrFreezeex Dec 7, 2024

Choose a reason for hiding this comment

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

The problem is that the CoreDNS plugin (which is used in the e2e tests in this repo!) or anything watching mcs api ressources would need to support v1alpha2 explicitly or that we have the webhooks already deployed/figured out. So my plan would be to do this after CoreDNS supports v1alpha2, see this #85 (comment)

Copy link
Contributor

Choose a reason for hiding this comment

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

What is this file for?

Copy link
Member Author

Choose a reason for hiding this comment

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

I am not entirely sure tbh, it was part of the crd generation before 🤷‍♂️

- type
type: object
served: true
storage: false
Copy link
Contributor

Choose a reason for hiding this comment

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

This file does not specify any webhook conversion config so who is the intended consumer?

Copy link
Member Author

@MrFreezeex MrFreezeex Dec 7, 2024

Choose a reason for hiding this comment

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

I wanted to figure out webhooks as a later steps when we would be actually storing v1alpha2, but we also said at the last sig meeting that we could provide only the webhook code and not the deployment manifests so I suppose that implementation would have to update that aspect if they want to have a webhook. TBD when we would be actually implementing that and figured out recomendations to integrate it for implementations.

Copy link
Contributor

Choose a reason for hiding this comment

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

I can work on the webhook code - shouldn't be difficult.

Copy link
Member Author

@MrFreezeex MrFreezeex Dec 7, 2024

Choose a reason for hiding this comment

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

Sure that would be great! Note that I would like to submit the CoreDNS PR to support v1alpha2 as soon as possible with the hope that it gets merged before the winter holidays by the CoreDNS folks. So I would recommend to not block the v1alpha2 version based on having the webhook or not.

@tpantelis
Copy link
Contributor

While this adds initial support for v1alpha2 in this repo the next step involves:

  • Possibly updating conformance tests to this versions (cc @tpantelis for opinion on this aspect?)

My thoughts are that the consuming test code can be updated to reference the v1alpha2 Go versions. At test suite setup, we read the CRD and and check which versions are served and create dynamic ResourceClients with the selected GVRs (biasing towards v1alpha2). The functions to read/create ServiceImports/ServiceExports would use the dynamic clients instead of the generated client sets. If v1alpha2 is served in the CRD then we can directly convert the Unstructured to the v1alpha2 Go struct (and vice versa). Otherwise, we first convert the v1alpha1 Unstructured to v1alpha2 (using the same code as the webhook converter) and then convert to the v1alpha2 Go struct.

@@ -23,6 +23,8 @@ import (

// +genclient
// +kubebuilder:object:root=true
// +kubebuilder:storageversion
// +kubebuilder:resource:shortName=svcimport
Copy link
Member

@skitt skitt Dec 9, 2024

Choose a reason for hiding this comment

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

The short name for service imports is currently svcim (see the CRDs).

Copy link
Member Author

Choose a reason for hiding this comment

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

I know but as the name "svcim" is not anywhere else I think it might be more a lack of customization than something intended, I added both the new name and kept the old in my latest push. Does this looks ok to you? We can separate this change in another PR (it's already in a separated commit FYI) if needed

@@ -22,6 +22,8 @@ import (

// +genclient
// +kubebuilder:object:root=true
// +kubebuilder:storageversion
// +kubebuilder:resource:shortName=svcexport
Copy link
Member

Choose a reason for hiding this comment

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

The short name for service exports is currently svcex.

Signed-off-by: Arthur Outhenin-Chalandre <arthur.outhenin-chalandre@ledger.fr>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants