func NewInstanceNetworkConfig()

in gke-windows-builder/builder/builder/network.go [37:57]


func NewInstanceNetworkConfig(instanceProject *string, network *string, networkProject *string, subnet *string, region *string) *InstanceNetworkConfig {
	netConfig := InstanceNetworkConfig{
		Network:        network,
		NetworkProject: networkProject,
		Subnet:         subnet,
		Region:         region,
	}
	if usingSharedVPC(&netConfig, instanceProject) {
		// When Shared VPC is detected, we do not make any assumptions
		// about the networks / projects other than what the user
		// passed as args.
		return &netConfig
	}

	// Infer network project from instance project
	if *netConfig.NetworkProject == "" {
		netConfig.NetworkProject = instanceProject
	}

	return &netConfig
}