Skip to content
This repository has been archived by the owner on Oct 10, 2023. It is now read-only.

Fixes TKC based cluster template generation issue when TKG_CUSTOM_IMAGE_REPOSITORY is set #2954

Merged
merged 1 commit into from
Jul 16, 2022

Conversation

chandrareddyp
Copy link
Contributor

@chandrareddyp chandrareddyp commented Jul 15, 2022

What this PR does / why we need it

why we need it:
In the existing cli overlays, tries to add KubeadmControlPlane and KubeadmConfigTemplate when environment variable TKG_CUSTOM_IMAGE_REPOSITORY set with any value, this is happening even for tkgs use case, which is not valid.

What this PR does:
this PR is to update ytt overlays to exclude KubeadmControlPlane and KubeadmConfigTemplate for tkgs provider, added new condition to check environment variable TKG_CUSTOM_IMAGE_REPOSITORY and the provider type, it includes only for providers ["vsphere", "aws", "azure", "docker"].

Signed-off-by: Chandra Pamuluri cpamuluri@cpamuluri-a01.vmware.com

Which issue(s) this PR fixes

Fixes #2953

Describe testing done for PR

  • Build CLI on local with command make build-install-cli-local
  • Set environment variable TKG_CUSTOM_IMAGE_REPOSITORY
  • unset environment variable SUPPRESS_PROVIDERS_UPDATE
  • create tkgs tkc cluster with command - tanzu cluster create -f /tkc.conf --tkr v1.23.5---vmware.1-tkg.1-zshippable -v 9, cluster was created successfully

Release note

Fixed TKC based cluster template generation issue when `TKG_CUSTOM_IMAGE_REPOSITORY` is set

PR Checklist

  • Squash the commits into one or a small number of logical commits
  • Use good commit messages
  • Ensure PR contains terms all contributors can understand and links all contributors can access

Additional information

Special notes for your reviewer

changes add condition to include KubeadmControlPlane only for non-tkgs proviers, and skip for tkgs use case

Signed-off-by: Chandra Pamuluri <cpamuluri@cpamuluri-a01.vmware.com>
@github-actions
Copy link

Cluster Generation A/B Results:
https://storage.googleapis.com/tkg-clustergen/2954/20220715230041/clustergen.diff.txt
Author/reviewers:
Please review to verify that the effects on the generated cluster configurations are exactly what the PR intended, and give a thumbs-up if so.

@chandrareddyp chandrareddyp changed the title add condition to skip KubeadmControlPlane overlay for tkgs Fixed TKC based cluster template generation issue when TKG_CUSTOM_IMAGE_REPOSITORY is set Jul 15, 2022
@chandrareddyp chandrareddyp changed the title Fixed TKC based cluster template generation issue when TKG_CUSTOM_IMAGE_REPOSITORY is set Fixes TKC based cluster template generation issue when TKG_CUSTOM_IMAGE_REPOSITORY is set Jul 15, 2022
Copy link
Contributor

@anujc25 anujc25 left a comment

Choose a reason for hiding this comment

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

Looks good

@codecov
Copy link

codecov bot commented Jul 15, 2022

Codecov Report

Merging #2954 (6c871aa) into main (5fdc05d) will decrease coverage by 0.01%.
The diff coverage is n/a.

@@            Coverage Diff             @@
##             main    #2954      +/-   ##
==========================================
- Coverage   44.00%   43.98%   -0.02%     
==========================================
  Files         416      416              
  Lines       41847    41847              
==========================================
- Hits        18414    18407       -7     
- Misses      21712    21718       +6     
- Partials     1721     1722       +1     
Impacted Files Coverage Δ
addons/controllers/clusterbootstrap_controller.go 63.28% <0.00%> (-0.62%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 5fdc05d...6c871aa. Read the comment docs.

@anujc25 anujc25 added area/cli kind/bug PR/Issue related to a bug ok-to-merge PRs should be labelled with this before merging labels Jul 15, 2022
@chandrareddyp chandrareddyp merged commit 80058b9 into main Jul 16, 2022
@chandrareddyp chandrareddyp deleted the topic/cpamuluri/update-ytt-overlay-for-tkgs branch July 16, 2022 00:01
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area/cli cla-not-required kind/bug PR/Issue related to a bug ok-to-merge PRs should be labelled with this before merging
Projects
None yet
Development

Successfully merging this pull request may close these issues.

tkgs tkc cluster creation failing when TKG_CUSTOM_IMAGE_REPOSITORY env variable has value
3 participants