From 2a371ce5d7b15d0c52b4582410e9ebd68f76edd8 Mon Sep 17 00:00:00 2001 From: Nic Jackson Date: Wed, 28 Feb 2024 14:20:23 +0000 Subject: [PATCH 1/7] Update release to use correct token --- .dagger/main.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.dagger/main.go b/.dagger/main.go index 98ae527d..a3547442 100644 --- a/.dagger/main.go +++ b/.dagger/main.go @@ -95,7 +95,7 @@ func (d *JumppadCI) Release(ctx context.Context, src *Directory, archives *Direc d.UpdateGemFury(ctx, version, gemfuryToken, archives) // update latest version on website - d.UpdateWebsite(ctx, version, gemfuryToken) + d.UpdateWebsite(ctx, version, githubToken) return version, d.lastError } From 402e2a93f941083c6d089930eb1e8052cdea1c33 Mon Sep 17 00:00:00 2001 From: Nic Jackson Date: Wed, 28 Feb 2024 15:38:36 +0000 Subject: [PATCH 2/7] Fix checksums --- .dagger/main.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.dagger/main.go b/.dagger/main.go index a3547442..1a5cd2ff 100644 --- a/.dagger/main.go +++ b/.dagger/main.go @@ -267,7 +267,11 @@ func (d *JumppadCI) Archive(ctx context.Context, binaries *Directory, version st return nil, d.lastError } - checksums.WriteString(fmt.Sprintf("%s %s\n", cs, outPath)) + // checksum is returned as "checksum filename" we need to remove the filename as it is not + // the same as the release name + csParts := strings.Split(cs, " ") + + checksums.WriteString(fmt.Sprintf("%s %s\n", csParts[0], outPath)) } out = out.WithNewFile("checksums.txt", checksums.String()) From 179c3d8f041babf7674f5b34a290f420ff180dfa Mon Sep 17 00:00:00 2001 From: Nic Jackson Date: Wed, 28 Feb 2024 17:07:24 +0000 Subject: [PATCH 3/7] Update to add local.jmpd.in replacing jumppad.dev --- ChangeLog.md | 6 +++++- cmd/log.go | 2 +- cmd/root.go | 6 +++++- examples/registries/build.hcl | 4 ++-- pkg/clients/connector/connector.go | 6 +++--- pkg/config/resources/k8s/provider_cluster_test.go | 4 ++-- pkg/utils/consts.go | 12 +++++++----- pkg/utils/util_test.go | 6 +++--- pkg/utils/utils.go | 6 +++--- 9 files changed, 31 insertions(+), 21 deletions(-) diff --git a/ChangeLog.md b/ChangeLog.md index fc2ce31f..ba2ad59b 100644 --- a/ChangeLog.md +++ b/ChangeLog.md @@ -1,6 +1,10 @@ # Change Log -## version v0.5.60 +## version v0.9.1 +* Update internal references to use the new `local.jmpd.in` domain bypassing + problems where chrome auto redirects .dev to https://. + +## version v0.7.0 * Add capability to add custom container registries to the image cache Nomad and Kuberentes clusters are started in a Docker container that does not save any state to the local disk. diff --git a/cmd/log.go b/cmd/log.go index 53e1918d..27d4efb8 100644 --- a/cmd/log.go +++ b/cmd/log.go @@ -206,7 +206,7 @@ func writeLogOutput(rc io.ReadCloser, stdout, stderr io.Writer, name string, c c dat := make([]byte, count) _, err = rc.Read(dat) - name = strings.TrimSuffix(name, ".jumppad.dev") + name = strings.TrimSuffix(name, utils.LocalTLD) colorWriter.Fprintf(w, "[%s] %s", name, string(dat)) } } diff --git a/cmd/root.go b/cmd/root.go index a86d517b..72d2a797 100644 --- a/cmd/root.go +++ b/cmd/root.go @@ -185,9 +185,13 @@ var discordHelp = ` ### For help and support join our community on Discord: https://discord.gg/ZuEFPJU69D ### ` -var changesVersion = "v0.7.0" +var changesVersion = "v0.9.1" var changes = ` +## version v0.9.1 +* Update internal references to use the new 'local.jmpd.in' domain bypassing + problems where chrome auto redirects .dev to https://. + ## version v0.7.0 ### Breaking Changes: diff --git a/examples/registries/build.hcl b/examples/registries/build.hcl index 20b77347..bd9f20ef 100644 --- a/examples/registries/build.hcl +++ b/examples/registries/build.hcl @@ -9,8 +9,8 @@ resource "certificate_leaf" "registry" { "localhost", "auth-registry.demo.gs", "noauth-registry.demo.gs", // have to set an external dns name as the registry resolves docker dns to localhost - "noauth.container.jumppad.dev", - "auth.container.jumppad.dev", + "noauth.container.local.jmpd.in", + "auth.container.local.jmpd.in", ] output = data("certs") diff --git a/pkg/clients/connector/connector.go b/pkg/clients/connector/connector.go index 55b9fbfe..25b62877 100644 --- a/pkg/clients/connector/connector.go +++ b/pkg/clients/connector/connector.go @@ -289,7 +289,7 @@ func (c *ConnectorImpl) GenerateLeafCert( return nil, err } - hosts := []string{"localhost", "*.jumppad.dev", c.options.GrpcBind} + hosts := []string{"localhost", fmt.Sprintf("*.local.%s", utils.LocalTLD), c.options.GrpcBind} hosts = append(hosts, host...) lc, err := crypto.GenerateLeaf( @@ -325,12 +325,12 @@ func (c *ConnectorImpl) ExposeService( dir := utils.CertsDir("") cb, err := c.GetLocalCertBundle(dir) if err != nil { - return "", fmt.Errorf("Unable to find certificate at location: %s, error: %s", dir, err) + return "", fmt.Errorf("unable to find certificate at location: %s, error: %s", dir, err) } cl, err := getClient(cb, c.options.GrpcBind) if err != nil { - return "", fmt.Errorf("Unable to create grpc client: %s", err) + return "", fmt.Errorf("unable to create grpc client: %s", err) } t := shipyard.ServiceType_LOCAL diff --git a/pkg/config/resources/k8s/provider_cluster_test.go b/pkg/config/resources/k8s/provider_cluster_test.go index 78a8f730..62dce78d 100644 --- a/pkg/config/resources/k8s/provider_cluster_test.go +++ b/pkg/config/resources/k8s/provider_cluster_test.go @@ -251,7 +251,7 @@ func TestClusterK3CreatesAServer(t *testing.T) { assert.Contains(t, params.Command[2], "--kube-proxy-arg=conntrack-max-per-core=0") assert.Contains(t, params.Command[3], "--disable=traefik") assert.Contains(t, params.Command[4], "--snapshotter=overlayfs") - assert.Contains(t, params.Command[5], "--tls-san=server.test.k8s-cluster.jumppad.dev") + assert.Contains(t, params.Command[5], "--tls-san=server.test.k8s-cluster.local.jmpd.in") } func TestClusterK3CreatesAServerWithAdditionalPorts(t *testing.T) { @@ -616,7 +616,7 @@ func TestClusterK3sDestroyGetsIDr(t *testing.T) { err := p.Destroy() assert.NoError(t, err) - md.AssertCalled(t, "FindContainerIDs", "server.test.k8s-cluster.jumppad.dev") + md.AssertCalled(t, "FindContainerIDs", "server.test.k8s-cluster.local.jmpd.in") } func TestClusterK3sDestroyWithFindIDErrorReturnsError(t *testing.T) { diff --git a/pkg/utils/consts.go b/pkg/utils/consts.go index 8bf4d424..e98823ce 100644 --- a/pkg/utils/consts.go +++ b/pkg/utils/consts.go @@ -2,9 +2,9 @@ package utils import "fmt" -var InvalidBlueprintURIError = fmt.Errorf("Inavlid blueprint URI") -var NameExceedsMaxLengthError = fmt.Errorf("Name exceeds the max length of 128 characters") -var NameContainsInvalidCharactersError = fmt.Errorf("Name contains invalid characters characters must be either a-z, A-Z, 0-9, -, _") +var InvalidBlueprintURIError = fmt.Errorf("inavlid blueprint URI") +var NameExceedsMaxLengthError = fmt.Errorf("name exceeds the max length of 128 characters") +var NameContainsInvalidCharactersError = fmt.Errorf("name contains invalid characters characters must be either a-z, A-Z, 0-9, -, _") // ImageVolumeName is the name of the volume which stores the images for clusters const ImageVolumeName string = "images" @@ -16,10 +16,12 @@ const BuildImagePrefix = "jumppad.dev/localcache" const CacheName string = "docker-cache" // Address of the proxy used for caching docker images -const jumppadProxyAddress string = "http://default.image-cache.jumppad.dev:3128" +const jumppadProxyAddress string = "http://default.image-cache.local.jmpd.in:3128" // Addresses to bypass when using a HTTP Proxy -const ProxyBypass string = "localhost,127.0.0.1,cluster.local,jumppad.dev,svc,consul" +const ProxyBypass string = "localhost,127.0.0.1,cluster.local,jumppad.dev,jumpd.in,svc,consul" + +const LocalTLD = "jmpd.in" const MaxRandomPort = 32767 const MinRandomPort = 30000 diff --git a/pkg/utils/util_test.go b/pkg/utils/util_test.go index 4693b6bd..a9d21d4a 100644 --- a/pkg/utils/util_test.go +++ b/pkg/utils/util_test.go @@ -97,17 +97,17 @@ func TestValidatesNameAndReturnsErrorWhenTooLong(t *testing.T) { func TestFQDNReturnsCorrectValue(t *testing.T) { fq := FQDN("test", "", "type") - assert.Equal(t, "test.type.jumppad.dev", fq) + assert.Equal(t, "test.type.local.jmpd.in", fq) } func TestFQDNReplacesInvalidChars(t *testing.T) { fq := FQDN("tes&t", "", "kubernetes_cluster") - assert.Equal(t, "tes-t.kubernetes-cluster.jumppad.dev", fq) + assert.Equal(t, "tes-t.kubernetes-cluster.local.jmpd.in", fq) } func TestFQDNVolumeReturnsCorrectValue(t *testing.T) { fq := FQDNVolumeName("test") - assert.Equal(t, "test.volume.jumppad.dev", fq) + assert.Equal(t, "test.volume.jmpd.in", fq) } func TestHomeReturnsCorrectValue(t *testing.T) { diff --git a/pkg/utils/utils.go b/pkg/utils/utils.go index 6769d0c0..c0786c3c 100644 --- a/pkg/utils/utils.go +++ b/pkg/utils/utils.go @@ -93,9 +93,9 @@ func ReplaceNonURIChars(s string) (string, error) { // FQDN generates the full qualified name for a container func FQDN(name, module, typeName string) string { - fqdn := fmt.Sprintf("%s.%s.jumppad.dev", name, typeName) + fqdn := fmt.Sprintf("%s.%s.local.%s", name, typeName, LocalTLD) if module != "" { - fqdn = fmt.Sprintf("%s.%s.%s.jumppad.dev", name, module, typeName) + fqdn = fmt.Sprintf("%s.%s.%s.local.%s", name, module, typeName, LocalTLD) } // ensure that the name is valid for URI schema @@ -115,7 +115,7 @@ func FQDNVolumeName(name string) string { panic(err) } - return fmt.Sprintf("%s.volume.jumppad.dev", cleanName) + return fmt.Sprintf("%s.volume.%s", cleanName, LocalTLD) } // CreateKubeConfigPath creates the file path for the KubeConfig file when From 44878124dab9f361b1a324e749094e295eb7d845 Mon Sep 17 00:00:00 2001 From: Nic Jackson Date: Wed, 28 Feb 2024 18:40:02 +0000 Subject: [PATCH 4/7] Fix tests --- pkg/clients/container/docker_tasks_volume_test.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkg/clients/container/docker_tasks_volume_test.go b/pkg/clients/container/docker_tasks_volume_test.go index dac8ec88..b97487d6 100644 --- a/pkg/clients/container/docker_tasks_volume_test.go +++ b/pkg/clients/container/docker_tasks_volume_test.go @@ -19,7 +19,7 @@ func TestCreateVolumeDoesNothingWhenVolumeExists(t *testing.T) { testutils.RemoveOn(&md.Mock, "VolumeList") args := volume.ListOptions{Filters: filters.NewArgs()} - args.Filters.Add("name", "test.volume.jumppad.dev") + args.Filters.Add("name", "test.volume.jmpd.in") md.On("VolumeList", mock.Anything, args).Return(volume.ListResponse{Volumes: []*volume.Volume{&volume.Volume{}}}, nil) p, _ := NewDockerTasks(md, mic, &tar.TarGz{}, logger.NewTestLogger(t)) @@ -36,7 +36,7 @@ func TestCreateVolumeReturnsErrorWhenVolumeListError(t *testing.T) { testutils.RemoveOn(&md.Mock, "VolumeList") args := volume.ListOptions{Filters: filters.NewArgs()} - args.Filters.Add("name", "test.volume.jumppad.dev") + args.Filters.Add("name", "test.volume.jmpd.in") md.On("VolumeList", mock.Anything, args).Return(volume.ListResponse{}, fmt.Errorf("Boom")) _, err := p.CreateVolume("test") @@ -63,5 +63,5 @@ func TestRemoveVolumeRemotesSuccesfully(t *testing.T) { err := p.RemoveVolume("test") assert.NoError(t, err) - md.AssertCalled(t, "VolumeRemove", mock.Anything, "test.volume.jumppad.dev", true) + md.AssertCalled(t, "VolumeRemove", mock.Anything, "test.volume.jmpd.in", true) } From fe9c64011efc0953a24f14085ed5a9a16b4e63f8 Mon Sep 17 00:00:00 2001 From: Nic Jackson Date: Thu, 29 Feb 2024 08:00:04 +0000 Subject: [PATCH 5/7] Update Nomad version, fix registry tests --- ChangeLog.md | 9 +++++---- cmd/root.go | 9 +++++---- examples/registries/k8s/files/insecure.yaml | 2 +- examples/registries/k8s/k8s.hcl | 4 ++-- examples/registries/nomad/files/insecure.nomad | 2 +- examples/registries/nomad/nomad.hcl | 4 ++-- pkg/config/resources/nomad/resource_cluster.go | 2 +- 7 files changed, 17 insertions(+), 15 deletions(-) diff --git a/ChangeLog.md b/ChangeLog.md index ba2ad59b..d713c2b2 100644 --- a/ChangeLog.md +++ b/ChangeLog.md @@ -3,6 +3,7 @@ ## version v0.9.1 * Update internal references to use the new `local.jmpd.in` domain bypassing problems where chrome auto redirects .dev to https://. +* Update Nomad to 1.7.5 ## version v0.7.0 * Add capability to add custom container registries to the image cache @@ -29,8 +30,8 @@ ```hcl # Define a custom registry that does not use authentication resource "container_registry" "noauth" { - hostname = "noauth-registry.demo.gs" // cache can not resolve local jumppad.dev dns for some reason, - // using external dns mapped to the local ip address + hostname = "noauth-registry.demo.gs" // cache can not resolve local.jmpd.in dns for some reason, + // using external dns mapped to the local ip address } # Define a custom registry that uses authentication @@ -66,8 +67,8 @@ resource "nomad_cluster" "dev" { // add configuration to allow cache bypass and insecure registry config { docker { - no_proxy = ["insecure.container.jumppad.dev"] - insecure_registries = ["insecure.container.jumppad.dev:5003"] + no_proxy = ["insecure.container.local.jmpd.in"] + insecure_registries = ["insecure.container.local.jmpd.in:5003"] } } } diff --git a/cmd/root.go b/cmd/root.go index 72d2a797..3d07c228 100644 --- a/cmd/root.go +++ b/cmd/root.go @@ -191,6 +191,7 @@ var changes = ` ## version v0.9.1 * Update internal references to use the new 'local.jmpd.in' domain bypassing problems where chrome auto redirects .dev to https://. +* Update Nomad to 1.7.5 ## version v0.7.0 @@ -254,8 +255,8 @@ from insecure registries. """hcl # Define a custom registry that does not use authentication resource "container_registry" "noauth" { - hostname = "noauth-registry.demo.gs" // cache can not resolve local jumppad.dev dns for some reason, - // using external dns mapped to the local ip address + hostname = "noauth-registry.demo.gs" // cache can not resolve local.jmpd.in dns for some reason, + // using external dns mapped to the local ip address } # Define a custom registry that uses authentication @@ -291,8 +292,8 @@ resource "nomad_cluster" "dev" { // add configuration to allow cache bypass and insecure registry config { docker { - no_proxy = ["insecure.container.jumppad.dev"] - insecure_registries = ["insecure.container.jumppad.dev:5003"] + no_proxy = ["insecure.container.jmpd.in"] + insecure_registries = ["insecure.container.jmpd.in:5003"] } } } diff --git a/examples/registries/k8s/files/insecure.yaml b/examples/registries/k8s/files/insecure.yaml index 958e1ccc..3ff1a602 100644 --- a/examples/registries/k8s/files/insecure.yaml +++ b/examples/registries/k8s/files/insecure.yaml @@ -16,7 +16,7 @@ spec: spec: containers: - name: insecure - image: "insecure.container.jumppad.dev:5003/mine:v0.1.0" + image: "insecure.container.local.jmpd.in:5003/mine:v0.1.0" ports: - containerPort: 19092 env: diff --git a/examples/registries/k8s/k8s.hcl b/examples/registries/k8s/k8s.hcl index d16bba57..8de40352 100644 --- a/examples/registries/k8s/k8s.hcl +++ b/examples/registries/k8s/k8s.hcl @@ -10,8 +10,8 @@ resource "k8s_cluster" "k3s" { // add configuration to allow cache bypass and insecure registry config { docker { - no_proxy = ["insecure.container.jumppad.dev"] - insecure_registries = ["insecure.container.jumppad.dev:5003"] + no_proxy = ["insecure.container.local.jumpd.in"] + insecure_registries = ["insecure.container.jmpd.in:5003"] } } } diff --git a/examples/registries/nomad/files/insecure.nomad b/examples/registries/nomad/files/insecure.nomad index 71c32ed7..de4f0e4f 100644 --- a/examples/registries/nomad/files/insecure.nomad +++ b/examples/registries/nomad/files/insecure.nomad @@ -32,7 +32,7 @@ job "insecure" { } config { - image = "insecure.container.jumppad.dev:5003/mine:v0.1.0" + image = "insecure.container.local.jmpd.in:5003/mine:v0.1.0" ports = ["http"] } diff --git a/examples/registries/nomad/nomad.hcl b/examples/registries/nomad/nomad.hcl index 01899403..8ca69654 100644 --- a/examples/registries/nomad/nomad.hcl +++ b/examples/registries/nomad/nomad.hcl @@ -14,8 +14,8 @@ resource "nomad_cluster" "dev" { // add configuration to allow cache bypass and insecure registry config { docker { - no_proxy = ["insecure.container.jumppad.dev"] - insecure_registries = ["insecure.container.jumppad.dev:5003"] + no_proxy = ["insecure.container.local.jmpd.in"] + insecure_registries = ["insecure.container.local.jmpd.in:5003"] } } } diff --git a/pkg/config/resources/nomad/resource_cluster.go b/pkg/config/resources/nomad/resource_cluster.go index abc972c8..4164586c 100644 --- a/pkg/config/resources/nomad/resource_cluster.go +++ b/pkg/config/resources/nomad/resource_cluster.go @@ -62,7 +62,7 @@ type NomadCluster struct { } const nomadBaseImage = "shipyardrun/nomad" -const nomadBaseVersion = "1.6.1" +const nomadBaseVersion = "1.7.5" type Config struct { // Specifies configuration for the Docker driver. From 439c73cefcc9a1f5c6bb43376683abae8828cb24 Mon Sep 17 00:00:00 2001 From: Nic Jackson Date: Thu, 29 Feb 2024 08:04:24 +0000 Subject: [PATCH 6/7] Fix test --- examples/registries/k8s/k8s.hcl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/registries/k8s/k8s.hcl b/examples/registries/k8s/k8s.hcl index 8de40352..4088944d 100644 --- a/examples/registries/k8s/k8s.hcl +++ b/examples/registries/k8s/k8s.hcl @@ -11,7 +11,7 @@ resource "k8s_cluster" "k3s" { config { docker { no_proxy = ["insecure.container.local.jumpd.in"] - insecure_registries = ["insecure.container.jmpd.in:5003"] + insecure_registries = ["insecure.container.local.jmpd.in:5003"] } } } From 7beece48b0e260a6f23c90a2fe3e8b0e3e940eae Mon Sep 17 00:00:00 2001 From: Nic Jackson Date: Thu, 29 Feb 2024 09:09:38 +0000 Subject: [PATCH 7/7] Fix tests properly --- examples/registries/k8s/k8s.hcl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/registries/k8s/k8s.hcl b/examples/registries/k8s/k8s.hcl index 4088944d..d9f413fc 100644 --- a/examples/registries/k8s/k8s.hcl +++ b/examples/registries/k8s/k8s.hcl @@ -10,7 +10,7 @@ resource "k8s_cluster" "k3s" { // add configuration to allow cache bypass and insecure registry config { docker { - no_proxy = ["insecure.container.local.jumpd.in"] + no_proxy = ["insecure.container.local.jmpd.in"] insecure_registries = ["insecure.container.local.jmpd.in:5003"] } }