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

Without the --write-to option, the "clusterctl generate cluster" command fails. #7970

Closed
hama-25179 opened this issue Jan 23, 2023 · 4 comments · Fixed by #7972
Closed

Without the --write-to option, the "clusterctl generate cluster" command fails. #7970

hama-25179 opened this issue Jan 23, 2023 · 4 comments · Fixed by #7972
Assignees
Labels
area/clusterctl Issues or PRs related to clusterctl kind/bug Categorizes issue or PR as related to a bug. lifecycle/active Indicates that an issue or PR is actively being worked on by a contributor. triage/accepted Indicates an issue or PR is ready to be actively worked on.

Comments

@hama-25179
Copy link

What steps did you take and what happened:
In clsuterctl built from latest source code for master branch, fail output yaml-template to stdout when running clsuterctl generate cluster.

$ kind create cluster
$ make clusterctl

$ ./bin/clusterctl version
clusterctl version: &version.Info{Major:"1", Minor:"3", GitVersion:"v1.3.0-rc.0.350-7527262d765cd5", GitCommit:"7527262d765cd5b5ad74538ce50660b23c7cf999", GitTreeState:"clean", BuildDate:"2023-01-23T01:13:33Z", GoVersion:"go1.19.3", Compiler:"gc", Platform:"linux/amd64"}

$ ./bin/clusterctl generate cluster test-cl  --kubernetes-version v1.26.0 --from test/infrastructure/docker/templates/cluster-template-development.yaml
Error: failed to write to destination file: open .: is a directory

--write-to option, output to any file works fine.

$ ./bin/clusterctl generate cluster test-cl  --kubernetes-version v1.26.0 --from test/infrastructure/docker/templates/cluster-template-development.yaml --write-to /work/cl.yaml

What did you expect to happen:
Since this command worked fine in previous versions, we hope the same result in the latest version.

Anything else you would like to add:
The output flag is added in the following PR.

If this flag is not specified, the return value of filepath.Clean() is "."(dot), but it appears that this is not handled.

Environment:

  • clusterctl version: GitVersion:"v1.3.0-rc.0.350-7527262d765cd5"
  • kind version: v0.17.0

/kind bug
/area clusterctl

@k8s-ci-robot k8s-ci-robot added kind/bug Categorizes issue or PR as related to a bug. area/clusterctl Issues or PRs related to clusterctl needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. labels Jan 23, 2023
@sbueringer
Copy link
Member

Definitely a bug. Thx for testing and reporting

/triage accepted

cc @Rohitrajak1807

@k8s-ci-robot k8s-ci-robot added triage/accepted Indicates an issue or PR is ready to be actively worked on. and removed needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. labels Jan 23, 2023
@Rohitrajak1807
Copy link
Contributor

Definitely a bug. Thx for testing and reporting

/triage accepted

cc @Rohitrajak1807

I'll take a look. Thanks for bringing it up

@Rohitrajak1807
Copy link
Contributor

/assign Rohitrajak1807
/lifecycle active

@Rohitrajak1807
Copy link
Contributor

Definitely a bug. Thx for testing and reporting

/triage accepted

cc @Rohitrajak1807

Please take a look: #7972

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/clusterctl Issues or PRs related to clusterctl kind/bug Categorizes issue or PR as related to a bug. lifecycle/active Indicates that an issue or PR is actively being worked on by a contributor. triage/accepted Indicates an issue or PR is ready to be actively worked on.
Projects
None yet
4 participants