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
4 changes: 2 additions & 2 deletions .github/workflows/test-integration.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ jobs:
echo "PATH=${{ github.workspace }}/hack/bin:$PATH" >> "$GITHUB_ENV"
echo "TEKTON_TESTS_ENABLED=1" >> "$GITHUB_ENV"
echo "GITLAB_TESTS_ENABLED=1" >> "$GITHUB_ENV"
echo "GITLAB_HOSTNAME=gitlab.127.0.0.1.sslip.io" >> "$GITHUB_ENV"
echo "GITLAB_HOSTNAME=gitlab.localtest.me" >> "$GITHUB_ENV"
echo "GITLAB_ROOT_PASSWORD=$(< /dev/urandom tr -dc _A-Z-a-z-0-9 | head -c${1:-32})" >> "$GITHUB_ENV"
echo "PAC_CONTROLLER_HOSTNAME=pac-ctr.127.0.0.1.sslip.io" >> "$GITHUB_ENV"
echo "PAC_CONTROLLER_HOSTNAME=pac-ctr.localtest.me" >> "$GITHUB_ENV"
- uses: actions/checkout@v4
- uses: knative/actions/setup-go@main
- uses: imjasonh/[email protected]
Expand Down
2 changes: 1 addition & 1 deletion docs/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ On other systems, add `127.0.0.1 kind-registry` to your local `hosts` file and `

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)

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

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

Expand Down
4 changes: 2 additions & 2 deletions hack/allocate.sh
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ dns() {
$KUBECTL patch configmap/config-domain \
--namespace knative-serving \
--type merge \
--patch '{"data":{"127.0.0.1.sslip.io":""}}' && break
--patch '{"data":{"localtest.me":""}}' && break

(( i+=1 ))
if (( i>=n )); then
Expand Down Expand Up @@ -402,7 +402,7 @@ tekton() {
pac() {
echo "${blue}Installing PAC (Pipelines-as-Code) ${pac_version} ${reset}"

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

# Install Pipelines as Code
$KUBECTL apply -f "https://raw.githubusercontent.com/openshift-pipelines/pipelines-as-code/release-${pac_version}/release.k8s.yaml"
Expand Down
2 changes: 1 addition & 1 deletion hack/install-gitlab.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ source "$(dirname "$(realpath "$0")")/common.sh"
function install_gitlab() {
echo "${blue}Installing GitLab${reset}"

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

$KUBECTL apply -f - <<EOF
kind: Namespace
Expand Down
6 changes: 3 additions & 3 deletions hack/patch-hosts.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
# limitations under the License.

#
# Create DNS A records for '127.0.0.1.sslip.io' and '*.127.0.0.1.sslip.io' pointing to the cluster node.
# Create DNS A records for 'localtest.me' and '*.localtest.me' pointing to the cluster node.
#

source "$(dirname "$(realpath "$0")")/common.sh"
Expand All @@ -28,8 +28,8 @@ function patch_hosts() {
$KUBECTL patch cm/coredns -n kube-system --patch-file /dev/stdin <<EOF
{
"data": {
"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",
"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"
"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",
"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"
}
}
EOF
Expand Down
2 changes: 1 addition & 1 deletion hack/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ EOF
kubectl wait --for=condition=Ready route echo -n func --timeout=600s

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

echo "${green}✅ Echo succeeded${reset}"
}
Expand Down
24 changes: 12 additions & 12 deletions pkg/builders/builders_int_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ func TestPrivateGitRepository(t *testing.T) {
t.Fatal(err)
}

gitCred := `url=https://git-private.127.0.0.1.sslip.io
gitCred := `url=https://git-private.localtest.me
username=developer
password=nbusr123
`
Expand All @@ -80,7 +80,7 @@ password=nbusr123
}

