-
Notifications
You must be signed in to change notification settings - Fork 67
Add snapshot property to Datasource class #1587
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
Conversation
Signed-off-by: Harel Meir <hmeir@redhat.com>
|
Report bugs in Issues The following are automatically added:
Available user actions:
Supported /retest check runs
Supported labels
|
| @property | ||
| def pvc(self): | ||
| return self._get_boot_source(boot_source_type="pvc") | ||
|
|
||
| @property | ||
| def snapshot(self): | ||
| return self._get_boot_source(boot_source_type="snapshot") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
boot_source should be the property that returns either a PVC or snapshot
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To clarify - add boot_source and add deprecation on pvc
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just to clarify:
You are suggesting that the only property should be boot source,
And that it should return PersisentVolumeClaim or VolumeSnapshot dynamically based on the the instance boot source type?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
right, and add deprecation warning on pvc that it will be deprecated in 4.16.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi
I have this PR in downstream.
And I want to apply this DataSource change on it as well, because its accessing its snapshot/pvc references.
Its currently on main, but need to be backported to 4.15 & 4.14.
So If I change to boot source instead of pvc, the implementation will be different in 4.14,4.15.
So should I implement the downstream PR with boot_source and in 4.14&4.15 add the snapshot property like I did here?
Short description:
Datasource can have two types of bootsource: pvc and snapshot.
pvc property already exists, adding snapshot.
What this PR does / why we need it:
Adding snapshot property
refactor the "pvc" property so we access the boot source according to the type requested
if the pvc/snapshot doesn't exists, return None