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

Data volume source image #751

Merged
merged 7 commits into from
Jun 20, 2024
Merged

Conversation

hebelsan
Copy link
Contributor

How to categorize this PR?

/area usability
/kind enhancement
/platform gcp

What this PR does / why we need it:

  • Add support for specifying data volume sourceImage in the workerConfig

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

Special notes for your reviewer:

Release note:

Add support for specifying data volume sourceImage in the workerConfig

@hebelsan hebelsan requested review from a team as code owners April 30, 2024 13:45
@gardener-robot gardener-robot added kind/api-change API change with impact on API users needs/second-opinion Needs second review by someone else area/usability Usability related kind/enhancement Enhancement, improvement, extension platform/gcp Google cloud platform/infrastructure needs/review Needs review size/s Size of pull request is small (see gardener-robot robot/bots/size.py) labels Apr 30, 2024
@gardener-robot-ci-2 gardener-robot-ci-2 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 Apr 30, 2024
@gardener-robot-ci-3 gardener-robot-ci-3 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 Apr 30, 2024
@gardener-robot-ci-1 gardener-robot-ci-1 added reviewed/ok-to-test Has 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 Apr 30, 2024
@kon-angelo
Copy link
Contributor

lgtm

/hold additional testing

@gardener-robot gardener-robot added the reviewed/do-not-merge Has no approval for merging as it may break things, be of poor quality or have (ext.) dependencies label May 8, 2024
@elankath
Copy link
Contributor

elankath commented May 8, 2024

@hebelsan @kon-angelo

Just a little confused. Don't we need to add a DataVolume struct similar to what we have done in gep-aws and also add a DataVolumes field in the WorkerConfig struct ? aws gep WorkerConfig has this.

Basically now the GEP for aws and gcp now appear to have non similar behaviours.

@kon-angelo
Copy link
Contributor

kon-angelo commented May 8, 2024

@elankath I think you are correct. The way it is setup now all dataVolumes would use the same sourceImage, which is clearly not what was intended.

@gardener-robot gardener-robot added size/m Size of pull request is medium (see gardener-robot robot/bots/size.py) and removed size/s Size of pull request is small (see gardener-robot robot/bots/size.py) labels May 10, 2024
@gardener-robot-ci-1 gardener-robot-ci-1 added reviewed/ok-to-test Has 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 May 10, 2024
@gardener-robot-ci-2 gardener-robot-ci-2 added reviewed/ok-to-test Has 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 May 10, 2024
@kon-angelo
Copy link
Contributor

/needs rebase

@gardener-robot gardener-robot added the needs/rebase Needs git rebase label Jun 3, 2024
@gardener-robot-ci-3 gardener-robot-ci-3 added reviewed/ok-to-test Has 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 Jun 3, 2024
@hebelsan
Copy link
Contributor Author

hebelsan commented Jun 3, 2024

@elankath Could you please review again? :)

return allErrs
}

func validateScratchDisk(volumeType string, workerConfig *gcp.WorkerConfig) field.ErrorList {
Copy link
Contributor

@elankath elankath Jun 14, 2024

Choose a reason for hiding this comment

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

(apologies for delay in reviewing. was on sick leave.)

Just for confirmation: I assume this new validation routine was introduced since we didn't any validation before to enforce this section in the usage document:

"If you attach the disk with SCRATCH type, either an NVMe interface or a SCSI interface must be specified. It is only meaningful to provide this volume interface if only SCRATCH data volumes are used."

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Previously, the validation for the SCRATCH disk type was present and has now been slightly refined.
A new validation rule requires that the workerConfigDataVolume name must correspond to a dataVolume name.

@@ -296,8 +305,8 @@ func createDiskSpec(size string, boot bool, machineImage, volumeType *string, wo
disk["labels"] = labels
}

if machineImage != nil {
disk["image"] = *machineImage
if image != nil {
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we need any changes in machine-controller-manager-provider-gcp or just setting image is good enough ? Just wondering why we decided to choose dataVolume.sourceImage instead of simply dataVolume.image ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yes, nothing to change in the mcm.
we went for sourceImage because that's how it is referred to by gcp client.

}

for _, configDataVolume := range workerConfigDataVolumes {
if !slices.Contains(dataVolumeNames, configDataVolume.Name) {
Copy link
Contributor

@elankath elankath Jun 14, 2024

Choose a reason for hiding this comment

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

Minor: instead of constructing dataVolumeNames slice can shorten by just using slices.ContainsFunc

		if slices.ContainsFunc(workerConfigDataVolumes, func(volume gcp.DataVolume) bool {
			return volume.Name ==  configDataVolume.Name
		}) {
			continue
		} 
		allErrs = append(allErrs, field.Invalid(
				dataVolumeFldPath,
				configDataVolume.Name,
				fmt.Sprintf("could not find dataVolume with name %s", configDataVolume.Name)))

Copy link
Contributor

@elankath elankath left a comment

Choose a reason for hiding this comment

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

thanks for the PR.

@gardener-robot-ci-2 gardener-robot-ci-2 added reviewed/ok-to-test Has 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 Jun 14, 2024
Copy link
Contributor

@kon-angelo kon-angelo 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 reviewed/lgtm Has approval for merging and removed needs/rebase Needs git rebase needs/review Needs review needs/second-opinion Needs second review by someone else labels Jun 18, 2024
@gardener-robot-ci-2 gardener-robot-ci-2 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 Jun 18, 2024
@kon-angelo
Copy link
Contributor

/unhold

@gardener-robot gardener-robot removed the reviewed/do-not-merge Has no approval for merging as it may break things, be of poor quality or have (ext.) dependencies label Jun 20, 2024
@kon-angelo kon-angelo merged commit 68d51c8 into gardener:master Jun 20, 2024
15 checks passed
@gardener-robot gardener-robot added the status/closed Issue is closed (either delivered or triaged) label Jun 20, 2024
@hebelsan hebelsan deleted the data-vol-image branch June 26, 2024 07:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/usability Usability related kind/api-change API change with impact on API users kind/enhancement Enhancement, improvement, extension needs/ok-to-test Needs approval for testing (check PR in detail before setting this label because PR is run on CI/CD) platform/gcp Google cloud platform/infrastructure reviewed/lgtm Has approval for merging reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) size/m Size of pull request is medium (see gardener-robot robot/bots/size.py) status/closed Issue is closed (either delivered or triaged)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Integrate vSMP MemeoryOne in GCP
7 participants