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

[release/1.7] Add cri-api v1alpha2 usage warning to all api calls #9479

Merged
merged 1 commit into from Dec 6, 2023

Conversation

ruiwen-zhao
Copy link
Member

Previous #9336 added warnings for the usage of cri-api Status and Version.

There are some use cases where clients might use cri-apis without calling those two apis. For example,

  1. client uses crictl to pre-pull container images,
  2. client uses ContainerStatus to find the container for a certain pid for monitoring purposes.

Therefore, this PR adds warning to all cri-api v1alpha2 apis.

Signed-off-by: ruiwen-zhao <ruiwen@google.com>
@samuelkarp samuelkarp added the area/cri Container Runtime Interface (CRI) label Dec 6, 2023
@samuelkarp samuelkarp changed the title Add cri-api v1alpha2 usage warning to all api calls [release/1.7] Add cri-api v1alpha2 usage warning to all api calls Dec 6, 2023
@samuelkarp samuelkarp added the cherry-pick/1.6.x Change to be cherry picked to release/1.6 branch label Dec 6, 2023
// emitUsageWarning emits a warning when v1alpha2 cri-api is called.
func (in *instrumentedAlphaService) emitUsageWarning(ctx context.Context) {
// Only emit the warning the first time an v1alpha2 api is called
in.emitWarning.Do(func() {
Copy link
Contributor

Choose a reason for hiding this comment

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

this LGTM. I don't know how big this problem will be for the end user - it may be interesting to log the specific call that was called. This way customers received this warning may understand who called it

@dmcgowan dmcgowan merged commit 8e06899 into containerd:release/1.7 Dec 6, 2023
49 checks passed
@samuelkarp
Copy link
Member

/cherrypick release/1.6

@k8s-infra-cherrypick-robot

@samuelkarp: #9479 failed to apply on top of branch "release/1.6":

Applying: Add cri-api v1alpha2 usage warning to all api calls
Using index info to reconstruct a base tree...
A	pkg/cri/instrument/instrumented_service.go
Falling back to patching base and 3-way merge...
Auto-merging pkg/cri/server/instrumented_service.go
CONFLICT (content): Merge conflict in pkg/cri/server/instrumented_service.go
error: Failed to merge in the changes.
hint: Use 'git am --show-current-patch=diff' to see the failed patch
Patch failed at 0001 Add cri-api v1alpha2 usage warning to all api calls
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".

In response to this:

/cherrypick release/1.6

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@samuelkarp samuelkarp added cherry-picked/1.6.x PR commits are cherry-picked into release/1.6 branch and removed cherry-pick/1.6.x Change to be cherry picked to release/1.6 branch labels Dec 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/cri Container Runtime Interface (CRI) cherry-picked/1.6.x PR commits are cherry-picked into release/1.6 branch size/M
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants