Skip to content

Commit b6853bd

Browse files
committed
fix: wrong nested field setting
1 parent b4c9911 commit b6853bd

File tree

5 files changed

+14
-69
lines changed

5 files changed

+14
-69
lines changed

.github/workflows/e2e.yml

+1-65
Original file line numberDiff line numberDiff line change
@@ -5,70 +5,6 @@ on:
55
branches: [master, main]
66

77
jobs:
8-
Karina:
9-
runs-on: ubuntu-latest
10-
env:
11-
FILE_CHANGES_TO_CORE_ARTIFACTS: true
12-
strategy:
13-
fail-fast: false
14-
matrix:
15-
k8s:
16-
- v1.18.6
17-
suite:
18-
- minimal
19-
steps:
20-
- uses: actions/checkout@v2
21-
with:
22-
path: kommons
23-
24-
- uses: actions/checkout@v2
25-
with:
26-
#Using Main branch of Karina Repository
27-
repository: flanksource/karina
28-
path: karina
29-
30-
- uses: actions/setup-go@v2
31-
with:
32-
go-version: "1.18" # The Go version to download (if necessary) and use.
33-
34-
- run: go version
35-
36-
- name: replace Module
37-
run: |
38-
cd karina
39-
module=$(cat go.mod | grep github.com/flanksource/kommons | awk '{print $2}')
40-
go mod edit -replace github.com/flanksource/kommons@$module=$GITHUB_WORKSPACE/kommons
41-
cat go.mod
42-
go mod tidy
43-
44-
- name: Test Make Linux
45-
working-directory: ./karina
46-
run: make linux
47-
48-
- name: Run e2e testing script
49-
id: e2e
50-
working-directory: ./karina
51-
env:
52-
SUITE: ${{ matrix.suite }}
53-
KUBERNETES_VERSION: ${{matrix.k8s}}
54-
BUILD: test (${{matrix.k8s}}, ${{ matrix.suite }})
55-
ADDITIONAL_CONFIG: -c test/hosted-tests.yaml
56-
run: ./test/test.sh
57-
58-
- name: Upload test results
59-
uses: actions/upload-artifact@v2
60-
with:
61-
if-no-files-found: ignore
62-
name: test-results-${{matrix.k8s}}-${{matrix.suite}}
63-
path: test-results/
64-
65-
- name: Upload snapshots
66-
uses: actions/upload-artifact@v2
67-
with:
68-
if-no-files-found: ignore
69-
name: snapshot-${{matrix.k8s}}-${{matrix.suite}}
70-
path: artifacts/snapshot.zip
71-
728
canary-checker:
739
runs-on: ubuntu-latest
7410
steps:
@@ -84,7 +20,7 @@ jobs:
8420

8521
- uses: actions/setup-go@v4
8622
with:
87-
go-version: 1.20.x
23+
go-version: 1.22.x
8824

8925
- name: replace Module
9026
run: |

.github/workflows/test.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ jobs:
1010
matrix:
1111
platform: [ubuntu-latest]
1212
go-version:
13-
- 1.20.x
13+
- 1.22.x
1414
runs-on: ${{ matrix.platform }}
1515
steps:
1616
- name: Install Go
@@ -22,4 +22,4 @@ jobs:
2222
- name: Test
2323
run: make test
2424
env:
25-
ASSUME_NO_MOVING_GC_UNSAFE_RISK_IT_WITH: go1.20
25+
ASSUME_NO_MOVING_GC_UNSAFE_RISK_IT_WITH: go1.20

