Documentation ¶
Index ¶
- func ArePodSpecEqual(lhs, rhs corev1.PodSpec, strictTolerations bool) bool
- func ArePodTemplateSpecEqual(lhs, rhs corev1.PodTemplateSpec) bool
- func List(ctx context.Context, c client.Client, namespace string, ...) ([]corev1.Pod, error)
- type Builder
- func (b *Builder) Build() *corev1.PodSpec
- func (b *Builder) WithAffinity(a *corev1.Affinity) *Builder
- func (b *Builder) WithNodeSelectors(s map[string]string) *Builder
- func (b *Builder) WithRestartPolicy(rp corev1.RestartPolicy) *Builder
- func (b *Builder) WithSecurityContext(sc corev1.PodSecurityContext) *Builder
- func (b *Builder) WithTerminationGracePeriodSeconds(p time.Duration) *Builder
- func (b *Builder) WithTolerations(t ...corev1.Toleration) *Builder
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ArePodSpecEqual ¶
ArePodSpecEqual compares two corev1.PodSpec objects and returns true only if they are equal in any of the following: - Length of containers slice - Node selectors - Tolerations, if strict they need to be the same, non-strict for superset check - Containers: Name, Image, VolumeMounts, EnvVar, Args, Ports, ResourceRequirements
func ArePodTemplateSpecEqual ¶
func ArePodTemplateSpecEqual(lhs, rhs corev1.PodTemplateSpec) bool
ArePodTemplateSpecEqual compares two corev1.PodTemplateSpec objects and returns true only if pod spec are equal and tolerations are strictly the same
Types ¶
type Builder ¶
type Builder struct {
// contains filtered or unexported fields
}
Builder represents the struct to build k9s podspecs
func NewSpec ¶
func NewSpec(serviceAccountName string, containers []corev1.Container, volumes []corev1.Volume) *Builder
NewSpec returns a new Builder instance with a default initialized podspec
func (*Builder) WithAffinity ¶
WithAffinity sets the affinity rule for the podspec
func (*Builder) WithNodeSelectors ¶
WithNodeSelectors sets the podsec selectors and ensures that the default linux node selector is always present.
func (*Builder) WithRestartPolicy ¶
func (b *Builder) WithRestartPolicy(rp corev1.RestartPolicy) *Builder
WithRestartPolicy sets the restart policy for the podspec
func (*Builder) WithSecurityContext ¶
func (b *Builder) WithSecurityContext(sc corev1.PodSecurityContext) *Builder
WithSecurityContext sets the security context for the podspec
func (*Builder) WithTerminationGracePeriodSeconds ¶
WithTerminationGracePeriodSeconds sets the termination grace period for the podspec
func (*Builder) WithTolerations ¶
func (b *Builder) WithTolerations(t ...corev1.Toleration) *Builder
WithTolerations appends tolerations to the podspec