INNER CODE UNIT · Go

ensureKubernetesBundle

werf/nelm · scripts/schemagen/main.go:126

func ensureKubernetesBundle(ctx context.Context, client *http.Client, opts options, existingIndex *schemas.Index) (*schemas.Bundle, error) {
	minors, err := kubeMinors(opts.kubeVersion, opts.kubeVersionCount)
	if err != nil {
		return nil, err
	}

	archivePath := filepath.Join(opts.outputDir, kubernetesArchiveFileName)

	var existing *schemas.Bundle
	if existingIndex != nil {
		existing = existingIndex.Kubernetes
	}

	if !opts.force && isBundleUpToDate(archivePath, existing, opts.kubernetesRepo, opts.kubernetesRef) &&
		kubeVersionsMatch(existing.KubeVersions, opts.kubeVersion, minors) {
		log.Default.Info(ctx, "Embedded schemas for Kubernetes %s are up to date (%d schemas)",
			strings.Join(existing.KubeVersions, ", "), existing.FilesCount)

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…