Skip to content

Commit 7021ed4

Browse files
nammnfealebenpae
authored andcommitted
CLOUDP-301555 - cleanup switch context by running sourcing only once (#4115)
# Summary - we were sourcing `context.file` 2 times, one before creating `current_envs` and then when creating `current_envs`. This was because we were relying on `env` instead of `export -p` which does not support proper exporting - additionally replaces all `#!/bin/bash` to `#!/usr/bin/env bash` for consistency - exports PATH for the `env -i` command to ensure we have all the executables running the source - in the end we only "eval" the export -p output instead of sourcing it, which only runs export and not the full script (again) ## Proof of Work ``` make switch context=e2e_static_multi_cluster_kind Switching context to: e2e_static_multi_cluster_kind Generated env files in /Users/nam.nguyen/projects/ops-manager-kubernetes/.generated: context.env context.export.env context.operator.env context.operator.export.env Switched to context "kind-e2e-operator". Current context: e2e_static_multi_cluster_kind (kubectl context: kind-e2e-operator), namespace=nnguyen-evg-singl ``` ## Checklist - [x] Have you linked a jira ticket and/or is the ticket in the title? - [x] Have you checked whether your jira ticket required DOCSP changes? - [x] Have you checked for release_note changes? ## Reminder (Please remove this when merging) - Please try to Approve or Reject Changes the PR, keep PRs in review as short as possible - Our Short Guide for PRs: [Link](REDACTED) - Remember the following Communication Standards - use comment prefixes for clarity: * **blocking**: Must be addressed before approval. * **follow-up**: Can be addressed in a later PR or ticket. * **q**: Clarifying question. * **nit**: Non-blocking suggestions. * **note**: Side-note, non-actionable. Example: Praise * --> no prefix is considered a question
1 parent 77ecd90 commit 7021ed4

35 files changed

+53
-51
lines changed

.githooks/pre-commit

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/bin/bash
1+
#!/usr/bin/env bash
22

33
set -Eeou pipefail
44

docker/mongodb-enterprise-appdb-database/docker-entrypoint.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/bin/bash
1+
#!/usr/bin/env bash
22
set -Eeuo pipefail
33

44
if [ "${1:0:1}" = '-' ]; then

docker/mongodb-enterprise-init-database/content/probe.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/bin/bash
1+
#!/usr/bin/env bash
22
set -Eeou pipefail
33

44
check_process() {

multi_cluster/setup_multi_cluster_environment.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/bin/bash
1+
#!/usr/bin/env bash
22

33
aws_region="eu-west-2"
44
region="${aws_region}a"

multi_cluster/tools/download_istio.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/bin/bash
1+
#!/usr/bin/env bash
22
set -Eeou pipefail
33

44
export VERSION=${VERSION:-1.16.1}

multi_cluster/tools/install_istio.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/bin/bash
1+
#!/usr/bin/env bash
22

33
set -eux
44

multi_cluster/tools/install_istio_central.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/bin/bash
1+
#!/usr/bin/env bash
22

33
set -eux
44

public/architectures/setup-multi-cluster/setup-istio/install_istio_separate_network.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/bin/bash
1+
#!/usr/bin/env bash
22

33
# This script is an adjusted version of the official Istio guide:
44
# https://istio.io/latest/docs/setup/install/multicluster/multi-primary_multi-network/

public/tools/multicluster/install_istio_separate_network.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/bin/bash
1+
#!/usr/bin/env bash
22

33
set -eux
44

public/tools/multicluster/sign.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/bin/bash
1+
#!/usr/bin/env bash
22

33
set -euo pipefail
44

0 commit comments

Comments
 (0)