func validate()

in pkg/containerd/hosts.go [142:162]


func validate(urls []url.URL) error {
	errs := []error{}
	for _, u := range urls {
		if u.Scheme != "http" && u.Scheme != "https" {
			errs = append(errs, fmt.Errorf("invalid registry url, scheme must be http or https, got: %s", u.String()))
		}

		if u.Path != "" {
			errs = append(errs, fmt.Errorf("invalid registry url, path has to be empty, got: %s", u.String()))
		}

		if len(u.Query()) != 0 {
			errs = append(errs, fmt.Errorf("invalid registry url, query has to be empty, got: %s", u.String()))
		}

		if u.User != nil {
			errs = append(errs, fmt.Errorf("invalid registry url, user has to be empty, got: %s", u.String()))
		}
	}
	return errors.Join(errs...)
}