kubernetes-client icon indicating copy to clipboard operation
kubernetes-client copied to clipboard

Model->getMetadata TypeError

Open timbit123 opened this issue 2 years ago • 1 comments

Hello I have an error with the function, it can return an array not only a string For exemple if you call it with ->getMetadata('labels')

"Return value of Maclof\Kubernetes\Models\Model::getMetadata() must be of the type string or null, array returned"

https://github.com/maclof/kubernetes-client/blob/b726e6475834c77144bab1df6fc7cb27fff56caa/src/Models/Model.php#L82

Thank you

timbit123 avatar Apr 28 '22 21:04 timbit123

This should be fixed after merging https://github.com/maclof/kubernetes-client/pull/118

For now this can be used instead

->toArray()['metadata']['labels']

bartje321 avatar Apr 24 '23 09:04 bartje321