Skip to content

Commit 6f4a259

Browse files
committed
make neatPod remove pod.spec.serviceAccount
1 parent 7918350 commit 6f4a259

File tree

3 files changed

+4
-2
lines changed

3 files changed

+4
-2
lines changed

cmd/neat.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,7 @@ func neatPod(in string) (string, error) {
111111
}
112112
}
113113
in, err = sjson.Delete(in, "spec.nodeName")
114+
in, err = sjson.Delete(in, "spec.serviceAccount") //Deprecated: Use serviceAccountName instead
114115
if err != nil {
115116
//
116117
}

cmd/neat_test.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,8 @@ func TestNeatPod(t *testing.T) {
108108
]
109109
}
110110
],
111+
"serviceAccount": "default",
112+
"serviceAccountName": "default",
111113
"volumes": [
112114
{
113115
"name": "default-token-nmshj",
@@ -150,6 +152,7 @@ func TestNeatPod(t *testing.T) {
150152
]
151153
}
152154
],
155+
"serviceAccountName": "default",
153156
"volumes": [
154157
{
155158
"name": "my",
@@ -342,7 +345,6 @@ func TestNeat(t *testing.T) {
342345
}
343346
],
344347
"priority": 0,
345-
"serviceAccount": "default",
346348
"serviceAccountName": "default",
347349
"tolerations": [
348350
{

test/fixtures/pod-1-neat.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
}
2222
],
2323
"priority": 0,
24-
"serviceAccount": "default",
2524
"serviceAccountName": "default",
2625
"tolerations": [
2726
{

0 commit comments

Comments
 (0)