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

List of simple jobs returns: no job defined in config #418

Open
rkirimov opened this issue May 2, 2023 · 2 comments
Open

List of simple jobs returns: no job defined in config #418

rkirimov opened this issue May 2, 2023 · 2 comments

Comments

@rkirimov
Copy link

rkirimov commented May 2, 2023

Describe the problem

When I configure a list of simple jobs without parameters, it fails with no job defined in config: jenkins.jobs. Running with -show-config option returns

jenkins:
    host: https://jenkins.example.com
    username: my_user
    password: 123
    jobs: {}

config.yaml

jenkins:
  host: https://jenkins.example.com
  username: my_user
  password: 123
  jobs:
    JOB1:
    JOB2:

If I add parameters or trigger field, for example, the jobs are parsed correctly and I'm able to trigger the jobs.

I tried something like

jenkins:
  jobs:
    JOB1: {}
    JOB2: {}

But with the same result.

@brainexe
Copy link
Member

brainexe commented May 3, 2023

ah...dejavu. we had the same issue when having jobs without parameters. I remember there are some restrictions or strange behavior inside the mapstruture which does not add empty elements in this case.

We added a dummy key there to make it work as a "temporary fix"...works since 3 years now 🤡

jenkins:
  jobs:
    SomeJenkinsJob:
      foo: bar

@rkirimov
Copy link
Author

rkirimov commented May 3, 2023

Thanks for confirming the possible workaround heh. I wonder if this PR has anything to do with this issue: mitchellh/mapstructure#183

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

2 participants