Skip to content

feat: generate another .conf-file when conf parameter is used#1608

Merged
kkedziak-splunk merged 26 commits intodevelopfrom
fix/inputs_with_conf
Apr 17, 2025
Merged

feat: generate another .conf-file when conf parameter is used#1608
kkedziak-splunk merged 26 commits intodevelopfrom
fix/inputs_with_conf

Conversation

@kkedziak-splunk
Copy link
Copy Markdown
Contributor

@kkedziak-splunk kkedziak-splunk commented Feb 28, 2025

Issue number: ADDON-78536

PR Type

What kind of change does this PR introduce?

  • Feature
  • Bug Fix
  • Refactoring (no functional or API changes)
  • Documentation Update
  • Maintenance (dependency updates, CI, etc.)

Summary

Changes

The "conf" parameter for inputs indicates that a separate config file should be used. Therefore inputs with this parameter should not be included in inputs.conf and inputs.conf.spec.

Also, disableNewInputs parameter is improved.

User experience

No changes.

Checklist

If an item doesn't apply to your changes, leave it unchecked.

@kkedziak-splunk kkedziak-splunk requested a review from a team as a code owner February 28, 2025 14:44
@hetangmodi-crest
Copy link
Copy Markdown
Contributor

Should we create .conf.spec for the inputs that have the "conf" parameter defined?

@kkedziak-splunk
Copy link
Copy Markdown
Contributor Author

@hetangmodi-crest
Do you mean placing placeholder = placeholder as it used to be, or the actual parameters?

@hetangmodi-crest
Copy link
Copy Markdown
Contributor

I mean the actual parameters with their description and default values (if provided). Just like we are having inputs.conf.spec, we should have the same for services that have the conf parameter defined so that Splunkd doesn't complain about invalid conf files on restarts.

@artemrys
Copy link
Copy Markdown
Member

artemrys commented Mar 5, 2025

I mean the actual parameters with their description and default values (if provided). Just like we are having inputs.conf.spec, we should have the same for services that have the conf parameter defined so that Splunkd doesn't complain about invalid conf files on restarts.

@kkedziak-splunk you can check one of our TAs to see the example, one of the cloud TAs should be a good candidiate.

@pull-request-size pull-request-size bot added size/L and removed size/M labels Mar 11, 2025
@artemrys
Copy link
Copy Markdown
Member

@hetangmodi-crest would appreciate your review on this change please :)

Comment thread splunk_add_on_ucc_framework/generators/conf_files/create_inputs_conf.py Outdated
@artemrys artemrys changed the title feat: do not put "conf" inputs in inputs.conf feat: generate another .conf-file when conf parameter is used Mar 28, 2025
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

For me to understand - we do not have service_with_conf_param in inputs.conf anymore but we did not create a dedicated file for it during the build time.

Did we check that this file will be indeed created when a new input is created?

Can we please also check whether AWS add-on is not impacted because of this change.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

  1. I was experimenting and decided to revert this part and add entries to inputs.conf for every input, as this parameter python.version = python3, although not read by the input, it may be read by Splunk when starting the input.
  2. Yes, the file is created when input is added. I tested it locally.
  3. AWS shows no changes (used diff -r dir1 dir2) but it is because it contains those files in the default directory. The same is with the GCP TA.

One more thing about conf files not being created - I was experimenting with that and it seems that we could create those files with default values. But on the other hand we haven't done that so far. And I saw that default values are handled by the handlers.

# Conflicts:
#	splunk_add_on_ucc_framework/generators/conf_files/create_inputs_conf.py
#	tests/unit/generators/conf_files/test_create_inputs_conf.py
@github-actions
Copy link
Copy Markdown

Code Coverage 🎉

Type PR Develop Change Status
Line Coverage 87.65% 87.57% 0.08% 🟢 Increased
Branch Coverage 81.24% 81.12% 0.11% 🟢 Increased

@kkedziak-splunk kkedziak-splunk merged commit 849351f into develop Apr 17, 2025
12 of 14 checks passed
@kkedziak-splunk kkedziak-splunk deleted the fix/inputs_with_conf branch April 17, 2025 08:42
@github-actions github-actions bot locked and limited conversation to collaborators Apr 17, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants