Skip to content

Conversation

rejoshed
Copy link
Contributor

@rejoshed rejoshed commented Aug 10, 2022

Issue #, if available:

Description of changes:
Meta naming for failure domain custom resource objects currently follows failureDomainName + - + clusterName.

This was to work around EKS-A's decision to put all clusters in a single namespace.

Unfortunately k8s object names can only be 64 characters long and this leads to the concern that CAPC will break for any combination of names that leads to >64 character failure domain naming.

This uses a hash of the failure domain name and the cluster name to predictably generate a failure domain's meta name.

Also should close #113 (comment)

Testing performed:
All unit tests passing locally.

Ran e2e PR-Blocking tests successfully.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@k8s-ci-robot
Copy link
Contributor

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@k8s-ci-robot k8s-ci-robot added do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. labels Aug 10, 2022
@netlify
Copy link

netlify bot commented Aug 10, 2022

Deploy Preview for kubernetes-sigs-cluster-api-cloudstack ready!

Name Link
🔨 Latest commit 9f10f03
🔍 Latest deploy log https://app.netlify.com/sites/kubernetes-sigs-cluster-api-cloudstack/deploys/62f5427f2df2da00080bb97e
😎 Deploy Preview https://deploy-preview-147--kubernetes-sigs-cluster-api-cloudstack.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@k8s-ci-robot k8s-ci-robot added approved Indicates a PR has been approved by an approver from all required OWNERS files. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Aug 10, 2022
@@ -63,7 +63,7 @@ type CloudStackMachineSpec struct {

// Optional affinitygroupids for deployVirtualMachine
// +optional
AffinityGroupIDs []string `json:"affinitygroupids,omitempty"`
AffinityGroupIDs []string `json:"affinityGroupIDs,omitempty"`
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Just a fixup for JSON tagging consistency.


// Check if the passed network was an isolated network or the network was missing. In either case, create a
// CloudStackIsolatedNetwork to manage the many intricacies and wait until CloudStackIsolatedNetwork is ready.
if r.ReconciliationSubject.Spec.Zone.Network.ID == "" ||
r.ReconciliationSubject.Spec.Zone.Network.Type == infrav1.NetworkTypeIsolated {
netName := r.ReconciliationSubject.Spec.Zone.Network.Name
if res, err := r.GenerateIsolatedNetwork(netName)(); r.ShouldReturn(res, err) {
if res, err := r.GenerateIsolatedNetwork(
netName, func() string { return r.ReconciliationSubject.Spec.Name })(); r.ShouldReturn(res, err) {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Need to pass failure domain name in here.

@rejoshed rejoshed requested review from maxdrib and wongni and removed request for davidjumani and jweite-amazon August 10, 2022 23:04
@k8s-ci-robot k8s-ci-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Aug 10, 2022
Joshua Reed added 2 commits August 10, 2022 16:15
@rejoshed rejoshed marked this pull request as ready for review August 10, 2022 23:18
@k8s-ci-robot k8s-ci-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Aug 10, 2022
@codecov-commenter
Copy link

codecov-commenter commented Aug 10, 2022

Codecov Report

Merging #147 (9f10f03) into main (a541d71) will decrease coverage by 0.18%.
The diff coverage is 57.14%.

@@            Coverage Diff             @@
##             main     #147      +/-   ##
==========================================
- Coverage   24.35%   24.17%   -0.19%     
==========================================
  Files          43       43              
  Lines        3798     3748      -50     
==========================================
- Hits          925      906      -19     
+ Misses       2727     2699      -28     
+ Partials      146      143       -3     
Impacted Files Coverage Δ
api/v1beta1/zz_generated.conversion.go 0.53% <0.00%> (+0.02%) ⬆️
api/v1beta2/cloudstackisolatednetwork_types.go 28.57% <ø> (ø)
api/v1beta2/cloudstackmachine_types.go 28.57% <ø> (ø)
api/v1beta2/zz_generated.deepcopy.go 12.29% <ø> (+0.02%) ⬆️
...ontrollers/cloudstackisolatednetwork_controller.go 8.51% <0.00%> (-33.49%) ⬇️
...ollers/cloudstackmachinestatechecker_controller.go 0.00% <0.00%> (ø)
controllers/cloudstackfailuredomain_controller.go 32.94% <50.00%> (+0.75%) ⬆️
controllers/cloudstackcluster_controller.go 44.33% <60.00%> (+0.94%) ⬆️
api/v1beta2/cloudstackfailuredomain_types.go 100.00% <100.00%> (ø)
controllers/cloudstackaffinitygroup_controller.go 64.10% <100.00%> (-0.90%) ⬇️
... and 6 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@k8s-ci-robot k8s-ci-robot added size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Aug 11, 2022
@rejoshed rejoshed requested a review from wongni August 11, 2022 00:04
@@ -63,7 +63,7 @@ type CloudStackMachineSpec struct {

// Optional affinitygroupids for deployVirtualMachine
// +optional
AffinityGroupIDs []string `json:"affinitygroupids,omitempty"`
AffinityGroupIDs []string `json:"affinityGroupIDs,omitempty"`
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't think we should change this now. EKS-A is already and other customers may also be using this field and changing the serialization/deserialization patterns feels risky, with no gain. I'm inclined to keep these as they are and fix later on in an intentional way

Unless this is strictly for the v1beta2 types, and not v1beta1? Same for the other changes involving json

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Indeed, this is only on v1beta2 types.

That's why I wanted to jamb this into this release. It won't be easy to do outside of an API version bump.

Copy link
Contributor

@maxdrib maxdrib left a comment

Choose a reason for hiding this comment

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

Why are all these test data files deleted?

@wongni
Copy link
Contributor

wongni commented Aug 11, 2022

Why are all these test data files deleted?

They are generated files via kustomize during executing run-e2e make target

@jweite-amazon
Copy link
Contributor

/approved

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: maxdrib, rejoshed, wongni

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

The pull request process is described 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

@rejoshed rejoshed merged commit 4a47522 into kubernetes-sigs:main Aug 11, 2022
@rejoshed rejoshed deleted the feature/hash-failure-domain-naming branch August 11, 2022 18:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. 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.

Inconsistent JSON tags
6 participants