defaults.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -295,7 +295,7 @@ func Defaults(obj *unstructured.Unstructured) (*unstructured.Unstructured, error
295295
return nil, nil
296296
}
297297
if _, found, _ := unstructured.NestedString(obj.Object, "metadata", "creationTimestamp"); !found {
298-
unstructured.SetNestedField(obj.Object, "metadata", "creationTimestamp", "nil")
298+
unstructured.SetNestedField(obj.Object, nil, "metadata", "creationTimestamp")
299299
}
300300
if IsDeployment(obj) {
301301
deploy, err := AsDeployment(obj)

go.mod

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
module github.com/flanksource/kommons
22

3-
go 1.20
3+
go 1.22.5
4+
5+
toolchain go1.23.0
46

57
require (
68
github.com/AlekSi/pointer v1.1.0

go.sum

+7
Original file line numberDiff line numberDiff line change
@@ -662,6 +662,7 @@ github.com/aws/aws-sdk-go v1.44.234/go.mod h1:aVsgQcEevwlmQ7qHE9I3h+dtQgpqhFB+i8
662662
github.com/benbjohnson/clock v1.0.3/go.mod h1:bGMdMPoPVvcYyt1gHDf4J2KE153Yf9BuiUKYMaxlTDM=
663663
github.com/benbjohnson/clock v1.1.0/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA=
664664
github.com/benbjohnson/clock v1.3.0 h1:ip6w0uFQkncKQ979AypyG0ER7mqUSBdKLOgAle/AT8A=
665+
github.com/benbjohnson/clock v1.3.0/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA=
665666
github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q=
666667
github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8=
667668
github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw=
@@ -805,6 +806,7 @@ github.com/go-pdf/fpdf v0.6.0/go.mod h1:HzcnA+A23uwogo0tp9yU+l3V+KXhiESpt1PMayhO
805806
github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY=
806807
github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0/go.mod h1:fyg7847qk6SyHyPtNmDHnmrv/HOrqktSC+C9fM+CJOE=
807808
github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572 h1:tfuBGBXKqDEevZMzYi5KSi8KkcZtzBcTgAUUtapy0OI=
809+
github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572/go.mod h1:9Pwr4B2jHnOSGXyyzV8ROjYa2ojvAY6HCGYYfMoC3Ls=
808810
github.com/gobwas/glob v0.2.3 h1:A4xDbljILXROh+kObIiy5kIaPYD8e96x1tgBhUI5J+Y=
809811
github.com/gobwas/glob v0.2.3/go.mod h1:d3Ez4x06l9bZtSvzIay5+Yzi0fmZzPgnTbPcKjJAkT8=
810812
github.com/goccy/go-json v0.9.11/go.mod h1:6MelG93GURQebXPDq3khkgXZkazVtN9CRI+MGFi0w8I=
@@ -910,6 +912,7 @@ github.com/google/pprof v0.0.0-20210601050228-01bbb1931b22/go.mod h1:kpwsk12EmLe
910912
github.com/google/pprof v0.0.0-20210609004039-a478d1d731e9/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE=
911913
github.com/google/pprof v0.0.0-20210720184732-4bb14d4b1be1/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE=
912914
github.com/google/pprof v0.0.0-20230111200839-76d1ae5aea2b h1:8htHrh2bw9c7Idkb7YNac+ZpTqLMjRpI+FWu51ltaQc=
915+
github.com/google/pprof v0.0.0-20230111200839-76d1ae5aea2b/go.mod h1:dDKJzRmX4S37WGHujM7tX//fmj1uioxKzKxz3lo4HJo=
913916
github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI=
914917
github.com/google/s2a-go v0.1.4 h1:1kZ/sQM3srePvKs3tXAvQzo66XfcReoqFpIpIccE7Oc=
915918
github.com/google/s2a-go v0.1.4/go.mod h1:Ej+mSEMGRnqRzjc7VtF+jdBwYG5fuJfiZ8ELkjEwM0A=
@@ -1125,6 +1128,7 @@ github.com/onsi/ginkgo/v2 v2.1.6/go.mod h1:MEH45j8TBi6u9BMogfbp0stKC5cdGjumZj5Y7
11251128
github.com/onsi/ginkgo/v2 v2.3.0/go.mod h1:Eew0uilEqZmIEZr8JrvYlvOM7Rr6xzTmMV8AyFNU9d0=
11261129
github.com/onsi/ginkgo/v2 v2.4.0/go.mod h1:iHkDK1fKGcBoEHT5W7YBq4RFWaQulw+caOMkAt4OrFo=
11271130
github.com/onsi/ginkgo/v2 v2.9.4 h1:xR7vG4IXt5RWx6FfIjyAtsoMAtnc3C/rFXBBd2AjZwE=
1131+
github.com/onsi/ginkgo/v2 v2.9.4/go.mod h1:gCQYp2Q+kSoIj7ykSVb9nskRSsR6PUj4AiLywzIhbKM=
11281132
github.com/onsi/gomega v0.0.0-20170829124025-dcabb60a477c/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5uiA=
11291133
github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY=
11301134
github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo=
@@ -1135,6 +1139,7 @@ github.com/onsi/gomega v1.21.1/go.mod h1:iYAIXgPSaDHak0LCMA+AWBpIKBr8WZicMxnE8lu
11351139
github.com/onsi/gomega v1.22.1/go.mod h1:x6n7VNe4hw0vkyYUM4mjIXx3JbLiPaBPNgB7PRQ1tuM=
11361140
github.com/onsi/gomega v1.23.0/go.mod h1:Z/NWtiqwBrwUt4/2loMmHL63EDLnYHmVbuBpDr2vQAg=
11371141
github.com/onsi/gomega v1.27.6 h1:ENqfyGeS5AX/rlXDd/ETokDz93u0YufY1Pgxuy/PvWE=
1142+
github.com/onsi/gomega v1.27.6/go.mod h1:PIQNjfQwkP3aQAH7lf7j87O/5FiNr+ZR8+ipb+qQlhg=
11381143
github.com/opentracing/opentracing-go v1.1.0/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o=
11391144
github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc=
11401145
github.com/pascaldekloe/goe v0.1.0/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc=
@@ -1319,6 +1324,7 @@ go.uber.org/atomic v1.10.0 h1:9qC72Qh0+3MqyJbAn8YU5xVq1frD8bn3JtD2oXtafVQ=
13191324
go.uber.org/atomic v1.10.0/go.mod h1:LUxbIzbOniOlMKjJjyPfpl4v+PKK2cNJn91OQbhoJI0=
13201325
go.uber.org/goleak v1.1.10/go.mod h1:8a7PlsEVH3e/a/GLqe5IIrQx6GzcnRmZEufDUTk4A7A=
13211326
go.uber.org/goleak v1.2.0 h1:xqgm/S+aQvhWFTtR0XK3Jvg7z8kGV8P4X14IzwN3Eqk=
1327+
go.uber.org/goleak v1.2.0/go.mod h1:XJYK+MuIchqpmGmUSAzotztawfKvYLUIgg7guXrwVUo=
13221328
go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0=
13231329
go.uber.org/multierr v1.6.0/go.mod h1:cdWPpRnG4AhwMwsgIHip0KRBQjJy5kYEpYjJxpXp9iU=
13241330
go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0=
@@ -1754,6 +1760,7 @@ golang.org/x/tools v0.3.0/go.mod h1:/rWhSS2+zyEVwoJf8YAX6L2f0ntZ7Kn/mGgAWcipA5k=
17541760
golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU=
17551761
golang.org/x/tools v0.7.0/go.mod h1:4pg6aUX35JBAogB10C9AtvVL+qowtN4pT3CGSQex14s=
17561762
golang.org/x/tools v0.8.0 h1:vSDcovVPld282ceKgDimkRSC8kpaH1dgyc9UMzlt84Y=
1763+
golang.org/x/tools v0.8.0/go.mod h1:JxBZ99ISMI5ViVkT1tr6tdNmXeTrcpVSD3vZ1RsRdN4=
17571764
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
17581765
golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
17591766
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=

0 commit comments

Comments
 (0)