cleanup: skip a test validate time_zone letter case in darwin

Signed-off-by: Abirdcfly <fp544037857@gmail.com>
This commit is contained in:
Abirdcfly 2022-04-01 13:32:50 +08:00
parent 885f14d162
commit ceceb96f3d
No known key found for this signature in database
GPG Key ID: A4EA876831B0458B

View File

@ -17,6 +17,7 @@ limitations under the License.
package validation
import (
"runtime"
"strings"
"testing"
@ -1033,23 +1034,6 @@ func TestValidateCronJob(t *testing.T) {
},
},
},
"spec.timeZone: Invalid value: \"AMERICA/new_york\": unknown time zone AMERICA/new_york": {
ObjectMeta: metav1.ObjectMeta{
Name: "mycronjob",
Namespace: metav1.NamespaceDefault,
UID: types.UID("1a2b3c"),
},
Spec: batch.CronJobSpec{
Schedule: "0 * * * *",
TimeZone: &timeZoneBadCasing,
ConcurrencyPolicy: batch.AllowConcurrent,
JobTemplate: batch.JobTemplateSpec{
Spec: batch.JobSpec{
Template: validPodTemplateSpec,
},
},
},
},
"spec.timeZone: Invalid value: \" America/New_York\": unknown time zone America/New_York": {
ObjectMeta: metav1.ObjectMeta{
Name: "mycronjob",
@ -1348,6 +1332,26 @@ func TestValidateCronJob(t *testing.T) {
},
},
}
if runtime.GOOS != "darwin" {
// Skip this error case on darwin, see https://github.com/golang/go/issues/21512
errorCases["spec.timeZone: Invalid value: \"AMERICA/new_york\": unknown time zone AMERICA/new_york"] = batch.CronJob{
ObjectMeta: metav1.ObjectMeta{
Name: "mycronjob",
Namespace: metav1.NamespaceDefault,
UID: types.UID("1a2b3c"),
},
Spec: batch.CronJobSpec{
Schedule: "0 * * * *",
TimeZone: &timeZoneBadCasing,
ConcurrencyPolicy: batch.AllowConcurrent,
JobTemplate: batch.JobTemplateSpec{
Spec: batch.JobSpec{
Template: validPodTemplateSpec,
},
},
},
}
}
for k, v := range errorCases {
errs := ValidateCronJobCreate(&v, corevalidation.PodValidationOptions{})