external-snapshotter
external-snapshotter copied to clipboard
Creating snapshot with pre-provisioned contents with different namespace outputs wrong error.
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
VolumeSnapshotContent is a cluster-scoped API object. It should not have a namespace.
Correction to the above, if the namespace of the volumeSnapshotRef is wrong this will happen. I will edit above.
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"
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...
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/staleis applied - After 30d of inactivity since
lifecycle/stalewas applied,lifecycle/rottenis applied - After 30d of inactivity since
lifecycle/rottenwas 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
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/staleis applied - After 30d of inactivity since
lifecycle/stalewas applied,lifecycle/rottenis applied - After 30d of inactivity since
lifecycle/rottenwas 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
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/staleis applied - After 30d of inactivity since
lifecycle/stalewas applied,lifecycle/rottenis applied - After 30d of inactivity since
lifecycle/rottenwas 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: 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/staleis applied- After 30d of inactivity since
lifecycle/stalewas applied,lifecycle/rottenis applied- After 30d of inactivity since
lifecycle/rottenwas applied, the issue is closedYou 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.