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

Validate sandbox and container metadata #1274

Merged

Conversation

saschagrunert
Copy link
Member

What type of PR is this?

/kind bug

What this PR does / why we need it:

We pre-validate the container metadata before creation the sandbox/container.

Which issue(s) this PR fixes:

Fixes #1273

Special notes for your reviewer:

None

Does this PR introduce a user-facing change?

Validate sandbox and container metadata before creating them via `crictl`.

@k8s-ci-robot k8s-ci-robot added kind/bug Categorizes issue or PR as related to a bug. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Oct 9, 2023
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: saschagrunert

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Oct 9, 2023
@k8s-ci-robot k8s-ci-robot added the size/S Denotes a PR that changes 10-29 lines, ignoring generated files. label Oct 9, 2023
@saschagrunert
Copy link
Member Author

/hold

Refers to a previous discussion in cri-o/cri-o#3774, cri-o/cri-o#3618

@k8s-ci-robot k8s-ci-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Oct 9, 2023
@saschagrunert
Copy link
Member Author

/unhold

per kubernetes/kubernetes#119692 (comment)

@k8s-ci-robot k8s-ci-robot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Oct 9, 2023
cmd/crictl/util.go Outdated Show resolved Hide resolved
We pre-validate the container metadata before creation the
sandbox/container.

Fixes kubernetes-sigs#1273

Signed-off-by: Sascha Grunert <sgrunert@redhat.com>
@saschagrunert saschagrunert force-pushed the sandbox-container-metadata branch from d96416a to 75c136c Compare October 10, 2023 07:20
@haircommander
Copy link
Contributor

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Oct 10, 2023
@k8s-ci-robot k8s-ci-robot merged commit 60ee696 into kubernetes-sigs:master Oct 10, 2023
21 checks passed
@saschagrunert saschagrunert deleted the sandbox-container-metadata branch October 10, 2023 14:21
mike-nguyen added a commit to mike-nguyen/coreos-assembler that referenced this pull request Dec 14, 2023
Cri-tools 1.29[0] now pre-validates container metadata before
running with crictl[1]. The required uid field was missing in our
test causing the following failure.

```
load podSandboxConfig: name, namespace or uid is not in metadata \"&PodSandboxMetadata{Name:rhcos-crio-pod-restart-test,Uid:,Namespace:redhat.test.crio,Attempt:0,}\
```

[0] https://github.com/kubernetes-sigs/cri-tools/releases/tag/v1.29.0
[1] kubernetes-sigs/cri-tools#1274
mike-nguyen added a commit to mike-nguyen/coreos-assembler that referenced this pull request Dec 14, 2023
Cri-tools 1.29[0] now pre-validates container metadata before
running with crictl[1]. The required uid field was missing in our
test causing the following failure.

```
load podSandboxConfig: name, namespace or uid is not in metadata \"&PodSandboxMetadata{Name:rhcos-crio-pod-restart-test,Uid:,Namespace:redhat.test.crio,Attempt:0,}\
```

[0] https://github.com/kubernetes-sigs/cri-tools/releases/tag/v1.29.0
[1] kubernetes-sigs/cri-tools#1274
mike-nguyen added a commit to mike-nguyen/coreos-assembler that referenced this pull request Dec 14, 2023
Cri-tools 1.29[0] now pre-validates container metadata before
running with crictl[1]. The required uid field was missing in our
test causing the following failure.

```
load podSandboxConfig: name, namespace or uid is not in metadata \"&PodSandboxMetadata{Name:rhcos-crio-pod-restart-test,Uid:,Namespace:redhat.test.crio,Attempt:0,}\
```

[0] https://github.com/kubernetes-sigs/cri-tools/releases/tag/v1.29.0
[1] kubernetes-sigs/cri-tools#1274
mike-nguyen added a commit to coreos/coreos-assembler that referenced this pull request Dec 14, 2023
Cri-tools 1.29[0] now pre-validates container metadata before
running with crictl[1]. The required uid field was missing in our
test causing the following failure.

```
load podSandboxConfig: name, namespace or uid is not in metadata \"&PodSandboxMetadata{Name:rhcos-crio-pod-restart-test,Uid:,Namespace:redhat.test.crio,Attempt:0,}\
```

[0] https://github.com/kubernetes-sigs/cri-tools/releases/tag/v1.29.0
[1] kubernetes-sigs/cri-tools#1274
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/bug Categorizes issue or PR as related to a bug. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

cannot remove pod created without a UID in YAML metadata
3 participants