-
Notifications
You must be signed in to change notification settings - Fork 21
Fix private_gke_code_snippets
+ other small fixes
#477
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
Conversation
MCK 1.4.1 Release Notes |
@@ -1,3 +1,7 @@ | |||
#!/usr/bin/env bash | |||
|
|||
set -Eeou pipefail |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is not necessary as the file is only sourced, not executed directly
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
True! At the same time it helps mark the file in IDE as bash script ;)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
True! At the same time it helps mark the file in IDE as bash script ;)
Not requesting to change this. Just joining the chat :)
From my experience adding a shebang is usually enough for IDEs.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I thought that Łukasz commented all added lines. But I agree pipefail is not needed, but also harmless ;)
@@ -1,3 +1,7 @@ | |||
#!/usr/bin/env bash | |||
|
|||
set -Eeou pipefail |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
True! At the same time it helps mark the file in IDE as bash script ;)
Not requesting to change this. Just joining the chat :)
From my experience adding a shebang is usually enough for IDEs.
CUSTOM_OM_PREV_VERSION=6.0.0 | ||
export CUSTOM_OM_PREV_VERSION | ||
CUSTOM_OM_VERSION=$(grep -E "^\s*-\s*&ops_manager_60_latest\s+(\S+)\s+#" <"${script_dir}"/../../../../.evergreen.yml | awk '{print $3}') | ||
CUSTOM_OM_VERSION=$(grep -E "^\s*-\s*&ops_manager_60_latest\s+(\S+)\s+#" <"${PROJECT_DIR}"/.evergreen.yml | awk '{print $3}') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not something for this PR, but I think we should switch for yq/jq for reading yaml/json instead of awk.
Summary
This PR fixes
private_gke_code_snippets
tests that could not properly set the context:The reason was
om80
context file replaced thescript_dir
variable that was also set and used inprivate_gke_code_snippets
. After that thescript_dir
pointed to./scripts/dev/contexts/variables
instead of./scripts/dev/contexts/
and thegke
script could not be found. The solution was to replacescript_dir
usage inom80
script withPROJECT_DIR
. It was also replaced in other scripts which had long path based onscript_dir
.The other thing that was fixed is
switch_context
function. Previously because we concatenated result from multiple bash commands, we didn't consume the error code from actual command:Proof of Work
Passing CI + manual patch for private_gke_code_snippets .
Checklist
skip-changelog
label if not needed