maclof / kubernetes-client

A simple yet elegant client for accessing and controlling a Kubernetes cluster (https://github.com/kubernetes/kubernetes)
MIT License
231 stars 82 forks source link

Model->getMetadata TypeError #107

Open timbit123 opened 2 years ago

timbit123 commented 2 years ago

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

bartje321 commented 1 year ago

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

For now this can be used instead

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