func NewConfigs()

in kubelet-to-gcm/monitor/config/initialize.go [36:98]


func NewConfigs(zone, projectID, cluster, clusterLocation, host, instance, schemaPrefix, certificateLocation string, monitoredResourceLabels map[string]string, kubeletPort, ctrlPort uint, resolution time.Duration) (*monitor.SourceConfig, *monitor.SourceConfig, error) {
	zone, err := getZone(zone)
	if err != nil {
		return nil, nil, err
	}

	projectID, err = getProjectID(projectID)
	if err != nil {
		return nil, nil, err
	}

	cluster, err = getCluster(cluster)
	if err != nil {
		return nil, nil, err
	}

	clusterLocation, err = getClusterLocation(clusterLocation)
	if err != nil {
		return nil, nil, err
	}

	host, err = getKubeletHost(host)
	if err != nil {
		return nil, nil, err
	}

	instance, err = getInstance(instance)
	if err != nil {
		return nil, nil, err
	}

	instanceID, err := getInstanceID()
	if err != nil {
		return nil, nil, err
	}

	return &monitor.SourceConfig{
			Zone:                    zone,
			Project:                 projectID,
			Cluster:                 cluster,
			ClusterLocation:         clusterLocation,
			Host:                    host,
			Instance:                instance,
			InstanceID:              instanceID,
			SchemaPrefix:            schemaPrefix,
			MonitoredResourceLabels: monitoredResourceLabels,
			Port:                    kubeletPort,
			Resolution:              resolution,
			CertificateLocation:     certificateLocation,
		}, &monitor.SourceConfig{
			Zone:                    zone,
			Project:                 projectID,
			Cluster:                 cluster,
			ClusterLocation:         clusterLocation,
			Host:                    host,
			Instance:                instance,
			InstanceID:              instanceID,
			SchemaPrefix:            schemaPrefix,
			MonitoredResourceLabels: monitoredResourceLabels,
			Port:                    ctrlPort,
			Resolution:              resolution,
		}, nil
}