MCPcopy Create free account
hub / github.com/cloudnative-pg/cloudnative-pg / WithContainer

Method WithContainer

pkg/podspec/builder.go:100–112  ·  view source on GitHub ↗

WithContainer ensures that in the current status there is a container with the passed name

(name string)

Source from the content-addressed store, hash-verified

98// WithContainer ensures that in the current status there is a container
99// with the passed name
100func (builder *Builder) WithContainer(name string) *Builder {
101 for _, value := range builder.status.Spec.Containers {
102 if value.Name == name {
103 return builder
104 }
105 }
106
107 builder.status.Spec.Containers = append(builder.status.Spec.Containers,
108 corev1.Container{
109 Name: name,
110 })
111 return builder
112}
113
114// WithContainerImage ensures that, if in the current status there is
115// a container with the passed name and the image is empty, the image will be

Callers 9

WithContainerImageMethod · 0.95
WithContainerEnvMethod · 0.95
WithLivenessProbeMethod · 0.95
WithReadinessProbeMethod · 0.95
WithContainerCommandMethod · 0.95
WithContainerPortMethod · 0.95
builder_test.goFile · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected