Skip to content

Commit

Permalink
Unexport additional functions
Browse files Browse the repository at this point in the history
  • Loading branch information
kobayashi authored and tekton-robot committed Mar 1, 2021
1 parent 4eb489a commit 10865b8
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.
6 changes: 3 additions & 3 deletions pkg/pod/pod.go
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,7 @@ func (b *Builder) Build(ctx context.Context, taskRun *v1beta1.TaskRun, taskSpec
*metav1.NewControllerRef(taskRun, groupVersionKind),
},
Annotations: podAnnotations,
Labels: MakeLabels(taskRun),
Labels: makeLabels(taskRun),
},
Spec: corev1.PodSpec{
RestartPolicy: corev1.RestartPolicyNever,
Expand All @@ -302,8 +302,8 @@ func (b *Builder) Build(ctx context.Context, taskRun *v1beta1.TaskRun, taskSpec
}, nil
}

// MakeLabels constructs the labels we will propagate from TaskRuns to Pods.
func MakeLabels(s *v1beta1.TaskRun) map[string]string {
// makeLabels constructs the labels we will propagate from TaskRuns to Pods.
func makeLabels(s *v1beta1.TaskRun) map[string]string {
labels := make(map[string]string, len(s.ObjectMeta.Labels)+1)
// NB: Set this *before* passing through TaskRun labels. If the TaskRun
// has a managed-by label, it should override this default.
Expand Down
2 changes: 1 addition & 1 deletion pkg/pod/pod_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1264,7 +1264,7 @@ func TestMakeLabels(t *testing.T) {
"foo": "bar",
"hello": "world",
}
got := MakeLabels(&v1beta1.TaskRun{
got := makeLabels(&v1beta1.TaskRun{
ObjectMeta: metav1.ObjectMeta{
Name: taskRunName,
Labels: map[string]string{
Expand Down
6 changes: 3 additions & 3 deletions pkg/reconciler/pipelinerun/resources/pipelinerunresolution.go
Original file line number Diff line number Diff line change
Expand Up @@ -363,7 +363,7 @@ func ResolvePipelineRunTask(
rprt.PipelineTask.TaskRef.APIVersion != "" && rprt.PipelineTask.TaskRef.Kind != ""

if rprt.IsCustomTask() {
rprt.RunName = GetRunName(pipelineRun.Status.Runs, task.Name, pipelineRun.Name)
rprt.RunName = getRunName(pipelineRun.Status.Runs, task.Name, pipelineRun.Name)
run, err := getRun(rprt.RunName)
if err != nil && !errors.IsNotFound(err) {
return nil, fmt.Errorf("error retrieving Run %s: %w", rprt.RunName, err)
Expand Down Expand Up @@ -450,9 +450,9 @@ func GetTaskRunName(taskRunsStatus map[string]*v1beta1.PipelineRunTaskRunStatus,
return names.SimpleNameGenerator.RestrictLengthWithRandomSuffix(fmt.Sprintf("%s-%s", prName, ptName))
}

// GetRunName should return a unique name for a `Run` if one has not already
// getRunName should return a unique name for a `Run` if one has not already
// been defined, and the existing one otherwise.
func GetRunName(runsStatus map[string]*v1beta1.PipelineRunRunStatus, ptName, prName string) string {
func getRunName(runsStatus map[string]*v1beta1.PipelineRunRunStatus, ptName, prName string) string {
for k, v := range runsStatus {
if v.PipelineTaskName == ptName {
return k
Expand Down
6 changes: 3 additions & 3 deletions pkg/reconciler/testing/logger.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import (

// SetupFakeContext sets up the the Context and the fake filtered informers for the tests.
func SetupFakeContext(t *testing.T) (context.Context, []controller.Informer) {
ctx, _, informer := SetupFakeContextWithLabelKey(t)
ctx, _, informer := setupFakeContextWithLabelKey(t)
cloudEventClientBehaviour := cloudevent.FakeClientBehaviour{
SendSuccessfully: true,
}
Expand All @@ -42,9 +42,9 @@ func TestLogger(t *testing.T) *zap.SugaredLogger {
return logger.Sugar().Named(t.Name())
}

// SetupFakeContextWithLabelKey sets up the the Context and the fake informers for the tests
// setupFakeContextWithLabelKey sets up the the Context and the fake informers for the tests
// The provided context includes the FilteredInformerFactory LabelKey.
func SetupFakeContextWithLabelKey(t zaptest.TestingT) (context.Context, context.CancelFunc, []controller.Informer) {
func setupFakeContextWithLabelKey(t zaptest.TestingT) (context.Context, context.CancelFunc, []controller.Informer) {
ctx, c := context.WithCancel(logtesting.TestContextWithLogger(t))
ctx = controller.WithEventRecorder(ctx, record.NewFakeRecorder(1000))
ctx = filteredinformerfactory.WithSelectors(ctx, v1beta1.ManagedByLabelKey)
Expand Down

0 comments on commit 10865b8

Please sign in to comment.