Skip to content

Commit

Permalink
rename suggestedValue to proposedValue (#473)
Browse files Browse the repository at this point in the history
To be consistent with the KRM function spec
  • Loading branch information
Mengqi Yu committed Dec 3, 2021
1 parent 49b02e8 commit 9bdbadb
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 15 deletions.
16 changes: 8 additions & 8 deletions ts/kpt-functions/src/io_test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -504,7 +504,7 @@ items:
field: {
path: 'foo',
currentValue: { a: 3 },
suggestedValue: { a: 4 },
proposedValue: { a: 4 },
},
});

Expand All @@ -522,7 +522,7 @@ results:
path: foo
currentValue:
a: 3
suggestedValue:
proposedValue:
a: 4
`);
});
Expand All @@ -535,7 +535,7 @@ results:
field: {
path: 'foo',
currentValue: [3],
suggestedValue: [4],
proposedValue: [4],
},
});

Expand All @@ -553,7 +553,7 @@ results:
path: foo
currentValue:
- 3
suggestedValue:
proposedValue:
- 4
`);
});
Expand All @@ -568,7 +568,7 @@ results:
// tslint:disable-next-line:no-null-keyword
currentValue: null,
// tslint:disable-next-line:no-null-keyword
suggestedValue: null,
proposedValue: null,
},
});

Expand All @@ -585,7 +585,7 @@ results:
field:
path: foo
currentValue: null
suggestedValue: null
proposedValue: null
`);
});
});
Expand Down Expand Up @@ -710,7 +710,7 @@ describe('roundtrip', () => {
path: 'spec.array',
// Note: we re-use objects from the input to trigger YAML refs to normally be created
currentValue: foo.spec.array as unknown as JsonArray,
suggestedValue: foo.spec.array.concat([
proposedValue: foo.spec.array.concat([
{ baz: 3 },
]) as unknown as JsonArray,
})
Expand Down Expand Up @@ -744,7 +744,7 @@ results:
path: spec.array
currentValue:
- baz: 1
suggestedValue:
proposedValue:
- baz: 1
- baz: 3
`);
Expand Down
12 changes: 6 additions & 6 deletions ts/kpt-functions/src/result_test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ describe('Results', () => {
const e = kubernetesObjectResult('hello', someObject, {
path: 'x.y.z[0]',
currentValue: 1,
suggestedValue: 2,
proposedValue: 2,
});

expect(e).toEqual({
Expand All @@ -158,7 +158,7 @@ describe('Results', () => {
namespace: 'bar',
},
file: { path: undefined, index: undefined },
field: { path: 'x.y.z[0]', currentValue: 1, suggestedValue: 2 },
field: { path: 'x.y.z[0]', currentValue: 1, proposedValue: 2 },
});
});

Expand All @@ -169,7 +169,7 @@ describe('Results', () => {
w: 0,
v: false,
},
suggestedValue: {
proposedValue: {
w: 1,
v: 'hi',
},
Expand All @@ -193,7 +193,7 @@ describe('Results', () => {
w: 0,
v: false,
},
suggestedValue: {
proposedValue: {
w: 1,
v: 'hi',
},
Expand All @@ -205,7 +205,7 @@ describe('Results', () => {
const e = kubernetesObjectResult('hello', someObject, {
path: 'x.y.z[0]',
currentValue: [1, 'true', false],
suggestedValue: [1, true, 'false'],
proposedValue: [1, true, 'false'],
});

expect(e).toEqual({
Expand All @@ -223,7 +223,7 @@ describe('Results', () => {
field: {
path: 'x.y.z[0]',
currentValue: [1, 'true', false],
suggestedValue: [1, true, 'false'],
proposedValue: [1, true, 'false'],
},
});
});
Expand Down
2 changes: 1 addition & 1 deletion ts/kpt-functions/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -454,7 +454,7 @@ export interface FieldInfo {
// Current value of the field.
currentValue?: Json;
// Proposed value to fix the issue.
suggestedValue?: Json;
proposedValue?: Json;
}

function resultToString(result: Result): string {
Expand Down

0 comments on commit 9bdbadb

Please sign in to comment.