feat : Initial support for converting devcontainer.json to devfile.yaml
#184
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What does this PR do?
This PR provides initial implementation for converting
devcontainer.jsontodevfile.yaml. It adds a new file calleddev-containers-to-devfile-adapter.tsthat is responsible for converting adevcontainer.jsoninto adevfile.yamldevContainerJsonContentto methodgenerateDevfileContextdevContainerJsonContentis parsed into an object and dev-container-to-devfile-adapter is invoked to perform the conversion.DevContainers Specification
https://containers.dev/implementors/json_reference/
Devfile Specification
https://devfile.io/docs/2.3.0/devfile-schema
At the moment, these fields are being considered for conversion:
Name->metadata.nameforwardPorts->components[*].container.endpointscontainerEnv->components[*].container.envremoteEnv->components[*].container.envoverrideCommand-> a command is added to the containerwhile true; do sleep 1000; doneMounts->components[*].volumeImage->components[*].container.imageBuild.dockerfile->components[*].image.dockerfile.uriBuild.context->components[*].image.dockerfile.buildContextBuild.args->components[*].image.dockerfile.argsworkspaceFolder->components[*].container.sourceMappinginitializeCommand->events.preStartonCreateCommand->events.postStartupdateContentCommand->events.postStartpostCreateCommand->events.postStartpostStartCommand->events.postStartpostAttachCommand->events.postStarthostRequirements.cpus->components[*].container.cpuRequesthostRequirements.memory->components[*].container.memoryRequestI couldn't find mapping for these fields:
portsAttributesotherPortsAttributesremoteUsercontainerUserupdateRemoteUserUIDuserEnvProbeshutdownActionInitPrivilegedcapAddsecurityOptFeaturesoverrideFeatureInstallOrderCustomizationsBuild.optionsBuild.targetbuild.cacheFromappPort(legacy equivalent toforwardPorts)workspaceMountrunArgsdockerComposeFileServicerunServiceswaitForhostRequirements.storagehostRequirements.gpuWhat issues does this PR fix or reference?
Related to https://issues.redhat.com/browse/CRW-7180
Is it tested? How?