import payloadHeader from "./payloadHeader"

export default (props = {}) => {
  const header = payloadHeader({
    ...props,
    ...{ _type: "cluster" },
  })

  return {
    ...header,
    _source: {
      _id: props._id || null,
      project: props.project || null,
      kind: props.kind || null,
      metadata: {
        name: props.name || props.clusterName,
        labels: {
          location: props.location || false,
        },
      },
    },
  }
}
