mirror of https://github.com/k3s-io/k3s
Revert "assorted formatting and typo fixes"
parent
211f6b312f
commit
05f01a3654
|
@ -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. 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. **Mac OS X** The best way to go is to use `boot2docker`. See instructions [here](https://docs.docker.com/installation/mac/).
|
||||||
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.
|
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.
|
||||||
2. Have python installed. Pretty much it is installed everywhere at this point so you can probably ignore this.
|
1. 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.
|
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.
|
||||||
|
|
||||||
## Key scripts
|
## Key scripts
|
||||||
|
|
||||||
|
|
|
@ -19,13 +19,13 @@ import salt.utils.ipaddr as ipaddr
|
||||||
|
|
||||||
def ensure(name, cidr, mtu=1460):
|
def ensure(name, cidr, mtu=1460):
|
||||||
'''
|
'''
|
||||||
Ensure that a bridge (named <name>) is configured for containers.
|
Ensure that a bridge (named <name>) is configured for contianers.
|
||||||
|
|
||||||
Under the covers we will make sure that
|
Under the covers we will make sure that
|
||||||
- The bridge exists
|
- The bridge exists
|
||||||
- The MTU is set
|
- The MTU is set
|
||||||
- The correct network is added to the bridge
|
- The correct network is added to the bridge
|
||||||
- iptables is set up for MASQUERADE for egress
|
- iptables is set up for MASQUARADE for egress
|
||||||
|
|
||||||
cidr:
|
cidr:
|
||||||
The cidr range in the form of 10.244.x.0/24
|
The cidr range in the form of 10.244.x.0/24
|
||||||
|
|
|
@ -61,7 +61,7 @@ func main() {
|
||||||
var err error
|
var err error
|
||||||
cloud, err = cloudprovider.NewGCECloud()
|
cloud, err = cloudprovider.NewGCECloud()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
glog.Fatalf("Couldn't connect to GCE cloud: %#v", err)
|
glog.Fatal("Couldn't connect to GCE cloud: %#v", err)
|
||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
if len(*cloudProvider) > 0 {
|
if len(*cloudProvider) > 0 {
|
||||||
|
|
|
@ -42,7 +42,7 @@ var (
|
||||||
httpServer = flag.String("h", "", "The host to connect to.")
|
httpServer = flag.String("h", "", "The host to connect to.")
|
||||||
config = flag.String("c", "", "Path to the config file.")
|
config = flag.String("c", "", "Path to the config file.")
|
||||||
selector = flag.String("l", "", "Selector (label query) to use for listing")
|
selector = flag.String("l", "", "Selector (label query) to use for listing")
|
||||||
updatePeriod = flag.Duration("u", 60*time.Second, "Update interval period")
|
updatePeriod = flag.Duration("u", 60*time.Second, "Update interarrival period")
|
||||||
portSpec = flag.String("p", "", "The port spec, comma-separated list of <external>:<internal>,...")
|
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'")
|
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.")
|
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")
|
verbose = flag.Bool("verbose", false, "If true, print extra information")
|
||||||
proxy = flag.Bool("proxy", false, "If true, run a proxy to the api server")
|
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")
|
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 use it for output printing")
|
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 use it for output printing")
|
templateStr = flag.String("template", "", "If present parse this string as a golang template and us it for output printing")
|
||||||
)
|
)
|
||||||
|
|
||||||
func usage() {
|
func usage() {
|
||||||
|
|
|
@ -244,7 +244,7 @@ func TestDelete(t *testing.T) {
|
||||||
_, err = client.Do(request)
|
_, err = client.Do(request)
|
||||||
expectNoError(t, err)
|
expectNoError(t, err)
|
||||||
if simpleStorage.deleted != ID {
|
if simpleStorage.deleted != ID {
|
||||||
t.Errorf("Unexpected delete: %s, expected %s", simpleStorage.deleted, ID)
|
t.Errorf("Unexpected delete: %s, expected %s (%s)", simpleStorage.deleted, ID)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -317,7 +317,7 @@ func (c *testClient) Validate(t *testing.T, received interface{}, err error) {
|
||||||
|
|
||||||
if c.Error {
|
if c.Error {
|
||||||
if err == nil {
|
if err == nil {
|
||||||
t.Errorf("error expected for %#v, got none", c.Request)
|
t.Errorf("error expeced for %#v, got none", c.Request)
|
||||||
}
|
}
|
||||||
return
|
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) {
|
if c.Response.Body != nil && !reflect.DeepEqual(c.Response.Body, received) {
|
||||||
t.Errorf("bad response for request %#v: expected %s, got %s", c.Request, c.Response.Body, received)
|
t.Errorf("bad response for request %#v: expeced %s, got %s", c.Request, c.Response.Body, received)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -80,7 +80,7 @@ func Update(name string, client client.Interface, updatePeriod time.Duration) er
|
||||||
}
|
}
|
||||||
for _, pod := range podList.Items {
|
for _, pod := range podList.Items {
|
||||||
// We delete the pod here, the controller will recreate it. This will result in pulling
|
// 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 it's what we support for now.
|
// a new Docker image. This isn't a full "update" but its what we support for now.
|
||||||
err = client.DeletePod(pod.ID)
|
err = client.DeletePod(pod.ID)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
|
|
|
@ -133,7 +133,7 @@ func verifyPackUnpack(t *testing.T, manifestID, containerName string) {
|
||||||
|
|
||||||
func verifyBoolean(t *testing.T, expected, value bool) {
|
func verifyBoolean(t *testing.T, expected, value bool) {
|
||||||
if expected != value {
|
if expected != value {
|
||||||
t.Errorf("Unexpected boolean. Expected %t. Found %t", expected, value)
|
t.Errorf("Unexpected boolean. Expected %s. Found %s", expected, value)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -599,7 +599,7 @@ func TestMakeVolumesAndBinds(t *testing.T) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if len(binds) != len(expectedBinds) {
|
if len(binds) != len(expectedBinds) {
|
||||||
t.Errorf("Unexpected binds: Expected %#v got %#v. Container was: %#v", expectedBinds, binds, container)
|
t.Errorf("Unexpected binds: Expected %# got %#v. Container was: %#v", expectedBinds, binds, container)
|
||||||
}
|
}
|
||||||
verifyStringArrayEquals(t, binds, expectedBinds)
|
verifyStringArrayEquals(t, binds, expectedBinds)
|
||||||
}
|
}
|
||||||
|
@ -1160,26 +1160,26 @@ func TestGetContainerInfoOnNonExistContainer(t *testing.T) {
|
||||||
func TestParseImageName(t *testing.T) {
|
func TestParseImageName(t *testing.T) {
|
||||||
name, tag := parseImageName("ubuntu")
|
name, tag := parseImageName("ubuntu")
|
||||||
if name != "ubuntu" || tag != "" {
|
if name != "ubuntu" || tag != "" {
|
||||||
t.Fatalf("Unexpected name/tag: %s/%s", name, tag)
|
t.Fatal("Unexpected name/tag: %s/%s", name, tag)
|
||||||
}
|
}
|
||||||
|
|
||||||
name, tag = parseImageName("ubuntu:2342")
|
name, tag = parseImageName("ubuntu:2342")
|
||||||
if name != "ubuntu" || tag != "2342" {
|
if name != "ubuntu" || tag != "2342" {
|
||||||
t.Fatalf("Unexpected name/tag: %s/%s", name, tag)
|
t.Fatal("Unexpected name/tag: %s/%s", name, tag)
|
||||||
}
|
}
|
||||||
|
|
||||||
name, tag = parseImageName("foo/bar:445566")
|
name, tag = parseImageName("foo/bar:445566")
|
||||||
if name != "foo/bar" || tag != "445566" {
|
if name != "foo/bar" || tag != "445566" {
|
||||||
t.Fatalf("Unexpected name/tag: %s/%s", name, tag)
|
t.Fatal("Unexpected name/tag: %s/%s", name, tag)
|
||||||
}
|
}
|
||||||
|
|
||||||
name, tag = parseImageName("registry.example.com:5000/foobar")
|
name, tag = parseImageName("registry.example.com:5000/foobar")
|
||||||
if name != "registry.example.com:5000/foobar" || tag != "" {
|
if name != "registry.example.com:5000/foobar" || tag != "" {
|
||||||
t.Fatalf("Unexpected name/tag: %s/%s", name, tag)
|
t.Fatal("Unexpected name/tag: %s/%s", name, tag)
|
||||||
}
|
}
|
||||||
|
|
||||||
name, tag = parseImageName("registry.example.com:5000/foobar:5342")
|
name, tag = parseImageName("registry.example.com:5000/foobar:5342")
|
||||||
if name != "registry.example.com:5000/foobar" || tag != "5342" {
|
if name != "registry.example.com:5000/foobar" || tag != "5342" {
|
||||||
t.Fatalf("Unexpected name/tag: %s/%s", name, tag)
|
t.Fatal("Unexpected name/tag: %s/%s", name, tag)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -50,7 +50,7 @@ func TestMakeManifestNoServices(t *testing.T) {
|
||||||
t.Errorf("Expected one env vars, got: %#v", manifest)
|
t.Errorf("Expected one env vars, got: %#v", manifest)
|
||||||
}
|
}
|
||||||
if manifest.ID != "foobar" {
|
if manifest.ID != "foobar" {
|
||||||
t.Errorf("Failed to assign ID to manifest: %#v", manifest.ID)
|
t.Errorf("Failed to assign id to manifest: %#v")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -112,14 +112,14 @@ func TestIsValidPortNum(t *testing.T) {
|
||||||
goodValues := []int{1, 2, 1000, 16384, 32768, 65535}
|
goodValues := []int{1, 2, 1000, 16384, 32768, 65535}
|
||||||
for _, val := range goodValues {
|
for _, val := range goodValues {
|
||||||
if !IsValidPortNum(val) {
|
if !IsValidPortNum(val) {
|
||||||
t.Errorf("expected true for '%d'", val)
|
t.Errorf("expected true for '%s'", val)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
badValues := []int{0, -1, 65536, 100000}
|
badValues := []int{0, -1, 65536, 100000}
|
||||||
for _, val := range badValues {
|
for _, val := range badValues {
|
||||||
if IsValidPortNum(val) {
|
if IsValidPortNum(val) {
|
||||||
t.Errorf("expected false for '%d'", val)
|
t.Errorf("expected false for '%s'", val)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue