Skip to content

Commit

Permalink
Merge branch 'an-exten-task-context' into release-07-07-23
Browse files Browse the repository at this point in the history
  • Loading branch information
rekfuki-f3 committed Jul 7, 2023
2 parents 77e7073 + 843b826 commit 29eb704
Show file tree
Hide file tree
Showing 14 changed files with 21,495 additions and 3,165 deletions.
1 change: 1 addition & 0 deletions .github/.licenserc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ header:
- '**/*.json'
- '**/*.log'
- 'vendor/**'
- 'api/vendor/**'
- '**/go.mod'
- '**/go.sum'
- '**/*.crt'
Expand Down
59 changes: 55 additions & 4 deletions api/v1alpha1/workflow_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -158,12 +158,63 @@ type Task struct {
// Container is the main container image to run in the pod
Container *corev1.Container `json:"container,omitempty"`

// Volumes is a list of volumes that can be mounted by containers in a template.
// +patchStrategy=merge
// +optional
// +patchMergeKey=name
Volumes []corev1.Volume `json:"volumes,omitempty" patchStrategy:"merge" patchMergeKey:"name"`
// +patchStrategy=merge,retainKeys
Volumes []corev1.Volume `json:"volumes,omitempty" patchStrategy:"merge,retainKeys" patchMergeKey:"name"`

// +optional
TerminationGracePeriodSeconds *int64 `json:"terminationGracePeriodSeconds,omitempty"`

// +optional
ActiveDeadlineSeconds *int64 `json:"activeDeadlineSeconds,omitempty"`

// +optional
// +mapType=atomic
NodeSelector map[string]string `json:"nodeSelector,omitempty"`

// +optional
ServiceAccountName string `json:"serviceAccountName,omitempty"`

// +optional
AutomountServiceAccountToken *bool `json:"automountServiceAccountToken,omitempty"`

// +optional
SecurityContext *corev1.PodSecurityContext `json:"securityContext,omitempty"`

// TODO: maybe we could specify parameters in other ways, like loading context from file
// +optional
// +patchMergeKey=name
// +patchStrategy=merge
ImagePullSecrets []corev1.LocalObjectReference `json:"imagePullSecrets,omitempty" patchStrategy:"merge" patchMergeKey:"name"`

// +optional
Affinity *corev1.Affinity `json:"affinity,omitempty"`

// +optional
Tolerations []corev1.Toleration `json:"tolerations,omitempty"`

// +optional
// +patchMergeKey=topologyKey
// +patchStrategy=merge
// +listType=map
// +listMapKey=topologyKey
// +listMapKey=whenUnsatisfiable
TopologySpreadConstraints []corev1.TopologySpreadConstraint `json:"topologySpreadConstraints,omitempty" patchStrategy:"merge" patchMergeKey:"topologyKey"`
}

func (t *Task) PodSpec() corev1.PodSpec {
return corev1.PodSpec{
Volumes: t.Volumes,
TerminationGracePeriodSeconds: t.TerminationGracePeriodSeconds,
ActiveDeadlineSeconds: t.ActiveDeadlineSeconds,
NodeSelector: t.NodeSelector,
ServiceAccountName: t.ServiceAccountName,
AutomountServiceAccountToken: t.AutomountServiceAccountToken,
SecurityContext: t.SecurityContext,
ImagePullSecrets: t.ImagePullSecrets,
Affinity: t.Affinity,
TopologySpreadConstraints: t.TopologySpreadConstraints,
}
}

// +kubebuilder:object:root=true
Expand Down
51 changes: 51 additions & 0 deletions api/v1alpha1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1,451 changes: 1,449 additions & 2 deletions config/crd/bases/chaos-mesh.org_schedules.yaml

Large diffs are not rendered by default.

Loading

0 comments on commit 29eb704

Please sign in to comment.