Skip to content
This repository was archived by the owner on Mar 16, 2024. It is now read-only.

Commit 3016953

Browse files
authored
Merge pull request #1933 from njhale/chore/bump-z
Bump z
2 parents 474682e + a3eaed4 commit 3016953

File tree

24 files changed

+92
-92
lines changed

24 files changed

+92
-92
lines changed

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ require (
1717
github.com/acorn-io/baaah v0.0.0-20230707151126-5d519d272865
1818
github.com/acorn-io/mink v0.0.0-20230523184405-ceaaa366d500
1919
github.com/acorn-io/namegenerator v0.0.0-20220915160418-9e3d5a0ffe78
20-
github.com/acorn-io/z v0.0.0-20230710161405-78afed0850a8
20+
github.com/acorn-io/z v0.0.0-20230714155009-a770ecbbdc45
2121
github.com/adrg/xdg v0.4.0
2222
github.com/aws/aws-sdk-go-v2 v1.18.0
2323
github.com/aws/aws-sdk-go-v2/config v1.18.23

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,8 +102,8 @@ github.com/acorn-io/namegenerator v0.0.0-20220915160418-9e3d5a0ffe78 h1:5zs9L/CX
102102
github.com/acorn-io/namegenerator v0.0.0-20220915160418-9e3d5a0ffe78/go.mod h1:/5647+1/L7m7Aq7upTLtfLznTLYttURzH7Y23LKrW0M=
103103
github.com/acorn-io/wrangler v0.0.0-20230619194218-746dc7cf6a0c h1:4k4uuDw+PT3neNLCALme0hGe67XjoR/0cUXnxaT5d+g=
104104
github.com/acorn-io/wrangler v0.0.0-20230619194218-746dc7cf6a0c/go.mod h1:D6Tu6oVX8aGtCHsMCtYaysgVK3ad920MTSeAu7rzb5U=
105-
github.com/acorn-io/z v0.0.0-20230710161405-78afed0850a8 h1:E8/GtUHuIBRNLXv/uHwjjZqQg2B6BDCU5RXQA/OgDCQ=
106-
github.com/acorn-io/z v0.0.0-20230710161405-78afed0850a8/go.mod h1:5UO0+eOne2Zhvn7Ox5IiK4u+4dlCSLmHfTQWORRdEyo=
105+
github.com/acorn-io/z v0.0.0-20230714155009-a770ecbbdc45 h1:+od+ijNLAt+tc33uZa71qkE4eyvubts45thVXz8J7DU=
106+
github.com/acorn-io/z v0.0.0-20230714155009-a770ecbbdc45/go.mod h1:5UO0+eOne2Zhvn7Ox5IiK4u+4dlCSLmHfTQWORRdEyo=
107107
github.com/adrg/xdg v0.4.0 h1:RzRqFcjH4nE5C6oTAxhBtoE2IRyjBSa62SCbyPidvls=
108108
github.com/adrg/xdg v0.4.0/go.mod h1:N6ag73EX4wyxeaoeHctc1mas01KZgsj5tYiAIwqJE/E=
109109
github.com/agnivade/levenshtein v1.1.1 h1:QY8M92nrzkmr798gCo3kmMyqXFzdQVpxLlGPRBij0P8=

integration/client/apps/apps_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -509,7 +509,7 @@ func TestAppRunImageVariations(t *testing.T) {
509509
name: "autoupgrade",
510510
image: "foo/bar:**",
511511
options: &client.AppRunOptions{
512-
AutoUpgrade: z.P(true),
512+
AutoUpgrade: z.Pointer(true),
513513
},
514514
},
515515
{

integration/run/run_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1661,7 +1661,7 @@ func TestAutoUpgradeImageValidation(t *testing.T) {
16611661

16621662
app, err := c.AppRun(ctx, "ghcr.io/acorn-io/library/nginx:latest", &client.AppRunOptions{
16631663
Name: "myapp",
1664-
AutoUpgrade: z.P(true),
1664+
AutoUpgrade: z.Pointer(true),
16651665
})
16661666
if err != nil {
16671667
t.Fatal(err)
@@ -1697,7 +1697,7 @@ func TestAutoUpgradeLocalImage(t *testing.T) {
16971697

16981698
// Attempt to run an auto-upgrade app with a non-existent local image. Should get an error.
16991699
_, err = c.AppRun(ctx, "mylocalimage", &client.AppRunOptions{
1700-
AutoUpgrade: z.P(true),
1700+
AutoUpgrade: z.Pointer(true),
17011701
})
17021702
if err == nil {
17031703
t.Fatalf("expected to get a not found error, instead got %v", err)
@@ -1724,7 +1724,7 @@ func TestAutoUpgradeLocalImage(t *testing.T) {
17241724
}
17251725

17261726
_, err = c.AppRun(ctx, appImage, &client.AppRunOptions{
1727-
AutoUpgrade: z.P(true),
1727+
AutoUpgrade: z.Pointer(true),
17281728
})
17291729
if err != nil {
17301730
t.Fatal(err)

pkg/apis/internal.acorn.io/v1/memory_test.go

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -24,29 +24,29 @@ func TestValidateMemory(t *testing.T) {
2424
specMemory: MemoryMap{},
2525
container: Container{},
2626
containerName: "onecontainer",
27-
specMemDefault: z.P(100 * Mi),
27+
specMemDefault: z.Pointer(100 * Mi),
2828
specMemMaximum: new(int64),
29-
want: z.P(100 * Mi),
29+
want: z.Pointer(100 * Mi),
3030
err: nil,
3131
},
3232
{
3333
name: "successful with setting from user",
34-
specMemory: MemoryMap{"onecontainer": z.P(512 * Mi)},
34+
specMemory: MemoryMap{"onecontainer": z.Pointer(512 * Mi)},
3535
container: Container{},
3636
containerName: "onecontainer",
3737
specMemDefault: new(int64),
3838
specMemMaximum: new(int64),
39-
want: z.P(512 * Mi),
39+
want: z.Pointer(512 * Mi),
4040
err: nil,
4141
},
4242
{
4343
name: "successful with setting from Acornfile",
4444
specMemory: MemoryMap{},
45-
container: Container{Memory: z.P(512 * Mi)},
45+
container: Container{Memory: z.Pointer(512 * Mi)},
4646
containerName: "onecontainer",
4747
specMemDefault: new(int64),
4848
specMemMaximum: new(int64),
49-
want: z.P(512 * Mi),
49+
want: z.Pointer(512 * Mi),
5050
err: nil,
5151
},
5252
{
@@ -55,9 +55,9 @@ func TestValidateMemory(t *testing.T) {
5555
specMemory: MemoryMap{"onecontainer": new(int64)},
5656
container: Container{},
5757
containerName: "onecontainer",
58-
specMemDefault: z.P(512 * Mi),
59-
specMemMaximum: z.P(512 * Mi),
60-
want: z.P(512 * Mi),
58+
specMemDefault: z.Pointer(512 * Mi),
59+
specMemMaximum: z.Pointer(512 * Mi),
60+
want: z.Pointer(512 * Mi),
6161
err: nil,
6262
},
6363
{
@@ -66,9 +66,9 @@ func TestValidateMemory(t *testing.T) {
6666
specMemory: MemoryMap{},
6767
container: Container{Memory: new(int64)},
6868
containerName: "onecontainer",
69-
specMemDefault: z.P(512 * Mi),
70-
specMemMaximum: z.P(512 * Mi),
71-
want: z.P(512 * Mi),
69+
specMemDefault: z.Pointer(512 * Mi),
70+
specMemMaximum: z.Pointer(512 * Mi),
71+
want: z.Pointer(512 * Mi),
7272
err: nil,
7373
},
7474
{
@@ -78,37 +78,37 @@ func TestValidateMemory(t *testing.T) {
7878
container: Container{Memory: new(int64)},
7979
containerName: "onecontainer",
8080
specMemDefault: new(int64),
81-
specMemMaximum: z.P(512 * Mi),
82-
want: z.P(512 * Mi),
81+
specMemMaximum: z.Pointer(512 * Mi),
82+
want: z.Pointer(512 * Mi),
8383
err: nil,
8484
},
8585
{
8686
name: "successful overwrite of Acornfile with user setting",
87-
specMemory: MemoryMap{"onecontainer": z.P(512 * Mi)},
88-
container: Container{Memory: z.P(256 * Mi)},
87+
specMemory: MemoryMap{"onecontainer": z.Pointer(512 * Mi)},
88+
container: Container{Memory: z.Pointer(256 * Mi)},
8989
containerName: "onecontainer",
9090
specMemDefault: new(int64),
9191
specMemMaximum: new(int64),
92-
want: z.P(512 * Mi),
92+
want: z.Pointer(512 * Mi),
9393
err: nil,
9494
},
9595
{
9696
name: "failure from user setting exceeding the maximum memory",
97-
specMemory: MemoryMap{"onecontainer": z.P(512 * Mi)},
97+
specMemory: MemoryMap{"onecontainer": z.Pointer(512 * Mi)},
9898
container: Container{},
9999
containerName: "onecontainer",
100-
specMemDefault: z.P(128 * Mi),
101-
specMemMaximum: z.P(128 * Mi),
100+
specMemDefault: z.Pointer(128 * Mi),
101+
specMemMaximum: z.Pointer(128 * Mi),
102102
want: nil,
103103
err: ErrInvalidSetMemory,
104104
},
105105
{
106106
name: "failure from Acornfile setting exceeding the maximum memory",
107107
specMemory: MemoryMap{},
108-
container: Container{Memory: z.P(512 * Mi)},
108+
container: Container{Memory: z.Pointer(512 * Mi)},
109109
containerName: "onecontainer",
110-
specMemDefault: z.P(128 * Mi),
111-
specMemMaximum: z.P(128 * Mi),
110+
specMemDefault: z.Pointer(128 * Mi),
111+
specMemMaximum: z.Pointer(128 * Mi),
112112
want: nil,
113113
err: ErrInvalidAcornMemory,
114114
},
@@ -117,8 +117,8 @@ func TestValidateMemory(t *testing.T) {
117117
specMemory: MemoryMap{},
118118
container: Container{},
119119
containerName: "onecontainer",
120-
specMemDefault: z.P(512 * Mi),
121-
specMemMaximum: z.P(128 * Mi),
120+
specMemDefault: z.Pointer(512 * Mi),
121+
specMemMaximum: z.Pointer(128 * Mi),
122122
want: nil,
123123
err: ErrInvalidDefaultMemory,
124124
},

pkg/appdefinition/appdefinition_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1697,7 +1697,7 @@ acorns: first: {
16971697
assert.True(t, *acorn.NotifyUpgrade)
16981698
assert.Equal(t, "20s", acorn.AutoUpgradeInterval)
16991699
assert.Equal(t, v1.MemoryMap{
1700-
"": z.P[int64](1 << 30),
1700+
"": z.Pointer[int64](1 << 30),
17011701
}, acorn.Memory)
17021702
assert.Equal(t, v1.NameValue{
17031703
Name: "a",
@@ -1797,7 +1797,7 @@ acorns: first: {
17971797
Target: "def",
17981798
}, acorn.Links[0])
17991799
assert.Equal(t, v1.MemoryMap{
1800-
"foo": z.P[int64](1 << 30),
1800+
"foo": z.Pointer[int64](1 << 30),
18011801
}, acorn.Memory)
18021802
assert.Equal(t, v1.NameValues{
18031803
{

pkg/autoupgrade/daemon_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ func TestDetermineAppsToRefresh(t *testing.T) {
8282
now := time.Now()
8383
thirtySecondsAgo := now.Add(-30 * time.Second)
8484
oneMinuteAgo := now.Add(-time.Minute)
85-
ptrTrue := z.P(true)
85+
ptrTrue := z.Pointer(true)
8686
appImages := map[string]string{
8787
"test-1": "acorn/test-1:v#.*.**",
8888
"acorn-1": "acorn/acorn-1:v1.1.1-*",
@@ -189,7 +189,7 @@ func TestDetermineAppsToRefresh(t *testing.T) {
189189
func TestRefreshImages(t *testing.T) {
190190
now := time.Now()
191191
thirtySecondsAgo := now.Add(-30 * time.Second)
192-
ptrTrue := z.P(true)
192+
ptrTrue := z.Pointer(true)
193193
appImages := map[string]string{
194194
"test-1": "acorn/test-1:v#.#.#",
195195
"acorn-1": "docker.io/acorn/acorn-1:v1.1.1-*",
@@ -451,7 +451,7 @@ func TestDaemonSync(t *testing.T) {
451451
start := time.Now()
452452
tenMinutesAgo := time.Now().Add(-10 * time.Minute)
453453
fiftySecondsAgo := time.Now().Add(-50 * time.Second)
454-
ptrTrue := z.P(true)
454+
ptrTrue := z.Pointer(true)
455455
appImages := map[string]string{
456456
"test-1": "30s",
457457
"acorn-1": "1m",

pkg/client/app.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -575,7 +575,7 @@ func (c *DefaultClient) appStop(ctx context.Context, name string) error {
575575
return err
576576
}
577577
if app.Spec.Stop == nil || !*app.Spec.Stop {
578-
app.Spec.Stop = z.P(true)
578+
app.Spec.Stop = z.Pointer(true)
579579
return c.Client.Update(ctx, app)
580580
}
581581
return nil

pkg/config/config_test.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,15 +42,15 @@ func TestAcornDNSStates(t *testing.T) {
4242
// acornDNS is explicitly disabled, expect no clusterDomain to be returned
4343
name: "acornDNS disabled expect no clusterdomains",
4444
conf: &apiv1.Config{
45-
AcornDNS: z.P("disabled"),
45+
AcornDNS: z.Pointer("disabled"),
4646
},
4747
expectedClusterDomains: nil,
4848
},
4949
{
5050
// acornDNS is explicitly disabled. User defined domain, expect just user defined domain
5151
name: "acornDNS disabled expect custom clusterdomains",
5252
conf: &apiv1.Config{
53-
AcornDNS: z.P("disabled"),
53+
AcornDNS: z.Pointer("disabled"),
5454
ClusterDomains: []string{".custom.com"},
5555
},
5656
expectedClusterDomains: []string{".custom.com"},
@@ -59,7 +59,7 @@ func TestAcornDNSStates(t *testing.T) {
5959
// acornDNS is in "auto" mode. No user configured domain, expect local as a fallback
6060
name: "acornDNS auto expect local clusterdomain",
6161
conf: &apiv1.Config{
62-
AcornDNS: z.P("auto"),
62+
AcornDNS: z.Pointer("auto"),
6363
},
6464
expectedClusterDomains: []string{".local.oss-acorn.io"},
6565
prepare: func(f *mocks.MockReader) {
@@ -71,7 +71,7 @@ func TestAcornDNSStates(t *testing.T) {
7171
// acornDNS is in "auto" mode, but user configured a domain, expect just the user configured domain
7272
name: "acornDNS auto expect custom clusterdomain",
7373
conf: &apiv1.Config{
74-
AcornDNS: z.P("auto"),
74+
AcornDNS: z.Pointer("auto"),
7575
ClusterDomains: []string{".custom.com"},
7676
},
7777
expectedClusterDomains: []string{".custom.com"},

pkg/controller/appdefinition/deploy.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -646,7 +646,7 @@ func toDeployment(req router.Request, appInstance *v1.AppInstance, tag name.Refe
646646
Affinity: appInstance.Status.Scheduling[name].Affinity,
647647
Tolerations: appInstance.Status.Scheduling[name].Tolerations,
648648
PriorityClassName: appInstance.Status.Scheduling[name].PriorityClassName,
649-
TerminationGracePeriodSeconds: z.P[int64](5),
649+
TerminationGracePeriodSeconds: z.Pointer[int64](5),
650650
ImagePullSecrets: pullSecrets.ForContainer(name, append(containers, initContainers...)),
651651
EnableServiceLinks: new(bool),
652652
Containers: containers,
@@ -659,7 +659,7 @@ func toDeployment(req router.Request, appInstance *v1.AppInstance, tag name.Refe
659659
}
660660

661661
if stateful {
662-
dep.Spec.Replicas = z.P[int32](1)
662+
dep.Spec.Replicas = z.Pointer[int32](1)
663663
dep.Spec.Template.Spec.Hostname = dep.Name
664664
dep.Spec.Strategy.Type = appsv1.RecreateDeploymentStrategyType
665665
} else if dep.Spec.Replicas == nil || *dep.Spec.Replicas == 1 {

0 commit comments

Comments
 (0)