Skip to content

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
// 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
@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".

Details

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.

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.

6 participants