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

bug: customizations directory doesn't seem to be used during planning? #1194

Closed
HarikrishnanBalagopal opened this issue Oct 17, 2024 · 3 comments · Fixed by #1195
Closed
Labels
kind/bug Categorizes issue or PR as related to a bug. needs investigation Requires more discussion and thought before it can be solved.

Comments

@HarikrishnanBalagopal
Copy link
Contributor

HarikrishnanBalagopal commented Oct 17, 2024

Overview

Even though the plan command has a --customizations flag

$ move2kube plan --help
Discover and create a plan file based on an input directory

Usage:
  move2kube plan [flags]

Flags:
  -f, --config strings                Specify config file locations. By default we look for m2k-default-config.yaml
  -c, --customizations string         Specify directory or a git url (see https://move2kube.konveyor.io/concepts/git-support) where customizations are stored. By default we look for m2k-default-customizations
      --disable-local-execution       Allow files to be executed locally.
      --fail-on-empty-plan            If true, planning will exit with a failure exit code if no services are detected (and no default transformers are found).
  -h, --help                          help for plan
      --max-clone-size int            Max size in bytes when cloning a git repo. Default -1 is infinite (default -1)
  -n, --name string                   Specify the project name. (default "myproject")
  -p, --plan string                   Specify a file path to save plan to. (default "m2k.plan")
      --preset strings                Specify preset config to use.
      --set-config stringArray        Specify config key-value pairs.
  -s, --source string                 Specify source directory or a git url (see https://move2kube.konveyor.io/concepts/git-support).
  -t, --transformer-selector string   Specify the transformer selector.

Global Flags:
      --log-file string    File to store the logs in. By default it only prints to console.
      --log-level string   Set logging levels. (default "info")

The customization directory does not seem to actually be used during planning?

plan.Spec.CustomizationsDir = customizationsPath

The CheckAndCopyCustomizations function is defined in utils.go, tested in utils_test.go and only used in transform.go

Image

@HarikrishnanBalagopal HarikrishnanBalagopal changed the title bug? customizations directory doesn't seem to be used during planning bug: customizations directory doesn't seem to be used during planning Oct 17, 2024
@HarikrishnanBalagopal HarikrishnanBalagopal added the kind/bug Categorizes issue or PR as related to a bug. label Oct 17, 2024
@HarikrishnanBalagopal HarikrishnanBalagopal changed the title bug: customizations directory doesn't seem to be used during planning bug: customizations directory doesn't seem to be used during planning? Oct 17, 2024
@HarikrishnanBalagopal HarikrishnanBalagopal added the needs investigation Requires more discussion and thought before it can be solved. label Oct 17, 2024
@HarikrishnanBalagopal
Copy link
Contributor Author

HarikrishnanBalagopal commented Oct 17, 2024

This custom transformer doesn't see to get picked up. Even though the override field seems to work when it is added.

apiVersion: move2kube.konveyor.io/v1alpha1
kind: Transformer
metadata:
  name: MyCustomJarTransformer
  labels:
    move2kube.konveyor.io/task: containerization
spec:
  class: "JarAnalyser"
  directoryDetect:
    levels: -1
  consumes: 
    Service: 
      merge: false
    Jar:
      merge: false
  produces:
    Dockerfile:
      disabled: false
    DockerfileForService:
      disabled: false
  config: 
    defaultJavaVersion: "17"

@ashokponkumar
Copy link
Member

This custom transformer doesn't see to get picked up. Even though the override field seems to work when it is added.

apiVersion: move2kube.konveyor.io/v1alpha1
kind: Transformer
metadata:
name: MyCustomJarTransformer
labels:
move2kube.konveyor.io/task: containerization
spec:
class: "JarAnalyser"
directoryDetect:
levels: -1
consumes:
Service:
merge: false
Jar:
merge: false
produces:
Dockerfile:
disabled: false
DockerfileForService:
disabled: false
config:
defaultJavaVersion: "17"

@HarikrishnanBalagopal I don't think the override was working. Its most probably removing it from the config made it disabled.

@HarikrishnanBalagopal
Copy link
Contributor Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Categorizes issue or PR as related to a bug. needs investigation Requires more discussion and thought before it can be solved.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants