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

Add RHEL8 and RHEL9 fix for validation webhook and tests for Nutanix #6822

Merged
merged 3 commits into from
Oct 19, 2023
Merged

Add RHEL8 and RHEL9 fix for validation webhook and tests for Nutanix #6822

merged 3 commits into from
Oct 19, 2023

Conversation

adiantum
Copy link
Contributor

@adiantum adiantum commented Oct 16, 2023

  • add rhel8 and rhel9 tests for nutanix
  • add rhel8 and rhel9 template vars
  • add rhel9 constants
  • change NutanixMachineConfig validation

@eks-distro-bot
Copy link
Collaborator

Hi @adiantum. Thanks for your PR.

I'm waiting for a aws member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

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.

@eks-distro-bot eks-distro-bot added the size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. label Oct 16, 2023
 - add tests
 - add rhel8 and rhel9 template vars
 - add rhel9 constants
 - change NutanixMachineConfig validation
@adiantum adiantum changed the title Add RHEL8 and RHEL9 tests for Nutanix Add RHEL8 and RHEL9 fix for validation webhook and tests for Nutanix Oct 17, 2023
@adiantum
Copy link
Contributor Author

/assign @abhinavmpandey08

@@ -153,14 +153,6 @@ func validateNutanixMachineConfig(c *NutanixMachineConfig) error {
return fmt.Errorf("NutanixMachineConfig: %v", err)
}

if c.Spec.OSFamily != Ubuntu {
Copy link
Member

Choose a reason for hiding this comment

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

instead of deleting this entire validation, can we do something like
if c.Spec.OSFamily != Ubuntu && c.Spec.OSFamily != RedHat

for ex:

if config.Spec.OSFamily != Bottlerocket && config.Spec.OSFamily != Ubuntu && config.Spec.OSFamily != RedHat {

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@ahreehong Fixed

Copy link
Member

Choose a reason for hiding this comment

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

Does RedHat OSFamily cover both redhat8 and redhat9

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Comment on lines +567 to +576
func TestNutanixKubernetes128RedHatSimpleFlowWithUUID(t *testing.T) {
test := framework.NewClusterE2ETest(
t,
framework.NewNutanix(t, framework.WithRedHat128NutanixUUID(),
framework.WithPrismElementClusterUUID(),
framework.WithNutanixSubnetUUID()),
framework.WithClusterFiller(api.WithKubernetesVersion(v1alpha1.Kube128)),
)
runSimpleFlow(test)
}
Copy link
Member

Choose a reason for hiding this comment

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

I dont think we need separate UUID tests since the images are going to be the same and it's not really adding a lot more coverage. If we really wanted, we can keep just the 128 tests for UUID and remove the other ones.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@abhinavmpandey08
Copy link
Member

/ok-to-test

@codecov
Copy link

codecov bot commented Oct 19, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (61784f0) 71.99% compared to head (2b7ee88) 72.01%.
Report is 20 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #6822      +/-   ##
==========================================
+ Coverage   71.99%   72.01%   +0.02%     
==========================================
  Files         532      532              
  Lines       41597    41641      +44     
==========================================
+ Hits        29947    29988      +41     
- Misses       9978     9980       +2     
- Partials     1672     1673       +1     
Files Coverage Δ
pkg/api/v1alpha1/nutanixmachineconfig.go 92.96% <100.00%> (+0.05%) ⬆️

... and 15 files with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Member

@abhinavmpandey08 abhinavmpandey08 left a comment

Choose a reason for hiding this comment

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

Can you add all the new RHEL env vars in this file here: https://github.com/aws/eks-anywhere/blob/main/cmd/integration_test/build/buildspecs/nutanix-test-eks-a-cli.yml#L42

Something like this for all the envs should be good:

    T_NUTANIX_TEMPLATE_NAME_REDHAT_1_24: "nutanix_ci:nutanix_template_rhel_8_1_24"
    ...
    T_NUTANIX_TEMPLATE_NAME_REDHAT_9_1_24: "nutanix_ci:nutanix_template_rhel_9_1_24"
    ...

Comment on lines 60 to 65
nutanixTemplateNameUbuntu123Var,
nutanixTemplateNameUbuntu124Var,
nutanixTemplateNameUbuntu125Var,
nutanixTemplateNameUbuntu126Var,
nutanixTemplateNameUbuntu127Var,
nutanixTemplateNameUbuntu128Var,
Copy link
Member

Choose a reason for hiding this comment

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

Can you add these back along with all the new RHEL env vars? These are needed for the tests to run in our CI.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed

nutanixTemplateNameUbuntu126Var = "T_NUTANIX_TEMPLATE_NAME_UBUNTU_1_26"
nutanixTemplateNameUbuntu127Var = "T_NUTANIX_TEMPLATE_NAME_UBUNTU_1_27"
nutanixTemplateNameUbuntu128Var = "T_NUTANIX_TEMPLATE_NAME_UBUNTU_1_28"
nutanixTemplateNameRedHat123Var = "T_NUTANIX_TEMPLATE_NAME_REDHAT_1_23"
Copy link
Member

Choose a reason for hiding this comment

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

We are removing support for k8s v1.23 so we can remove this

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed

nutanixTemplateNameRedHat126Var = "T_NUTANIX_TEMPLATE_NAME_REDHAT_1_26"
nutanixTemplateNameRedHat127Var = "T_NUTANIX_TEMPLATE_NAME_REDHAT_1_27"
nutanixTemplateNameRedHat128Var = "T_NUTANIX_TEMPLATE_NAME_REDHAT_1_28"
nutanixTemplateNameRedHat9123Var = "T_NUTANIX_TEMPLATE_NAME_REDHAT_9_1_23"
Copy link
Member

Choose a reason for hiding this comment

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

This isn't needed anymore either for the same reason

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed

@adiantum
Copy link
Contributor Author

Can you add all the new RHEL env vars in this file here: https://github.com/aws/eks-anywhere/blob/main/cmd/integration_test/build/buildspecs/nutanix-test-eks-a-cli.yml#L42

Something like this for all the envs should be good:

    T_NUTANIX_TEMPLATE_NAME_REDHAT_1_24: "nutanix_ci:nutanix_template_rhel_8_1_24"
    ...
    T_NUTANIX_TEMPLATE_NAME_REDHAT_9_1_24: "nutanix_ci:nutanix_template_rhel_9_1_24"
    ...

Fixed

Copy link
Member

@abhinavmpandey08 abhinavmpandey08 left a comment

Choose a reason for hiding this comment

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

/approve
/lgtm

@eks-distro-bot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: abhinavmpandey08

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

@eks-distro-bot eks-distro-bot merged commit 0d8e817 into aws:main Oct 19, 2023
5 checks passed
@adiantum adiantum deleted the ntnx-rhel-tests branch October 24, 2023 15:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved lgtm ok-to-test size/XL Denotes a PR that changes 500-999 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants