forked from tektoncd/pipeline
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fetch resource metadata from unstructured
In sink.createResource, we need access to resource metadata such as name, namespace, apiVersion, and kind from the raw json template. We were using gjson.GetBytes to do this. However, later in the function we were also unmarshalling the raw template to `unstructured.Unstructured` which already has methods for accessing all of the required metadata. This commit refactors the createResource function to first umarshall the raw template to unstructured and then get all of the metadata we need from that object. This was also the only place where we were using gjson so, as a side effect we can now remove our dependency on the GJson library. Signed-off-by: Dibyo Mukherjee <dibyo@google.com>
- Loading branch information
1 parent
3c645a9
commit 5347b05
Showing
3 changed files
with
274 additions
and
273 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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.