-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Currently the `CreateK8sCR` function receives an `oldObject` parameter that is needed because the function doesn't know how to create an empty object of the same type of the object that is going to be created. But that can be solved using reflection, something like this: ```go // Create an empty object of the same type of the new object. We will use it to store the // fetch the current state. objectType := reflect.TypeOf(newObject).Elem() oldObject := reflect.New(objectType).Interface().(client.Object) ``` This patch does that and removes the `oldObject` parameter, which simplifies the code that calls the `CreateK8sCR` function. Signed-off-by: Juan Hernandez <[email protected]>
- Loading branch information
Showing
3 changed files
with
14 additions
and
10 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