Skip to content

Fix enabled: false validation#2192

Merged
aleksmaus merged 1 commit intoelastic:mainfrom
aleksmaus:feature/mapping_enabled_false
Nov 8, 2024
Merged

Fix enabled: false validation#2192
aleksmaus merged 1 commit intoelastic:mainfrom
aleksmaus:feature/mapping_enabled_false

Conversation

@aleksmaus
Copy link
Copy Markdown
Contributor

This change fixes enabled: false validation.

There is a use case where I need to set enabled: false for the field in order to disable indexing of the field but still preserve the source.
Defining the fields like this

    - name: cisco_av_pair
      type: object
      enabled: false

produces the correct mapping:

                      "cisco_av_pair": {
                       "type": "object",
                       "enabled": false
                     },

but it fails the pipeline test with errors like these:

FAILURE DETAILS:
cisco_ise/log test-pipeline-passed-authentications.log:
[0] field "cisco_ise.log.cisco_av_pair.audit-session-id" is undefined
[1] field "cisco_ise.log.cisco_av_pair.client-iif-id" is undefined
[2] field "cisco_ise.log.cisco_av_pair.coa-push" is undefined
[3] field "cisco_ise.log.cisco_av_pair.cts-device-capability" is undefined
[4] field "cisco_ise.log.cisco_av_pair.cts-environment-data" is undefined
[5] field "cisco_ise.log.cisco_av_pair.cts-environment-version" is undefined
[6] field "cisco_ise.log.cisco_av_pair.cts-pac-opaque" is undefined
[7] field "cisco_ise.log.cisco_av_pair.dc-certainty-metric" is undefined
[8] field "cisco_ise.log.cisco_av_pair.dc-device-class-tag" is undefined
[9] field "cisco_ise.log.cisco_av_pair.dc-device-name" is undefined
[10] field "cisco_ise.log.cisco_av_pair.dc-profile-name" is undefined
[11] field "cisco_ise.log.cisco_av_pair.dc-protocol-map" is undefined
[12] field "cisco_ise.log.cisco_av_pair.method" is undefined
[13] field "cisco_ise.log.cisco_av_pair.service-type" is undefined

The fix is to update the validation code path and pass validation if the parent enabled: false is set.

Screenshot 2024-10-30 at 5 02 08 PM

We need this change in CI eventually in order to be able to build and release the pending integration SDH fixes.

Let me know what else if anything needs to be added to this PR or if there any other pieces like docs need to be updated.

Thanks!

@aleksmaus
Copy link
Copy Markdown
Contributor Author

/test

@elasticmachine
Copy link
Copy Markdown
Collaborator

💚 Build Succeeded

History

cc @aleksmaus

@aleksmaus
Copy link
Copy Markdown
Contributor Author

👋 This PR is needed for related package changes PR and is currently blocking it. Could anybody take look at it?

@aleksmaus aleksmaus requested a review from a team November 7, 2024 18:20
@aleksmaus aleksmaus merged commit 5867f9d into elastic:main Nov 8, 2024
@aleksmaus aleksmaus deleted the feature/mapping_enabled_false branch November 8, 2024 13:49
@jsoriano
Copy link
Copy Markdown
Member

@aleksmaus could you please add some test cases to validate the expected behaviour?

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.

4 participants