misc/agent-introspection-validator/agent-introspection-validator.go
func verifyContainerMetadata(containerMetadataRawMsg json.RawMessage) error {
	containerMetadataMap := make(map[string]json.RawMessage)
	json.Unmarshal(containerMetadataRawMsg, &containerMetadataMap)

	if containerMetadataMap["Name"] == nil {
		return notEmptyErrMsg("Name")
	}

	var actualContainerName string
	json.Unmarshal(containerMetadataMap["Name"], &actualContainerName)

	if actualContainerName != containerName {
		return fmt.Errorf("incorrect container name, expected %s, received %s",
			containerName, actualContainerName)
	}

	if containerMetadataMap["DockerId"] == nil {
		return notEmptyErrMsg("DockerId")
	}

	if containerMetadataMap["DockerName"] == nil {
		return notEmptyErrMsg("DockerName")
	}

	if containerMetadataMap["Volumes"] == nil {
		return notEmptyErrMsg("Volumes")
	}

	return nil
}
func verifyContainerMetadata(containerMetadataRawMsg json.RawMessage) error {
	containerMetadataMap := make(map[string]json.RawMessage)
	json.Unmarshal(containerMetadataRawMsg, &containerMetadataMap)

	if containerMetadataMap["Name"] == nil {
		return notEmptyErrMsg("Name")
	}

	var actualContainerName string
	json.Unmarshal(containerMetadataMap["Name"], &actualContainerName)

	if actualContainerName != containerName {
		return fmt.Errorf("incorrect container name, expected %s, received %s",
			containerName, actualContainerName)
	}

	if containerMetadataMap["DockerId"] == nil {
		return notEmptyErrMsg("DockerId")
	}

	if containerMetadataMap["DockerName"] == nil {
		return notEmptyErrMsg("DockerName")
	}

	if containerMetadataMap["Volumes"] == nil {
		return notEmptyErrMsg("Volumes")
	}

	return nil
}
func verifyContainerMetadata ( containerMetadataRawMsg json . RawMessage ) error { containerMetadataMap := make ( map [ string ] json . RawMessage ) json . Unmarshal ( containerMetadataRawMsg , & containerMetadataMap ) if containerMetadataMap [ " " ] == nil { return notEmptyErrMsg ( " " ) } var actualContainerName string json . Unmarshal ( containerMetadataMap [ " " ] , & actualContainerName ) if actualContainerName != containerName { return fmt . Errorf ( " " , containerName , actualContainerName ) } if containerMetadataMap [ " " ] == nil { return notEmptyErrMsg ( " " ) } if containerMetadataMap [ " " ] == nil { return notEmptyErrMsg ( " " ) } if containerMetadataMap [ " " ] == nil { return notEmptyErrMsg ( " " ) } return nil }
// verifyContainerMetadata verifies the container name of the container metadata,
// and each necessary field is not empty.
verifyContainerMetadata verifies the container name of the container metadata and each necessary field is not empty .