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

[OCPCLOUD-960] Add support for dedicated instance tenancy #360

Merged
merged 2 commits into from Oct 22, 2020
Merged

[OCPCLOUD-960] Add support for dedicated instance tenancy #360

merged 2 commits into from Oct 22, 2020

Conversation

alexander-demicev
Copy link

This PR adds support for dedicated instance tenancy.

Copy link

@JoelSpeed JoelSpeed left a comment

Choose a reason for hiding this comment

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

Looks good, left a couple of suggestions for possible improvements.

Do you plan to have a follow up PR that validates the options in the validating webhook for AWS? This is a very viable field for validating there IMO

Have you done any manual testing for this feature yet? Do we need any extra config on the AWS account to be able to do this?

@@ -88,6 +88,9 @@ type AWSMachineProviderConfig struct {

// SpotMarketOptions allows users to configure instances to be run using AWS Spot instances.
SpotMarketOptions *SpotMarketOptions `json:"spotMarketOptions,omitempty"`

// Tenancy indicates if instance should run on shared or single-tenant hardware.
Tenancy string `json:"tenancy,omitempty"`

Choose a reason for hiding this comment

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

Might be worth setting this as a typed string and having the valid options be part of this package as exported variables? WDYT?

I would also suggest adding a comment to this to explain the valid and default options

pkg/actuators/machine/instances.go Outdated Show resolved Hide resolved
@@ -342,6 +342,25 @@ func launchInstance(machine *machinev1.Machine, machineProviderConfig *awsprovid
}
}

instanceTenancy := machineProviderConfig.Tenancy

switch instanceTenancy {
Copy link
Author

Choose a reason for hiding this comment

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

I know this can be validated in a webhook, but I'd leave the check serverside too.

Choose a reason for hiding this comment

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

Agreed, we should check in both places

@alexander-demicev
Copy link
Author

/retest

Copy link

@JoelSpeed JoelSpeed left a comment

Choose a reason for hiding this comment

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

Once nit on the comment otherwise LGTM

@@ -342,6 +342,25 @@ func launchInstance(machine *machinev1.Machine, machineProviderConfig *awsprovid
}
}

instanceTenancy := machineProviderConfig.Tenancy

switch instanceTenancy {

Choose a reason for hiding this comment

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

Agreed, we should check in both places

Comment on lines +92 to +93
// Tenancy indicates if instance should run on shared or single-tenant hardware. There are
// supported 3 options: default, dedicated and host.

Choose a reason for hiding this comment

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

Might be worth adjusting this and marking it optional (just for future readers, I realise it doesn't achieve anything)

Suggested change
// Tenancy indicates if instance should run on shared or single-tenant hardware. There are
// supported 3 options: default, dedicated and host.
// Tenancy indicates if instance should run on shared or single-tenant hardware.
// There are 3 supported options: default, dedicated and host.
// +optional

Copy link

@JoelSpeed JoelSpeed left a comment

Choose a reason for hiding this comment

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

/approve

@openshift-ci-robot
Copy link

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: JoelSpeed

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci-robot openshift-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Oct 19, 2020
@JoelSpeed
Copy link

/retitle [OCPCLOUD-960] Add support for dedicated instance tenancy

@openshift-ci-robot openshift-ci-robot changed the title Add support for dedicated instance tenancy [OCPCLOUD-960] Add support for dedicated instance tenancy Oct 19, 2020
Copy link

@michaelgugino michaelgugino left a comment

Choose a reason for hiding this comment

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

LGMT

Copy link

@elmiko elmiko left a comment

Choose a reason for hiding this comment

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

/lgtm

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Oct 22, 2020
Copy link

@michaelgugino michaelgugino left a comment

Choose a reason for hiding this comment

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

/lgtm

@openshift-bot
Copy link

/retest

Please review the full test history for this PR and help us cut down flakes.

@openshift-merge-robot openshift-merge-robot merged commit d30c7a2 into openshift:master Oct 22, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants