Skip to content

fix: set importer secretId from secretRef name#257

Merged
lbroudoux merged 1 commit intomicrocks:mainfrom
adrims:fix/256-apisource-importer-secretref
Apr 8, 2026
Merged

fix: set importer secretId from secretRef name#257
lbroudoux merged 1 commit intomicrocks:mainfrom
adrims:fix/256-apisource-importer-secretref

Conversation

@adrims
Copy link
Copy Markdown
Contributor

@adrims adrims commented Apr 7, 2026

Summary
This fixes importer creation when spec.importers[].repository.secretRef is provided.

The operator was setting only[job.secretRef.name, but Microcks importer runtime expects job.secretRef.secretId in this path.
As a result, importer jobs could fail at runtime with:

java.lang.IllegalArgumentException: The given id must not be null

What changed
In APISourceReconciler.java:
During importer mapping, resolve secret by name using ConfigApi.searchSecrets(secretName).
Set both:

  • secretRef.name
  • secretRef.secretId

Why
This aligns the operator behavior with Microcks job API expectations and enables private repository importer jobs using repository.secretRef.

Related
Fixes #256

@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 7, 2026

👋 @adrims

Welcome to the Microcks community! 💖

Thanks and congrats 🎉 for opening your first pull request here! Be sure to follow the pull request template or please update it accordingly.

Hope you have a great time there!

@lbroudoux
Copy link
Copy Markdown
Member

Hey! Thanks for taking the time to push this, I was not able to do so these last days.
Unfortunately, your commits need to be signed to be accepted.

To add your Signed-off-by line to every commit in this branch:

  1. Ensure you have a local copy of your branch by checking out the pull request locally via command line.
  2. In your local branch, run: git rebase HEAD~1 --signoff
  3. Force push your changes to overwrite the branch: git push --force-with-lease origin fix/256-apisource-importer-secretref

Copy link
Copy Markdown
Member

@lbroudoux lbroudoux left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks good to me. Please fix the commit signature, and I'll be able to merge.

@lbroudoux lbroudoux added kind/bug Something isn't working component/source labels Apr 8, 2026
Signed-off-by: adrims <adrims1986@gmail.com>
@adrims adrims force-pushed the fix/256-apisource-importer-secretref branch from d8a028e to 29a9fc1 Compare April 8, 2026 07:03
@adrims
Copy link
Copy Markdown
Contributor Author

adrims commented Apr 8, 2026

Hey! Thanks for taking the time to push this, I was not able to do so these last days. Unfortunately, your commits need to be signed to be accepted.

To add your Signed-off-by line to every commit in this branch:

  1. Ensure you have a local copy of your branch by checking out the pull request locally via command line.
  2. In your local branch, run: git rebase HEAD~1 --signoff
  3. Force push your changes to overwrite the branch: git push --force-with-lease origin fix/256-apisource-importer-secretref

Ops, sorry I though I did it, now should be ok!

Copy link
Copy Markdown
Member

@lbroudoux lbroudoux left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM with signature

@lbroudoux lbroudoux added this to the 0.0.9 milestone Apr 8, 2026
@lbroudoux lbroudoux merged commit 788bb8b into microcks:main Apr 8, 2026
4 of 6 checks passed
@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 8, 2026

🎉 @adrims

You are now a Microcks community contributor! 💖

Thanks and congrats 🚀 on merging your first pull request! We are delighted and very proud of you! 👏

📢 If you're using Microcks in your organization, please add your company name to this list. 🙏 It really helps the project to gain momentum and credibility. It's a small contribution back to the project with a big impact.

If you need to know why and how to add yourself to the list, please read the blog post "Join the Microcks Adopters list and Empower the vibrant open source Community 🙌"

Kudos and please keep going, we need you 🙌

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

component/source kind/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

APISource importer with repository.secretRef fails at runtime with The given id must not be null (operator path)

2 participants