cli: ignore VaultToken when generating job diff (#14424)
This commit is contained in:
parent
4b9bcf94da
commit
19de803503
|
@ -0,0 +1,3 @@
|
|||
```release-note:bug
|
||||
cli: Ignore Vault token when generating job diff.
|
||||
```
|
|
@ -69,7 +69,7 @@ func (j *Job) Diff(other *Job, contextual bool) (*JobDiff, error) {
|
|||
diff := &JobDiff{Type: DiffTypeNone}
|
||||
var oldPrimitiveFlat, newPrimitiveFlat map[string]string
|
||||
filter := []string{"ID", "Status", "StatusDescription", "Version", "Stable", "CreateIndex",
|
||||
"ModifyIndex", "JobModifyIndex", "Update", "SubmitTime", "NomadTokenID"}
|
||||
"ModifyIndex", "JobModifyIndex", "Update", "SubmitTime", "NomadTokenID", "VaultToken"}
|
||||
|
||||
if j == nil && other == nil {
|
||||
return diff, nil
|
||||
|
|
|
@ -1176,7 +1176,6 @@ func TestJobDiff(t *testing.T) {
|
|||
},
|
||||
},
|
||||
},
|
||||
|
||||
{
|
||||
// Multiregion: region added
|
||||
Old: &Job{
|
||||
|
@ -1321,6 +1320,21 @@ func TestJobDiff(t *testing.T) {
|
|||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
// VaultToken is filtered
|
||||
Old: &Job{
|
||||
ID: "vault-job",
|
||||
VaultToken: "secret",
|
||||
},
|
||||
New: &Job{
|
||||
ID: "vault-job",
|
||||
VaultToken: "new-secret",
|
||||
},
|
||||
Expected: &JobDiff{
|
||||
Type: DiffTypeNone,
|
||||
ID: "vault-job",
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
for i, c := range cases {
|
||||
|
|
Loading…
Reference in New Issue