Skip to content

Commit a2b0a62

Browse files
committed
Add optional chaining for olm-example name
This PR fixes #2293. Signed-off-by: Denis Golovin dgolovin@redhat.com
1 parent 8da7d46 commit a2b0a62

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/k8s/csv.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ export class ClusterServiceVersion extends OpenShiftItem {
126126
generateDefaults(openAPIV3SchemaAll, example);
127127
const openAPIV3Schema = _.defaultsDeep({}, DEFAULT_K8S_SCHEMA, _.omit(openAPIV3SchemaAll, 'properties.status'));
128128
openAPIV3Schema.properties.metadata.properties.name.default =
129-
example?.metadata.name ? `${example.metadata.name}-${randomString()}` : `${crdDescription.kind}-${randomString()}`;
129+
example?.metadata?.name ? `${example.metadata.name}-${randomString()}` : `${crdDescription.kind}-${randomString()}`;
130130

131131
const uiSchema = getUISchema(
132132
openAPIV3Schema,

0 commit comments

Comments
 (0)