diff --git a/pkg/validate/validate.go b/pkg/validate/validate.go index 4a418c97..13f3b6c5 100644 --- a/pkg/validate/validate.go +++ b/pkg/validate/validate.go @@ -62,12 +62,12 @@ func getSchemaLocations() []string { r := repo.Repo{CloneURL: schemasLocation} err = r.CloneRepoLocal(ctx, tmpSchemasLocalDir) if err != nil { - telemetry.SetError(span, err, "failed to clone schemas repository") - log.Err(err).Msg("failed to clone schemas repository") + telemetry.SetError(span, err, fmt.Sprintf("failed to clone schemas repository %s", schemasLocation)) + log.Err(err).Msgf("failed to clone schemas repository %s", schemasLocation) return } - log.Debug().Str("schemas-repo", schemasLocation).Msg("Cloned schemas Repo to /tmp/schemas") + log.Debug().Str("schemas-repo", schemasLocation).Msgf("Cloned schemas Repo %s to /tmp/schemas", schemasLocation) localSchemasLocation = tmpSchemasLocalDir err = os.RemoveAll(oldLocalSchemasLocation) @@ -80,6 +80,7 @@ func getSchemaLocations() []string { refreshSchemasOnce.Do(func() { c := cron.New() c.AddFunc("@daily", func() { + log.Info().Msg("resetting schemas lock to allow refresh") getSchemasOnce = *new(sync.Once) }) c.Start() @@ -89,7 +90,8 @@ func getSchemaLocations() []string { return []string{ localSchemasLocation + `/{{ .NormalizedKubernetesVersion }}/{{ .ResourceKind }}{{ .KindSuffix }}.json`, - "https://raw.githubusercontent.com/yannh/kubernetes-json-schema/master/{{ .NormalizedKubernetesVersion }}-standalone{{ .StrictSuffix }}/{{ .ResourceKind }}{{ .KindSuffix }}.json", + "default", + "https://raw.githubusercontent.com/yannh/kubernetes-json-schema/master/{{ .NormalizedKubernetesVersion }}/{{ .ResourceKind }}{{ .KindSuffix }}.json", } } diff --git a/pkg/vcs_clients/message.go b/pkg/vcs_clients/message.go index 4d0e7123..86c66a10 100644 --- a/pkg/vcs_clients/message.go +++ b/pkg/vcs_clients/message.go @@ -16,7 +16,7 @@ const ( appFormat = `
## ArgoCD Application Checks:` + "`%s` %s" + - ` + ` %s
@@ -79,7 +79,7 @@ func (m *Message) buildComment(ctx context.Context) string { defer span.End() var names []string - for _, name := range m.Apps { + for name := range m.Apps { names = append(names, name) } sort.Strings(names)