chore: update jenkins and plugins to latest lts, update gh actions, add flake, remove minikube and use kind (#974)

- update to latest jenkins lts
- update github actions
- add nix flake (experimental, build artifacts still wip)
- remove minikube and use kind for a better experience
This commit is contained in:
Luigi Operoso
2024-02-24 17:08:10 +01:00
committed by GitHub
parent 95f0215c37
commit 81251d3ddc
38 changed files with 1289 additions and 239 deletions
+5 -5
View File
@@ -24,13 +24,13 @@ import (
const e2e = "e2e"
var expectedBasePluginsList = []plugins.Plugin{
plugins.Must(plugins.New("configuration-as-code:1700.v6f448841296e")),
plugins.Must(plugins.New("configuration-as-code:1775.v810dc950b_514")),
plugins.Must(plugins.New("git:5.2.1")),
plugins.Must(plugins.New("kubernetes:4029.v5712230ccb_f8")),
plugins.Must(plugins.New("kubernetes-credentials-provider:1.234.vf3013b_35f5b_a")),
plugins.Must(plugins.New("job-dsl:1.85")),
plugins.Must(plugins.New("kubernetes:4186.v1d804571d5d4")),
plugins.Must(plugins.New("kubernetes-credentials-provider:1.258.v95949f923a_a_e")),
plugins.Must(plugins.New("job-dsl:1.87")),
plugins.Must(plugins.New("workflow-aggregator:596.v8c21c963d92d")),
plugins.Must(plugins.New("workflow-job:1342.v046651d5b_dfe")),
plugins.Must(plugins.New("workflow-job:1385.vb_58b_86ea_fff1")),
}
func createUserConfigurationSecret(namespace string, stringData map[string]string) {
+7 -4
View File
@@ -125,10 +125,10 @@ func createJenkinsCRSafeRestart(name, namespace string, seedJob *[]v1alpha2.Seed
},
},
Plugins: []v1alpha2.Plugin{
{Name: "audit-trail", Version: "3.11"},
{Name: "simple-theme-plugin", Version: "136.v23a_15f86c53d"},
{Name: "github", Version: "1.36.0"},
{Name: "devoptics", Version: "1.1973", DownloadURL: "https://jenkins-updates.cloudbees.com/download/plugins/devoptics/1.1973/devoptics.hpi"},
{Name: "audit-trail", Version: "361.v82cde86c784e"},
{Name: "simple-theme-plugin", Version: "176.v39740c03a_a_f5"},
{Name: "github", Version: "1.38.0"},
{Name: "devoptics", Version: "2.0", DownloadURL: "https://jenkins-updates.cloudbees.com/download/plugins/devoptics/2.0/devoptics.hpi"},
},
PriorityClassName: priorityClassName,
NodeSelector: map[string]string{"kubernetes.io/os": "linux"},
@@ -145,6 +145,7 @@ func createJenkinsCRSafeRestart(name, namespace string, seedJob *[]v1alpha2.Seed
Service: v1alpha2.Service{
Type: corev1.ServiceTypeNodePort,
Port: constants.DefaultHTTPPortInt32,
NodePort: 30303,
},
},
}
@@ -239,10 +240,12 @@ func verifyJenkinsAPIConnection(jenkins *v1alpha2.Jenkins, namespace string) (je
func restartJenkinsMasterPod(jenkins *v1alpha2.Jenkins) {
_, _ = fmt.Fprintf(GinkgoWriter, "Restarting Jenkins master pod\n")
jenkinsPod := getJenkinsMasterPod(jenkins)
_, _ = fmt.Fprintf(GinkgoWriter, "Jenkins pod: %+v\n", jenkinsPod)
Expect(K8sClient.Delete(context.TODO(), jenkinsPod)).Should(Succeed())
Eventually(func() (bool, error) {
jenkinsPod = getJenkinsMasterPod(jenkins)
fmt.Printf("Jenkins pod deletion timestamp: %v\n", jenkinsPod.DeletionTimestamp)
return jenkinsPod.DeletionTimestamp != nil, nil
}, 45*retryInterval, retryInterval).Should(BeTrue())
+2 -1
View File
@@ -53,7 +53,7 @@ func createPVC(namespace string) {
Namespace: namespace,
},
Spec: corev1.PersistentVolumeClaimSpec{
AccessModes: []corev1.PersistentVolumeAccessMode{corev1.ReadWriteMany},
AccessModes: []corev1.PersistentVolumeAccessMode{corev1.ReadWriteOnce},
Resources: corev1.ResourceRequirements{
Requests: corev1.ResourceList{
corev1.ResourceStorage: resource.MustParse("1Gi"),
@@ -212,6 +212,7 @@ func createJenkinsWithBackupAndRestoreConfigured(name, namespace string) *v1alph
Service: v1alpha2.Service{
Type: corev1.ServiceTypeNodePort,
Port: constants.DefaultHTTPPortInt32,
NodePort: 30303,
},
},
}
+6 -5
View File
@@ -21,7 +21,7 @@ import (
"sigs.k8s.io/controller-runtime/pkg/envtest"
)
const JenkinsTestImage = "jenkins/jenkins:2.414.1-lts"
const JenkinsTestImage = "jenkins/jenkins:2.440.1-lts"
var (
Cfg *rest.Config
@@ -147,10 +147,10 @@ func RenderJenkinsCR(name, namespace string, seedJob *[]v1alpha2.SeedJob, groovy
},
},
Plugins: []v1alpha2.Plugin{
{Name: "audit-trail", Version: "3.11"},
{Name: "simple-theme-plugin", Version: "136.v23a_15f86c53d"},
{Name: "github", Version: "1.36.0"},
{Name: "devoptics", Version: "1.1973", DownloadURL: "https://jenkins-updates.cloudbees.com/download/plugins/devoptics/1.1973/devoptics.hpi"},
{Name: "audit-trail", Version: "361.v82cde86c784e"},
{Name: "simple-theme-plugin", Version: "176.v39740c03a_a_f5"},
{Name: "github", Version: "1.38.0"},
{Name: "devoptics", Version: "2.0", DownloadURL: "https://jenkins-updates.cloudbees.com/download/plugins/devoptics/2.0/devoptics.hpi"},
},
PriorityClassName: priorityClassName,
NodeSelector: map[string]string{"kubernetes.io/os": "linux"},
@@ -167,6 +167,7 @@ func RenderJenkinsCR(name, namespace string, seedJob *[]v1alpha2.SeedJob, groovy
Service: v1alpha2.Service{
Type: corev1.ServiceTypeNodePort,
Port: constants.DefaultHTTPPortInt32,
NodePort: 30303,
},
Roles: []rbacv1.RoleRef{
{
+3 -1
View File
@@ -20,7 +20,7 @@ import (
)
var (
retryInterval = time.Second * 5
retryInterval = time.Second * 10
)
func WaitForJenkinsBaseConfigurationToComplete(jenkins *v1alpha2.Jenkins) {
@@ -53,6 +53,8 @@ func waitForRecreateJenkinsMasterPod(jenkins *v1alpha2.Jenkins) {
}
pods := &corev1.PodList{}
err := K8sClient.List(context.TODO(), pods, lo)
// debug print
_, _ = fmt.Fprintf(ginkgo.GinkgoWriter, "Pods: %+v\n", pods)
if err != nil {
return false, err
}
+4 -4
View File
@@ -47,7 +47,7 @@ var _ = Describe("Jenkins Controller", func() {
cmd := exec.Command("../../bin/helm", "upgrade", "jenkins", "../../chart/jenkins-operator", "--namespace", namespace.Name, "--debug",
"--set-string", fmt.Sprintf("jenkins.namespace=%s", namespace.Name),
"--set-string", fmt.Sprintf("jenkins.image=%s", "jenkins/jenkins:2.414.1-lts"),
"--set-string", fmt.Sprintf("jenkins.image=%s", "jenkins/jenkins:2.440.1-lts"),
"--set-string", fmt.Sprintf("operator.image=%s", *imageName), "--install")
output, err := cmd.CombinedOutput()
Expect(err).NotTo(HaveOccurred(), string(output))
@@ -80,9 +80,9 @@ var _ = Describe("Jenkins Controller with security validator", func() {
{Name: "github", Version: "1.36.0"},
}
validPlugins = []v1alpha2.Plugin{
{Name: "simple-theme-plugin", Version: "136.v23a_15f86c53d"},
{Name: "audit-trail", Version: "3.11"},
{Name: "github", Version: "1.37.3.1"},
{Name: "simple-theme-plugin", Version: "176.v39740c03a_a_f5"},
{Name: "audit-trail", Version: "361.v82cde86c784e"},
{Name: "github", Version: "1.38.0"},
}
)