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

Ensure default value in variables #12020

Merged
merged 2 commits into from
May 28, 2024

Conversation

marcusburghardt
Copy link
Member

Description:

During some tests it was found two variables without a default value.
Ensure a default value based on existing options.

Rationale:

All variables have a default value.

Ensure a default value so it doesn't fail if an explicit definition is
absent.
….var

Ensure a default value so it doesn't fail if an explicit definition is
absent. This variable is explicitly used by many products. The default
value was based on current values for rhel9. It is just for reference
and to not fail. Specific products should review their own values.
@marcusburghardt marcusburghardt added the bugfix Fixes to reported bugs. label May 23, 2024
@marcusburghardt marcusburghardt added this to the 0.1.74 milestone May 23, 2024
Copy link

Start a new ephemeral environment with changes proposed in this pull request:

Fedora Environment
Open in Gitpod

Oracle Linux 8 Environment
Open in Gitpod

Copy link

🤖 A k8s content image for this PR is available at:
ghcr.io/complianceascode/k8scontent:12020
This image was built from commit: 15faa0b

Click here to see how to deploy it

If you alread have Compliance Operator deployed:
utils/build_ds_container.py -i ghcr.io/complianceascode/k8scontent:12020

Otherwise deploy the content and operator together by checking out ComplianceAsCode/compliance-operator and:
CONTENT_IMAGE=ghcr.io/complianceascode/k8scontent:12020 make deploy-local

Copy link

codeclimate bot commented May 23, 2024

Code Climate has analyzed commit 15faa0b and detected 0 issues on this pull request.

The test coverage on the diff in this pull request is 100.0% (50% is the threshold).

This pull request will bring the total coverage in the repository to 59.4% (0.0% change).

View more on Code Climate.

@jan-cerny
Copy link
Collaborator

@marcusburghardt Can we have some test or build-time check that would prevent this situation? For example I think that when the build system loads a variable from YAML file it could check that it contains the "default" key.

@marcusburghardt
Copy link
Member Author

@marcusburghardt Can we have some test or build-time check that would prevent this situation? For example I think that when the build system loads a variable from YAML file it could check that it contains the "default" key.

Hi @marcusburghardt , I plan to introduce a test for this after the #12019. It is already in my list here but I would prefer to introduce it later in a different PR, ok?

@jan-cerny jan-cerny self-assigned this May 28, 2024
@jan-cerny jan-cerny merged commit 7b39a71 into ComplianceAsCode:master May 28, 2024
112 of 113 checks passed
@marcusburghardt marcusburghardt deleted the vars_default_value branch May 28, 2024 08:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugfix Fixes to reported bugs.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants