Closed rguske closed 8 months ago
Fixed by changing the sha of the example checksum annotation and manually changing it in the release.yml file via the Github editing option.
Here is the snippet for more context on how to fix it:
import (
"fmt"
"hash/crc32"
"os"
"regexp"
"strings"
"gopkg.in/yaml.v2"
)
var (
// Allows for normalizing by collapsing newlines.
sequentialNewlines = regexp.MustCompile("(?:\r?\n)+")
)
type ConfigMap struct {
Data map[string]string `json:"data,omitempty" protobuf:"bytes,2,rep,name=data"`
}
func Checksum(value string) string {
return fmt.Sprintf("%08x", crc32.ChecksumIEEE([]byte(sequentialNewlines.ReplaceAllString(strings.TrimSpace(value), `\n`))))
}
func main() {
contents, _ := os.ReadFile("./config/config-leader-election.yaml")
var cm ConfigMap
if err := yaml.Unmarshal(contents, &cm); err != nil {
fmt.Println("cannot decode incoming new object:")
}
exampleData := cm.Data["_example"]
chks := Checksum(exampleData)
exampleChecksum := "a2f53e10"
fmt.Println(chks, exampleChecksum)
}
Describe the bug When trying to install the Tanzu Sources (
k apply -f release.yaml
) it always fails when creating theconfig-election-leader
configMap.To Reproduce Steps to reproduce the behavior:
kn quickstart kind
kubectl apply -f release.yaml
Expected behavior A clean run through.
Affected version I validated Kubernetes version s 1.25.x, 1.28.x and 1.29.x Knative versions 1.10 and latest 1.13 Tanzu Sources 0.37.1, 0.38.1 and 0.39.0
Screenshots/Debug Output It runs through when deleting the annotation
knative.dev/example-checksum: "a2f53e10"