-
Notifications
You must be signed in to change notification settings - Fork 1
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
Conversation
} | ||
for _, tt := range tests { | ||
t.Run(tt.name, func(t *testing.T) { | ||
input, err := os.ReadFile(fmt.Sprintf("testdata/%s.json", tt.name)) |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sorry, done
Signed-off-by: Matthias Bertschy <[email protected]>
Summary:
|
armometadata/k8sutils.go
Outdated
@@ -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) { |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
Signed-off-by: Matthias Bertschy <[email protected]>
Summary:
|
Signed-off-by: Matthias Bertschy <[email protected]>
Summary:
|
No description provided.