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

Refactor cluster templates #1341

Merged
merged 1 commit into from
Aug 20, 2023
Merged

Refactor cluster templates #1341

merged 1 commit into from
Aug 20, 2023

Conversation

Amulyam24
Copy link
Contributor

@Amulyam24 Amulyam24 commented Aug 11, 2023

What this PR does / why we need it:
This PR refactors the construction of cluster templates by reducing code duplication.

Which issue(s) this PR fixes (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close the issue(s) when PR gets merged):
Fixes #855

Special notes for your reviewer:

/area provider/ibmcloud

  1. Please confirm that if this PR changes any image versions, then that's the sole change this PR makes.

Release note:

Refactor cluster templates

@k8s-ci-robot k8s-ci-robot added area/provider/ibmcloud Issues or PRs related to ibmcloud provider cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Aug 11, 2023
@netlify
Copy link

netlify bot commented Aug 11, 2023

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

Name Link
🔨 Latest commit 71c7903
🔍 Latest deploy log https://app.netlify.com/sites/kubernetes-sigs-cluster-api-ibmcloud/deploys/64da1db7653cf10008a3add2
😎 Deploy Preview https://deploy-preview-1341--kubernetes-sigs-cluster-api-ibmcloud.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 configuration.

@k8s-ci-robot k8s-ci-robot added the size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. label Aug 11, 2023
@Prajyot-Parab
Copy link
Contributor

@Amulyam24
Is this the same behavior on your machine as well?

cluster-api-provider-ibmcloud % make generate-templates
./hack/version.sh: line 95: GIT_MAJOR: unbound variable
hack/tools/bin/kustomize build /Users/prajyotparab/Workspace/sandbox/cluster-api-provider-ibmcloud/templates/cluster-template --load-restrictor LoadRestrictionsNone > /Users/prajyotparab/Workspace/sandbox/cluster-api-provider-ibmcloud/templates/cluster-template.yaml
# Warning: 'patchesStrategicMerge' is deprecated. Please use 'patches' instead. Run 'kustomize edit fix' to update your Kustomization automatically.
hack/tools/bin/kustomize build /Users/prajyotparab/Workspace/sandbox/cluster-api-provider-ibmcloud/templates/cluster-template-powervs --load-restrictor LoadRestrictionsNone > /Users/prajyotparab/Workspace/sandbox/cluster-api-provider-ibmcloud/templates/cluster-template-powervs.yaml
# Warning: 'patchesStrategicMerge' is deprecated. Please use 'patches' instead. Run 'kustomize edit fix' to update your Kustomization automatically.
hack/tools/bin/kustomize build /Users/prajyotparab/Workspace/sandbox/cluster-api-provider-ibmcloud/templates/cluster-template-powervs-cloud-provider --load-restrictor LoadRestrictionsNone > /Users/prajyotparab/Workspace/sandbox/cluster-api-provider-ibmcloud/templates/cluster-template-powervs-cloud-provider.yaml
# Warning: 'patchesStrategicMerge' is deprecated. Please use 'patches' instead. Run 'kustomize edit fix' to update your Kustomization automatically.
hack/tools/bin/kustomize build /Users/prajyotparab/Workspace/sandbox/cluster-api-provider-ibmcloud/templates/cluster-template-powervs-clusterclass --load-restrictor LoadRestrictionsNone > /Users/prajyotparab/Workspace/sandbox/cluster-api-provider-ibmcloud/templates/cluster-template-powervs-clusterclass.yaml
hack/tools/bin/kustomize build /Users/prajyotparab/Workspace/sandbox/cluster-api-provider-ibmcloud/templates/cluster-template-vpc-load-balancer --load-restrictor LoadRestrictionsNone > /Users/prajyotparab/Workspace/sandbox/cluster-api-provider-ibmcloud/templates/cluster-template-vpc-load-balancer.yaml
# Warning: 'patchesStrategicMerge' is deprecated. Please use 'patches' instead. Run 'kustomize edit fix' to update your Kustomization automatically.

@Amulyam24
Copy link
Contributor Author

@Amulyam24 Is this the same behavior on your machine as well?

