Skip to content

Commit bb1623f

Browse files
authored
Use localtest.me instead of sslip.io (knative#2918)
Signed-off-by: Matej Vašek <[email protected]>
1 parent 668175b commit bb1623f

File tree

12 files changed

+28
-30
lines changed

12 files changed

+28
-30
lines changed

.github/workflows/test-integration.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@ jobs:
2121
echo "PATH=${{ github.workspace }}/hack/bin:$PATH" >> "$GITHUB_ENV"
2222
echo "TEKTON_TESTS_ENABLED=1" >> "$GITHUB_ENV"
2323
echo "GITLAB_TESTS_ENABLED=1" >> "$GITHUB_ENV"
24-
echo "GITLAB_HOSTNAME=gitlab.127.0.0.1.sslip.io" >> "$GITHUB_ENV"
24+
echo "GITLAB_HOSTNAME=gitlab.localtest.me" >> "$GITHUB_ENV"
2525
echo "GITLAB_ROOT_PASSWORD=$(< /dev/urandom tr -dc _A-Z-a-z-0-9 | head -c${1:-32})" >> "$GITHUB_ENV"
26-
echo "PAC_CONTROLLER_HOSTNAME=pac-ctr.127.0.0.1.sslip.io" >> "$GITHUB_ENV"
26+
echo "PAC_CONTROLLER_HOSTNAME=pac-ctr.localtest.me" >> "$GITHUB_ENV"
2727
- uses: actions/checkout@v4
2828
- uses: knative/actions/setup-go@main
2929
- uses: imjasonh/[email protected]

docs/CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ On other systems, add `127.0.0.1 kind-registry` to your local `hosts` file and `
102102

103103
Once the cluster has been allocated, the `func` CLI (or client library) will automatically use it (see the [Kubeconfig Docs](https://kubernetes.io/docs/concepts/configuration/organize-cluster-access-kubeconfig/) for more)
104104

105-
Functions will be available at the address `[Function Name].default.127.0.0.1.sslip.io`
105+
Functions will be available at the address `[Function Name].default.localtest.me`
106106

107107
To run integration tests, use `make test-integration`.
108108

hack/allocate.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ dns() {
115115
$KUBECTL patch configmap/config-domain \
116116
--namespace knative-serving \
117117
--type merge \
118-
--patch '{"data":{"127.0.0.1.sslip.io":""}}' && break
118+
--patch '{"data":{"localtest.me":""}}' && break
119119

120120
(( i+=1 ))
121121
if (( i>=n )); then
@@ -402,7 +402,7 @@ tekton() {
402402
pac() {
403403
echo "${blue}Installing PAC (Pipelines-as-Code) ${pac_version} ${reset}"
404404

405-
local -r pac_ctr_host="${PAC_CONTROLLER_HOSTNAME:-pac-ctr.127.0.0.1.sslip.io}"
405+
local -r pac_ctr_host="${PAC_CONTROLLER_HOSTNAME:-pac-ctr.localtest.me}"
406406

407407
# Install Pipelines as Code
408408
$KUBECTL apply -f "https://raw.githubusercontent.com/openshift-pipelines/pipelines-as-code/release-${pac_version}/release.k8s.yaml"

hack/install-gitlab.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ source "$(dirname "$(realpath "$0")")/common.sh"
2121
function install_gitlab() {
2222
echo "${blue}Installing GitLab${reset}"
2323

24-
local -r gitlab_host="${GITLAB_HOSTNAME:-gitlab.127.0.0.1.sslip.io}"
24+
local -r gitlab_host="${GITLAB_HOSTNAME:-gitlab.localtest.me}"
2525

2626
$KUBECTL apply -f - <<EOF
2727
kind: Namespace

hack/patch-hosts.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
# limitations under the License.
1414

1515
#
16-
# Create DNS A records for '127.0.0.1.sslip.io' and '*.127.0.0.1.sslip.io' pointing to the cluster node.
16+
# Create DNS A records for 'localtest.me' and '*.localtest.me' pointing to the cluster node.
1717
#
1818

1919
source "$(dirname "$(realpath "$0")")/common.sh"
@@ -28,8 +28,8 @@ function patch_hosts() {
2828
$KUBECTL patch cm/coredns -n kube-system --patch-file /dev/stdin <<EOF
2929
{
3030
"data": {
31-
"Corefile": ".:53 {\n errors\n health {\n lameduck 5s\n }\n ready\n kubernetes cluster.local in-addr.arpa ip6.arpa {\n pods insecure\n fallthrough in-addr.arpa ip6.arpa\n ttl 30\n }\n file /etc/coredns/example.db 127.0.0.1.sslip.io\n prometheus :9153\n forward . /etc/resolv.conf {\n max_concurrent 1000\n }\n cache 30\n loop\n reload\n loadbalance\n}\n",
32-
"example.db": "; 127.0.0.1.sslip.io test file\n127.0.0.1.sslip.io. IN SOA sns.dns.icann.org. noc.dns.icann.org. 2015082541 7200 3600 1209600 3600\n127.0.0.1.sslip.io. IN A ${cluster_node_addr}\n*.127.0.0.1.sslip.io. IN A ${cluster_node_addr}\n"
31+
"Corefile": ".:53 {\n errors\n health {\n lameduck 5s\n }\n ready\n kubernetes cluster.local in-addr.arpa ip6.arpa {\n pods insecure\n fallthrough in-addr.arpa ip6.arpa\n ttl 30\n }\n file /etc/coredns/example.db localtest.me\n prometheus :9153\n forward . /etc/resolv.conf {\n max_concurrent 1000\n }\n cache 30\n loop\n reload\n loadbalance\n}\n",
32+
"example.db": "; localtest.me test file\nlocaltest.me. IN SOA sns.dns.icann.org. noc.dns.icann.org. 2015082541 7200 3600 1209600 3600\nlocaltest.me. IN A ${cluster_node_addr}\n*.localtest.me. IN A ${cluster_node_addr}\n"
3333
}
3434
}
3535
EOF

hack/test.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ EOF
4343
kubectl wait --for=condition=Ready route echo -n func --timeout=600s
4444

4545
echo "${blue}Invoking echo server${reset}"
46-
curl http://echo.func.127.0.0.1.sslip.io/
46+
curl http://echo.func.localtest.me/
4747

4848
echo "${green}✅ Echo succeeded${reset}"
4949
}

pkg/builders/builders_int_test.go

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ func TestPrivateGitRepository(t *testing.T) {
7070
t.Fatal(err)
7171
}
7272

73-
gitCred := `url=https://git-private.127.0.0.1.sslip.io
73+
gitCred := `url=https://git-private.localtest.me
7474
username=developer
7575
password=nbusr123
7676
`
@@ -80,7 +80,7 @@ password=nbusr123
8080
}
8181

