@@ -1032,11 +1032,11 @@ public Metadata(Map<String, String> labels) {
1032
1032
}
1033
1033
1034
1034
void setSecurityContext (SecurityContext securityContext ) {
1035
- this .securityContext = Objects .requireNonNull (securityContext );
1035
+ this .securityContext = new SecurityContext ( Objects .requireNonNull (securityContext ) );
1036
1036
}
1037
1037
1038
1038
public SecurityContext getSecurityContext () {
1039
- return securityContext ;
1039
+ return new SecurityContext ( securityContext ) ;
1040
1040
}
1041
1041
1042
1042
public Map <String , String > getLabels () {
@@ -1056,12 +1056,15 @@ public boolean equals(Object o) {
1056
1056
}
1057
1057
1058
1058
Metadata metadata = (Metadata ) o ;
1059
- return new EqualsBuilder ().append (labels , metadata .labels ).build ();
1059
+ return new EqualsBuilder ()
1060
+ .append (labels , metadata .labels )
1061
+ .append (securityContext , metadata .securityContext )
1062
+ .build ();
1060
1063
}
1061
1064
1062
1065
@ Override
1063
1066
public int hashCode () {
1064
- return new HashCodeBuilder ().append (labels ).toHashCode ();
1067
+ return new HashCodeBuilder ().append (securityContext ). append ( labels ).toHashCode ();
1065
1068
}
1066
1069
}
1067
1070
@@ -1080,6 +1083,10 @@ private SecurityContext(Map<String, String> ctx) {
1080
1083
this .ctx = Collections .unmodifiableMap (new HashMap <>(ctx ));
1081
1084
}
1082
1085
1086
+ SecurityContext (SecurityContext o ) {
1087
+ this .ctx = new HashMap <>(o .ctx );
1088
+ }
1089
+
1083
1090
public SecurityContext (ServiceRef serviceRef ) {
1084
1091
this .ctx = new HashMap <>();
1085
1092
// FIXME this should be platform-specific
0 commit comments