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

Add s390x resource #35

Merged
merged 1 commit into from Sep 18, 2017
Jump to file or symbol
Failed to load files and symbols.
+18 −3
Diff settings

Always

Just for now

View
@@ -21,7 +21,11 @@ requires:
interface: kubernetes-cni
scope: container
resources:
flannel:
flannel-amd64:
type: file
filename: flannel.tar.gz
description: "A tarball packaged release of flannel"
description: "A tarball packaged release of flannel for amd64"
flannel-s390x:
type: file
filename: flannel.tar.gz
description: "A tarball packaged release of flannel for s390x"
View
@@ -1,5 +1,6 @@
import os
import json
import subprocess
from shlex import split
from subprocess import check_output, check_call, CalledProcessError, STDOUT
@@ -25,7 +26,8 @@
def install_flannel_binaries():
''' Unpack the Flannel binaries. '''
try:
archive = resource_get('flannel')
resource_name = 'flannel-{}'.format(arch())
archive = resource_get(resource_name)
except Exception:
message = 'Error fetching the flannel resource.'
log(message)
@@ -280,5 +282,14 @@ def get_flannel_subnet():
raise FlannelSubnetNotFound() from e
def arch():
'''Return the package architecture as a string.'''
# Get the package architecture for this system.
architecture = check_output(['dpkg', '--print-architecture']).rstrip()
# Convert the binary result into a string.
architecture = architecture.decode('utf-8')
return architecture
class FlannelSubnetNotFound(Exception):
pass
ProTip! Use n and p to navigate between commits in a pull request.