Configuring "deprecated: warn" in the operator helm install values file to prevent "agentProtocols no longer configurable" error

I’m new to installing Jenkinsa and try to install it on our k8s cluster by using the jenkins-operator installed with helm (via ArgoCD). After installing, the jenkins pods gives the following error:

WARNING jenkins.model.Jenkins#setAgentProtocols
java.lang.IllegalStateException: Jenkins.agentProtocols no longer configurable

The documentation told me to add the following lines to the configuration:

configuration-as-code:
  deprecated: warn

I cannot figure out where i should place these lines in de values.yaml for helm install of the operator.

I tried to place it in the values files like this:

  configuration:
    configurationAsCode:
       - configMapName: jenkins-casc
         content: 
           configuration-as-code:
             deprecated: "warn"

But that does not work. Where should i place these lines?

why not just remove the agentProtocols instead?

The jenkins-operator creates a (config map with a) Groovy script.

https://github.com/jenkinsci/kubernetes-operator/blob/d919a2a11cf1b6417daaa414ad315cf3cc985fcc/pkg/configuration/base/resources/base_configuration_configmap.go#L80

They call the deprecated setAgentProtocols method which triggers the warning.

But it seems that this groovy script they generate there is an init.groovy so it will only be applied after restart. Not sure though if that happens before or after CasC is applied. Anyway the code for that script was last changed 7 years ago so it seems pretty outdated.

There is a quite new issue there Setting agent protocol is deprecated · Issue #1093 · jenkinsci/kubernetes-operator · GitHub about the problem