Skip to content

Commit

Permalink
Merge pull request #20 from mwadon/master
Browse files Browse the repository at this point in the history
Return API response instead of 'true'
  • Loading branch information
maclof authored Feb 28, 2018
2 parents b88f952 + 4332a20 commit 9d193d3
Showing 1 changed file with 8 additions and 10 deletions.
18 changes: 8 additions & 10 deletions src/Repositories/Repository.php
Original file line number Diff line number Diff line change
Expand Up @@ -97,32 +97,30 @@ protected function getApiVersion()
* Create a new model.
*
* @param \Maclof\Kubernetes\Models\Model $model
* @return boolean
* @return array
*/
public function create(Model $model)
{
$this->sendRequest('POST', '/' . $this->uri, null, $model->getSchema(), $this->namespace);
return true;
return $this->sendRequest('POST', '/' . $this->uri, null, $model->getSchema(), $this->namespace);
}

/**
* Update a model.
*
* @param \Maclof\Kubernetes\Models\Model $model
* @return boolean
* @return array
*/
public function update(Model $model)
{
$this->sendRequest('PUT', '/' . $this->uri . '/' . $model->getMetadata('name'), null, $model->getSchema(), $this->namespace);
return true;
return $this->sendRequest('PUT', '/' . $this->uri . '/' . $model->getMetadata('name'), null, $model->getSchema(), $this->namespace);
}

/**
* Delete a model.
*
* @param \Maclof\Kubernetes\Models\Model $model
* @param \Maclof\Kubernetes\Models\DeleteOptions $options
* @return boolean
* @return array
*/
public function delete(Model $model, DeleteOptions $options = null)
{
Expand All @@ -134,13 +132,13 @@ public function delete(Model $model, DeleteOptions $options = null)
*
* @param string $name
* @param \Maclof\Kubernetes\Models\DeleteOptions $options
* @return boolean
* @return array
*/
public function deleteByName($name, DeleteOptions $options = null)
{
$body = $options ? $options->getSchema() : null;
$this->sendRequest('DELETE', '/' . $this->uri . '/' . $name, null, $body, $this->namespace);
return true;

return $this->sendRequest('DELETE', '/' . $this->uri . '/' . $name, null, $body, $this->namespace);
}

/**
Expand Down

0 comments on commit 9d193d3

Please sign in to comment.