Skip to content

Commit

Permalink
annotate with cm resource version
Browse files Browse the repository at this point in the history
  • Loading branch information
lionelvillard committed Nov 16, 2019
1 parent 262f78c commit 7cce126
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 6 deletions.
1 change: 0 additions & 1 deletion hack/release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ ROOT=$(dirname $BASH_SOURCE[0])/..
source $ROOT/hack/lib/library.sh

TAG=$1

export KO_DOCKER_REPO=docker.io/knativefunctions
docker login -p $DOCKER_PASS -u $DOCKER_USER docker.io

Expand Down
2 changes: 1 addition & 1 deletion hack/update-codegen.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env bash

# Copyright 2018 The Knative Authors
# Copyright 2019 The Knative Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion pkg/reconciler/functions/functions.go
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,7 @@ func (r *Reconciler) reconcileService(ctx context.Context, fn *duckv1alpha1.Func
return nil, errors.New("Missing functions.knative.dev/image annotation on function CRD")
}

expected := resources.MakeKnativeService(r.functionName, string(cm.UID), image)
expected := resources.MakeKnativeService(r.functionName, cm.ResourceVersion, image)

// Update service annotation with config map UUID.
service, err := r.serviceLister.Services("knative-functions").Get(r.functionName)
Expand Down
6 changes: 3 additions & 3 deletions pkg/reconciler/functions/resources/ksvc.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,11 @@ import (
)

const (
ConfigMapAnnotation = "functions.knative.dev/cm-uuid"
ConfigMapAnnotation = "functions.knative.dev/cm-resourceVersion"
)

// MakeKnativeService create a knative service
func MakeKnativeService(functionName string, cmuuid, image string) *servingv1beta1.Service {
func MakeKnativeService(functionName string, version, image string) *servingv1beta1.Service {
return &servingv1beta1.Service{
TypeMeta: metav1.TypeMeta{
APIVersion: "v1beta1",
Expand All @@ -45,7 +45,7 @@ func MakeKnativeService(functionName string, cmuuid, image string) *servingv1bet
ConfigurationSpec: servingv1beta1.ConfigurationSpec{
Template: servingv1beta1.RevisionTemplateSpec{
ObjectMeta: metav1.ObjectMeta{
Annotations: map[string]string{ConfigMapAnnotation: cmuuid},
Annotations: map[string]string{ConfigMapAnnotation: version},
},
Spec: servingv1beta1.RevisionSpec{
PodSpec: corev1.PodSpec{
Expand Down

0 comments on commit 7cce126

Please sign in to comment.