code: func resolveDefaultContext(opts *cliflags.CommonOptions, config *configfile.ConfigFile, stderr io.Writer) (*DefaultContext, error) {
  	stackOrchestrator, err := GetStackOrchestrator("", "", config.StackOrchestrator, stderr)
  	if err != nil {
  		return nil, err
  	}
  	contextTLSData := store.ContextTLSData{
  		Endpoints: make(map[string]store.EndpointTLSData),
  	}
  	contextMetadata := store.Metadata{
  		Endpoints: make(map[string]interface{}),
  		Metadata: DockerContext{
  			Description:       "",
  			StackOrchestrator: stackOrchestrator,
  		},
  		Name: DefaultContextName,
  	}
  
  	dockerEP, err := resolveDefaultDockerEndpoint(opts)
  	if err != nil {
  		return nil, err
  	}
  	contextMetadata.Endpoints[docker.DockerEndpoint] = dockerEP.EndpointMeta
  	if dockerEP.TLSData != nil {
  		contextTLSData.Endpoints[docker.DockerEndpoint] = *dockerEP.TLSData.ToStoreTLSData()
  	}
  
  	// Default context uses env-based kubeconfig for Kubernetes endpoint configuration
  	kubeconfig := os.Getenv("KUBECONFIG")
  	if kubeconfig == "" {
  		kubeconfig = filepath.Join(homedir.Get(), ".kube/config")
  	}
  	kubeEP, err := kubernetes.FromKubeConfig(kubeconfig, "", "")
  	if (stackOrchestrator == OrchestratorKubernetes || stackOrchestrator == OrchestratorAll) && err != nil {
  		return nil, errors.Wrapf(err, "default orchestrator is %s but kubernetes endpoint could not be found", stackOrchestrator)
  	}
  	if err == nil {
  		contextMetadata.Endpoints[kubernetes.KubernetesEndpoint] = kubeEP.EndpointMeta
  		if kubeEP.TLSData != nil {
  			contextTLSData.Endpoints[kubernetes.KubernetesEndpoint] = *kubeEP.TLSData.ToStoreTLSData()
  		}
  	}
  
  	return &DefaultContext{Meta: contextMetadata, TLS: contextTLSData}, nil
  }
docs: // resolveDefaultContext creates a Metadata for the current CLI invocation parameters