konveyor / move2kube

Move2Kube is a command-line tool for automating creation of Infrastructure as code (IaC) artifacts. It has inbuilt support for creating IaC artifacts for replatforming to Kubernetes/Openshift.
https://move2kube.konveyor.io/
Apache License 2.0
385 stars 119 forks source link

Cloud foundry sample in move2kube-demos results in wrong plan with duplicates and wrong containerization options #140

Closed ashokponkumar closed 3 years ago

ashokponkumar commented 4 years ago
apiVersion: move2kube.konveyor.io/v1alpha1
kind: Plan
metadata:
  name: myproject
spec:
  inputs:
    rootDir: samples/cloud-foundry
    services:
      move2kube-demo-cf:
        - serviceName: move2kube-demo-cf
          serviceRelPath: /move2kube-demo-cf
          image: move2kube-demo-cf:latest
          translationType: Cfmanifest2Kube
          containerBuildType: NewDockerfile
          sourceType:
            - Directory
            - CfManifest
          targetOptions:
            - m2kassets/dockerfiles/golang
            - m2kassets/dockerfiles/php
          sourceArtifacts:
            CfRunningManifest:
              - cfapps.yaml
            SourceCode:
              - ../../.
          buildArtifacts:
            SourceCode:
              - ../../.
          updateContainerBuildPipeline: true
          updateDeployPipeline: true
        - serviceName: move2kube-demo-cf
          serviceRelPath: /move2kube-demo-cf
          image: move2kube-demo-cf:latest
          translationType: Cfmanifest2Kube
          containerBuildType: S2I
          sourceType:
            - Directory
            - CfManifest
          targetOptions:
            - m2kassets/s2i/golang
            - m2kassets/s2i/java
            - m2kassets/s2i/php
          sourceArtifacts:
            CfRunningManifest:
              - cfapps.yaml
            SourceCode:
              - ../../.
          buildArtifacts:
            SourceCode:
              - ../../.
          updateContainerBuildPipeline: true
          updateDeployPipeline: true
        - serviceName: move2kube-demo-cf
          serviceRelPath: /move2kube-demo-cf
          image: move2kube-demo-cf:latest
          translationType: Cfmanifest2Kube
          containerBuildType: CNB
          sourceType:
            - Directory
            - CfManifest
          targetOptions:
            - cloudfoundry/cnb:cflinuxfs3
            - gcr.io/buildpacks/builder
          sourceArtifacts:
            CfRunningManifest:
              - cfapps.yaml
            SourceCode:
              - ../../.
          buildArtifacts:
            SourceCode:
              - ../../.
          updateContainerBuildPipeline: true
          updateDeployPipeline: true
        - serviceName: move2kube-demo-cf
          serviceRelPath: /move2kube-demo-cf
          image: move2kube-demo-cf:latest
          translationType: Cfmanifest2Kube
          containerBuildType: NewDockerfile
          sourceType:
            - Directory
            - CfManifest
          targetOptions:
            - m2kassets/dockerfiles/nodejs
          sourceArtifacts:
            CfManifest:
              - manifest.yml
            CfRunningManifest:
              - cfapps.yaml
            SourceCode:
              - .
          buildArtifacts:
            SourceCode:
              - .
          updateContainerBuildPipeline: true
          updateDeployPipeline: true
        - serviceName: move2kube-demo-cf
          serviceRelPath: /move2kube-demo-cf
          image: move2kube-demo-cf:latest
          translationType: Cfmanifest2Kube
          containerBuildType: S2I
          sourceType:
            - Directory
            - CfManifest
          targetOptions:
            - m2kassets/s2i/nodejs
          sourceArtifacts:
            CfManifest:
              - manifest.yml
            CfRunningManifest:
              - cfapps.yaml
            SourceCode:
              - .
          buildArtifacts:
            SourceCode:
              - .
          updateContainerBuildPipeline: true
          updateDeployPipeline: true
        - serviceName: move2kube-demo-cf
          serviceRelPath: /move2kube-demo-cf
          image: move2kube-demo-cf:latest
          translationType: Cfmanifest2Kube
          containerBuildType: CNB
          sourceType:
            - Directory
            - CfManifest
          targetOptions:
            - cloudfoundry/cnb:cflinuxfs3
            - gcr.io/buildpacks/builder
          sourceArtifacts:
            CfManifest:
              - manifest.yml
            CfRunningManifest:
              - cfapps.yaml
            SourceCode:
              - .
          buildArtifacts:
            SourceCode:
              - .
          updateContainerBuildPipeline: true
          updateDeployPipeline: true
    targetInfoArtifacts:
      KubernetesCluster:
        - cluster.yaml
  outputs:
    kubernetes:
      artifactType: Yamls
      clusterType: |
        default/c114-e-us-south-containers-cloud-ibm-com:32230/IAM#ashokponkumar@in.ibm.com
      ignoreUnsupportedKinds: true
