Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pkg/apis: unexport ApplyContainerReplacements #3578

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion pkg/apis/pipeline/v1beta1/container_replacements.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ import (
corev1 "k8s.io/api/core/v1"
)

func ApplyContainerReplacements(step *corev1.Container, stringReplacements map[string]string, arrayReplacements map[string][]string) {
// applyContainerReplacements applies variable interpolation on a Container (subset of a Step).
func applyContainerReplacements(step *corev1.Container, stringReplacements map[string]string, arrayReplacements map[string][]string) {
step.Name = substitution.ApplyReplacements(step.Name, stringReplacements)
step.Image = substitution.ApplyReplacements(step.Image, stringReplacements)
step.ImagePullPolicy = corev1.PullPolicy(substitution.ApplyReplacements(string(step.ImagePullPolicy), stringReplacements))
Expand Down
149 changes: 0 additions & 149 deletions pkg/apis/pipeline/v1beta1/container_replacements_test.go

This file was deleted.

3 changes: 2 additions & 1 deletion pkg/apis/pipeline/v1beta1/sidecar_replacements.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ import (
"github.com/tektoncd/pipeline/pkg/substitution"
)

// ApplySidecarReplacements applies variable interpolation on a Sidecar.
func ApplySidecarReplacements(sidecar *Sidecar, stringReplacements map[string]string, arrayReplacements map[string][]string) {
sidecar.Script = substitution.ApplyReplacements(sidecar.Script, stringReplacements)
ApplyContainerReplacements(&sidecar.Container, stringReplacements, arrayReplacements)
applyContainerReplacements(&sidecar.Container, stringReplacements, arrayReplacements)
}
3 changes: 2 additions & 1 deletion pkg/apis/pipeline/v1beta1/step_replacements.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ import (
"github.com/tektoncd/pipeline/pkg/substitution"
)

// ApplyStepReplacements applies variable interpolation on a Step.
func ApplyStepReplacements(step *Step, stringReplacements map[string]string, arrayReplacements map[string][]string) {
step.Script = substitution.ApplyReplacements(step.Script, stringReplacements)
ApplyContainerReplacements(&step.Container, stringReplacements, arrayReplacements)
applyContainerReplacements(&step.Container, stringReplacements, arrayReplacements)
}