-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Conversation
af7cce7
to
c906d37
Compare
NB: there is one change to the example deployments in I think this is a good thing, but I have little idea of how |
@squaremo I see no problem with setting git label, email and user, but I would use |
@stefanprodan Thanks -- I'll change the label. I am reluctant to change too much about either fluxctl install or the example manifests here, so I'll leave the "better yet" to another PR. |
The change is a great improvement for us, both in complexity and code reduction, and improved maintainability. I am however wondering if there is any impact on |
I think this breaks eksctl, wksctl, firekube and any other project that depends on the install package. |
WHYYYYYYY |
Oh yes, it was the motivation for the |
I think it's OK to break the API (eksctl vendors it anyways) but Flux should still supply a way for eksctl to generate the files (ideally in memory and including the filenames) |
@2opremio would it be possible for them to generate their own embedded file based on the templates they receive from vendoring the package? |
I can commit the generated file, and restore the change detection, while still breaking the dependency that was causing problems. (It's just a shame go doesn't let us avoid it) |
Yes, I guess that would be possible, but in practice that's pushing the problem to the consumer which I don't think it's ideal (particularly if it's not just eksctl which uses this functionality) |
Not really -- the consumer wouldn't have the circular dependency problem that's being fixed here. However, it is fiddly to call |
02644fe
to
69fa669
Compare
69fa669
to
658b845
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for double checking the timestamp issues @squaremo, LGTM 🥇
It's pretty useful to be able to get a flux config as individual files, so you can e.g., check them into git. This also means we can use `fluxctl install` to generate the files under deploy/, so they will be reliably close to what you'd get from running the tool.
For `fluxctl install`, we embed a set of templates in the fluxctl binary by generating a fake filesystem as Go code (pkg/install/generated_templates.gogen.go). But the code that generates the fake filesystem also _depends_ on the fake filesystem, since it does double duty as a program for generating example manifests from those templates. This leads to a problem: if anything has upset the generation process, it's not possible to regenerate the files, since the generation tool won't build. (A related problem, worked around elsewhere (#2473), is that it's easy to introduce spurious differences in the generated code -- which, since it's checked in -- means painful merges. The solution there still works here.) In general we don't care about the generated Go code, only about what it produces. This commit removes the generated file from the "uncommitted change" detection (`make check-generated`); and uses `fluxctl install` to generate the example files, removing the need for the code generating program to depend on the code it's generating. NB It's still necessary to commit the generated code, since other projects depend on the install package.
658b845
to
3cae80d
Compare
Adapted from commit msg:
For
fluxctl install
, we embed a set of templates in the fluxctl binary by generating a fake filesystem as Go code (pkg/install/generated_templates.gogen.go). But the code that generates the fake filesystem also depends on the fake filesystem, since it does double duty as a program for generating example manifests from those templates.This leads to a problem: if anything has upset the generation process, it's not possible to regenerate the files, since the generation tool won't build.
A related problem, worked around elsewhere (#2473), is that it's easy to introduce spurious differences in the generated code -- which, since it's checked in -- means painful merges.
In general we don't care about the generated Go code, only about what it produces. This PR removes it from git and from the uncommitted change detection (
make check-generated
); and uses a new capability offluxctl install
to write to individual files to generate the example files under deploy/, removing the need for the code generating program to depend on the code it's generating.