netrc := filepath.Join(t.TempDir(), ".netrc")
netrcContent := `machine git-private.127.0.0.1.sslip.io login developer password nbusr123`
netrcContent := `machine git-private.localtest.me login developer password nbusr123`
err = os.WriteFile(netrc, []byte(netrcContent), 0644)
if err != nil {
t.Fatal(err)
Expand All @@ -93,7 +93,7 @@ password=nbusr123
f.Build.BuildEnvs = []fn.Env{
{
Name: ptr("GOPRIVATE"),
Value: ptr("*.127.0.0.1.sslip.io"),
Value: ptr("*.localtest.me"),
},
}

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

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

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

Expand Down
2 changes: 1 addition & 1 deletion pkg/builders/testdata/go-fn-with-private-deps/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ module function

go 1.22

require git-private.127.0.0.1.sslip.io/foo.git v0.0.0-20250319130200-b1126104a200 // indirect
require git-private.localtest.me/foo.git v0.0.0-20250704181237-d1e4de9dcd02 // indirect
6 changes: 2 additions & 4 deletions pkg/builders/testdata/go-fn-with-private-deps/go.sum
Original file line number Diff line number Diff line change
@@ -1,4 +1,2 @@
git-private.127.0.0.1.sslip.io/foo.git v0.0.0-20250312185939-e7bf19abfd77 h1:IJ6SiucMsd0bjPwuj3VIGCHN225+0lCU1OZSmsg3Rjk=
git-private.127.0.0.1.sslip.io/foo.git v0.0.0-20250312185939-e7bf19abfd77/go.mod h1:rG9yzCHOSu2zUBmaB7GEu7RBsjiJZRUP1hy26O5CLsc=
git-private.127.0.0.1.sslip.io/foo.git v0.0.0-20250319130200-b1126104a200 h1:moO2xbNMRhtKOUjzkXNgtv0y3k2Xo+xP9N4MagWSXe0=
git-private.127.0.0.1.sslip.io/foo.git v0.0.0-20250319130200-b1126104a200/go.mod h1:8MJdyAVONQdluGP17pXr5Lu//oVu7YHyXBE29FDEEng=
git-private.localtest.me/foo.git v0.0.0-20250704181237-d1e4de9dcd02 h1:8zZccH+dkzYMYRJN+sPw4fed4NlwC5W9hfNM4kl6RlM=
git-private.localtest.me/foo.git v0.0.0-20250704181237-d1e4de9dcd02/go.mod h1:jqnvPQqnKYxxNNRBi9Wmpo5coeutnzAYIim12Lo9qRc=
2 changes: 1 addition & 1 deletion pkg/builders/testdata/go-fn-with-private-deps/handle.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"fmt"
"net/http"

"git-private.127.0.0.1.sslip.io/foo.git/pkg/foo"
"git-private.localtest.me/foo.git/pkg/foo"
)

// Handle an HTTP Request.
Expand Down
2 changes: 1 addition & 1 deletion pkg/pipelines/tekton/pipelines_int_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ func newRemoteTestClient(verbose bool) *fn.Client {
func assertFunctionEchoes(url string) (err error) {
token := time.Now().Format("20060102150405.000000000")

// res, err := http.Get("http://testremote-default.default.127.0.0.1.sslip.io?token=" + token)
// res, err := http.Get("http://testremote-default.default.localtest.me?token=" + token)
res, err := http.Get(url + "?token=" + token)
if err != nil {
return
Expand Down
2 changes: 1 addition & 1 deletion test/e2e/scenario_subscribe_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ func (f *FuncSubscribeTestType) setupBroker() {

// setupProducerFunc creates and deploy a knative function that produces events
// It will take 'type' and 'message' from query string to build and send an event to a TARGET_SINK (env var)
// Example: https://func-producer.default.127.0.0.1.sslip.io?type=HelloEvent&message=HELLO+EVENT+1
// Example: https://func-producer.default.localtest.me?type=HelloEvent&message=HELLO+EVENT+1
func (f *FuncSubscribeTestType) setupProducerFunc() {

var funcProducerName = "func-producer"
Expand Down
Loading