cluster-api-provider-ibmcloud % make generate-templates
./hack/version.sh: line 95: GIT_MAJOR: unbound variable
hack/tools/bin/kustomize build /Users/prajyotparab/Workspace/sandbox/cluster-api-provider-ibmcloud/templates/cluster-template --load-restrictor LoadRestrictionsNone > /Users/prajyotparab/Workspace/sandbox/cluster-api-provider-ibmcloud/templates/cluster-template.yaml
# Warning: 'patchesStrategicMerge' is deprecated. Please use 'patches' instead. Run 'kustomize edit fix' to update your Kustomization automatically.
hack/tools/bin/kustomize build /Users/prajyotparab/Workspace/sandbox/cluster-api-provider-ibmcloud/templates/cluster-template-powervs --load-restrictor LoadRestrictionsNone > /Users/prajyotparab/Workspace/sandbox/cluster-api-provider-ibmcloud/templates/cluster-template-powervs.yaml
# Warning: 'patchesStrategicMerge' is deprecated. Please use 'patches' instead. Run 'kustomize edit fix' to update your Kustomization automatically.
hack/tools/bin/kustomize build /Users/prajyotparab/Workspace/sandbox/cluster-api-provider-ibmcloud/templates/cluster-template-powervs-cloud-provider --load-restrictor LoadRestrictionsNone > /Users/prajyotparab/Workspace/sandbox/cluster-api-provider-ibmcloud/templates/cluster-template-powervs-cloud-provider.yaml
# Warning: 'patchesStrategicMerge' is deprecated. Please use 'patches' instead. Run 'kustomize edit fix' to update your Kustomization automatically.
hack/tools/bin/kustomize build /Users/prajyotparab/Workspace/sandbox/cluster-api-provider-ibmcloud/templates/cluster-template-powervs-clusterclass --load-restrictor LoadRestrictionsNone > /Users/prajyotparab/Workspace/sandbox/cluster-api-provider-ibmcloud/templates/cluster-template-powervs-clusterclass.yaml
hack/tools/bin/kustomize build /Users/prajyotparab/Workspace/sandbox/cluster-api-provider-ibmcloud/templates/cluster-template-vpc-load-balancer --load-restrictor LoadRestrictionsNone > /Users/prajyotparab/Workspace/sandbox/cluster-api-provider-ibmcloud/templates/cluster-template-vpc-load-balancer.yaml
# Warning: 'patchesStrategicMerge' is deprecated. Please use 'patches' instead. Run 'kustomize edit fix' to update your Kustomization automatically.

yes @Prajyot-Parab. Made changes for the warning regarding deprecation of patchesStrategicMerge except for cluster-template-vpc-load-balancer since it has multiple patches in one, will see if that can be changed too.

@Prajyot-Parab
Copy link
Contributor

Prajyot-Parab commented Aug 14, 2023

@Amulyam24 Is this the same behavior on your machine as well?

yes @Prajyot-Parab. Made changes for the warning regarding deprecation of patchesStrategicMerge except for cluster-template-vpc-load-balancer since it has multiple patches in one, will see if that can be changed too.

@Amulyam24 Checked looking good, let me know if its possible to fix vpc-load-blancer template as well.

@Amulyam24
Copy link
Contributor Author

@Amulyam24 Is this the same behavior on your machine as well?

yes @Prajyot-Parab. Made changes for the warning regarding deprecation of patchesStrategicMerge except for cluster-template-vpc-load-balancer since it has multiple patches in one, will see if that can be changed too.

@Amulyam24 Checked looking good, let me know if its possible to fix vpc-load-blancer template as well.

@Prajyot-Parab, split the patches. PR is ready for review. PTAL

Copy link
Contributor

@Prajyot-Parab Prajyot-Parab left a comment

Choose a reason for hiding this comment

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

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Aug 14, 2023
@Amulyam24
Copy link
Contributor Author

/cc @mkumatag

@k8s-ci-robot k8s-ci-robot requested a review from mkumatag August 14, 2023 12:33
Copy link
Member

@mkumatag mkumatag left a comment

Choose a reason for hiding this comment

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

/lgtm

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Aug 20, 2023
@@ -174,6 +175,14 @@ generate-go-conversions: $(CONVERSION_GEN) ## Generate conversions go code
--output-file-base=zz_generated.conversion $(CONVERSION_GEN_OUTPUT_BASE) \
--go-header-file=./hack/boilerplate/boilerplate.generatego.txt

.PHONY: generate-templates
Copy link
Member

Choose a reason for hiding this comment

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

We should explore how consume this target! @Amulyam24 can you create a follow up task for that?

@k8s-ci-robot k8s-ci-robot removed the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Aug 20, 2023
@mkumatag
Copy link
Member

lets merge this meanwhile

/approve

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: Amulyam24, mkumatag, Prajyot-Parab

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

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Aug 20, 2023
@k8s-ci-robot k8s-ci-robot merged commit a402887 into kubernetes-sigs:main Aug 20, 2023
@@ -406,4 +403,7 @@ data:
name: ibm-cloud-config
- name: ibm-secret
secret:
secretName: ibm-cloud-credential
secretName: ibm-cloud-credentia
Copy link
Contributor

Choose a reason for hiding this comment

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

ibm-cloud-credentia -> ibm-cloud-credential

@Amulyam24 typo error

name: ibm-cloud-config
- name: ibm-secret
secret:
secretName: ibm-cloud-credentia
Copy link
Contributor

Choose a reason for hiding this comment

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

ibm-cloud-credentia -> ibm-cloud-credential

@Amulyam24 another one here

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. area/provider/ibmcloud Issues or PRs related to ibmcloud provider cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. 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.

Reduce the code duplication in the cluster templates
4 participants