From 8566329acdbddfde72b662aa332cbd39f92bdc65 Mon Sep 17 00:00:00 2001 From: Aaron Lunsford Date: Wed, 31 Jul 2024 15:24:57 -0400 Subject: [PATCH] redo branch from main --- api/v1alpha1/privateloadzone_types.go | 1 + api/v1alpha1/zz_generated.deepcopy.go | 7 +++++++ config/crd/bases/k6.io_privateloadzones.yaml | 16 ++++++++++++++++ pkg/testrun/plz.go | 2 ++ 4 files changed, 26 insertions(+) diff --git a/api/v1alpha1/privateloadzone_types.go b/api/v1alpha1/privateloadzone_types.go index fa033441..d827ba96 100644 --- a/api/v1alpha1/privateloadzone_types.go +++ b/api/v1alpha1/privateloadzone_types.go @@ -34,6 +34,7 @@ import ( type PrivateLoadZoneSpec struct { Token string `json:"token"` Resources corev1.ResourceRequirements `json:"resources"` + Tolerations []corev1.Toleration `json:tolerations` ServiceAccountName string `json:"serviceAccountName,omitempty"` NodeSelector map[string]string `json:"nodeSelector,omitempty"` Image string `json:"image,omitempty"` diff --git a/api/v1alpha1/zz_generated.deepcopy.go b/api/v1alpha1/zz_generated.deepcopy.go index e65a4851..8cae893f 100644 --- a/api/v1alpha1/zz_generated.deepcopy.go +++ b/api/v1alpha1/zz_generated.deepcopy.go @@ -380,6 +380,13 @@ func (in *PrivateLoadZoneList) DeepCopyObject() runtime.Object { func (in *PrivateLoadZoneSpec) DeepCopyInto(out *PrivateLoadZoneSpec) { *out = *in in.Resources.DeepCopyInto(&out.Resources) + if in.Tolerations != nil { + in, out := &in.Tolerations, &out.Tolerations + *out = make([]v1.Toleration, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } if in.NodeSelector != nil { in, out := &in.NodeSelector, &out.NodeSelector *out = make(map[string]string, len(*in)) diff --git a/config/crd/bases/k6.io_privateloadzones.yaml b/config/crd/bases/k6.io_privateloadzones.yaml index 3ce91732..ee08add9 100644 --- a/config/crd/bases/k6.io_privateloadzones.yaml +++ b/config/crd/bases/k6.io_privateloadzones.yaml @@ -71,6 +71,22 @@ spec: x-kubernetes-int-or-string: true type: object type: object + tolerations: + items: + properties: + effect: + type: string + key: + type: string + operator: + type: string + tolerationSeconds: + format: int64 + type: integer + value: + type: string + type: object + type: array serviceAccountName: type: string token: diff --git a/pkg/testrun/plz.go b/pkg/testrun/plz.go index bbe42ef7..95b716dc 100644 --- a/pkg/testrun/plz.go +++ b/pkg/testrun/plz.go @@ -51,6 +51,7 @@ func NewPLZTestRun(plz *v1alpha1.PrivateLoadZone, trData *cloud.TestRunData, ing ServiceAccountName: plz.Spec.ServiceAccountName, NodeSelector: plz.Spec.NodeSelector, Resources: plz.Spec.Resources, + Tolerations: plz.Spec.Tolerations, Volumes: []corev1.Volume{ volume, }, @@ -66,6 +67,7 @@ func NewPLZTestRun(plz *v1alpha1.PrivateLoadZone, trData *cloud.TestRunData, ing ServiceAccountName: plz.Spec.ServiceAccountName, NodeSelector: plz.Spec.NodeSelector, ImagePullSecrets: plz.Spec.ImagePullSecrets, + Tolerations: plz.Spec.Tolerations, }, Script: v1alpha1.K6Script{ LocalFile: "/test/archive.tar",