-
-
Notifications
You must be signed in to change notification settings - Fork 22
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
Source dir of extraManifests #871
Comments
Good catch! Yeah this should get fixed. Do you want to do the PR or should I do it myself? |
After some thinking, I don't know how to do this without breaking the behavior of: #619 |
I can / are in the middle of fixing it. I would propose two solutions to how it works currently:
What would do you think? |
Ah yeah I missed that @mircea-pavel-anton What do you think? My thought is it will be confusing but personally I always run |
The more I think about it, to be honest, the more I realize that #619 might have been a mistake... To be fully honest, I don't even remember exactly what caused us to discuss and eventually implement it. Maybe it was tab completion for node names? Regardless. The thing is - I have said this before and I still stand by it - what What I mean by that is that when you do define In that regard, I think that the approach proposed, i.e. using I think that, even with the risk of it being a breaking change, we should set some clear boundaries as to how this behavior is expected to work. My personal thoughts on the matter are that all relative paths should be evaluated in relation to the config file itself, since that's also the behavior we've grown to expect from the likes of I would say that the functionality to have paths relative to the place of CLI invocation should be removed entirely and then everything should be evaluated in relation to the config file location. |
Looking at the code from #619, I think the current implementation is already correct? Maybe it's just the wrong wording of the PR? I see the code logic is doing:
This should mean that the value is substituted with the the path relative to the config file? |
Nope it is definitely not correct currently. For this two examples:
Now he checks if it is in the cmd invocation dir. As expected from the code since there is no '@' Otherwise if we have
An error occurs for 'extraManifests[0], "stat @${TALCONFIG_DIR}/extra1.yaml: no such file or directory"' so the '@' isnt replaced thats all :). I find the "@" really confusing here since it is directly loaded by talhelper and not like the other ones by the talosctl cmd. |
I thought I'd like to rewrite the pathsub logic so that it operates on the parsed (not validated!) yaml content. So on the The problem is that the config type is in the same package as the config loader which uses the pathsub i.e. dependency cycle So i would like to rewrite the path sub and move the config type to its own basic package. For the user this shouldn't affect anything |
Looks like you're correct. @jonsch318 you want to work on this? |
Currently the extraManifests are sourced from the current working directory where the cli was launched
https://github.com/budimanjojo/talhelper/blob/7380a168284f7c6985f528feb8e513d1823a6b86/pkg/generate/config.go#L185C1-L198C2
Although this can be logical I would prefer if it were sourced relative to the
talconfig.yaml
.What do you think?
The text was updated successfully, but these errors were encountered: