Skip to content

Commit

Permalink
Add pod plaement policy to v1 api with no defaults
Browse files Browse the repository at this point in the history
Signed-off-by: Tamal Saha <[email protected]>
  • Loading branch information
tamalsaha committed Jun 3, 2024
1 parent 1679e7d commit 0e49618
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 0 deletions.
2 changes: 2 additions & 0 deletions api/v1/conversion/conversion.go
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@ func Convert_v1_PodSpec_To_v2_PodSpec(in *v1.PodSpec, out *v2.PodSpec, s convers
out.SecurityContext = (*core.PodSecurityContext)(unsafe.Pointer(in.SecurityContext))
out.ImagePullSecrets = *(*[]core.LocalObjectReference)(unsafe.Pointer(&in.ImagePullSecrets))
// WARNING: in.Affinity requires manual conversion: does not exist in peer-type
out.PodPlacementPolicy = in.PodPlacementPolicy
out.SchedulerName = in.SchedulerName
out.Tolerations = *(*[]core.Toleration)(unsafe.Pointer(&in.Tolerations))
out.PriorityClassName = in.PriorityClassName
Expand Down Expand Up @@ -164,6 +165,7 @@ func Convert_v2_PodSpec_To_v1_PodSpec(in *v2.PodSpec, out *v1.PodSpec, s convers
out.ShareProcessNamespace = (*bool)(unsafe.Pointer(in.ShareProcessNamespace))
out.SecurityContext = (*core.PodSecurityContext)(unsafe.Pointer(in.SecurityContext))
out.ImagePullSecrets = *(*[]core.LocalObjectReference)(unsafe.Pointer(&in.ImagePullSecrets))
out.PodPlacementPolicy = in.PodPlacementPolicy
out.SchedulerName = in.SchedulerName
out.Tolerations = *(*[]core.Toleration)(unsafe.Pointer(&in.Tolerations))
// WARNING: in.HostAliases requires manual conversion: does not exist in peer-type
Expand Down
6 changes: 6 additions & 0 deletions api/v1/openapi_generated.go

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

4 changes: 4 additions & 0 deletions api/v1/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,10 @@ type PodSpec struct {
// +patchMergeKey=mountPath
// +patchStrategy=merge
VolumeMounts []core.VolumeMount `json:"volumeMounts,omitempty" patchStrategy:"merge" patchMergeKey:"mountPath"`

// PodPlacementPolicy is the reference of the podPlacementPolicy
// +optional
PodPlacementPolicy *core.LocalObjectReference `json:"podPlacementPolicy,omitempty"`
}

// ServiceTemplateSpec describes the data a service should have when created from a template
Expand Down
5 changes: 5 additions & 0 deletions api/v1/zz_generated.deepcopy.go

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

0 comments on commit 0e49618

Please sign in to comment.