Skip to content

Commit

Permalink
Merge pull request #80 from renoki-co/feature/fix-yaml
Browse files Browse the repository at this point in the history
[2.x] Fix YAML parse for multiple files
  • Loading branch information
rennokki authored Mar 26, 2021
2 parents cf1c80d + f00a77a commit b25b1d8
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 b25b1d8

Please sign in to comment.