INNER CODE UNIT · Go

ValidateTerminalVersions

kubesphere/kubekey · builtin/core/upgrade_path.go:286

func ValidateTerminalVersions(vfs fs.FS, base map[string]interface{}, steps []string) error {
	if len(steps) <= 1 {
		return nil // single hop / patch-only: no intermediate to conflict with
	}

	var problems []string
	for _, path := range upgradeVersionFieldPaths {
		termVal, found, err := unstructured.NestedString(base, path...)
		if err != nil {
			return fmt.Errorf("read terminal version field %q: %w", strings.Join(path, "."), err)
		}
		if !found || termVal == "" {
			continue // not pinned by the user -> no conflict possible
		}

		// Compare the pinned terminal value against every intermediate hop's overlay.
		for _, step := range steps[:len(steps)-1] {
			minor, err := MinorOfVersion(step)

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…