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
7a10073e
Unverified
Commit
7a10073e
authored
Aug 09, 2018
by
Christoph Blecker
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update kube::util::ensure-cfssl
parent
c14a9c7c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
43 deletions
+8
-43
util.sh
hack/lib/util.sh
+8
-43
No files found.
hack/lib/util.sh
View file @
7a10073e
...
...
@@ -707,50 +707,15 @@ function kube::util::join {
# CFSSLJSON_BIN: The path of the installed cfssljson binary
#
function
kube::util::ensure-cfssl
{
if
command
-v
cfssl &>/dev/null
&&
command
-v
cfssljson &>/dev/null
;
then
CFSSL_BIN
=
$(
command
-v
cfssl
)
CFSSLJSON_BIN
=
$(
command
-v
cfssljson
)
return
0
fi
# Create a temp dir for cfssl if no directory was given
local
cfssldir
=
${
1
:-}
if
[[
-z
"
${
cfssldir
}
"
]]
;
then
kube::util::ensure-temp-dir
cfssldir
=
"
${
KUBE_TEMP
}
/cfssl"
echo
"Installing cfssl from vendor"
GOBIN
=
"
${
KUBE_OUTPUT_BINPATH
:-}
"
go
install
k8s.io/kubernetes/vendor/github.com/cloudflare/cfssl/cmd/cfssl
GOBIN
=
"
${
KUBE_OUTPUT_BINPATH
:-}
"
go
install
k8s.io/kubernetes/vendor/github.com/cloudflare/cfssl/cmd/cfssljson
CFSSL_BIN
=
"
$(
PATH
=
"
${
KUBE_OUTPUT_BINPATH
:-}
:
${
PATH
}
"
command
-v
cfssl
)
"
CFSSLJSON_BIN
=
"
$(
PATH
=
"
${
KUBE_OUTPUT_BINPATH
:-}
:
${
PATH
}
"
command
-v
cfssljson
)
"
if
[[
!
-x
${
CFSSL_BIN
}
||
!
-x
${
CFSSLJSON_BIN
}
]]
;
then
echo
"Failed to install cfssl."
>
&2
exit
1
fi
mkdir
-p
"
${
cfssldir
}
"
pushd
"
${
cfssldir
}
"
>
/dev/null
echo
"Unable to successfully run 'cfssl' from
$PATH
; downloading instead..."
kernel
=
$(
uname
-s
)
case
"
${
kernel
}
"
in
Linux
)
curl
--retry
10
-L
-o
cfssl https://pkg.cfssl.org/R1.2/cfssl_linux-amd64
curl
--retry
10
-L
-o
cfssljson https://pkg.cfssl.org/R1.2/cfssljson_linux-amd64
;;
Darwin
)
curl
--retry
10
-L
-o
cfssl https://pkg.cfssl.org/R1.2/cfssl_darwin-amd64
curl
--retry
10
-L
-o
cfssljson https://pkg.cfssl.org/R1.2/cfssljson_darwin-amd64
;;
*
)
echo
"Unknown, unsupported platform:
${
kernel
}
."
>
&2
echo
"Supported platforms: Linux, Darwin."
>
&2
exit
2
esac
chmod
+x cfssl
||
true
chmod
+x cfssljson
||
true
CFSSL_BIN
=
"
${
cfssldir
}
/cfssl"
CFSSLJSON_BIN
=
"
${
cfssldir
}
/cfssljson"
if
[[
!
-x
${
CFSSL_BIN
}
||
!
-x
${
CFSSLJSON_BIN
}
]]
;
then
echo
"Failed to download 'cfssl'. Please install cfssl and cfssljson and verify they are in
\$
PATH."
echo
"Hint: export PATH=
\$
PATH:
\$
GOPATH/bin; go get -u github.com/cloudflare/cfssl/cmd/..."
exit
1
fi
popd
>
/dev/null
}
# kube::util::ensure_dockerized
...
...
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