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

Automated cherry pick of #30008 #30479 #30942

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 4 additions & 4 deletions build/common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -1082,7 +1082,7 @@ function kube::release::gcs::verify_prereqs() {
fi

if [[ -z "${GCLOUD_ACCOUNT-}" ]]; then
GCLOUD_ACCOUNT=$(gcloud auth list 2>/dev/null | awk '/(active)/ { print $2 }')
GCLOUD_ACCOUNT=$(gcloud config list --format='value(core.account)' 2>/dev/null)
fi
if [[ -z "${GCLOUD_ACCOUNT-}" ]]; then
echo "No account authorized through gcloud. Please fix with:"
Expand All @@ -1092,7 +1092,7 @@ function kube::release::gcs::verify_prereqs() {
fi

if [[ -z "${GCLOUD_PROJECT-}" ]]; then
GCLOUD_PROJECT=$(gcloud config list project | awk '{project = $3} END {print project}')
GCLOUD_PROJECT=$(gcloud config list --format='value(core.project)' 2>/dev/null)
fi
if [[ -z "${GCLOUD_PROJECT-}" ]]; then
echo "No account authorized through gcloud. Please fix with:"
Expand Down Expand Up @@ -1594,9 +1594,9 @@ function kube::release::docker::release() {

function kube::release::has_gcloud_account() {
local -r account="${1-}"
if [[ -n $(gcloud auth list --filter-account $account 2>/dev/null) ]]; then
if [[ "$(gcloud config list --format='value(core.account)')" == "${account}" ]]; then
return 0
else
return 1
fi
}
}
6 changes: 3 additions & 3 deletions cluster/gce/list-resources.sh
Original file line number Diff line number Diff line change
Expand Up @@ -82,12 +82,12 @@ gcloud-compute-list disks ${ZONE:+"--zone=${ZONE}"} --regexp="${INSTANCE_PREFIX}

# List network resources. We include names starting with "a", corresponding to
# those that Kubernetes creates.
gcloud-compute-list addresses ${REGION:+"--region=${REGION}"} --regexp="a.*|${INSTANCE_PREFIX}.*"
gcloud-compute-list addresses ${REGION:+"--regions=${REGION}"} --regexp="a.*|${INSTANCE_PREFIX}.*"
# Match either the header or a line with the specified e2e network.
# This assumes that the network name is the second field in the output.
GREP_REGEX="^NAME\|^[^ ]\+[ ]\+\(default\|${NETWORK}\) "
gcloud-compute-list routes --regexp="default.*|${INSTANCE_PREFIX}.*"
gcloud-compute-list firewall-rules --regexp="default.*|k8s-fw.*|${INSTANCE_PREFIX}.*"
GREP_REGEX=""
gcloud-compute-list forwarding-rules ${REGION:+"--region=${REGION}"}
gcloud-compute-list target-pools ${REGION:+"--region=${REGION}"}
gcloud-compute-list forwarding-rules ${REGION:+"--regions=${REGION}"}
gcloud-compute-list target-pools ${REGION:+"--regions=${REGION}"}