Skip to content

Commit

Permalink
Fixed YAML for multiple files.
Browse files Browse the repository at this point in the history
  • Loading branch information
rennokki committed Mar 26, 2021
1 parent cf1c80d commit f00a77a
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions src/K8s.php
Original file line number Diff line number Diff line change
Expand Up @@ -372,12 +372,7 @@ public static function expression(array $attributes = [])
*/
public static function fromYaml($cluster, string $yaml)
{
$docs = explode('---', $yaml);

$instances = collect($docs)->reduce(function ($classes, $doc) use ($cluster) {
$yaml = yaml_parse($doc);

$version = $yaml['apiVersion'];
$instances = collect(yaml_parse($yaml, -1))->reduce(function ($classes, $yaml) use ($cluster) {
$kind = $yaml['kind'];

unset($yaml['apiVersion'], $yaml['kind']);
Expand Down

0 comments on commit f00a77a

Please sign in to comment.