Skip to content

Add SetProcessKind#271

Merged
rhatdan merged 1 commit into
opencontainers:mainfrom
kolyshkin:change-type
May 21, 2026
Merged

Add SetProcessKind#271
rhatdan merged 1 commit into
opencontainers:mainfrom
kolyshkin:change-type

Conversation

@kolyshkin
Copy link
Copy Markdown
Collaborator

@kolyshkin kolyshkin commented May 12, 2026

All (open source) users of KVMContainerLabel[s] and InitContainerLabel[s] (containerd, podman, and cri-o) are immediately releasing the acquired MCS. They only need the type field, so they can change the existing label to that type. Everything else, including the just-generated unique MCS label, is not used.

Introduce SetProcessKind which does just what all those users need.

Fixes: #266

Testing this:

@kolyshkin kolyshkin added this to the v1.15.0 milestone May 12, 2026
@kolyshkin kolyshkin force-pushed the change-type branch 2 times, most recently from 7ca5651 to f07753b Compare May 12, 2026 21:42
Comment thread go-selinux/selinux.go Outdated
@kolyshkin
Copy link
Copy Markdown
Collaborator Author

Comment thread go-selinux/selinux.go
thaJeztah
thaJeztah previously approved these changes May 18, 2026
Copy link
Copy Markdown
Member

@thaJeztah thaJeztah left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Comment thread go-selinux/selinux.go Outdated
Comment on lines +52 to +58
type LabelType int

const (
TypeProcess LabelType = 1
TypeInitProcess LabelType = 2
TypeKVMProcess LabelType = 3
)
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe change Type to Kind?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changed

  • ChangeLabelType → SetProcessKind
  • LabelType → ProcessKind
  • Type{Process,InitProcess,KVMProcess} → ProcessKind{Regular,Init,KVM}

Comment thread go-selinux/selinux.go Outdated
All (open source) users of KVMContainerLabel[s] and InitContainerLabel[s]
(containerd, podman, and cri-o) are immediately releasing the acquired
MCS. They only need the type field, so they can change the existing
label to that type. Everything else, including the just-generated unique
MCS label, is not used.

Introduce SetProcessKind which does just what all those users need.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
@kolyshkin kolyshkin changed the title Add ChangeLabelType Add SetProcessKind May 20, 2026
Copy link
Copy Markdown
Member

@thaJeztah thaJeztah left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

code changes LGTM

for naming (naming is hard!) I'd like to defer to more SELinux "native" folks to decide what's the most natural term / language to use. @rhatdan ?

@rhatdan
Copy link
Copy Markdown
Collaborator

rhatdan commented May 21, 2026

The kind versus type here is not really an SELinux thing. These are move Containers/VM Labels that leaked into this repository. So the upstream SELinux people would have no opinion.

LGTM

@rhatdan rhatdan merged commit 84683a6 into opencontainers:main May 21, 2026
18 checks passed
chhe pushed a commit to chhe/act_runner that referenced this pull request May 22, 2026
… (#990)

This PR contains the following updates:

| Package | Change | [Age](https://docs.renovatebot.com/merge-confidence/) | [Confidence](https://docs.renovatebot.com/merge-confidence/) |
|---|---|---|---|
| [github.com/opencontainers/selinux](https://github.com/opencontainers/selinux) | `v1.14.1` → `v1.15.0` | ![age](https://developer.mend.io/api/mc/badges/age/go/github.com%2fopencontainers%2fselinux/v1.15.0?slim=true) | ![confidence](https://developer.mend.io/api/mc/badges/confidence/go/github.com%2fopencontainers%2fselinux/v1.14.1/v1.15.0?slim=true) |

---

### Release Notes

<details>
<summary>opencontainers/selinux (github.com/opencontainers/selinux)</summary>

### [`v1.15.0`](https://github.com/opencontainers/selinux/releases/tag/v1.15.0)

[Compare Source](opencontainers/selinux@v1.14.1...v1.15.0)

This release adds a new function, SetProcessKind, which is to be used instead of KVMProcessLabel\[s] and InitProcessLabel\[s] in case the user only wants to change the type of the existing label, not generate a new one. It also fixes an CI issue and optimizes label.InitLabels for a few common cases.

#### What's Changed

- ci: set timeout for vm jobs by [@&#8203;kolyshkin](https://github.com/kolyshkin) in [#&#8203;270](opencontainers/selinux#270)
- label.InitLabels: optimize by [@&#8203;kolyshkin](https://github.com/kolyshkin) in [#&#8203;269](opencontainers/selinux#269)
- Add SetProcessKind by [@&#8203;kolyshkin](https://github.com/kolyshkin) in [#&#8203;271](opencontainers/selinux#271)

**Full Changelog**: <opencontainers/selinux@v1.14.1...v1.15.0>

</details>

---

### Configuration

📅 **Schedule**: (UTC)

- Branch creation
  - At any time (no schedule defined)
- Automerge
  - At any time (no schedule defined)

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box

---

This PR has been generated by [Mend Renovate](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0My4xOTAuMSIsInVwZGF0ZWRJblZlciI6IjQzLjE5MC4xIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6W119-->

Reviewed-on: https://gitea.com/gitea/runner/pulls/990
Reviewed-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: Renovate Bot <renovate-bot@gitea.com>
Co-committed-by: Renovate Bot <renovate-bot@gitea.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

RFC: introduce SetProcessKind

3 participants