Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OCPBUGS-17164: Fix SelinuxProfile inherit issue #1904

Merged
merged 1 commit into from
Oct 9, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion internal/pkg/daemon/selinuxprofile/selinuxprofile.go
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ func (sph *selinuxProfileHandler) validateAndTrackInherit(
// We default to System if Kind is left empty
case selxv1alpha2.SystemPolicyKind, "":
return sph.handleInheritSystemPolicy(ancestorRef)
case "SelinuxPolicy":
case "SelinuxProfile":
return sph.handleInheritSPOPolicy(ancestorRef, namespace)
}
return fmt.Errorf("%s/%s: %w", ancestorRef.Kind, ancestorRef.Name, ErrUnknownKindForEntry)
Expand Down
8 changes: 4 additions & 4 deletions internal/pkg/daemon/selinuxprofile/selinuxprofile_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ func Test_selinuxProfileHandler(t *testing.T) {
Spec: selxv1alpha2.SelinuxProfileSpec{
Inherit: []selxv1alpha2.PolicyRef{
{
Kind: "SelinuxPolicy",
Kind: "SelinuxProfile",
Name: "foo",
},
},
Expand Down Expand Up @@ -188,7 +188,7 @@ func Test_selinuxProfileHandler(t *testing.T) {
Spec: selxv1alpha2.SelinuxProfileSpec{
Inherit: []selxv1alpha2.PolicyRef{
{
Kind: "SelinuxPolicy",
Kind: "SelinuxProfile",
Name: "unexistent-ref",
},
},
Expand All @@ -203,7 +203,7 @@ func Test_selinuxProfileHandler(t *testing.T) {
},
wantValidateErr: true,
wantErrMatches: []string{
"couldn't find inherit reference SelinuxPolicy/unexistent-ref",
"couldn't find inherit reference SelinuxProfile/unexistent-ref",
},
existingObjs: []client.Object{
spodinstance.DeepCopy(),
Expand Down Expand Up @@ -250,7 +250,7 @@ func Test_selinuxProfileHandler(t *testing.T) {
Spec: selxv1alpha2.SelinuxProfileSpec{
Inherit: []selxv1alpha2.PolicyRef{
{
Kind: "SelinuxPolicy",
Kind: "SelinuxProfile",
Name: "foo",
},
},
Expand Down
Loading