Skip to content

Commit 882be0b

Browse files
committed
Merge branch 'an-exten-task-context' into release-07-07-23
2 parents d50b38c + 843b826 commit 882be0b

14 files changed

+21495
-3165
lines changed

.github/.licenserc.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ header:
1313
- '**/*.json'
1414
- '**/*.log'
1515
- 'vendor/**'
16+
- 'api/vendor/**'
1617
- '**/go.mod'
1718
- '**/go.sum'
1819
- '**/*.crt'

api/v1alpha1/workflow_types.go

Lines changed: 55 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -158,12 +158,63 @@ type Task struct {
158158
// Container is the main container image to run in the pod
159159
Container *corev1.Container `json:"container,omitempty"`
160160

161-
// Volumes is a list of volumes that can be mounted by containers in a template.
162-
// +patchStrategy=merge
161+
// +optional
163162
// +patchMergeKey=name
164-
Volumes []corev1.Volume `json:"volumes,omitempty" patchStrategy:"merge" patchMergeKey:"name"`
163+
// +patchStrategy=merge,retainKeys
164+
Volumes []corev1.Volume `json:"volumes,omitempty" patchStrategy:"merge,retainKeys" patchMergeKey:"name"`
165+
166+
// +optional
167+
TerminationGracePeriodSeconds *int64 `json:"terminationGracePeriodSeconds,omitempty"`
168+
169+
// +optional
170+
ActiveDeadlineSeconds *int64 `json:"activeDeadlineSeconds,omitempty"`
171+
172+
// +optional
173+
// +mapType=atomic
174+
NodeSelector map[string]string `json:"nodeSelector,omitempty"`
175+
176+
// +optional
177+
ServiceAccountName string `json:"serviceAccountName,omitempty"`
178+
179+
// +optional
180+
AutomountServiceAccountToken *bool `json:"automountServiceAccountToken,omitempty"`
181+
182+
// +optional
183+
SecurityContext *corev1.PodSecurityContext `json:"securityContext,omitempty"`
165184

166-
// TODO: maybe we could specify parameters in other ways, like loading context from file
185+
// +optional
186+
// +patchMergeKey=name
187+
// +patchStrategy=merge
188+
ImagePullSecrets []corev1.LocalObjectReference `json:"imagePullSecrets,omitempty" patchStrategy:"merge" patchMergeKey:"name"`
189+
190+
// +optional
191+
Affinity *corev1.Affinity `json:"affinity,omitempty"`
192+
193+
// +optional
194+
Tolerations []corev1.Toleration `json:"tolerations,omitempty"`
195+
196+
// +optional
197+
// +patchMergeKey=topologyKey
198+
// +patchStrategy=merge
199+
// +listType=map
200+
// +listMapKey=topologyKey
201+
// +listMapKey=whenUnsatisfiable
202+
TopologySpreadConstraints []corev1.TopologySpreadConstraint `json:"topologySpreadConstraints,omitempty" patchStrategy:"merge" patchMergeKey:"topologyKey"`
203+
}
204+
205+
func (t *Task) PodSpec() corev1.PodSpec {
206+
return corev1.PodSpec{
207+
Volumes: t.Volumes,
208+
TerminationGracePeriodSeconds: t.TerminationGracePeriodSeconds,
209+
ActiveDeadlineSeconds: t.ActiveDeadlineSeconds,
210+
NodeSelector: t.NodeSelector,
211+
ServiceAccountName: t.ServiceAccountName,
212+
AutomountServiceAccountToken: t.AutomountServiceAccountToken,
213+
SecurityContext: t.SecurityContext,
214+
ImagePullSecrets: t.ImagePullSecrets,
215+
Affinity: t.Affinity,
216+
TopologySpreadConstraints: t.TopologySpreadConstraints,
217+
}
167218
}
168219

169220
// +kubebuilder:object:root=true

api/v1alpha1/zz_generated.deepcopy.go

Lines changed: 51 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

config/crd/bases/chaos-mesh.org_schedules.yaml

Lines changed: 1449 additions & 2 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)