Skip to content

Commit

Permalink
plugins/ism: add omitempty to Conditions fiels in Trasistion struct
Browse files Browse the repository at this point in the history
Signed-off-by: Jakob Hahn <jakob.hahn@hetzner.com>
  • Loading branch information
Jakob3xD committed Aug 30, 2024
1 parent 10f5b50 commit 63f044d
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 3 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
### Added

### Changed
- Adjust ISM Transition to omitempty Conditions field ([#609](https://github.com/opensearch-project/opensearch-go/pull/609))

### Deprecated

Expand Down
2 changes: 1 addition & 1 deletion plugins/ism/api_policies.go
Original file line number Diff line number Diff line change
Expand Up @@ -264,5 +264,5 @@ type PolicyStateTransitionConditionCron struct {
// PolicyStateTransition is a sub type of PolicyState containing information about transition to other states
type PolicyStateTransition struct {
StateName string `json:"state_name"`
Conditions *PolicyStateTransitionCondition `json:"conditions"`
Conditions *PolicyStateTransitionCondition `json:"conditions,omitempty"`
}
17 changes: 15 additions & 2 deletions plugins/ism/api_policies_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,16 +69,29 @@ func TestPoliciesClient(t *testing.T) {
Source: "The index {{ctx.index}} failed during policy execution.",
},
},
DefaultState: "test",
DefaultState: "transition",
States: []ism.PolicyState{
ism.PolicyState{
Name: "test",
Name: "delete",
Actions: []ism.PolicyStateAction{
ism.PolicyStateAction{
Delete: &ism.PolicyStateDelete{},
},
},
},
ism.PolicyState{
Name: "transition",
Actions: []ism.PolicyStateAction{
ism.PolicyStateAction{
Close: &ism.PolicyStateClose{},
},
Transitions: &[]ism.PolicyStateTransition{

Check failure on line 88 in plugins/ism/api_policies_test.go

View workflow job for this annotation

GitHub Actions / integ-test-compat (false, 2.3.0)

undefined: Transitions

Check failure on line 88 in plugins/ism/api_policies_test.go

View workflow job for this annotation

GitHub Actions / integ-test-compat (false, 2.3.0)

cannot use &[]ism.PolicyStateTransition{…} (value of type *[]ism.PolicyStateTransition) as ism.PolicyStateAction value in array or slice literal

Check failure on line 88 in plugins/ism/api_policies_test.go

View workflow job for this annotation

GitHub Actions / integ-test-compat (false, 2.1.0)

undefined: Transitions

Check failure on line 88 in plugins/ism/api_policies_test.go

View workflow job for this annotation

GitHub Actions / integ-test-compat (false, 2.1.0)

cannot use &[]ism.PolicyStateTransition{…} (value of type *[]ism.PolicyStateTransition) as ism.PolicyStateAction value in array or slice literal

Check failure on line 88 in plugins/ism/api_policies_test.go

View workflow job for this annotation

GitHub Actions / integ-test-compat (false, 2.0.1)

undefined: Transitions

Check failure on line 88 in plugins/ism/api_policies_test.go

View workflow job for this annotation

GitHub Actions / integ-test-compat (false, 2.0.1)

cannot use &[]ism.PolicyStateTransition{…} (value of type *[]ism.PolicyStateTransition) as ism.PolicyStateAction value in array or slice literal

Check failure on line 88 in plugins/ism/api_policies_test.go

View workflow job for this annotation

GitHub Actions / integ-test-compat (false, 2.4.1)

undefined: Transitions

Check failure on line 88 in plugins/ism/api_policies_test.go

View workflow job for this annotation

GitHub Actions / integ-test-compat (false, 2.4.1)

cannot use &[]ism.PolicyStateTransition{…} (value of type *[]ism.PolicyStateTransition) as ism.PolicyStateAction value in array or slice literal

Check failure on line 88 in plugins/ism/api_policies_test.go

View workflow job for this annotation

GitHub Actions / integ-test-compat (false, 1.3.18)

undefined: Transitions

Check failure on line 88 in plugins/ism/api_policies_test.go

View workflow job for this annotation

GitHub Actions / integ-test-compat (false, 1.3.18)

cannot use &[]ism.PolicyStateTransition{…} (value of type *[]ism.PolicyStateTransition) as ism.PolicyStateAction value in array or slice literal

Check failure on line 88 in plugins/ism/api_policies_test.go

View workflow job for this annotation

GitHub Actions / integ-test-compat (false, 2.14.0)

undefined: Transitions

Check failure on line 88 in plugins/ism/api_policies_test.go

View workflow job for this annotation

GitHub Actions / integ-test-compat (false, 2.14.0)

cannot use &[]ism.PolicyStateTransition{…} (value of type *[]ism.PolicyStateTransition) as ism.PolicyStateAction value in array or slice literal

Check failure on line 88 in plugins/ism/api_policies_test.go

View workflow job for this annotation

GitHub Actions / integ-test-compat (false, 2.11.1)

undefined: Transitions

Check failure on line 88 in plugins/ism/api_policies_test.go

View workflow job for this annotation

GitHub Actions / integ-test-compat (false, 2.11.1)

cannot use &[]ism.PolicyStateTransition{…} (value of type *[]ism.PolicyStateTransition) as ism.PolicyStateAction value in array or slice literal

Check failure on line 88 in plugins/ism/api_policies_test.go

View workflow job for this annotation

GitHub Actions / integ-test-compat (false, 2.12.0)

undefined: Transitions

Check failure on line 88 in plugins/ism/api_policies_test.go

View workflow job for this annotation

GitHub Actions / integ-test-compat (false, 2.12.0)

cannot use &[]ism.PolicyStateTransition{…} (value of type *[]ism.PolicyStateTransition) as ism.PolicyStateAction value in array or slice literal

Check failure on line 88 in plugins/ism/api_policies_test.go

View workflow job for this annotation

GitHub Actions / integ-test-compat (false, 2.10.0)

undefined: Transitions

Check failure on line 88 in plugins/ism/api_policies_test.go

View workflow job for this annotation

GitHub Actions / integ-test-compat (false, 2.10.0)

cannot use &[]ism.PolicyStateTransition{…} (value of type *[]ism.PolicyStateTransition) as ism.PolicyStateAction value in array or slice literal

Check failure on line 88 in plugins/ism/api_policies_test.go

View workflow job for this annotation

GitHub Actions / integ-test-compat (false, 2.2.1)

undefined: Transitions

Check failure on line 88 in plugins/ism/api_policies_test.go

View workflow job for this annotation

GitHub Actions / integ-test-compat (false, 2.2.1)

cannot use &[]ism.PolicyStateTransition{…} (value of type *[]ism.PolicyStateTransition) as ism.PolicyStateAction value in array or slice literal

Check failure on line 88 in plugins/ism/api_policies_test.go

View workflow job for this annotation

GitHub Actions / Tests

undefined: Transitions

Check failure on line 88 in plugins/ism/api_policies_test.go

View workflow job for this annotation

GitHub Actions / Tests

cannot use &[]ism.PolicyStateTransition{…} (value of type *[]ism.PolicyStateTransition) as ism.PolicyStateAction value in array or slice literal

Check failure on line 88 in plugins/ism/api_policies_test.go

View workflow job for this annotation

GitHub Actions / integ-test-compat (false, 2.13.0)

undefined: Transitions

Check failure on line 88 in plugins/ism/api_policies_test.go

View workflow job for this annotation

GitHub Actions / integ-test-compat (false, 2.13.0)

cannot use &[]ism.PolicyStateTransition{…} (value of type *[]ism.PolicyStateTransition) as ism.PolicyStateAction value in array or slice literal

Check failure on line 88 in plugins/ism/api_policies_test.go

View workflow job for this annotation

GitHub Actions / integ-test-compat (false, 2.5.0)

undefined: Transitions

Check failure on line 88 in plugins/ism/api_policies_test.go

View workflow job for this annotation

GitHub Actions / integ-test-compat (false, 2.5.0)

cannot use &[]ism.PolicyStateTransition{…} (value of type *[]ism.PolicyStateTransition) as ism.PolicyStateAction value in array or slice literal

Check failure on line 88 in plugins/ism/api_policies_test.go

View workflow job for this annotation

GitHub Actions / integ-test-compat (false, 2.16.0)

undefined: Transitions

Check failure on line 88 in plugins/ism/api_policies_test.go

View workflow job for this annotation

GitHub Actions / integ-test-compat (false, 2.16.0)

cannot use &[]ism.PolicyStateTransition{…} (value of type *[]ism.PolicyStateTransition) as ism.PolicyStateAction value in array or slice literal

Check failure on line 88 in plugins/ism/api_policies_test.go

View workflow job for this annotation

GitHub Actions / Tests against secure cluster

undefined: Transitions

Check failure on line 88 in plugins/ism/api_policies_test.go

View workflow job for this annotation

GitHub Actions / Tests against secure cluster

cannot use &[]ism.PolicyStateTransition{…} (value of type *[]ism.PolicyStateTransition) as ism.PolicyStateAction value in array or slice literal

Check failure on line 88 in plugins/ism/api_policies_test.go

View workflow job for this annotation

GitHub Actions / integ-test-compat (false, 2.8.0)

undefined: Transitions

Check failure on line 88 in plugins/ism/api_policies_test.go

View workflow job for this annotation

GitHub Actions / integ-test-compat (false, 2.8.0)

cannot use &[]ism.PolicyStateTransition{…} (value of type *[]ism.PolicyStateTransition) as ism.PolicyStateAction value in array or slice literal

Check failure on line 88 in plugins/ism/api_policies_test.go

View workflow job for this annotation

GitHub Actions / integ-test-compat (false, 2.6.0)

undefined: Transitions

Check failure on line 88 in plugins/ism/api_policies_test.go

View workflow job for this annotation

GitHub Actions / integ-test-compat (false, 2.6.0)

cannot use &[]ism.PolicyStateTransition{…} (value of type *[]ism.PolicyStateTransition) as ism.PolicyStateAction value in array or slice literal

Check failure on line 88 in plugins/ism/api_policies_test.go

View workflow job for this annotation

GitHub Actions / integ-test-compat (false, 2.7.0)

undefined: Transitions

Check failure on line 88 in plugins/ism/api_policies_test.go

View workflow job for this annotation

GitHub Actions / integ-test-compat (false, 2.7.0)

cannot use &[]ism.PolicyStateTransition{…} (value of type *[]ism.PolicyStateTransition) as ism.PolicyStateAction value in array or slice literal

Check failure on line 88 in plugins/ism/api_policies_test.go

View workflow job for this annotation

GitHub Actions / integ-test-compat (false, 2.9.0)

undefined: Transitions

Check failure on line 88 in plugins/ism/api_policies_test.go

View workflow job for this annotation

GitHub Actions / integ-test-compat (false, 2.9.0)

cannot use &[]ism.PolicyStateTransition{…} (value of type *[]ism.PolicyStateTransition) as ism.PolicyStateAction value in array or slice literal

Check failure on line 88 in plugins/ism/api_policies_test.go

View workflow job for this annotation

GitHub Actions / integ-test-compat (true, 1.3.18)

undefined: Transitions

Check failure on line 88 in plugins/ism/api_policies_test.go

View workflow job for this annotation

GitHub Actions / integ-test-compat (true, 1.3.18)

cannot use &[]ism.PolicyStateTransition{…} (value of type *[]ism.PolicyStateTransition) as ism.PolicyStateAction value in array or slice literal

Check failure on line 88 in plugins/ism/api_policies_test.go

View workflow job for this annotation

GitHub Actions / integ-test-compat (true, 2.0.1)

undefined: Transitions

Check failure on line 88 in plugins/ism/api_policies_test.go

View workflow job for this annotation

GitHub Actions / integ-test-compat (true, 2.0.1)

cannot use &[]ism.PolicyStateTransition{…} (value of type *[]ism.PolicyStateTransition) as ism.PolicyStateAction value in array or slice literal

Check failure on line 88 in plugins/ism/api_policies_test.go

View workflow job for this annotation

GitHub Actions / integ-test-compat (true, 2.1.0)

undefined: Transitions

Check failure on line 88 in plugins/ism/api_policies_test.go

View workflow job for this annotation

GitHub Actions / integ-test-compat (true, 2.1.0)

cannot use &[]ism.PolicyStateTransition{…} (value of type *[]ism.PolicyStateTransition) as ism.PolicyStateAction value in array or slice literal

Check failure on line 88 in plugins/ism/api_policies_test.go

View workflow job for this annotation

GitHub Actions / integ-test-compat (true, 2.2.1)

undefined: Transitions

Check failure on line 88 in plugins/ism/api_policies_test.go

View workflow job for this annotation

GitHub Actions / integ-test-compat (true, 2.2.1)

cannot use &[]ism.PolicyStateTransition{…} (value of type *[]ism.PolicyStateTransition) as ism.PolicyStateAction value in array or slice literal

Check failure on line 88 in plugins/ism/api_policies_test.go

View workflow job for this annotation

GitHub Actions / integ-test-compat (true, 2.12.0)

undefined: Transitions

Check failure on line 88 in plugins/ism/api_policies_test.go

View workflow job for this annotation

GitHub Actions / integ-test-compat (true, 2.12.0)

cannot use &[]ism.PolicyStateTransition{…} (value of type *[]ism.PolicyStateTransition) as ism.PolicyStateAction value in array or slice literal

Check failure on line 88 in plugins/ism/api_policies_test.go

View workflow job for this annotation

GitHub Actions / integ-test-compat (true, 2.11.1)

undefined: Transitions

Check failure on line 88 in plugins/ism/api_policies_test.go

View workflow job for this annotation

GitHub Actions / integ-test-compat (true, 2.11.1)

cannot use &[]ism.PolicyStateTransition{…} (value of type *[]ism.PolicyStateTransition) as ism.PolicyStateAction value in array or slice literal

Check failure on line 88 in plugins/ism/api_policies_test.go

View workflow job for this annotation

GitHub Actions / integ-test-compat (true, 2.10.0)

undefined: Transitions

Check failure on line 88 in plugins/ism/api_policies_test.go

View workflow job for this annotation

GitHub Actions / integ-test-compat (true, 2.10.0)

cannot use &[]ism.PolicyStateTransition{…} (value of type *[]ism.PolicyStateTransition) as ism.PolicyStateAction value in array or slice literal

Check failure on line 88 in plugins/ism/api_policies_test.go

View workflow job for this annotation

GitHub Actions / integ-test-compat (true, 2.16.0)

undefined: Transitions

Check failure on line 88 in plugins/ism/api_policies_test.go

View workflow job for this annotation

GitHub Actions / integ-test-compat (true, 2.16.0)

cannot use &[]ism.PolicyStateTransition{…} (value of type *[]ism.PolicyStateTransition) as ism.PolicyStateAction value in array or slice literal

Check failure on line 88 in plugins/ism/api_policies_test.go

View workflow job for this annotation

GitHub Actions / integ-test-compat (true, 2.14.0)

undefined: Transitions

Check failure on line 88 in plugins/ism/api_policies_test.go

View workflow job for this annotation

GitHub Actions / integ-test-compat (true, 2.14.0)

cannot use &[]ism.PolicyStateTransition{…} (value of type *[]ism.PolicyStateTransition) as ism.PolicyStateAction value in array or slice literal

Check failure on line 88 in plugins/ism/api_policies_test.go

View workflow job for this annotation

GitHub Actions / integ-test-compat (true, 2.13.0)

undefined: Transitions

Check failure on line 88 in plugins/ism/api_policies_test.go

View workflow job for this annotation

GitHub Actions / integ-test-compat (true, 2.13.0)

cannot use &[]ism.PolicyStateTransition{…} (value of type *[]ism.PolicyStateTransition) as ism.PolicyStateAction value in array or slice literal

Check failure on line 88 in plugins/ism/api_policies_test.go

View workflow job for this annotation

GitHub Actions / integ-test-compat (true, 2.15.0)

undefined: Transitions

Check failure on line 88 in plugins/ism/api_policies_test.go

View workflow job for this annotation

GitHub Actions / integ-test-compat (true, 2.15.0)

cannot use &[]ism.PolicyStateTransition{…} (value of type *[]ism.PolicyStateTransition) as ism.PolicyStateAction value in array or slice literal

Check failure on line 88 in plugins/ism/api_policies_test.go

View workflow job for this annotation

GitHub Actions / integ-test-compat (true, 2.4.1)

undefined: Transitions

Check failure on line 88 in plugins/ism/api_policies_test.go

View workflow job for this annotation

GitHub Actions / integ-test-compat (true, 2.4.1)

cannot use &[]ism.PolicyStateTransition{…} (value of type *[]ism.PolicyStateTransition) as ism.PolicyStateAction value in array or slice literal

Check failure on line 88 in plugins/ism/api_policies_test.go

View workflow job for this annotation

GitHub Actions / integ-test-compat (true, 2.3.0)

undefined: Transitions

Check failure on line 88 in plugins/ism/api_policies_test.go

View workflow job for this annotation

GitHub Actions / integ-test-compat (true, 2.3.0)

cannot use &[]ism.PolicyStateTransition{…} (value of type *[]ism.PolicyStateTransition) as ism.PolicyStateAction value in array or slice literal

Check failure on line 88 in plugins/ism/api_policies_test.go

View workflow job for this annotation

GitHub Actions / integ-test-compat (true, 2.6.0)

undefined: Transitions

Check failure on line 88 in plugins/ism/api_policies_test.go

View workflow job for this annotation

GitHub Actions / integ-test-compat (true, 2.6.0)

cannot use &[]ism.PolicyStateTransition{…} (value of type *[]ism.PolicyStateTransition) as ism.PolicyStateAction value in array or slice literal

Check failure on line 88 in plugins/ism/api_policies_test.go

View workflow job for this annotation

GitHub Actions / integ-test-compat (true, 2.7.0)

undefined: Transitions

Check failure on line 88 in plugins/ism/api_policies_test.go

View workflow job for this annotation

GitHub Actions / integ-test-compat (true, 2.7.0)

cannot use &[]ism.PolicyStateTransition{…} (value of type *[]ism.PolicyStateTransition) as ism.PolicyStateAction value in array or slice literal

Check failure on line 88 in plugins/ism/api_policies_test.go

View workflow job for this annotation

GitHub Actions / integ-test-compat (true, 2.5.0)

undefined: Transitions

Check failure on line 88 in plugins/ism/api_policies_test.go

View workflow job for this annotation

GitHub Actions / integ-test-compat (true, 2.5.0)

cannot use &[]ism.PolicyStateTransition{…} (value of type *[]ism.PolicyStateTransition) as ism.PolicyStateAction value in array or slice literal

Check failure on line 88 in plugins/ism/api_policies_test.go

View workflow job for this annotation

GitHub Actions / integ-test-compat (true, 2.8.0)

undefined: Transitions

Check failure on line 88 in plugins/ism/api_policies_test.go

View workflow job for this annotation

GitHub Actions / integ-test-compat (true, 2.8.0)

cannot use &[]ism.PolicyStateTransition{…} (value of type *[]ism.PolicyStateTransition) as ism.PolicyStateAction value in array or slice literal

Check failure on line 88 in plugins/ism/api_policies_test.go

View workflow job for this annotation

GitHub Actions / integ-test-compat (true, 2.9.0)

undefined: Transitions

Check failure on line 88 in plugins/ism/api_policies_test.go

View workflow job for this annotation

GitHub Actions / integ-test-compat (true, 2.9.0)

cannot use &[]ism.PolicyStateTransition{…} (value of type *[]ism.PolicyStateTransition) as ism.PolicyStateAction value in array or slice literal
ism.PolicyStateTransition{
StateName: "delete",
},
},
},
},
},
Template: []ism.Template{
ism.Template{
Expand Down

0 comments on commit 63f044d

Please sign in to comment.