Skip to content

Allow removing credentials from job templates if they are not set or set to empty when job_template_enforce_defaults is true#84

Merged
djdanielsson merged 2 commits intoredhat-cop:develfrom
w4hf:devel
Feb 2, 2026
Merged

Allow removing credentials from job templates if they are not set or set to empty when job_template_enforce_defaults is true#84
djdanielsson merged 2 commits intoredhat-cop:develfrom
w4hf:devel

Conversation

@w4hf
Copy link
Contributor

@w4hf w4hf commented Feb 2, 2026

What does this PR do?

In AAP, if a job templates have credentials there is no way to remove it using configuration as code.
This PR makes it possible to do so if job_template_enforce_defaults is set to true, and if the user do not set the credential or set an empty credential in the JT yaml definition.

It is worth noting that this change might result unwanted behavior if configuration as code is not reflecting real world AAP configuration:
Example :
if

  1. the JT already has a credential in AAP
  2. the user declare the same JT (same name) in configuration as code without declaring his credential
  3. job_template_enforce_defaults is set to true
  4. the user apply the conf as code

then the credential will be removed from the JT.

How should this be tested?

  1. set JT enforce defaults to true
  2. set a credential in the JT (via conf as code or via UI)
  3. from the job template conf as code yaml, remove the credentials key or set to empty value
  4. apply the conf as code
  5. the JT credential is removed

Is there a relevant Issue open for this?

N/A

Other Relevant info, PRs, etc

N/A

@w4hf w4hf requested a review from a team as a code owner February 2, 2026 14:28
@w4hf w4hf changed the title Allo removing credentials from job templates if they are not set or set to empty when job_template_enforce_defaults is true Allow removing credentials from job templates if they are not set or set to empty when job_template_enforce_defaults is true Feb 2, 2026
Copy link
Contributor

@djdanielsson djdanielsson left a comment

Choose a reason for hiding this comment

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

LGTM

@djdanielsson djdanielsson merged commit dfc067e into redhat-cop:devel Feb 2, 2026
11 checks passed
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

Successfully merging this pull request may close these issues.

2 participants