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

Rename dontUsePreAllocatedDataVolumes to disablePreAllocatedDataVolumes #70

Merged

Conversation

stoyanr
Copy link
Contributor

@stoyanr stoyanr commented Sep 30, 2020

How to categorize this PR?

/area storage
/kind technical-debt
/priority normal
/platform kubevirt

What this PR does / why we need it:
Renames dontUsePreAllocatedDataVolumes to useDynamicallyAllocatedDataVolumes to avoid using "don't" and double negation.

Which issue(s) this PR fixes:
Fixes #65

Special notes for your reviewer:

Release note:

NONE

@stoyanr stoyanr requested a review from a team as a code owner September 30, 2020 14:17
@gardener-robot gardener-robot added area/storage Storage related kind/technical-debt Something that is only solved on the surface, but requires more (re)work to be done properly platform/kubevirt Container Native Virtualization (CNV) KubeVirt platform/infrastructure priority/normal labels Sep 30, 2020
@gardener-robot-ci-3 gardener-robot-ci-3 added the reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) label Sep 30, 2020
@stoyanr
Copy link
Contributor Author

stoyanr commented Sep 30, 2020

/cc @mfranczy @mvladev

@gardener-robot-ci-2 gardener-robot-ci-2 added needs/ok-to-test Needs approval for testing (check PR in detail before setting this label because PR is run on CI/CD) and removed reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) labels Sep 30, 2020
@@ -207,7 +207,7 @@ func (w *workerDelegate) allocateDataVolumes(ctx context.Context) error {
}

for _, machineClass := range w.machineClasses {
if !machineClass["dontUsePreAllocatedDataVolumes"].(bool) {
if !machineClass["useDynamicallyAllocatedDataVolumes"].(bool) {
Copy link
Contributor

Choose a reason for hiding this comment

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

in this case you should remove negation in this condition, should be

if machineClass["useDynamicallyAllocatedDataVolumes"].(bool) {

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No, I shouldn't. The semantic of the option is the same, only the name has changed.

Copy link
Contributor

Choose a reason for hiding this comment

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

@stoyanr but this means(from a semantic point of view) that the default is actually using the dynamic data volume allocation(dv created on vm creation).

Copy link
Contributor

@mfranczy mfranczy Sep 30, 2020

Choose a reason for hiding this comment

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

so in that case if somebody will set useDynamicallyAllocatedDataVolumes = true they won't use it as there is negation. Semantic is different.

# Don't use pre-allocated data volumes. Defaults to 'false'.
dontUsePreallocatedDataVolumes: true
# Use dynamically allocated data volumes instead of pre-allocated data volumes. Defaults to 'false'.
useDynamicallyAllocatedDataVolumes: true
Copy link
Contributor

Choose a reason for hiding this comment

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

in this case shouldn't be default = true? You removed negation (word "don't"). What should be the default value? By default I think we want to have dynamically allocated data volumes.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

See above, useDynamicallyAllocatedDataVolumes is the same as dontUsePreAllocatedDataVolumes, i.e. the 2 options are:

  • pre-allocated data volumes (default)
  • dynamically allocated data volumes

Copy link
Contributor

Choose a reason for hiding this comment

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

my apologies, you're right I didn't read this correctly, see my comment #65 (comment)

```

Currently, these KubeVirt-specific options may include:

* The DNS policy and DNS configuration for the KubeVirt VMs used as shoot cluster nodes. For more information, see [DNS for Services and Pods](https://kubernetes.io/docs/concepts/services-networking/dns-pod-service/).
* Whether to use *pre-allocated data volumes* with KubeVirt VMs. With pre-allocated data volumes (the default), a data volume is created in advance for each machine class / worker pool, the OS image is imported into this volume only once, and actual KubeVirt VM data volumes are cloned from this data volume. Typically, this significantly speeds up the data volume creation process. You can disable this feature by setting the `dontUsePreallocatedDataVolumes` option to `false`.
* Whether to use *pre-allocated data volumes* with KubeVirt VMs. With pre-allocated data volumes (the default), a data volume is created in advance for each machine class / worker pool, the OS image is imported into this volume only once, and actual KubeVirt VM data volumes are cloned from this data volume. Typically, this significantly speeds up the data volume creation process. You can disable this feature by setting the `useDynamicallyAllocatedDataVolumes` option to `true`.
Copy link
Contributor

Choose a reason for hiding this comment

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

You can disable this feature by setting the useDynamicallyAllocatedDataVolumes option to true.

Should be

You can disable this feature by setting the `useDynamicallyAllocatedDataVolumes` option to `false`.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

See above, no, to disable the pre-allocated data volumes feature (which is enabled by default), useDynamicallyAllocatedDataVolumes should be set to true, not false.

@stoyanr stoyanr force-pushed the rename-dont-use-preallocated branch from 79ec65e to bcebf08 Compare October 1, 2020 12:53
@gardener-robot-ci-3 gardener-robot-ci-3 added the reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) label Oct 1, 2020
@gardener-robot-ci-1 gardener-robot-ci-1 removed the reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) label Oct 1, 2020
@stoyanr stoyanr changed the title Rename dontUsePreAllocatedDataVolumes to useDynamicallyAllocatedDataVolumes Rename dontUsePreAllocatedDataVolumes to disablePreAllocatedDataVolumes Oct 1, 2020
@stoyanr
Copy link
Contributor Author

stoyanr commented Oct 1, 2020

@mfranczy Renamed as suggested in the issue comment.

Copy link
Contributor

@mfranczy mfranczy left a comment

Choose a reason for hiding this comment

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

/lgtm

@gardener-robot gardener-robot added the reviewed/lgtm Has approval for merging label Oct 1, 2020
@mfranczy mfranczy merged commit fa6cd76 into gardener-attic:master Oct 1, 2020
@stoyanr stoyanr deleted the rename-dont-use-preallocated branch October 1, 2020 13:02
@gardener-robot gardener-robot added priority/3 Priority (lower number equals higher priority) and removed priority/3 Priority (lower number equals higher priority) labels Mar 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/storage Storage related kind/technical-debt Something that is only solved on the surface, but requires more (re)work to be done properly needs/ok-to-test Needs approval for testing (check PR in detail before setting this label because PR is run on CI/CD) platform/kubevirt Container Native Virtualization (CNV) KubeVirt platform/infrastructure reviewed/lgtm Has approval for merging
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Rename "dontUsePreAllocatedDataVolumes" to not have "dont" in it
7 participants