Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions hack/test-end-to-end.sh
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,8 @@ DOCKER_REGISTRY=$(osc get --output-version=v1beta1 --template="{{ .portalIP }}:{
echo "[INFO] Verifying the docker-registry is up at ${DOCKER_REGISTRY}"
wait_for_url_timed "http://${DOCKER_REGISTRY}" "[INFO] Docker registry says: " $((2*TIME_MIN))

[ "$(dig @${API_HOST} "docker-registry.default.local." A)" ]

docker tag -f centos:centos7 ${DOCKER_REGISTRY}/cached/centos:centos7
docker push ${DOCKER_REGISTRY}/cached/centos:centos7
echo "[INFO] Pushed centos7"
Expand Down
10 changes: 1 addition & 9 deletions pkg/cmd/server/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ import (
"github.com/openshift/origin/pkg/api/latest"
"github.com/openshift/origin/pkg/cmd/flagtypes"
"github.com/openshift/origin/pkg/cmd/util"
cmdutil "github.com/openshift/origin/pkg/cmd/util"
"github.com/openshift/origin/pkg/cmd/util/docker"
"github.com/openshift/origin/pkg/cmd/util/variable"
)
Expand Down Expand Up @@ -103,14 +102,7 @@ func NewDefaultConfig() *Config {
}

// TODO: allow DNS binding to be disabled.
dnsAddr := flagtypes.Addr{Value: config.BindAddr.Host, DefaultPort: 53}.Default()
if !cmdutil.TryListen(dnsAddr.URL.Host) {
original := dnsAddr.URL.Host
dnsAddr.DefaultPort = 8053
dnsAddr = dnsAddr.Default()
glog.Warningf("Unable to bind DNS as %s (you may need to run as root), using %s which will not resolve from all locations", original, dnsAddr.URL.Host)
}
config.DNSBindAddr = dnsAddr
config.DNSBindAddr = flagtypes.Addr{Value: config.BindAddr.Host, DefaultPort: 53}.Default()

config.ClientConfig = clientcmd.NewNonInteractiveDeferredLoadingClientConfig(&config.ClientConfigLoadingRules, &clientcmd.ConfigOverrides{})

Expand Down
8 changes: 8 additions & 0 deletions pkg/cmd/server/origin/master.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package origin
import (
"crypto/tls"
"fmt"
"net"
"net/http"
"net/url"
"os"
Expand Down Expand Up @@ -577,6 +578,13 @@ func (c *MasterConfig) RunDNSServer() {
if err != nil {
glog.Fatalf("Could not start DNS: %v", err)
}

if _, port, err := net.SplitHostPort(c.DNSBindAddr); err == nil {
if len(port) != 0 && port != "53" {
glog.Warningf("Unable to bind DNS on port 53 (you may need to run as root), using %s which will not resolve from all locations", c.DNSBindAddr)
}
}

config.DnsAddr = c.DNSBindAddr
go func() {
err := dns.ListenAndServe(config, c.DNSServerClient(), c.EtcdHelper.Client.(*etcdclient.Client))
Expand Down
9 changes: 8 additions & 1 deletion pkg/cmd/server/origin_master.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import (
osclient "github.com/openshift/origin/pkg/client"
"github.com/openshift/origin/pkg/cmd/server/crypto"
"github.com/openshift/origin/pkg/cmd/server/origin"
cmdutil "github.com/openshift/origin/pkg/cmd/util"
)

func (cfg Config) BuildOriginMasterConfig() (*origin.MasterConfig, error) {
Expand Down Expand Up @@ -83,10 +84,16 @@ func (cfg Config) BuildOriginMasterConfig() (*origin.MasterConfig, error) {
return nil, err
}

dnsAddr := cfg.DNSBindAddr
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This validation should happen in a separate method call for GetDNSAddr like we do for other addresses that require detection. https://github.com/openshift/origin/blob/master/pkg/cmd/server/config.go#L123 as an example.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's not appropriate for it to be called more than once, so I don't want to encourage reuse.

On Mar 10, 2015, at 7:46 AM, David Eads [email protected] wrote:

In pkg/cmd/server/origin_master.go:

@@ -83,10 +85,18 @@ func (cfg Config) BuildOriginMasterConfig() (*origin.MasterConfig, error) {
return nil, err
}


Reply to this email directly or view it on GitHub.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this feels similar to the warnings you get when :80 and :443 can't be bound to, but those happen at start time. I would move this earlier (to a validate func) or later (to the start func). Doing it in buildconfig feels weird

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed

----- Original Message -----

@@ -83,10 +85,18 @@ func (cfg Config) BuildOriginMasterConfig()
(*origin.MasterConfig, error) {
return nil, err
}

  • dnsAddr := cfg.DNSBindAddr

this feels similar to the warnings you get when :80 and :443 can't be bound
to, but those happen at start time. I would move this earlier (to a validate
func) or later (to the start func). Doing it in buildconfig feels weird


Reply to this email directly or view it on GitHub:
https://github.com/openshift/origin/pull/1263/files#r26119239

if !cmdutil.TryListen(dnsAddr.URL.Host) {
dnsAddr.DefaultPort = 8053
dnsAddr = dnsAddr.Default()
}

openshiftConfigParameters := origin.MasterConfigParameters{
MasterBindAddr: cfg.BindAddr.URL.Host,
AssetBindAddr: cfg.GetAssetBindAddress(),
DNSBindAddr: cfg.DNSBindAddr.URL.Host,
DNSBindAddr: dnsAddr.URL.Host,
MasterAddr: masterAddr.String(),
KubernetesAddr: kubeAddr.String(),
MasterPublicAddr: masterPublicAddr.String(),
Expand Down