external-snapshotter icon indicating copy to clipboard operation
external-snapshotter copied to clipboard

Creating snapshot with pre-provisioned contents with different namespace outputs wrong error.

Open 651juan opened this issue 3 years ago • 6 comments

What happened: Create snapshot content X with volumeSnapshotRef field and namespace: one . Create snapshot Y with namespace two. Error outputs Failed to check and update snapshot: VolumeSnapshotContent [X] is bound to a different snapshot

What you expected to happen: A different error message such as "Snapshot not found" How to reproduce it:

X snapshot content:

      apiVersion: snapshot.storage.k8s.io/v1
      kind: VolumeSnapshotContent
      metadata:
        name: "content"
        namespace: "one"
      spec:
        deletionPolicy: Retain
        driver: ebs.csi.aws.com
        source:
          snapshotHandle: "aws_handle"
        volumeSnapshotRef:
          name: "snapshot"
          namespace: "one"

Y Snapshot:

      apiVersion: snapshot.storage.k8s.io/v1
      kind: VolumeSnapshot
      metadata:
        name: "snapshot"
        namespace: "two"
      spec:
        source:
          volumeSnapshotContentName: "content"

Anything else we need to know?:

Environment:

  • Driver version: 5.0.1
  • Kubernetes version (use kubectl version): 1.21

651juan avatar Mar 28 '22 15:03 651juan

VolumeSnapshotContent is a cluster-scoped API object. It should not have a namespace.

xing-yang avatar Mar 28 '22 15:03 xing-yang

Correction to the above, if the namespace of the volumeSnapshotRef is wrong this will happen. I will edit above.

651juan avatar Mar 28 '22 15:03 651juan

The error message looks correct to me. The VolumeSnapshotContent is bound to the following snapshot which is different from the VolumeSnapshot you intend to bound. The binding logic is not going to try to find snapshot one from API server and print out "not found" message because that is expensive.

       volumeSnapshotRef:
          name: "snapshot"
          namespace: "one"

xing-yang avatar Mar 29 '22 13:03 xing-yang

Yes, I agree but the error message is not indicative of what actually happens. The error message states VolumeSnapshotContent [X] is bound to a different snapshot. This is not the case, the snapshot content is not bound to any snapshot...

651juan avatar Mar 29 '22 15:03 651juan

The Kubernetes project currently lacks enough contributors to adequately respond to all issues and PRs.

This bot triages issues and PRs according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the issue is closed

You can:

  • Mark this issue or PR as fresh with /remove-lifecycle stale
  • Mark this issue or PR as rotten with /lifecycle rotten
  • Close this issue or PR with /close
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle stale

k8s-triage-robot avatar Jun 27 '22 15:06 k8s-triage-robot

The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs.

This bot triages issues and PRs according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the issue is closed

You can:

  • Mark this issue or PR as fresh with /remove-lifecycle rotten
  • Close this issue or PR with /close
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle rotten

k8s-triage-robot avatar Jul 27 '22 16:07 k8s-triage-robot

The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs.

This bot triages issues and PRs according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the issue is closed

You can:

  • Reopen this issue or PR with /reopen
  • Mark this issue or PR as fresh with /remove-lifecycle rotten
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/close

k8s-triage-robot avatar Aug 26 '22 16:08 k8s-triage-robot

@k8s-triage-robot: Closing this issue.

In response to this:

The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs.

This bot triages issues and PRs according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the issue is closed

You can:

  • Reopen this issue or PR with /reopen
  • Mark this issue or PR as fresh with /remove-lifecycle rotten
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/close

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.

k8s-ci-robot avatar Aug 26 '22 16:08 k8s-ci-robot