maclof/kubernetes-client

ServiceCollection with IlluminateCollection bug

tamaspanczel opened this issue · 2 comments

IlluminateCollection functions like 'filter' not working on ServiceCollection class:

example:

$services = $client->services()->find()->filter(function($item) {
  return $item->toArray()['spec']['type'] === 'NodePort';
});

in Collection.php:

return new static(...);

in ServiceCollection.php (no items property):

public function __construct(array $data)
{
  parent::__construct($this->getServices(isset($data['items']) ? $data['items'] : []));

I'll take a look at this and get back to you.

This is fixed in master