-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Duplicate resource when using .flux.yaml files #2571
Comments
Could you please be more specific about what caused the problem and what you are trying to achieve? (Including the file layout of the git repo, the content of the Flux does support using multiple |
@2opremio thanks for getting back to me. I have multiple git-paths like
I'm puzzled since flux is complaining about the .flux.yaml instead of an actual k8s resource files. |
The resources are generated to stdout so the closest you have to a file is the configuration file which specifies how to generate them. The example you provide should work just fine as long as there are no duplicate resources generated by the config files, so I would check that. Unfortunately, I am afraid I cannot help you further without a full, self-contained example which allows me to reproduce the problem. BTW, flux looks for |
If flux only cares about generated resources how come it complains about the I tried that with the parent approach but that didn't work either since I got a lot of errors when processing the resources, which didn't appear when I ran/generated resources for every directory independently. Could you please elaborate how the parent dir Thanks! |
This is because the |
The docs could be friendlier. Here are the important bits:
|
Thanks, I understand better now. I think the text itself is ok, I even remember reading both sentences, but wasn't able to bring these together. I guess an example, showing that, would help greatly. I put a single .flux.yaml in the parent of the subdirectory. And have the --git-path directive pointing to the subdirectories. Weird thing is I do now get this error:
|
( CC @squaremo , that message is pretty bad, I think we should include the resource ID and the |
I guess more logging would help generally. 👍 Any idea why it is failing now - struggling with the same path? |
@AlessandroEmm I am not sure, I am afraid can only ask you for a full example to debug it. |
@2opremio fluxResource/base is the configuration for the flux instance |
Thanks. Can you provide the |
This suggests to me a few UX improvements, even if we don't know exactly what is the problem here:
|
@2opremio they are in fluxResource/base/patch.yaml - I based my flux deployment on the base found in this repo here. |
This assumes |
@AlessandroEmm your setup produces a duplicated resource. To find it I created the following bases:
- configuration/cluster-base/dev-lab/cluster-services
- configuration/cluster-base/dev-lab/devops/connect
- configuration/cluster-base/dev-lab/devops/iam
- configuration/cluster-base/dev-lab/devops/rail When running
Which means that the flux namespace is produced in different Flux should get better at reporting the error (including the |
Closing since the root cause is found. I have created #2595 to improve the error message Flux gives. @AlessandroEmm please reopen if you think the issue isn't solved. |
@2opremio |
Flux detects a problem related to duplicated resources. The error message is confusing but it refers to the generated resources by the The Kustomize problem is equivalent, solve it (by removing the duplicate) and Flux will also work
Kustomize struggles because the final resources are the same, including the namespace (two resources are the same if they have the same
No, the check in Flux happens after generating the resources. |
It is possible that you want to have a subdirectory that gets processed as "plain" YAMLs as well as being subject to a |
I meant Thanks for the explanation, now I know what you meant. |
I'm not sure if it is a feature request, bug or rather a support question, but I'll ask anyway.
Describe the feature
Flux should allow multiple .flux files in different git-folders. I currently get an error like
Looking at the code this seems to be a conscious behaviour, but I don't get why that would be since different git-paths are usually not related hence the use of different folders/path.
What would the new user story look like?
Will be able to tell when I get an answer to my question. 👍
Expected behavior
Flux should allow multiple .flux files in different git-folders.
The text was updated successfully, but these errors were encountered: