Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add method to extract some metadata from raw json #10

Merged
merged 3 commits into from
Nov 16, 2023
Merged

add method to extract some metadata from raw json #10

merged 3 commits into from
Nov 16, 2023

Conversation

matthyx
Copy link
Contributor

@matthyx matthyx commented Nov 16, 2023

No description provided.

@matthyx matthyx requested review from kooomix and amirmalka November 16, 2023 14:11
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
input, err := os.ReadFile(fmt.Sprintf("testdata/%s.json", tt.name))
Copy link
Contributor

Choose a reason for hiding this comment

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

@matthyx I think you forgot to commit the testdata dir?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

sorry, done

Copy link

Summary:

  • License scan: failure
  • Credentials scan: skipped
  • Vulnerabilities scan: skipped
  • Unit test: success
  • Go linting: success

@@ -102,3 +104,45 @@ func LoadConfig(configPath string) (*ClusterConfig, error) {
err = json.Unmarshal(res, &config)
return config, err
}

// ExtractMetadataFromBytes extracts metadata from the JSON bytes of a Kubernetes object
func ExtractMetadataFromJsonBytes(input []byte) (error, map[string]string, map[string]string, string) {
Copy link
Contributor

Choose a reason for hiding this comment

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

@matthyx we need also ownerReferences and resourceVersion

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

Copy link

Summary:

  • License scan: failure
  • Credentials scan: skipped
  • Vulnerabilities scan: skipped
  • Unit test: success
  • Go linting: success

Signed-off-by: Matthias Bertschy <[email protected]>
@matthyx matthyx merged commit b2f26df into master Nov 16, 2023
3 checks passed
@matthyx matthyx deleted the ujson branch November 16, 2023 14:46
Copy link

Summary:

  • License scan: failure
  • Credentials scan: skipped
  • Vulnerabilities scan: skipped
  • Unit test: success
  • Go linting: success

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.

3 participants