Closed kadel closed 2 weeks ago
That stack was copied from https://github.com/odo-devfiles/registry/tree/master/devfiles/nodejs. I think that was created for the original odo deploy
as the first attempt to provide the outer loop function in the prototype. In the original devfile in https://github.com/odo-devfiles/registry/blob/master/devfiles/nodejs/devfile.yaml, it has the metadata that can only be handled by odo:
alpha.build-dockerfile: "https://raw.githubusercontent.com/odo-devfiles/registry/master/devfiles/nodejs/build/Dockerfile"
alpha.deployment-manifest: "https://raw.githubusercontent.com/odo-devfiles/registry/master/devfiles/nodejs/deploy/deployment-manifest.yaml"
Since it does not conform with the spec, we currently removed those metadata from the version in the current repo but leave the files in the stack.
Regarding the conflict with the existing problem that you described, I wonder if odo needs to handle file conflict generically and prompt the user for action instead of just overwrites with the stack version. The reason is stack owners may decide to include any file as part of the stack, and those files can potentially conflict with files in the user's project. So the tools probably need to handle the conflict scenario anyway.
Even if we decide to not prompt the user, we can consider changing the default conflict-handling behaviour to preserve the existing user project files instead of overwriting them.
We should probably consider some naming standards for extra files. We can't ask users every time if the files should be overridden or not. Overriding project files with stack files is just bad behavior, and not overriding will most probably break the stack.
The current design where extra files can be in any directory is problematic. Stack creators will create directories like deploy
, build
, or even src
. I can imagine that quite a few projects will already have directories with the same name as part of their repo.
What if I minimize the chances of this by saying that all extra files and dirs need to be in devfile
or .devfile
directory?
This will make devfile stack a nice "package". It will always be .devfile.yaml
with .devfile
dir or devfile.yaml
with devfile
dir.
I will open PR to remove extra files from nodejs stack. They have no use right now.
+1 I think a dot folder (not sure if we want to call it .devfile, .stack, or something else) is a good suggestion. One of the goals that we have is to hide the complexity from the user. If the user is just a pure application developer and a stack consumer (no override), putting the devfile under a .devfile folder by default will help us to achieve that.
Note:
the issue has been fixed in https://github.com/devfile/registry/pull/21
Why nodejs stack (https://github.com/devfile/registry/tree/master/stacks/nodejs) has extra directories like
deploy
andbuild
If it is not used anywhere?This creates problems. If I have nodejs project that already has
build/Dockerfile
in itodo create nodejs
will override my Dockerfile!