Skip to content
This repository has been archived by the owner on Feb 22, 2022. It is now read-only.

[stable/jenkins] specifying master.enableXmlConfig false with JCasC results in setup wizard dialog on a first Jenkins launch #18250

Closed
apogrebnyak opened this issue Oct 23, 2019 · 0 comments · Fixed by #18252

Comments

@apogrebnyak
Copy link
Contributor

apogrebnyak commented Oct 23, 2019

Describe the bug
When you specify master.enableXmlConfig: false and master.JCasC.enabled: true and master.JCasC.defaultConfig: true on initial login you are presented with Jenkins Setup Wizard.

When specifying master.enableXmlConfig: true no Wizard is displayed.

Version of Helm and Kubernetes:
Helm:

Client: &version.Version{SemVer:"v2.14.3", GitCommit:"0e7f3b6637f7af8fcfddb3d2941fcc7cbebb0085", GitTreeState:"clean"}
Server: &version.Version{SemVer:"v2.14.3", GitCommit:"0e7f3b6637f7af8fcfddb3d2941fcc7cbebb0085", GitTreeState:"clean"}

Kubernetes:

Client Version: version.Info{Major:"1", Minor:"16", GitVersion:"v1.16.2", GitCommit:"c97fe5036ef3df2967d086711e6c0c405941e14b", GitTreeState:"clean", BuildDate:"2019-10-15T23:41:55Z", GoVersion:"go1.12.10", Compiler:"gc", Platform:"darwin/amd64"}
Server Version: version.Info{Major:"1", Minor:"14+", GitVersion:"v1.14.7-eks-e9b1d0", GitCommit:"e9b1d0551216e1e8ace5ee4ca50161df34325ec2", GitTreeState:"clean", BuildDate:"2019-09-21T08:33:01Z", GoVersion:"go1.12.9", Compiler:"gc", Platform:"linux/amd64"}

Which chart:
stable/jenkins

What happened:
When disabling Xml Configuration by setting master.enableXmlConfig: false, on initial login I am presented with initialAdminPassword dialog.
I was able to prevent this dialog from appearing by adding this to my JCasC config:

master:

  enableXmlConfig: false

  JCasC:
    enabled: true
    defaultConfig: true
    configScripts:
      security-realm: |
        jenkins:
          securityRealm:
            legacy: {}

With this fixed, the SetupWizard still comes up, asking to install plugins, although they are specified in my values.yml override and are indeed installed.

What you expected to happen:
I expect the same behavior as with enableXmlConfig: true specified.

How to reproduce it (as minimally and precisely as possible):
Have this values.yml file

master:

  serviceType: ClusterIP

  enableXmlConfig: false

  JCasC:
    enabled: true
    defaultConfig: true
    configScripts:
      security-realm: |
        jenkins:
          securityRealm:
            legacy: {}
      welcome-message: |
        jenkins:
          systemMessage: Welcome to our CI\CD server.  This Jenkins is configured and managed 'as code'.

  sidecars:
    configAutoReload:
      enabled: true

Run this install command

helm install --name jenkins --values values.yml stable/jenkins

When you connect to jenkins and enter admin password you are presented with Setup Wizard, not connected straight to Jenkins

Anything else we need to know:
According to this -> jenkinsci/configuration-as-code-plugin#38 (comment), all that is required to prevent Setup Wizard from coming up is this

echo $JENKINS_VERSION | tee \
    $JENKINS_HOME/jenkins.install.UpgradeWizard.state \
    $JENKINS_HOME/jenkins.install.InstallUtil.lastExecVersion

I suggest to add this conditionally to apply_config.sh in config.yaml template when enableXmlConfig is false

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
1 participant