diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 2e61ac31d..5f7ff1f91 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -22,10 +22,11 @@ If you're new to the project and want to help, but don't know where to start, we ## Contributing A Patch 1. If you haven't already done so, sign a Contributor License Agreement (see details above). +1. Read the [Ingress development guide](docs/dev/README.md) 1. Fork the desired repo, develop and test your code changes. 1. Submit a pull request. -All changes must be code reviewed. Coding conventions and standards are explained in the official [developer docs](https://github.com/kubernetes/kubernetes/tree/8a2c639bfb2087a9a89c02d2dc30fcb9bd0846f6/docs/devel). Expect reviewers to request that you avoid common [go style mistakes](https://github.com/golang/go/wiki/CodeReviewComments) in your PRs. +All changes must be code reviewed. Coding conventions and standards are explained in the official [developer docs](https://github.com/kubernetes/kubernetes/tree/master/docs/devel). Expect reviewers to request that you avoid common [go style mistakes](https://github.com/golang/go/wiki/CodeReviewComments) in your PRs. ### Merge Approval diff --git a/core/pkg/ingress/controller/annotations_test.go b/core/pkg/ingress/controller/annotations_test.go index f577920db..58b0d8093 100644 --- a/core/pkg/ingress/controller/annotations_test.go +++ b/core/pkg/ingress/controller/annotations_test.go @@ -28,10 +28,10 @@ import ( ) const ( - annotation_secureUpstream = "ingress.kubernetes.io/secure-backends" - annotation_upsMaxFails = "ingress.kubernetes.io/upstream-max-fails" - annotation_upsFailTimeout = "ingress.kubernetes.io/upstream-fail-timeout" - annotation_passthrough = "ingress.kubernetes.io/ssl-passthrough" + annotationSecureUpstream = "ingress.kubernetes.io/secure-backends" + annotationUpsMaxFails = "ingress.kubernetes.io/upstream-max-fails" + annotationUpsFailTimeout = "ingress.kubernetes.io/upstream-fail-timeout" + annotationPassthrough = "ingress.kubernetes.io/ssl-passthrough" ) type mockCfg struct { @@ -106,9 +106,9 @@ func TestSecureUpstream(t *testing.T) { annotations map[string]string er bool }{ - {map[string]string{annotation_secureUpstream: "true"}, true}, - {map[string]string{annotation_secureUpstream: "false"}, false}, - {map[string]string{annotation_secureUpstream + "_no": "true"}, false}, + {map[string]string{annotationSecureUpstream: "true"}, true}, + {map[string]string{annotationSecureUpstream: "false"}, false}, + {map[string]string{annotationSecureUpstream + "_no": "true"}, false}, {map[string]string{}, false}, {nil, false}, } @@ -131,9 +131,9 @@ func TestHealthCheck(t *testing.T) { eumf int euft int }{ - {map[string]string{annotation_upsMaxFails: "3", annotation_upsFailTimeout: "10"}, 3, 10}, - {map[string]string{annotation_upsMaxFails: "3"}, 3, 0}, - {map[string]string{annotation_upsFailTimeout: "10"}, 0, 10}, + {map[string]string{annotationUpsMaxFails: "3", annotationUpsFailTimeout: "10"}, 3, 10}, + {map[string]string{annotationUpsMaxFails: "3"}, 3, 0}, + {map[string]string{annotationUpsFailTimeout: "10"}, 0, 10}, {map[string]string{}, 0, 0}, {nil, 0, 0}, } @@ -164,9 +164,9 @@ func TestSSLPassthrough(t *testing.T) { annotations map[string]string er bool }{ - {map[string]string{annotation_passthrough: "true"}, true}, - {map[string]string{annotation_passthrough: "false"}, false}, - {map[string]string{annotation_passthrough + "_no": "true"}, false}, + {map[string]string{annotationPassthrough: "true"}, true}, + {map[string]string{annotationPassthrough: "false"}, false}, + {map[string]string{annotationPassthrough + "_no": "true"}, false}, {map[string]string{}, false}, {nil, false}, } diff --git a/core/pkg/ingress/controller/controller.go b/core/pkg/ingress/controller/controller.go index 146a00aa3..e992efda8 100644 --- a/core/pkg/ingress/controller/controller.go +++ b/core/pkg/ingress/controller/controller.go @@ -620,9 +620,8 @@ func (ic *GenericController) getBackendServers() ([]*ingress.Backend, []*ingress } if rule.HTTP == nil && - len(ing.Spec.TLS) == 0 && host != defServerName { - glog.V(3).Infof("ingress rule %v/%v does not contains HTTP or TLS rules. using default backend", ing.Namespace, ing.Name) + glog.V(3).Infof("ingress rule %v/%v does not contains HTTP rules. using default backend", ing.Namespace, ing.Name) server.Locations[0].Backend = defBackend.Name continue } @@ -976,7 +975,7 @@ func (ic *GenericController) getEndpoints( port, err := service.GetPortMapping(servicePort.StrVal, s) if err == nil { targetPort = port - continue + break } glog.Warningf("error mapping service port: %v", err) diff --git a/core/pkg/net/ssl/ssl.go b/core/pkg/net/ssl/ssl.go index 1ac6d2fa2..5907d5f5e 100644 --- a/core/pkg/net/ssl/ssl.go +++ b/core/pkg/net/ssl/ssl.go @@ -38,7 +38,7 @@ func AddOrUpdateCertAndKey(name string, cert, key, ca []byte) (*ingress.SSLCert, tempPemFile, err := ioutil.TempFile(ingress.DefaultSSLDirectory, pemName) if err != nil { - return nil, fmt.Errorf("could not create temp pem file %v: %v", tempPemFile.Name(), err) + return nil, fmt.Errorf("could not create temp pem file %v: %v", pemFileName, err) } _, err = tempPemFile.Write(cert) diff --git a/docs/dev/releases.md b/docs/dev/releases.md index 7cb3e0f1d..ce613cc23 100644 --- a/docs/dev/releases.md +++ b/docs/dev/releases.md @@ -4,7 +4,7 @@ This doc explains how to build, test and release ingress controllers. ## Building -All ingress controllers are build through a Makefile. Depending on your +All ingress controllers are built through a Makefile. Depending on your requirements you can build a raw server binary, a local container image, or push an image to a remote repository. @@ -76,7 +76,9 @@ $ cd $GOPATH/src/k8s.io/kubernetes $ ./hack/ginkgo-e2e.sh --ginkgo.focus=Ingress.* --delete-namespace-on-failure=false ``` -TODO: add instructions on running integration tests, or e2e against +See also [related FAQs](../faq#how-are-the-ingress-controllers-tested). + +[TODO](https://github.com/kubernetes/ingress/issues/5): add instructions on running integration tests, or e2e against local-up/minikube. ## Releasing diff --git a/docs/dev/setup.md b/docs/dev/setup.md index 72bd667be..b41810e1b 100644 --- a/docs/dev/setup.md +++ b/docs/dev/setup.md @@ -49,7 +49,7 @@ NAME STATUS AGE VERSION a sandboxed local cluster. You will first need to [install](https://github.com/kubernetes/minikube/releases) the minikube binary, then bring up a cluster ```console -$ minikube up +$ minikube start ``` Check for Ready nodes @@ -71,12 +71,16 @@ $ minikube addons list If this list already contains the ingress controller, you don't need to redeploy it. If the addon controller is disabled, you can enable it with ```console -$ minikube enable addons ingress +$ minikube addons enable ingress ``` If the list *does not* contain the ingress controller, you can either update minikube, or deploy it yourself as shown in the next section. +You may want to consider [using the VM's docker +daemon](https://github.com/kubernetes/minikube/blob/master/README.md#reusing-the-docker-daemon) +when developing. + ## Deploy the ingress controller You can deploy an ingress controller on the cluster setup in the previous step diff --git a/docs/faq/README.md b/docs/faq/README.md index f7e4de16e..dd36de9a1 100644 --- a/docs/faq/README.md +++ b/docs/faq/README.md @@ -100,7 +100,7 @@ Testing for the Ingress controllers is divided between: * Ingress repo: unittests and pre-submit integration tests run via travis * Kubernetes repo: [pre-submit e2e](https://k8s-testgrid.appspot.com/google-gce#gce&include-filter-by-regex=Loadbalancing), [post-merge e2e](https://k8s-testgrid.appspot.com/google-gce#gci-gce-ingress), - [per release-branch e2e](https://k8s-testgrid.appspot.com/google-gce#gci-gce-ingress-release-1.5) + [per release-branch e2e](https://k8s-testgrid.appspot.com/google-gce#gci-gce-ingress-1.5) The configuration for jenkins e2e tests are located [here](https://github.com/kubernetes/test-infra). The Ingress E2Es are located [here](https://github.com/kubernetes/kubernetes/blob/master/test/e2e/ingress.go),