Skip to content

Commit

Permalink
[kubernetes]: make kubernetes maintenance_policy day case insensitive (
Browse files Browse the repository at this point in the history
  • Loading branch information
loosla authored Jan 9, 2025
1 parent f5b8e97 commit 2152b89
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion kubernetes.go
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,7 @@ var (

// KubernetesMaintenanceToDay returns the appropriate KubernetesMaintenancePolicyDay for the given string.
func KubernetesMaintenanceToDay(day string) (KubernetesMaintenancePolicyDay, error) {
d, ok := toDay[day]
d, ok := toDay[strings.ToLower(day)]
if !ok {
return 0, fmt.Errorf("unknown day: %q", day)
}
Expand Down
10 changes: 5 additions & 5 deletions kubernetes_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -351,7 +351,7 @@ func TestKubernetesClusters_Get(t *testing.T) {
],
"maintenance_policy": {
"start_time": "00:00",
"day": "monday"
"day": "Monday"
},
"created_at": "2018-06-15T07:10:23Z",
"updated_at": "2018-06-15T07:11:26Z"
Expand Down Expand Up @@ -633,7 +633,7 @@ func TestKubernetesClusters_Create(t *testing.T) {
],
"maintenance_policy": {
"start_time": "00:00",
"day": "monday"
"day": "Monday"
},
"control_plane_firewall": {
"enabled": true,
Expand Down Expand Up @@ -743,7 +743,7 @@ func TestKubernetesClusters_Create_AutoScalePool(t *testing.T) {
],
"maintenance_policy": {
"start_time": "00:00",
"day": "monday"
"day": "Monday"
}
}
}`
Expand Down Expand Up @@ -851,7 +851,7 @@ func TestKubernetesClusters_Update(t *testing.T) {
],
"maintenance_policy": {
"start_time": "00:00",
"day": "monday"
"day": "Monday"
},
"control_plane_firewall": {
"enabled": true,
Expand Down Expand Up @@ -944,7 +944,7 @@ func TestKubernetesClusters_Update_FalseAutoUpgrade(t *testing.T) {
],
"maintenance_policy": {
"start_time": "00:00",
"day": "monday"
"day": "Monday"
}
}
}`
Expand Down

0 comments on commit 2152b89

Please sign in to comment.