apiVersion: v1
kind: ConfigMap
metadata:
  name: gerrit-jenkins-plugin-ready
  namespace: {{ .Release.Namespace }}
  labels:
    app: jenkins
    {{- include "jenkins-operator.metaLabels" . | nindent 4 }}
data:
  gerrit-jenkins-plugin-ready.groovy: |-
    import com.sonyericsson.hudson.plugins.gerrit.trigger.GerritServer
    import com.sonyericsson.hudson.plugins.gerrit.trigger.PluginImpl
    import com.sonyericsson.hudson.plugins.gerrit.trigger.config.PluginConfig

    PluginImpl plugin = PluginImpl.getInstance();
    PluginConfig pluginConfig = plugin.getPluginConfig();
    for (gerritServer in plugin.getServers()) {
        if (gerritServer.name == "gerrit") {
            println("Ready")
        }
    }