8282
netrc := filepath.Join(t.TempDir(), ".netrc")
83-
netrcContent := `machine git-private.127.0.0.1.sslip.io login developer password nbusr123`
83+
netrcContent := `machine git-private.localtest.me login developer password nbusr123`
8484
err = os.WriteFile(netrc, []byte(netrcContent), 0644)
8585
if err != nil {
8686
t.Fatal(err)
@@ -93,7 +93,7 @@ password=nbusr123
9393
f.Build.BuildEnvs = []fn.Env{
9494
{
9595
Name: ptr("GOPRIVATE"),
96-
Value: ptr("*.127.0.0.1.sslip.io"),
96+
Value: ptr("*.localtest.me"),
9797
},
9898
}
9999

@@ -167,13 +167,13 @@ func createCertificate(t *testing.T) string {
167167
BasicConstraintsValid: true,
168168
IsCA: true,
169169
SerialNumber: randSN(),
170-
// openssl hash of this subject is 712d4c9d
170+
// openssl hash of this subject is 85c05568
171171
// do not update the subject without also updating the hash referred from another places (e.g. Dockerfile)
172172
// See also: https://github.com/paketo-buildpacks/ca-certificates/blob/v1.0.1/cacerts/certs.go#L132
173173
Subject: pkix.Name{
174-
CommonName: "git-private.127.0.0.1.sslip.io",
174+
CommonName: "git-private.localtest.me",
175175
},
176-
DNSNames: []string{"git-private.127.0.0.1.sslip.io"},
176+
DNSNames: []string{"git-private.localtest.me"},
177177
NotBefore: time.Now(),
178178
NotAfter: time.Now().AddDate(0, 0, 1),
179179
SubjectKeyId: ski[:],
@@ -231,7 +231,7 @@ func randSN() *big.Int {
231231
func buildPatchedS2IBuilder(ctx context.Context, t *testing.T, certDir string) string {
232232
tag := "localhost:50000/go-toolset:test"
233233
dockerfile := `FROM registry.access.redhat.com/ubi8/go-toolset:latest
234-
COPY 712d4c9d.0 /etc/pki/ca-trust/source/anchors/
234+
COPY 85c05568.0 /etc/pki/ca-trust/source/anchors/
235235
USER 0:0
236236
RUN update-ca-trust
237237
USER 1001:0
@@ -243,13 +243,13 @@ USER 1001:0
243243
func buildPatcheBuildpackBuilder(ctx context.Context, t *testing.T, certDir string) string {
244244
tag := "localhost:50000/builder-jammy-tin:test"
245245
dockerfile := `FROM ghcr.io/knative/builder-jammy-tiny:latest
246-
COPY 712d4c9d.0 /etc/ssl/certs/
246+
COPY 85c05568.0 /etc/ssl/certs/
247247
`
248248
return buildPatchedBuilder(ctx, t, tag, dockerfile, certDir)
249249
}
250250

251251
// Builds an image with specified tag from specified dockerfile.
252-
// This function also injects self-signed as "712d4c9d.0" into the build context.
252+
// This function also injects self-signed as "85c05568.0" into the build context.
253253
func buildPatchedBuilder(ctx context.Context, t *testing.T, tag, dockerfile, certDir string) string {
254254
cli, err := client.NewClientWithOpts(client.FromEnv, client.WithAPIVersionNegotiation())
255255
if err != nil {
@@ -277,7 +277,7 @@ func buildPatchedBuilder(ctx context.Context, t *testing.T, tag, dockerfile, cer
277277
t.Fatal(err)
278278
}
279279
err = tw.WriteHeader(&tar.Header{
280-
Name: "712d4c9d.0",
280+
Name: "85c05568.0",
281281
Size: int64(len(cb)),
282282
Mode: 0644,
283283
})
@@ -320,12 +320,12 @@ func buildPatchedBuilder(ctx context.Context, t *testing.T, tag, dockerfile, cer
320320
}
321321

322322
// This sets up a private git repository for testing.
323-
// The repository url is https://git-private.127.0.0.1.sslip.io/foo.git, and it is protected by basic authentication.
323+
// The repository url is https://git-private.localtest.me/foo.git, and it is protected by basic authentication.
324324
// The credentials are developer:nbusr123.
325325
func servePrivateGit(ctx context.Context, t *testing.T, certDir string) {
326326
const (
327327
name = "git-private"
328-
host = "git-private.127.0.0.1.sslip.io"
328+
host = "git-private.localtest.me"
329329
image = "ghcr.io/matejvasek/git-private:latest"
330330
)
331331

pkg/builders/testdata/go-fn-with-private-deps/go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@ module function
22

33
go 1.22
44

5-
require git-private.127.0.0.1.sslip.io/foo.git v0.0.0-20250319130200-b1126104a200 // indirect
5+
require git-private.localtest.me/foo.git v0.0.0-20250704181237-d1e4de9dcd02 // indirect
Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,2 @@
1-
git-private.127.0.0.1.sslip.io/foo.git v0.0.0-20250312185939-e7bf19abfd77 h1:IJ6SiucMsd0bjPwuj3VIGCHN225+0lCU1OZSmsg3Rjk=
2-
git-private.127.0.0.1.sslip.io/foo.git v0.0.0-20250312185939-e7bf19abfd77/go.mod h1:rG9yzCHOSu2zUBmaB7GEu7RBsjiJZRUP1hy26O5CLsc=
3-
git-private.127.0.0.1.sslip.io/foo.git v0.0.0-20250319130200-b1126104a200 h1:moO2xbNMRhtKOUjzkXNgtv0y3k2Xo+xP9N4MagWSXe0=
4-
git-private.127.0.0.1.sslip.io/foo.git v0.0.0-20250319130200-b1126104a200/go.mod h1:8MJdyAVONQdluGP17pXr5Lu//oVu7YHyXBE29FDEEng=
1+
git-private.localtest.me/foo.git v0.0.0-20250704181237-d1e4de9dcd02 h1:8zZccH+dkzYMYRJN+sPw4fed4NlwC5W9hfNM4kl6RlM=
2+
git-private.localtest.me/foo.git v0.0.0-20250704181237-d1e4de9dcd02/go.mod h1:jqnvPQqnKYxxNNRBi9Wmpo5coeutnzAYIim12Lo9qRc=

pkg/builders/testdata/go-fn-with-private-deps/handle.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import (
44
"fmt"
55
"net/http"
66

7-
"git-private.127.0.0.1.sslip.io/foo.git/pkg/foo"
7+
"git-private.localtest.me/foo.git/pkg/foo"
88
)
99

1010
// Handle an HTTP Request.

0 commit comments

Comments
 (0)