Skip to content

Commit 3413f25

Browse files
committed
Rename parseLabels to buildLabels
**What** - rename parseLabels to buildLables to make the name more semantic Signed-off-by: Lucas Roesler <[email protected]>
1 parent 8d22ce8 commit 3413f25

File tree

4 files changed

+5
-5
lines changed

4 files changed

+5
-5
lines changed

handlers/deploy.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ func makeDeploymentSpec(request requests.CreateFunctionRequest, existingSecrets
162162
}
163163

164164
initialReplicas := getMinReplicaCount(request.Labels)
165-
labels := parseLabels(request.Service, request.Labels)
165+
labels := buildLabels(request.Service, request.Labels)
166166
nodeSelector := createSelector(request.Constraints)
167167
resources, resourceErr := createResources(request)
168168

handlers/labels.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,9 @@ const (
2424
FunctionVersionUID = "com.openfaas.uid"
2525
)
2626

27-
// parseLabels will copy the user request labels and ensure that any required internal labels
27+
// buildLabels will copy the user request labels and ensure that any required internal labels
2828
// are set appropriately.
29-
func parseLabels(functionName string, requestLables *map[string]string) map[string]string {
29+
func buildLabels(functionName string, requestLables *map[string]string) map[string]string {
3030
labels := map[string]string{}
3131
if requestLables != nil {
3232
for k, v := range *requestLables {

handlers/lables_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ func Test_parseLabels(t *testing.T) {
6969

7070
for _, s := range scenarios {
7171
t.Run(s.name, func(t *testing.T) {
72-
output := parseLabels(s.functionName, s.labels)
72+
output := buildLabels(s.functionName, s.labels)
7373
if output == nil {
7474
t.Errorf("parseLabels should not return nil map")
7575
}

handlers/update.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ func updateDeploymentSpec(
7272

7373
deployment.Spec.Template.Spec.NodeSelector = createSelector(request.Constraints)
7474

75-
labels := parseLabels(request.Service, request.Labels)
75+
labels := buildLabels(request.Service, request.Labels)
7676
labels["uid"] = fmt.Sprintf("%d", time.Now().Nanosecond())
7777

7878
deployment.Labels = labels

0 commit comments

Comments
 (0)