Skip to content

Commit 43dbed1

Browse files
committed
Make spec and api checks clearer
1 parent c5fd834 commit 43dbed1

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

pkg/crd/crd.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,11 +74,13 @@ func ParsePromise(iface any, crd *apiextensionsv1.CustomResourceDefinition) (err
7474
crdYAMLBytes []byte
7575
)
7676

77-
if spec, ok = iface.(map[string]any)["spec"].(map[string]any); !ok {
77+
spec, ok = iface.(map[string]any)["spec"].(map[string]any)
78+
if !ok {
7879
return microerror.Maskf(CouldNotParseCRDFileError, "kratix promise is missing its spec")
7980
}
8081

81-
if api, ok = spec["api"].(map[string]any); !ok {
82+
api, ok = spec["api"].(map[string]any)
83+
if !ok {
8284
return microerror.Maskf(CouldNotParseCRDFileError, "kratix promise is missing its spec.api")
8385
}
8486

0 commit comments

Comments
 (0)