Skip to content

Commit fb75fcf

Browse files
author
Matthew
committed
ref(pkg): remove extract-domain
the domain object is being removed in Deis v2, so this object is no longer necessary.
1 parent 49c303f commit fb75fcf

6 files changed

Lines changed: 2 additions & 67 deletions

File tree

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ BINARY_DEST_DIR := rootfs/usr/bin
1717
# Common flags passed into Go's linker.
1818
LDFLAGS := "-s -X main.version=${VERSION}"
1919
IMAGE_PREFIX ?= deis
20-
BINARIES := extract-domain extract-types extract-version generate-buildhook get-app-config get-app-values publish-release-controller yaml2json-procfile
20+
BINARIES := extract-types extract-version generate-buildhook get-app-config get-app-values publish-release-controller yaml2json-procfile
2121
STANDALONE := extract-types generate-buildhook yaml2json-procfile
2222
# Docker Root FS
2323
BINDIR := ./rootfs

pkg/src/extract-domain.go

Lines changed: 0 additions & 31 deletions
This file was deleted.

pkg/types.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ type BuildHook struct {
2929
// BuildHookResponse represents a controller's build-hook response object.
3030
type BuildHookResponse struct {
3131
Release map[string]int `json:"release"`
32-
Domains []string `json:"domains"`
3332
}
3433

3534
// Config represents a Deis application's configuration.

pkg/utils.go

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -36,24 +36,6 @@ func ParseConfig(body []byte) (*Config, error) {
3636
return &config, err
3737
}
3838

39-
// ParseDomain returns the domain field from the bytes of a build hook response.
40-
func ParseDomain(bytes []byte) (string, error) {
41-
var hook BuildHookResponse
42-
if err := json.Unmarshal(bytes, &hook); err != nil {
43-
return "", err
44-
}
45-
46-
if hook.Domains == nil {
47-
return "", fmt.Errorf("invalid application domain")
48-
}
49-
50-
if len(hook.Domains) < 1 {
51-
return "", fmt.Errorf("invalid application domain")
52-
}
53-
54-
return hook.Domains[0], nil
55-
}
56-
5739
// ParseReleaseVersion returns the version field from the bytes of a build hook response.
5840
func ParseReleaseVersion(bytes []byte) (int, error) {
5941
var hook BuildHookResponse

pkg/utils_test.go

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -86,20 +86,6 @@ func TestParseConfigGood(t *testing.T) {
8686
}
8787
}
8888

89-
func TestParseDomainGood(t *testing.T) {
90-
// mock controller build-hook response
91-
resp := []byte(`{"release": {"version": 1},
92-
"domains": ["test.example.com", "test2.example.com"]}`)
93-
94-
domain, err := ParseDomain(resp)
95-
if err != nil {
96-
t.Errorf("expected to parse domain, got '%v'", err)
97-
}
98-
if domain != "test.example.com" {
99-
t.Errorf("expected 'test.example.com', got '%s'", domain)
100-
}
101-
}
102-
10389
func TestParseReleaseVersionGood(t *testing.T) {
10490
// mock controller build-hook response
10591
resp := []byte(`{"release": {"version": 1},

rootfs/etc/confd/templates/builder

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -185,10 +185,9 @@ if [ $CODE -ne 0 ]; then
185185
fi
186186

187187
RELEASE=$(echo $PUBLISH_RELEASE | extract-version)
188-
DOMAIN=$(echo $PUBLISH_RELEASE | extract-domain)
189188
indent "done, $APP_NAME:v$RELEASE deployed to Deis"
190189
echo
191-
indent "http://$DOMAIN"
190+
indent "Use \`deis open\` to view this application in your browser."
192191
echo
193192
indent "To learn more, use \`deis help\` or visit http://deis.io"
194193
echo

0 commit comments

Comments
 (0)