Merge pull request #10498 from thockin/hostport-to-service

Fix leaking process in hostport proxy
This commit is contained in:
Dawn Chen
2015-08-06 10:50:44 -07:00
6 changed files with 59 additions and 11 deletions

View File

@@ -33,11 +33,16 @@ def file_passes(filename, extension, ref, regexs):
data = f.read()
# remove build tags from the top of Go file
# remove build tags from the top of Go files
if extension == "go":
p = regexs["go_build_constraints"]
(data, found) = p.subn("", data, 1)
# remove shebang from the top of shell files
if extension == "sh":
p = regexs["shebang"]
(data, found) = p.subn("", data, 1)
data = data.splitlines()
# if our test file is smaller than the reference it surely fails!
@@ -91,6 +96,8 @@ def main():
regexs["date"] = re.compile( '(2014|2015)' )
# strip // +build \n\n build constraints
regexs["go_build_constraints"] = re.compile(r"^(// \+build.*\n)+\n", re.MULTILINE)
# strip #!.* from shell scripts
regexs["shebang"] = re.compile(r"^(#!.*\n)\n*", re.MULTILINE)
for filename in filenames:
if not file_passes(filename, extension, ref, regexs):

View File

@@ -1,5 +1,3 @@
#!/bin/bash
# Copyright YEAR The Kubernetes Authors All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");