{{- if .Values.notary.enabled }}
apiVersion: v1
kind: Service
metadata:
  name: {{ include "harbor.notary-server" . }}
  namespace: {{ .Release.Namespace | quote }}
  labels: {{- include "common.labels.standard" . | nindent 4 }}
    {{- if .Values.commonLabels }}
    {{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }}
    {{- end }}
  {{- if .Values.commonAnnotations }}
  annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
  {{- end }}
spec:
  {{- if (eq .Values.ingress.notary.controller "gce") }}
  type: NodePort
  {{- end }}
  ports:
    - name: notary-server
      port: {{ .Values.notary.service.ports.server }}
      targetPort: notary-server
  selector: {{- include "common.labels.matchLabels" . | nindent 4 }}
    app.kubernetes.io/component: notary-server
---
apiVersion: v1
kind: Service
metadata:
  name: {{ include "harbor.notary-signer" . }}
  labels: {{- include "common.labels.standard" . | nindent 4 }}
    {{- if .Values.commonLabels }}
    {{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }}
    {{- end }}
  {{- if .Values.commonAnnotations }}
  annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
  {{- end }}
spec:
  ports:
    - name: notary-signer
      port: {{ .Values.notary.service.ports.signer }}
      targetPort: notary-signer
  selector: {{- include "common.labels.matchLabels" . | nindent 4 }}
    app.kubernetes.io/component: notary-signer
{{- end }}