ashokponkumar commented 4 years ago

Fixing #122 might fix this issue. This might be an issue with how parsing folders happens. @seshapad will be adding scenarios where it happens and when it does manifest.

seshapad commented 4 years ago

move2kube plan -s samples/cloud-foundry/ in move2kube-demos results in multiple incorrect detect scripts getting triggered. Has to do with relative paths going out of scope.

HarikrishnanBalagopal commented 3 years ago

Fixed by https://github.com/konveyor/move2kube/pull/163

apiVersion: move2kube.konveyor.io/v1alpha1
kind: Plan
metadata:
  name: myproject
spec:
  inputs:
    rootDir: samples/cloud-foundry
    services:
      move2kube-demo-cf:
        - serviceName: move2kube-demo-cf
          serviceRelPath: /move2kube-demo-cf
          image: move2kube-demo-cf:latest
          translationType: Cfmanifest2Kube
          containerBuildType: NewDockerfile
          sourceType:
            - Directory
            - CfManifest
          targetOptions:
            - m2kassets/dockerfiles/nodejs
          sourceArtifacts:
            CfManifest:
              - manifest.yml
            CfRunningManifest:
              - cfapps.yaml
            SourceCode:
              - .
          buildArtifacts:
            SourceCode:
              - .
          updateContainerBuildPipeline: true
          updateDeployPipeline: true
        - serviceName: move2kube-demo-cf
          serviceRelPath: /move2kube-demo-cf
          image: move2kube-demo-cf:latest
          translationType: Cfmanifest2Kube
          containerBuildType: S2I
          sourceType:
            - Directory
            - CfManifest
          targetOptions:
            - m2kassets/s2i/nodejs
          sourceArtifacts:
            CfManifest:
              - manifest.yml
            CfRunningManifest:
              - cfapps.yaml
            SourceCode:
              - .
          buildArtifacts:
            SourceCode:
              - .
          updateContainerBuildPipeline: true
          updateDeployPipeline: true
        - serviceName: move2kube-demo-cf
          serviceRelPath: /move2kube-demo-cf
          image: move2kube-demo-cf:latest
          translationType: Cfmanifest2Kube
          containerBuildType: CNB
          sourceType:
            - Directory
            - CfManifest
          targetOptions:
            - cloudfoundry/cnb:cflinuxfs3
            - gcr.io/buildpacks/builder
          sourceArtifacts:
            CfManifest:
              - manifest.yml
            CfRunningManifest:
              - cfapps.yaml
            SourceCode:
              - .
          buildArtifacts:
            SourceCode:
              - .
          updateContainerBuildPipeline: true
          updateDeployPipeline: true
    targetInfoArtifacts:
      KubernetesCluster:
        - cluster.yaml
  outputs:
    kubernetes:
      artifactType: Yamls
      targetCluster:
        type: |
          default/c114-e-us-south-containers-cloud-ibm-com:32230/IAM#ashokponkumar@in.ibm.com
      ignoreUnsupportedKinds: true