docs: @VisibleForTesting
    static String parseRegistryUrl(final String url) {
      if (url.equals("docker.io") || url.equals("index.docker.io")) {
        return DEFAULT_REGISTRY_URL;
      } else if (url.matches("(^|(\\w+)\\.)gcr\\.io$") || url.equals("gcr.kubernetes.io")) {
        // GCR uses https
        return "https://" + url;
      } else if (url.equals("quay.io")) {
        // Quay doesn't use any protocol in credentials file
        return "quay.io";
      } else if (!url.contains("http://") && !url.contains("https://")) {
        // Assume https
        return "https://" + url;
      } else {
        return url;
      }
    }