@@ -60,12 +60,13 @@ func (c *ControllerSELinuxTranslator) SELinuxOptionsToFileLabel(opts *v1.SELinux
6060// Conflicts returns true if two SELinux labels conflict.
6161// These labels must be generated by SELinuxOptionsToFileLabel above
6262// (the function expects strict nr. of elements in the labels).
63- // Since this translator cannot default missing components,
64- // the first three components treated as incomparable when missing and they do not
65- // conflict with anything.
63+ // Since this translator cannot default missing label components from the operating system,
64+ // the first three components can be empty. In this case, the empty components don't lead to a
65+ // conflict when compared to a real SELinux label and this function returns false (as no
66+ // conflict can be detected).
6667// The last component (level) is always compared, as it is not defaulted by the operating system.
6768// Example: "system_u:system_r:container_t:s0:c1,c2" *does not* conflict with ":::s0:c1,c2",
68- // because the node that will run such a Pod may expand "" :::s0:c1,c2" to "system_u:system_r:container_t:s0:c1,c2".
69+ // because the node that will run such a Pod may expand ":::s0:c1,c2" to "system_u:system_r:container_t:s0:c1,c2".
6970// However: "system_u:system_r:container_t:s0:c1,c2" *does* conflict with ":::s0:c98,c99".
7071// And ":::s0:c1,c2" *does* conflict with "" or ":::", because it's never defaulted by the OS.
7172func (c * ControllerSELinuxTranslator ) Conflicts (labelA , labelB string ) bool {
0 commit comments