Merge pull request #520 from jonboulle/master

assorted formatting and typo fixes
pull/6/head
Daniel Smith 2014-07-18 17:15:30 -07:00
commit 211f6b312f
11 changed files with 24 additions and 24 deletions

View File

@ -6,9 +6,9 @@ To build Kubernetes you need to have access to a Docker installation through eit
1. Be running Docker. 2 options supported/tested:
1. **Mac OS X** The best way to go is to use `boot2docker`. See instructions [here](https://docs.docker.com/installation/mac/).
1. **Linux with local Docker** Install Docker according to the [instructions](https://docs.docker.com/installation/#installation) for your OS. The scripts here assume that they are using a local Docker server and that they can "reach around" docker and grab results directly from the file system.
1. Have python installed. Pretty much it is installed everywhere at this point so you can probably ignore this.
1. For releasing, have the [Google Cloud SDK](https://developers.google.com/cloud/sdk/) installed and configured. The default release mechanism will upload Docker images to a private registry backed by Google Cloud Storage. Non-image release artifacts will be uploaded to Google Cloud Storage also.
2. **Linux with local Docker** Install Docker according to the [instructions](https://docs.docker.com/installation/#installation) for your OS. The scripts here assume that they are using a local Docker server and that they can "reach around" docker and grab results directly from the file system.
2. Have python installed. Pretty much it is installed everywhere at this point so you can probably ignore this.
3. For releasing, have the [Google Cloud SDK](https://developers.google.com/cloud/sdk/) installed and configured. The default release mechanism will upload Docker images to a private registry backed by Google Cloud Storage. Non-image release artifacts will be uploaded to Google Cloud Storage also.
## Key scripts

View File

@ -19,13 +19,13 @@ import salt.utils.ipaddr as ipaddr
def ensure(name, cidr, mtu=1460):
'''
Ensure that a bridge (named <name>) is configured for contianers.
Ensure that a bridge (named <name>) is configured for containers.
Under the covers we will make sure that
- The bridge exists
- The MTU is set
- The correct network is added to the bridge
- iptables is set up for MASQUARADE for egress
- iptables is set up for MASQUERADE for egress
cidr:
The cidr range in the form of 10.244.x.0/24

View File

@ -61,7 +61,7 @@ func main() {
var err error
cloud, err = cloudprovider.NewGCECloud()
if err != nil {
glog.Fatal("Couldn't connect to GCE cloud: %#v", err)
glog.Fatalf("Couldn't connect to GCE cloud: %#v", err)
}
default:
if len(*cloudProvider) > 0 {

View File

@ -42,7 +42,7 @@ var (
httpServer = flag.String("h", "", "The host to connect to.")
config = flag.String("c", "", "Path to the config file.")
selector = flag.String("l", "", "Selector (label query) to use for listing")
updatePeriod = flag.Duration("u", 60*time.Second, "Update interarrival period")
updatePeriod = flag.Duration("u", 60*time.Second, "Update interval period")
portSpec = flag.String("p", "", "The port spec, comma-separated list of <external>:<internal>,...")
servicePort = flag.Int("s", -1, "If positive, create and run a corresponding service on this port, only used with 'run'")
authConfig = flag.String("auth", os.Getenv("HOME")+"/.kubernetes_auth", "Path to the auth info file. If missing, prompt the user. Only used if doing https.")
@ -51,8 +51,8 @@ var (
verbose = flag.Bool("verbose", false, "If true, print extra information")
proxy = flag.Bool("proxy", false, "If true, run a proxy to the api server")
www = flag.String("www", "", "If -proxy is true, use this directory to serve static files")
templateFile = flag.String("template_file", "", "If present load this file as a golang template and us it for output printing")
templateStr = flag.String("template", "", "If present parse this string as a golang template and us it for output printing")
templateFile = flag.String("template_file", "", "If present, load this file as a golang template and use it for output printing")
templateStr = flag.String("template", "", "If present, parse this string as a golang template and use it for output printing")
)
func usage() {

View File

@ -244,7 +244,7 @@ func TestDelete(t *testing.T) {
_, err = client.Do(request)
expectNoError(t, err)
if simpleStorage.deleted != ID {
t.Errorf("Unexpected delete: %s, expected %s (%s)", simpleStorage.deleted, ID)
t.Errorf("Unexpected delete: %s, expected %s", simpleStorage.deleted, ID)
}
}

View File

@ -317,7 +317,7 @@ func (c *testClient) Validate(t *testing.T, received interface{}, err error) {
if c.Error {
if err == nil {
t.Errorf("error expeced for %#v, got none", c.Request)
t.Errorf("error expected for %#v, got none", c.Request)
}
return
}
@ -348,7 +348,7 @@ func (c *testClient) Validate(t *testing.T, received interface{}, err error) {
}
if c.Response.Body != nil && !reflect.DeepEqual(c.Response.Body, received) {
t.Errorf("bad response for request %#v: expeced %s, got %s", c.Request, c.Response.Body, received)
t.Errorf("bad response for request %#v: expected %s, got %s", c.Request, c.Response.Body, received)
}
}

View File

@ -80,7 +80,7 @@ func Update(name string, client client.Interface, updatePeriod time.Duration) er
}
for _, pod := range podList.Items {
// We delete the pod here, the controller will recreate it. This will result in pulling
// a new Docker image. This isn't a full "update" but its what we support for now.
// a new Docker image. This isn't a full "update" but it's what we support for now.
err = client.DeletePod(pod.ID)
if err != nil {
return err

View File

@ -133,7 +133,7 @@ func verifyPackUnpack(t *testing.T, manifestID, containerName string) {
func verifyBoolean(t *testing.T, expected, value bool) {
if expected != value {
t.Errorf("Unexpected boolean. Expected %s. Found %s", expected, value)
t.Errorf("Unexpected boolean. Expected %t. Found %t", expected, value)
}
}
@ -599,7 +599,7 @@ func TestMakeVolumesAndBinds(t *testing.T) {
}
}
if len(binds) != len(expectedBinds) {
t.Errorf("Unexpected binds: Expected %# got %#v. Container was: %#v", expectedBinds, binds, container)
t.Errorf("Unexpected binds: Expected %#v got %#v. Container was: %#v", expectedBinds, binds, container)
}
verifyStringArrayEquals(t, binds, expectedBinds)
}
@ -1160,26 +1160,26 @@ func TestGetContainerInfoOnNonExistContainer(t *testing.T) {
func TestParseImageName(t *testing.T) {
name, tag := parseImageName("ubuntu")
if name != "ubuntu" || tag != "" {
t.Fatal("Unexpected name/tag: %s/%s", name, tag)
t.Fatalf("Unexpected name/tag: %s/%s", name, tag)
}
name, tag = parseImageName("ubuntu:2342")
if name != "ubuntu" || tag != "2342" {
t.Fatal("Unexpected name/tag: %s/%s", name, tag)
t.Fatalf("Unexpected name/tag: %s/%s", name, tag)
}
name, tag = parseImageName("foo/bar:445566")
if name != "foo/bar" || tag != "445566" {
t.Fatal("Unexpected name/tag: %s/%s", name, tag)
t.Fatalf("Unexpected name/tag: %s/%s", name, tag)
}
name, tag = parseImageName("registry.example.com:5000/foobar")
if name != "registry.example.com:5000/foobar" || tag != "" {
t.Fatal("Unexpected name/tag: %s/%s", name, tag)
t.Fatalf("Unexpected name/tag: %s/%s", name, tag)
}
name, tag = parseImageName("registry.example.com:5000/foobar:5342")
if name != "registry.example.com:5000/foobar" || tag != "5342" {
t.Fatal("Unexpected name/tag: %s/%s", name, tag)
t.Fatalf("Unexpected name/tag: %s/%s", name, tag)
}
}

View File

@ -48,7 +48,7 @@ func (impl LoadBalancerRR) LoadBalance(service string, srcAddr net.Addr) (string
index := impl.rrIndex[service]
impl.lock.RUnlock()
if !exists {
return "", errors.New("no service entry for:" + service)
return "", errors.New("no service entry for: " + service)
}
if len(endpoints) == 0 {
return "", errors.New("no endpoints for: " + service)

View File

@ -50,7 +50,7 @@ func TestMakeManifestNoServices(t *testing.T) {
t.Errorf("Expected one env vars, got: %#v", manifest)
}
if manifest.ID != "foobar" {
t.Errorf("Failed to assign id to manifest: %#v")
t.Errorf("Failed to assign ID to manifest: %#v", manifest.ID)
}
}

View File

@ -112,14 +112,14 @@ func TestIsValidPortNum(t *testing.T) {
goodValues := []int{1, 2, 1000, 16384, 32768, 65535}
for _, val := range goodValues {
if !IsValidPortNum(val) {
t.Errorf("expected true for '%s'", val)
t.Errorf("expected true for '%d'", val)
}
}
badValues := []int{0, -1, 65536, 100000}
for _, val := range badValues {
if IsValidPortNum(val) {
t.Errorf("expected false for '%s'", val)
t.Errorf("expected false for '%d'", val)
}
}
}