-
Notifications
You must be signed in to change notification settings - Fork 190
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Functionality to make
ignore
work (#464)
**Issue** This PR is related to fix the issue generating after executing PR #462 **Summary** To disregard fields marked with `set: ignore` for nested fields. This PR also enhances the functionality of `set:ignore` to support the exclusion of fields from `set_sdk`. **Description** The PR fixes the issue coming after a new custom field is created and has `set.ignore` set to `true` for it. Even after setting the field to ignore, the field is getting used to set the SDK fields. In this case particularly, the new field was defined as shown below: ``` Code.S3SHA256: type: string set: - method: Create ignore: true ``` And the issue it is causing is under `sdk.go/newCreateRequestPayload` function, where it is being set, as shown below: ``` if r.ko.Spec.Code.S3SHA256 != nil { f1.SetS3SHA256(*r.ko.Spec.Code.S3SHA256) } ``` The goal is to ignore this particular line of code. And also to improve the basic functionality of `set.ignore`. The `set.ignore` functionality was till now supporting exclusion of fields only when the field was used to set for the resource. This PR checks the `set.ignore` for field and ignores the following code that creates request payload if it is set to `true`. **Limitations** Currently this PR checks the `set.ignore` field only for members of the field whose type is `structure`. **Acknowledgment** By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
- Loading branch information
1 parent
e8df4d5
commit 37f4ba2
Showing
9 changed files
with
291 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.