mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-27 05:27:21 +00:00
cleanup: skip a test validate time_zone letter case in darwin
Signed-off-by: Abirdcfly <fp544037857@gmail.com>
This commit is contained in:
parent
885f14d162
commit
ceceb96f3d
@ -17,6 +17,7 @@ limitations under the License.
|
|||||||
package validation
|
package validation
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"runtime"
|
||||||
"strings"
|
"strings"
|
||||||
"testing"
|
"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": {
|
"spec.timeZone: Invalid value: \" America/New_York\": unknown time zone America/New_York": {
|
||||||
ObjectMeta: metav1.ObjectMeta{
|
ObjectMeta: metav1.ObjectMeta{
|
||||||
Name: "mycronjob",
|
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 {
|
for k, v := range errorCases {
|
||||||
errs := ValidateCronJobCreate(&v, corevalidation.PodValidationOptions{})
|
errs := ValidateCronJobCreate(&v, corevalidation.PodValidationOptions{})
|
||||||
|
Loading…
Reference in New Issue
Block a user