Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
k3s
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jacklull
k3s
Commits
add6feb5
Commit
add6feb5
authored
Aug 03, 2016
by
Erick Fejta
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use format instead of awk to extract active account/project
parent
804109d3
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
3 deletions
+3
-3
common.sh
build/common.sh
+3
-3
No files found.
build/common.sh
View file @
add6feb5
...
...
@@ -1086,7 +1086,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:"
...
...
@@ -1096,7 +1096,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:"
...
...
@@ -1594,7 +1594,7 @@ function kube::release::docker::release() {
function
kube::release::gcloud_account_is_active
()
{
local
-r
account
=
"
${
1
-
}
"
if
[[
-n
$(
gcloud auth list
--filter-account
$account
2>/dev/null |
grep
"active"
)
]]
;
then
if
[[
"
$(
gcloud config list
--format
=
'value(core.account)'
)
"
==
"
${
account
}
"
]]
;
then
return
0
else
return
1
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment