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

Use simple match instead of regex match in GCE Windows OpenSSH startup script #106245

Merged
merged 1 commit into from
Nov 9, 2021

Conversation

mauriciopoppe
Copy link
Member

/kind bug

What this PR does / why we need it:

Followup of #106196, the good news is that the SSH issue is fixed! Prow could SSH to the Windows VM however after checking the contents of the administrators_keys_file I saw that it was increasing in size for every run of the loop, this is because of these new lines:

      $found = Select-String -Path $user_keys_file -Pattern $ssh_key
      if ($found -eq $null) {
        Add-Content -Encoding UTF8 $user_keys_file $ssh_key
      }
      $found = Select-String -Path $administrator_keys_file -Pattern $ssh_key
      if ($found -eq $null) {
        Add-Content -Encoding UTF8 $administrator_keys_file $ssh_key
      }

Select-String is using regex by default and the pattern contains some characters that are interpreted differently if they're part of a regex expression and therefore a key would never be found and it'd be appended to the file even if the string was there, I saw that -SimpleMatch fixes it.

Does this PR introduce a user-facing change?

NONE

/cc @pjh
/sig windows

@k8s-ci-robot k8s-ci-robot requested a review from pjh November 9, 2021 05:17
@k8s-ci-robot k8s-ci-robot added release-note-none Denotes a PR that doesn't merit a release note. kind/bug Categorizes issue or PR as related to a bug. sig/windows Categorizes an issue or PR as relevant to SIG Windows. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. needs-priority Indicates a PR lacks a `priority/foo` label and requires one. area/provider/gcp Issues or PRs related to gcp provider sig/cloud-provider Categorizes an issue or PR as relevant to SIG Cloud Provider. labels Nov 9, 2021
@mauriciopoppe
Copy link
Member Author

/cc @ibabou
hey Ibrahim, please take a look if you get the chance, thanks in advance :)

@pjh
Copy link
Contributor

pjh commented Nov 9, 2021

/priority important-soon
/triage accepted

@k8s-ci-robot k8s-ci-robot added priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release. triage/accepted Indicates an issue or PR is ready to be actively worked on. and removed needs-priority Indicates a PR lacks a `priority/foo` label and requires one. labels Nov 9, 2021
@pjh
Copy link
Contributor

pjh commented Nov 9, 2021

/lgtm
/approve

@k8s-ci-robot k8s-ci-robot removed the needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. label Nov 9, 2021
@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Nov 9, 2021
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: mauriciopoppe, pjh

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

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Nov 9, 2021
@k8s-ci-robot k8s-ci-robot merged commit 884a900 into kubernetes:master Nov 9, 2021
@k8s-ci-robot k8s-ci-robot added this to the v1.23 milestone Nov 9, 2021
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. area/provider/gcp Issues or PRs related to gcp provider cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/bug Categorizes issue or PR as related to a bug. lgtm "Looks good to me", indicates that a PR is ready to be merged. priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release. release-note-none Denotes a PR that doesn't merit a release note. sig/cloud-provider Categorizes an issue or PR as relevant to SIG Cloud Provider. sig/windows Categorizes an issue or PR as relevant to SIG Windows. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. triage/accepted Indicates an issue or PR is ready to be actively worked on.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants