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

✨clusterctl: implements hack for generating local overrides #2027

Merged

Conversation

fabriziopandini
Copy link
Member

What this PR does / why we need it:
This PR implements a hack that makes it easy to test clusterctl even if now there are no published releases for v1alpha3

From the cluster-api repo

Edit you local clusterctl-settings.json file (same philosophy of tilt-settings.json), e.g.

{
  "providers": [ "cluster-api", "kubeadm", "aws"],
  "provider_repos": ["../cluster-api-provider-aws"]
}

Then run

cmd/clusterctl/hack/local-overrides.py

The output will be similar to

clusterctl local overrides generated from local repositories for the cluster-api, kubeadm-bootstrap, aws providers.
in order to use them, please run:

clusterctl init  --core cluster-api:v0.3.0 --bootstrap kubeadm-bootstrap:v0.3.0 --infrastructure aws:v0.5.0

Happy hacking!

Which issue(s) this PR fixes
Rif #1729

/assign @vincepri
/assign @ncdc
/cc @akutz
/cc @yastij

@k8s-ci-robot k8s-ci-robot requested review from akutz and yastij January 9, 2020 09:25
@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Jan 9, 2020
cmd/clusterctl/hack/local-overrides.py Outdated Show resolved Hide resolved
cmd/clusterctl/hack/local-overrides.py Outdated Show resolved Hide resolved
cmd/clusterctl/hack/local-overrides.py Outdated Show resolved Hide resolved
def write_local_override(provider, version, components_file, components_yaml):
try:
home = get_home()
overrides_folder = os.path.join(home, 'cluster-api', 'overrides')
Copy link
Contributor

Choose a reason for hiding this comment

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

I think we'd want this in a dotfolder, like .cluster-api, right?

Copy link
Member Author

@fabriziopandini fabriziopandini Jan 9, 2020

Choose a reason for hiding this comment

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

In the CAEP the consensus was for $HOME/cluster-api/.clusterctl.yaml
If you are ok I will be happy to change it into $HOME/.cluster-api/clusterctl.yaml in a follow-up PR

Copy link
Contributor

Choose a reason for hiding this comment

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

$HOME/cluster-api feels very wrong to me. Follow-up is fine, but let's remember to do it 😄

Copy link
Member

Choose a reason for hiding this comment

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

Huge +1, the folder should be hidden

cmd/clusterctl/hack/local-overrides.py Outdated Show resolved Hide resolved
cmd/clusterctl/hack/local-overrides.py Outdated Show resolved Hide resolved
cmd/clusterctl/hack/local-overrides.py Outdated Show resolved Hide resolved
cmd/clusterctl/hack/local-overrides.py Outdated Show resolved Hide resolved
cmd/clusterctl/hack/local-overrides.py Outdated Show resolved Hide resolved
cmd/clusterctl/hack/local-overrides.py Show resolved Hide resolved
@fabriziopandini
Copy link
Member Author

@ncdc comment addressed!

Copy link
Contributor

@ncdc ncdc left a comment

Choose a reason for hiding this comment

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

LGTM pending squash

.gitignore Outdated Show resolved Hide resolved
cmd/clusterctl/hack/local-overrides.py Outdated Show resolved Hide resolved
@fabriziopandini
Copy link
Member Author

@ncdc squashed/add a new line where missing

@ncdc ncdc added the area/clusterctl Issues or PRs related to clusterctl label Jan 10, 2020
@ncdc ncdc added this to the v0.3.0 milestone Jan 10, 2020
@ncdc
Copy link
Contributor

ncdc commented Jan 10, 2020

/lgtm
/approve

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jan 10, 2020
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: fabriziopandini, ncdc

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 Jan 10, 2020
@k8s-ci-robot k8s-ci-robot merged commit 1b8498d into kubernetes-sigs:master Jan 10, 2020
@fabriziopandini fabriziopandini deleted the clusterctl-hack branch January 13, 2020 12:53
vuil added a commit to vuil/cluster-api-provider-vsphere that referenced this pull request Jan 15, 2020
XRef kubernetes-sigs/cluster-api#2027
a file with name clusterctl-settings.json is what is expected
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/clusterctl Issues or PRs related to clusterctl 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/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants