Skip to content

Commit b64269f

Browse files
committed
Merge branch 'upgrade-metadata' into 'main'
Protect against missing metadata See merge request weblogic-cloud/weblogic-kubernetes-operator!4795
2 parents 348c28d + 4b4881e commit b64269f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

common/src/main/java/oracle/kubernetes/common/utils/SchemaConversionUtils.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright (c) 2022, 2023, Oracle and/or its affiliates.
1+
// Copyright (c) 2022, 2024, Oracle and/or its affiliates.
22
// Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
33

44
package oracle.kubernetes.common.utils;
@@ -561,7 +561,7 @@ Map<String, Object> getStatus(Map<String, Object> domain) {
561561
}
562562

563563
Map<String, Object> getMetadata(Map<String, Object> domain) {
564-
return (Map<String, Object>) domain.get(METADATA);
564+
return (Map<String, Object>) domain.computeIfAbsent(METADATA, k -> new LinkedHashMap<>());
565565
}
566566

567567
@SuppressWarnings("unchecked")

0 commit comments

Comments
 (0)