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

OCPBUGS-2895: Azure: Fix DiskEncryptionSet regex validation #6513

Merged
merged 1 commit into from
Oct 31, 2022

Conversation

SudoBrendan
Copy link
Contributor

Current validation excludes upper-case letters. I expanded the test suite to cover some of the ugliest (legitimate) names possible.

@openshift-ci openshift-ci bot requested review from jhixson74 and m1kola October 21, 2022 20:23
@@ -47,7 +45,7 @@ func TestValidateDiskEncryption(t *testing.T) {
name: "invalid disk encryption set (platform is stack cloud)",
pool: validDiskEncryptionMachinePool(),
cloudName: azure.StackCloud,
expected: fmt.Sprintf(`diskEncryptionSet.diskEncryptionSet: Invalid value: azure.DiskEncryptionSet{SubscriptionID:"%s", ResourceGroup:"%s", Name:"%s"}: disk encryption sets are not supported on this platform`, subscriptionID, resourceGroup, diskEncryptionSetName),
expected: fmt.Sprintf(`diskEncryptionSet.diskEncryptionSet: Invalid value: azure.DiskEncryptionSet{SubscriptionID:"%s", ResourceGroup:".+", Name:"%s"}: disk encryption sets are not supported on this platform`, subscriptionID, diskEncryptionSetName),
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Unfortunately, this string is used as a regex itself, and since RGs allow characters like ., (, and ), we can't use that and still get a match.

@SudoBrendan SudoBrendan mentioned this pull request Oct 21, 2022
22 tasks
@r4f4
Copy link
Contributor

r4f4 commented Oct 27, 2022

/retitle OCPBUGS-2895: Azure: Fix DiskEncryptionSet regex validation

@openshift-ci openshift-ci bot changed the title Azure: Fix DiskEncryptionSet regex validation OCPBUGS-2895: Azure: Fix DiskEncryptionSet regex validation Oct 27, 2022
@openshift-ci-robot openshift-ci-robot added the jira/invalid-bug Indicates that a referenced Jira bug is invalid for the branch this PR is targeting. label Oct 27, 2022
@openshift-ci-robot
Copy link
Contributor

@SudoBrendan: This pull request references Jira Issue OCPBUGS-2895, which is invalid:

  • expected the bug to target the "4.12.0" version, but it targets "4.11" instead

Comment /jira refresh to re-evaluate validity if changes to the Jira bug are made, or edit the title of this pull request to link to a different bug.

The bug has been updated to refer to the pull request using the external bug tracker.

In response to this:

Current validation excludes upper-case letters. I expanded the test suite to cover some of the ugliest (legitimate) names possible.

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.

@r4f4
Copy link
Contributor

r4f4 commented Oct 27, 2022

/jira refresh

@openshift-ci-robot openshift-ci-robot added jira/valid-bug Indicates that a referenced Jira bug is valid for the branch this PR is targeting. bugzilla/valid-bug Indicates that a referenced Bugzilla bug is valid for the branch this PR is targeting. and removed jira/invalid-bug Indicates that a referenced Jira bug is invalid for the branch this PR is targeting. labels Oct 27, 2022
@openshift-ci-robot
Copy link
Contributor

@r4f4: This pull request references Jira Issue OCPBUGS-2895, which is valid. The bug has been moved to the POST state.

3 validation(s) were run on this bug
  • bug is open, matching expected state (open)
  • bug target version (4.12.0) matches configured target version for branch (4.12.0)
  • bug is in the state New, which is one of the valid states (NEW, ASSIGNED, POST)

Requesting review from QA contact:
/cc @MayXuQQ

In response to this:

/jira refresh

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.

@openshift-ci openshift-ci bot requested a review from MayXuQQ October 27, 2022 07:39
@MayXuQQ
Copy link
Contributor

MayXuQQ commented Oct 27, 2022

pre-merge build: registry.build05.ci.openshift.org/ci-ln-frpjg32/release:latest
clusterName: maxu-e2e-V12345678-eastus-16589
[INFO] Creating keyvault and disk encryption set in maxu-e2e-V12345678-eastus-rg
10-28 00:20:13.344 Creating keyvault maxu-e2e-V12345678-eastus-16589-kv in maxu-e2e-V12345678-eastus-rg
10-28 00:20:13.344 Running Command: az keyvault create -n maxu-e2e-V12345678-eastus-16589-kv -g maxu-e2e-V12345678-eastus-rg --enable-purge-protection true
10-28 00:20:14.715 ERROR: Parameter 'vault_name' must conform to the following pattern: '^[a-zA-Z0-9-]{3,24}$'.

@r4f4
Copy link
Contributor

r4f4 commented Oct 27, 2022

pre-merge build: registry.build05.ci.openshift.org/ci-ln-frpjg32/release:latest clusterName: maxu-e2e-V12345678-eastus-16589 [INFO] Creating keyvault and disk encryption set in maxu-e2e-V12345678-eastus-rg 10-28 00:20:13.344 Creating keyvault maxu-e2e-V12345678-eastus-16589-kv in maxu-e2e-V12345678-eastus-rg 10-28 00:20:13.344 Running Command: az keyvault create -n maxu-e2e-V12345678-eastus-16589-kv -g maxu-e2e-V12345678-eastus-rg --enable-purge-protection true 10-28 00:20:14.715 ERROR: Parameter 'vault_name' must conform to the following pattern: '^[a-zA-Z0-9-]{3,24}$'.

So the keyvault name is too long?

$: echo "maxu-e2e-V12345678-eastus-16589-kv" | wc -c
35

Where is that name coming from?

@cblecker
Copy link
Member

/retest

@MayXuQQ
Copy link
Contributor

MayXuQQ commented Oct 27, 2022

with the cluster_name_prefix=maxu-e2e-V1234
[INFO] Generating manifests files.....
10-28 00:44:40.031 level=error msg=failed to fetch Master Machines: failed to load asset "Install Config": failed to create install config: invalid "install-config.yaml" file: metadata.name: Invalid value: "maxu-e2e-V1234": a lowercase RFC 1123 subdomain must consist of lower case alphanumeric characters, '-' or '.', and must start and end with an alphanumeric character (e.g. 'example.com', regex used for validation is 'a-z0-9?(.a-z0-9?)*')

@r4f4
Copy link
Contributor

r4f4 commented Oct 27, 2022

with the cluster_name_prefix=maxu-e2e-V1234 [INFO] Generating manifests files..... 10-28 00:44:40.031 level=error msg=failed to fetch Master Machines: failed to load asset "Install Config": failed to create install config: invalid "install-config.yaml" file: metadata.name: Invalid value: "maxu-e2e-V1234": a lowercase RFC 1123 subdomain must consist of lower case alphanumeric characters, '-' or '.', and must start and end with an alphanumeric character (e.g. 'example.com', regex used for validation is 'a-z0-9?(.a-z0-9?)*')

You cannot use uppercase character in metadata.name. So maxu-e2e-v1234 should work instead of maxu-e2e-V1234.

@SudoBrendan
Copy link
Contributor Author

Just for a bit of clarity: the new functionality we are testing should be to have a DiskEncryptionSet that includes any upper-case letters in its name. In addition, we should test a DiskEncrptionSet that resides within a ResourceGroup with upper-case letters. All other fields in the installer-config should be conforming to their standard validations.

I did also modify the code to accept upper-case letters in the subscription ID, so it might be worth adding those as well.

@MayXuQQ
Copy link
Contributor

MayXuQQ commented Oct 28, 2022

how to test the bug , now the subdomain domain name can not contains uppercase, blocked use uppercase in the cluster name?

@patrickdillon
Copy link
Contributor

/approve
/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Oct 28, 2022
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Oct 28, 2022

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: patrickdillon

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 openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Oct 28, 2022
@cblecker
Copy link
Member

/cherry-pick release-4.11

@openshift-cherrypick-robot

@cblecker: once the present PR merges, I will cherry-pick it on top of release-4.11 in a new PR and assign it to you.

In response to this:

/cherry-pick release-4.11

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.

@patrickdillon
Copy link
Contributor

/skip

@openshift-ci-robot openshift-ci-robot added jira/invalid-bug Indicates that a referenced Jira bug is invalid for the branch this PR is targeting. and removed bugzilla/valid-bug Indicates that a referenced Bugzilla bug is valid for the branch this PR is targeting. labels Oct 28, 2022
@openshift-ci-robot
Copy link
Contributor

@openshift-bot: This pull request references Jira Issue OCPBUGS-2895, which is invalid:

  • expected the bug to target the "4.13.0" version, but it targets "4.12.0" instead

Comment /jira refresh to re-evaluate validity if changes to the Jira bug are made, or edit the title of this pull request to link to a different bug.

In response to this:

/jira refresh

The requirements for Jira bugs have changed (Jira issues linked to PRs on main branch need to target OCP 4.12), recalculating validity.

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.

@r4f4
Copy link
Contributor

r4f4 commented Oct 28, 2022

/jira refresh

@openshift-ci-robot openshift-ci-robot added jira/valid-bug Indicates that a referenced Jira bug is valid for the branch this PR is targeting. bugzilla/valid-bug Indicates that a referenced Bugzilla bug is valid for the branch this PR is targeting. and removed jira/invalid-bug Indicates that a referenced Jira bug is invalid for the branch this PR is targeting. labels Oct 28, 2022
@openshift-ci-robot
Copy link
Contributor

@r4f4: This pull request references Jira Issue OCPBUGS-2895, which is valid.

3 validation(s) were run on this bug
  • bug is open, matching expected state (open)
  • bug target version (4.13.0) matches configured target version for branch (4.13.0)
  • bug is in the state POST, which is one of the valid states (NEW, ASSIGNED, POST)

Requesting review from QA contact:
/cc @MayXuQQ

In response to this:

/jira refresh

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.

@patrickdillon
Copy link
Contributor

/cherry-pick release-4.12

@openshift-cherrypick-robot

@patrickdillon: once the present PR merges, I will cherry-pick it on top of release-4.12 in a new PR and assign it to you.

In response to this:

/cherry-pick release-4.12

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.

@patrickdillon
Copy link
Contributor

/label backport-risk-assessed

@openshift-ci openshift-ci bot added the backport-risk-assessed Indicates a PR to a release branch has been evaluated and considered safe to accept. label Oct 28, 2022
@cblecker
Copy link
Member

/retest

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Oct 29, 2022

@SudoBrendan: The following tests failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/prow/e2e-azure-ovn-shared-vpc c56fbd1 link false /test e2e-azure-ovn-shared-vpc
ci/prow/e2e-azurestack c56fbd1 link false /test e2e-azurestack

Full PR test history. Your PR dashboard.

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. I understand the commands that are listed here.

@r4f4
Copy link
Contributor

r4f4 commented Oct 29, 2022

error: unable to create a release: operator "cluster-capi-operator" contained an invalid image-references file: no input image tag named "ibmcloud-cluster-api-controllers"

This is a known error in the IBM cloud provider. We'll have to wait until Monday for it to be resolved.

@MayXuQQ
Copy link
Contributor

MayXuQQ commented Oct 29, 2022

checked with

  platform:
    azure:
      encryptionAtHost: true
      osDisk:
        diskEncryptionSet: &1
          resourceGroup: MAXU-DISK2-RG
          name: MAXU-DISK2-des

and

diskEncryptionSet: &1
  resourceGroup: maxu-disk-rg
  name: MAXU-DISK-des

@MayXuQQ
Copy link
Contributor

MayXuQQ commented Oct 29, 2022

/label qe-approved

@openshift-ci openshift-ci bot added the qe-approved Signifies that QE has signed off on this PR label Oct 29, 2022
@r4f4
Copy link
Contributor

r4f4 commented Oct 31, 2022

/retest-required

@sdodson
Copy link
Member

sdodson commented Oct 31, 2022

/override ci/prow/e2e-aws-ovn
/override ci/prow/e2e-azure-ovn
/override ci/prow/images
This is due to image build problems due to the recent brancing and missing tags on ibmcloud-cluster-api-controllers.

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Oct 31, 2022

@sdodson: Overrode contexts on behalf of sdodson: ci/prow/e2e-aws-ovn, ci/prow/e2e-azure-ovn, ci/prow/images

In response to this:

/override ci/prow/e2e-aws-ovn
/override ci/prow/e2e-azure-ovn
/override ci/prow/images
This is due to image build problems due to the recent brancing and missing tags on ibmcloud-cluster-api-controllers.

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.

@sdodson
Copy link
Member

sdodson commented Oct 31, 2022

ART is aware and putting in a temporary fix in openshift-eng/ocp-build-data#2129

@openshift-merge-robot openshift-merge-robot merged commit 61a7629 into openshift:master Oct 31, 2022
@openshift-ci-robot
Copy link
Contributor

@SudoBrendan: All pull requests linked via external trackers have merged:

Jira Issue OCPBUGS-2895 has been moved to the MODIFIED state.

In response to this:

Current validation excludes upper-case letters. I expanded the test suite to cover some of the ugliest (legitimate) names possible.

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.

@openshift-cherrypick-robot

@cblecker: new pull request created: #6537

In response to this:

/cherry-pick release-4.11

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.

@openshift-cherrypick-robot

@patrickdillon: new pull request created: #6538

In response to this:

/cherry-pick release-4.12

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.

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. backport-risk-assessed Indicates a PR to a release branch has been evaluated and considered safe to accept. bugzilla/valid-bug Indicates that a referenced Bugzilla bug is valid for the branch this PR is targeting. jira/valid-bug Indicates that a referenced Jira bug is valid for the branch this PR is targeting. lgtm Indicates that a PR is ready to be merged. qe-approved Signifies that QE has signed off on this PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

10 participants