Skip to content
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

Move2Kube - Unable to transform variable values from JSON file #980

Open
mnarkhede85 opened this issue Feb 28, 2023 · 3 comments
Open

Move2Kube - Unable to transform variable values from JSON file #980

mnarkhede85 opened this issue Feb 28, 2023 · 3 comments

Comments

@mnarkhede85
Copy link

Describe the bug
Application has a custom variables in docker-compose file with the variables defined a separate JSON file. Upon running move2kube on docker-compose file, it did not transform the artifacts to Kubernetes manifests. It created the m2kplan file but did not create the myproject directory with required Kubernetes deployment files.

m2k transformer did not also prompt for options to enter or select port, deployment type, service type, registry etc.

To Reproduce
Steps to reproduce the behavior:

  1. Created an application directory and copied docker-compose & .env ( json file) to docker-deploy directory.
  2. Copied custom m2k tranformer to application directory.
  3. Executed - move2kube plan -s docker-deploy -c fullm2kcustomtranformer --log-level=debug - Successful
  4. Executed - move2kube transform m2k.plan and below was the output.
  5. See error

move2kube transform m2k.plan
INFO[0000] Detected a plan file at path /m2k.plan. Will transform using this plan.
INFO[0000] Starting transformation
? Specify a Kubernetes style selector to select only the transformers that you want to run.
ID: move2kube.transformerselector
Hints:

  • Leave empty to select everything. This is the default.

? Select all transformer types that you are interested in:
ID: move2kube.transformers.types
Hints:

  • Services that don't support any of the transformer types you are interested in will be ignored.

AdvancedCustomParameterizer, ArgoCD, Buildconfig, CloudFoundry, ClusterSelector, ComposeAnalyser, ComposeGenerator, ConfigMapGen, ContainerImagesPushScriptGenerator, DockerfileDetector, DockerfileImageBuildScript, DockerfileParser, DotNetCore-Dockerfile, EarAnalyser, EarRouter, Golang-Dockerfile, Gradle, InvokeDetect, Jar, Jboss, Knative, Kubernetes, KubernetesVersionChanger, Liberty, ManipulateDockerCompose, Maven, Nodejs-Dockerfile, OperatorTransformer, PHP-Dockerfile, Python-Dockerfile, ReadMeGenerator, Ruby-Dockerfile, Rust-Dockerfile, StatefulsetHeadlessService, Tekton, Tomcat, WarAnalyser, WarRouter, WinWebApp-Dockerfile, ZuulAnalyser
? Select all services that are needed:
ID: move2kube.services.[].enable
Hints:

  • The services unselected here will be ignored.

myproject
INFO[0011] Using the transformation option 'ManipulateDockerCompose' for the service 'myproject'.
INFO[0011] Iteration 1
INFO[0011] Iteration 2 - 1 artifacts to process
INFO[0011] Transformer ManipulateDockerCompose processing 1 artifacts
INFO[0011] Transformer ManipulateDockerCompose Done
INFO[0011] Created 0 pathMappings and 1 artifacts. Total Path Mappings : 0. Total Artifacts : 1.
INFO[0011] Iteration 3 - 1 artifacts to process
INFO[0011] Transformer InvokeDetect processing 1 artifacts
INFO[0011] Transformer InvokeDetect Done
INFO[0011] Transformation done
INFO[0011] Transformed target artifacts can be found at [/myproject].

Expected behavior
m2k should transform the docker-compose file to Kubernetes manifest files.

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: RHEL
  • Version - v0.3.0+unreleased
    Additional context
    Add any other context about the problem here.
@HarikrishnanBalagopal
Copy link
Contributor

Probably we can close this.
If I recall correctly the docker-compose.yaml was not valid. The service name had ${variable_name} in it.
We worked around this with a custom Starlark transformer that created a valid yaml by substituting the service name.

@Mohdcode
Copy link

is it still open ? as you have commented on this seems like yaml config mismatch but if it is still need help please assign it to me

@mnarkhede85
Copy link
Author

mnarkhede85 commented Aug 14, 2023 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants