Skip to content

Commit aa65844

Browse files
author
Kingdon Barrett
committed
don't abort so harshly on alternative sample kinds
Signed-off-by: Kingdon Barrett <[email protected]>
1 parent 8dd7fc5 commit aa65844

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

lib/pkv_sample.rb

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,10 @@ def self.ensure()
1717
docs = [docs]
1818
end
1919

20+
count = 0
2021
docs.each do |pkv|
2122
if pkv["kind"] == "PackageVersion"
23+
count = count + 1
2224
name = pkv["metadata"]["name"]
2325
projectName = pkv["spec"]["projectName"]
2426
packageName = pkv["spec"]["packageName"]
@@ -41,7 +43,11 @@ def self.ensure()
4143
}
4244
}))
4345
else
44-
raise StandardError, "Sample yaml was not a PackageVersion as expected"
46+
if count == 0
47+
raise StandardError, "Sample yaml was not a PackageVersion as expected"
48+
else
49+
# (do nothing, samples were created)
50+
end
4551
end
4652
end
4753
end

0 commit comments

Comments
 (0)