Bump version to v0.6.0

This commit is contained in:
Mateusz Korus 2021-06-09 10:05:18 +02:00
parent e762957cc1
commit fbea1ed790
26 changed files with 483 additions and 684 deletions

View File

@ -358,16 +358,18 @@ bump-version: sembump ## Bump the version in the version file. Set BUMP to [ pat
@echo "Bumping VERSION.txt from $(VERSION) to $(NEW_VERSION)"
echo $(NEW_VERSION) > VERSION.txt
@echo "Updating version from $(VERSION) to $(NEW_VERSION) in README.md"
sed -i s/$(VERSION)/$(NEW_VERSION)/g README.md
sed -i s/$(VERSION)/$(NEW_VERSION)/g deploy/operator.yaml
sed -i s/$(VERSION)/$(NEW_VERSION)/g deploy/$(ALL_IN_ONE_DEPLOY_FILE_PREFIX)-$(API_VERSION).yaml
sed -i.bak 's/$(VERSION)/$(NEW_VERSION)/g' README.md
sed -i.bak 's/$(VERSION)/$(NEW_VERSION)/g' deploy/operator.yaml
sed -i.bak 's/$(VERSION)/$(NEW_VERSION)/g' deploy/$(ALL_IN_ONE_DEPLOY_FILE_PREFIX)-$(API_VERSION).yaml
rm */**.bak
rm *.bak
cp config/service_account.yaml deploy/$(ALL_IN_ONE_DEPLOY_FILE_PREFIX)-$(API_VERSION).yaml
cat config/rbac/leader_election_role.yaml >> config/$(ALL_IN_ONE_DEPLOY_FILE_PREFIX)-$(API_VERSION).yaml
cat config/rbac/leader_election_role_binding.yaml >> config/$(ALL_IN_ONE_DEPLOY_FILE_PREFIX)=$(API_VERSION).yaml
cat config/rbac/role.yaml >> config/$(ALL_IN_ONE_DEPLOY_FILE_PREFIX)=$(API_VERSION).yaml
cat config/rbac/role_binding.yaml >> config/$(ALL_IN_ONE_DEPLOY_FILE_PREFIX)-$(API_VERSION).yaml
cat config/manager/manager.yaml >> config/$(ALL_IN_ONE_DEPLOY_FILE_PREFIX)-$(API_VERSION).yaml
git add VERSION.txt README.md config/manager/manager.yaml config/$(ALL_IN_ONE_DEPLOY_FILE_PREFIX)-$(API_VERSION).yaml
cat config/rbac/leader_election_role.yaml >> deploy/$(ALL_IN_ONE_DEPLOY_FILE_PREFIX)-$(API_VERSION).yaml
cat config/rbac/leader_election_role_binding.yaml >> deploy/$(ALL_IN_ONE_DEPLOY_FILE_PREFIX)-$(API_VERSION).yaml
cat config/rbac/role.yaml >> deploy/$(ALL_IN_ONE_DEPLOY_FILE_PREFIX)-$(API_VERSION).yaml
cat config/rbac/role_binding.yaml >> deploy/$(ALL_IN_ONE_DEPLOY_FILE_PREFIX)-$(API_VERSION).yaml
cat config/manager/manager.yaml >> deploy/$(ALL_IN_ONE_DEPLOY_FILE_PREFIX)-$(API_VERSION).yaml
git add VERSION.txt README.md config/manager/manager.yaml deploy/$(ALL_IN_ONE_DEPLOY_FILE_PREFIX)-$(API_VERSION).yaml
git commit -vaem "Bump version to $(NEW_VERSION)"
@echo "Run make tag to create and push the tag for new version $(NEW_VERSION)"
@ -439,18 +441,6 @@ generate-docs: hugo ## Re-generate docs directory from the website directory
cd website && npm install
$(HUGO_PATH)/hugo -s website -d ../docs
.PHONY: all-in-one-build
FILENAME := config/all_in_one_$(API_VERSION).yaml
all-in-one-build: ## Re-generate all-in-one yaml
@echo "+ $@"
> $(FILENAME)
cat config/service_account.yaml >> $(FILENAME)
cat config/rbac/leader_election_role.yaml >> $(FILENAME)
cat config/rbac/leader_election_role_binding.yaml >> $(FILENAME)
cat config/rbac/role.yaml >> $(FILENAME)
cat config/rbac/role_binding.yaml >> $(FILENAME)
cat config/manager/manager.yaml >> $(FILENAME)
##################### FROM OPERATOR SDK ########################
# Install CRDs into a cluster
install-crds: manifests kustomize
@ -470,7 +460,7 @@ undeploy:
$(KUSTOMIZE) build config/default | kubectl delete -f -
# Generate manifests e.g. CRD, RBAC etc.
manifests: controller-gen all-in-one-build
manifests: controller-gen
$(CONTROLLER_GEN) $(CRD_OPTIONS) rbac:roleName=manager-role webhook paths="./..." output:crd:artifacts:config=config/crd/bases
# Generate code

View File

@ -1,6 +1,6 @@
# Jenkins Operator
[![Version](https://img.shields.io/badge/version-v0.5.0-brightgreen.svg)](https://github.com/jenkinsci/kubernetes-operator/releases/tag/v0.5.0)
[![Version](https://img.shields.io/badge/version-v0.6.0-brightgreen.svg)](https://github.com/jenkinsci/kubernetes-operator/releases/tag/v0.6.0)
[![Build status](https://github.com/jenkinsci/kubernetes-operator/actions/workflows/auto-tests.yaml/badge.svg)](https://github.com/jenkinsci/kubernetes-operator/actions/workflows/auto-tests.yaml)
[![Go Report Card](https://goreportcard.com/badge/github.com/jenkinsci/kubernetes-operator "Go Report Card")](https://goreportcard.com/report/github.com/jenkinsci/kubernetes-operator)
[![Docker Pulls](https://img.shields.io/docker/pulls/virtuslab/jenkins-operator.svg)](https://hub.docker.com/r/virtuslab/jenkins-operator/tags)

View File

@ -1 +1 @@
v0.5.0
v0.6.0

View File

@ -343,13 +343,13 @@ type JenkinsMaster struct {
// +optional
// Defaults to :
// - name: kubernetes
// version: "1.29.4"
// version: "1.29.6"
// - name: workflow-job
// version: "2.40"
// version: "2.41"
// - name: workflow-aggregator
// version: "2.6"
// - name: git
// version: "4.6.0"
// version: "4.7.2"
// - name: job-dsl
// version: "1.77"
// - name: configuration-as-code

View File

@ -5,7 +5,6 @@ kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.4.1
creationTimestamp: null
name: jenkins.jenkins.io
spec:
group: jenkins.io
@ -157,9 +156,9 @@ spec:
type: object
basePlugins:
description: 'BasePlugins contains plugins required by operator
Defaults to : - name: kubernetes version: "1.29.4" - name: workflow-job
version: "2.40" - name: workflow-aggregator version: "2.6" -
name: git version: "4.6.0" - name: job-dsl version: "1.77" -
Defaults to : - name: kubernetes version: "1.29.6" - name: workflow-job
version: "2.41" - name: workflow-aggregator version: "2.6" -
name: git version: "4.7.2" - name: job-dsl version: "1.77" -
name: configuration-as-code version: "1.51" - name: kubernetes-credentials-provider
version: "0.18-1"'
items:

View File

@ -63,34 +63,20 @@ jenkins:
#
# basePlugins:
# - name: kubernetes
# version: 1.29.4
# version: 1.29.6
# - name: workflow-job
# version: "2.40"
# version: "2.41"
# - name: workflow-aggregator
# version: "2.6"
# - name: git
# version: 4.6.0
# version: 4.7.2
# - name: job-dsl
# version: "1.77"
# - name: configuration-as-code
# version: "1.51"
# - name: kubernetes-credentials-provider
# version: 0.18-1
basePlugins:
- name: kubernetes
version: "1.29.4"
- name: workflow-job
version: "2.40"
- name: workflow-aggregator
version: "2.6"
- name: git
version: "4.6.0"
- name: job-dsl
version: "1.77"
- name: configuration-as-code
version: "1.51"
- name: kubernetes-credentials-provider
version: "0.18-1"
basePlugins: []
# plugins are plugins required by the user
# You can define plugins here

View File

@ -1,284 +0,0 @@
---
apiVersion: v1
kind: ServiceAccount
metadata:
name: jenkins-operator
---
# permissions to do leader election.
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
name: leader-election-role
rules:
- apiGroups:
- ""
- coordination.k8s.io
resources:
- configmaps
- leases
verbs:
- get
- list
- watch
- create
- update
- patch
- delete
- apiGroups:
- ""
resources:
- events
verbs:
- create
- patch
---
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
name: leader-election-rolebinding
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: Role
name: leader-election-role
subjects:
- kind: ServiceAccount
name: jenkins-operator
---
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
creationTimestamp: null
name: jenkins-operator
rules:
- apiGroups:
- apps
resources:
- daemonsets
- deployments
- replicasets
- statefulsets
verbs:
- '*'
- apiGroups:
- apps
- jenkins-operator
resources:
- deployments/finalizers
verbs:
- update
- apiGroups:
- build.openshift.io
resources:
- buildconfigs
- builds
verbs:
- get
- list
- watch
- apiGroups:
- ""
resources:
- configmaps
- secrets
- services
verbs:
- create
- get
- list
- update
- watch
- apiGroups:
- ""
resources:
- events
verbs:
- create
- get
- list
- patch
- watch
- apiGroups:
- ""
resources:
- persistentvolumeclaims
verbs:
- get
- list
- watch
- apiGroups:
- ""
resources:
- pods
verbs:
- create
- delete
- get
- list
- patch
- update
- watch
- apiGroups:
- ""
resources:
- pods
- pods/exec
verbs:
- '*'
- apiGroups:
- ""
resources:
- pods/log
verbs:
- get
- list
- watch
- apiGroups:
- ""
resources:
- pods/portforward
verbs:
- create
- apiGroups:
- ""
resources:
- serviceaccounts
verbs:
- create
- get
- list
- update
- watch
- apiGroups:
- image.openshift.io
resources:
- imagestreams
verbs:
- get
- list
- watch
- apiGroups:
- jenkins.io
resources:
- jenkins/finalizers
verbs:
- update
- apiGroups:
- jenkins.io
resources:
- jenkins/status
verbs:
- get
- patch
- update
- apiGroups:
- jenkins.io
resources:
- '*'
verbs:
- '*'
- apiGroups:
- rbac.authorization.k8s.io
resources:
- rolebindings
- roles
verbs:
- create
- get
- list
- update
- watch
- apiGroups:
- "route.openshift.io"
resources:
- routes
verbs:
- create
- get
- list
- update
- watch
- apiGroups:
- "image.openshift.io"
resources:
- imagestreams
verbs:
- get
- list
- watch
- apiGroups:
- "build.openshift.io"
resources:
- builds
- buildconfigs
verbs:
- get
- list
- watch
---
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
name: jenkins-operator
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: Role
name: jenkins-operator
subjects:
- kind: ServiceAccount
name: jenkins-operator
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: jenkins-operator
labels:
control-plane: controller-manager
spec:
selector:
matchLabels:
control-plane: controller-manager
replicas: 1
template:
metadata:
labels:
control-plane: controller-manager
spec:
serviceAccountName: jenkins-operator
securityContext:
runAsUser: 65532
containers:
- command:
- /manager
args:
- --leader-elect
image: virtuslab/jenkins-operator:v0.5.0
name: jenkins-operator
imagePullPolicy: IfNotPresent
securityContext:
allowPrivilegeEscalation: false
livenessProbe:
httpGet:
path: /healthz
port: 8081
initialDelaySeconds: 15
periodSeconds: 20
readinessProbe:
httpGet:
path: /readyz
port: 8081
initialDelaySeconds: 5
periodSeconds: 10
resources:
limits:
cpu: 100m
memory: 30Mi
requests:
cpu: 100m
memory: 20Mi
env:
- name: WATCH_NAMESPACE
valueFrom:
fieldRef:
fieldPath: metadata.namespace
terminationGracePeriodSeconds: 10

View File

@ -5,7 +5,6 @@ kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.4.1
creationTimestamp: null
name: jenkins.jenkins.io
spec:
group: jenkins.io
@ -157,9 +156,9 @@ spec:
type: object
basePlugins:
description: 'BasePlugins contains plugins required by operator
Defaults to : - name: kubernetes version: "1.29.4" - name: workflow-job
version: "2.40" - name: workflow-aggregator version: "2.6" -
name: git version: "4.6.0" - name: job-dsl version: "1.77" -
Defaults to : - name: kubernetes version: "1.29.6" - name: workflow-job
version: "2.41" - name: workflow-aggregator version: "2.6" -
name: git version: "4.7.2" - name: job-dsl version: "1.77" -
name: configuration-as-code version: "1.51" - name: kubernetes-credentials-provider
version: "0.18-1"'
items:

View File

@ -9,5 +9,4 @@ roleRef:
name: leader-election-role
subjects:
- kind: ServiceAccount
name: default
namespace: default
name: jenkins-operator

View File

@ -3,10 +3,9 @@
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
creationTimestamp: null
name: jenkins-operator
rules:
- apiGroups:
- apiGroups:
- apps
resources:
- daemonsets
@ -15,14 +14,14 @@ rules:
- statefulsets
verbs:
- '*'
- apiGroups:
- apiGroups:
- apps
- jenkins-operator
resources:
- deployments/finalizers
verbs:
- update
- apiGroups:
- apiGroups:
- build.openshift.io
resources:
- buildconfigs
@ -31,7 +30,7 @@ rules:
- get
- list
- watch
- apiGroups:
- apiGroups:
- ""
resources:
- configmaps
@ -43,7 +42,7 @@ rules:
- list
- update
- watch
- apiGroups:
- apiGroups:
- ""
resources:
- events
@ -53,7 +52,7 @@ rules:
- list
- patch
- watch
- apiGroups:
- apiGroups:
- ""
resources:
- persistentvolumeclaims
@ -61,7 +60,7 @@ rules:
- get
- list
- watch
- apiGroups:
- apiGroups:
- ""
resources:
- pods
@ -73,14 +72,14 @@ rules:
- patch
- update
- watch
- apiGroups:
- apiGroups:
- ""
resources:
- pods
- pods/exec
verbs:
- '*'
- apiGroups:
- apiGroups:
- ""
resources:
- pods/log
@ -88,13 +87,13 @@ rules:
- get
- list
- watch
- apiGroups:
- apiGroups:
- ""
resources:
- pods/portforward
verbs:
- create
- apiGroups:
- apiGroups:
- ""
resources:
- serviceaccounts
@ -104,7 +103,7 @@ rules:
- list
- update
- watch
- apiGroups:
- apiGroups:
- image.openshift.io
resources:
- imagestreams
@ -112,13 +111,31 @@ rules:
- get
- list
- watch
- apiGroups:
- apiGroups:
- jenkins.io
resources:
- '*'
verbs:
- '*'
- apiGroups:
- jenkins.io
resources:
- jenkins
verbs:
- create
- delete
- get
- list
- patch
- update
- watch
- apiGroups:
- jenkins.io
resources:
- jenkins/finalizers
verbs:
- update
- apiGroups:
- apiGroups:
- jenkins.io
resources:
- jenkins/status
@ -126,13 +143,7 @@ rules:
- get
- patch
- update
- apiGroups:
- jenkins.io
resources:
- '*'
verbs:
- '*'
- apiGroups:
- apiGroups:
- rbac.authorization.k8s.io
resources:
- rolebindings
@ -143,8 +154,8 @@ rules:
- list
- update
- watch
- apiGroups:
- "route.openshift.io"
- apiGroups:
- route.openshift.io
resources:
- routes
verbs:
@ -153,20 +164,3 @@ rules:
- list
- update
- watch
- apiGroups:
- "image.openshift.io"
resources:
- imagestreams
verbs:
- get
- list
- watch
- apiGroups:
- "build.openshift.io"
resources:
- builds
- buildconfigs
verbs:
- get
- list
- watch

View File

@ -3,4 +3,3 @@ apiVersion: v1
kind: ServiceAccount
metadata:
name: jenkins-operator
namespace: default

View File

@ -4,88 +4,100 @@ kind: ServiceAccount
metadata:
name: jenkins-operator
---
kind: Role
# permissions to do leader election.
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
name: jenkins-operator
name: leader-election-role
rules:
- apiGroups:
- apiGroups:
- ""
- coordination.k8s.io
resources:
- services
- configmaps
- secrets
- serviceaccounts
verbs:
- get
- create
- update
- list
- watch
- apiGroups:
- apps
resources:
- deployments
- daemonsets
- replicasets
- statefulsets
verbs:
- '*'
- apiGroups:
- rbac.authorization.k8s.io
resources:
- roles
- rolebindings
verbs:
- create
- update
- list
- watch
- apiGroups:
- ""
resources:
- pods/portforward
verbs:
- create
- apiGroups:
- ""
resources:
- pods/log
- leases
verbs:
- get
- list
- watch
- apiGroups:
- ""
resources:
- pods
- pods/exec
verbs:
- "*"
- apiGroups:
- create
- update
- patch
- delete
- apiGroups:
- ""
resources:
- events
verbs:
- watch
- list
- create
- patch
- apiGroups:
---
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
name: leader-election-rolebinding
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: Role
name: leader-election-role
subjects:
- kind: ServiceAccount
name: jenkins-operator
---
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
name: jenkins-operator
rules:
- apiGroups:
- apps
resources:
- daemonsets
- deployments
- replicasets
- statefulsets
verbs:
- '*'
- apiGroups:
- apps
resourceNames:
- jenkins-operator
resources:
- deployments/finalizers
verbs:
- update
- apiGroups:
- jenkins.io
- apiGroups:
- build.openshift.io
resources:
- '*'
- buildconfigs
- builds
verbs:
- '*'
- apiGroups:
- get
- list
- watch
- apiGroups:
- ""
resources:
- configmaps
- secrets
- services
verbs:
- create
- get
- list
- update
- watch
- apiGroups:
- ""
resources:
- events
verbs:
- create
- get
- list
- patch
- watch
- apiGroups:
- ""
resources:
- persistentvolumeclaims
@ -93,76 +105,174 @@ rules:
- get
- list
- watch
- apiGroups:
- "route.openshift.io"
- apiGroups:
- ""
resources:
- routes
- pods
verbs:
- create
- delete
- get
- list
- patch
- update
- watch
- apiGroups:
- ""
resources:
- pods
- pods/exec
verbs:
- '*'
- apiGroups:
- ""
resources:
- pods/log
verbs:
- get
- list
- watch
- apiGroups:
- ""
resources:
- pods/portforward
verbs:
- create
- apiGroups:
- ""
resources:
- serviceaccounts
verbs:
- create
- get
- list
- update
- apiGroups:
- "image.openshift.io"
- watch
- apiGroups:
- image.openshift.io
resources:
- imagestreams
verbs:
- get
- list
- watch
- apiGroups:
- "build.openshift.io"
- apiGroups:
- jenkins.io
resources:
- builds
- buildconfigs
- '*'
verbs:
- '*'
- apiGroups:
- jenkins.io
resources:
- jenkins
verbs:
- create
- delete
- get
- list
- patch
- update
- watch
- apiGroups:
- jenkins.io
resources:
- jenkins/finalizers
verbs:
- update
- apiGroups:
- jenkins.io
resources:
- jenkins/status
verbs:
- get
- patch
- update
- apiGroups:
- rbac.authorization.k8s.io
resources:
- rolebindings
- roles
verbs:
- create
- get
- list
- update
- watch
- apiGroups:
- route.openshift.io
resources:
- routes
verbs:
- create
- get
- list
- update
- watch
---
kind: RoleBinding
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
name: manager-rolebinding
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: Role
name: jenkins-operator
subjects:
- kind: ServiceAccount
name: jenkins-operator
roleRef:
kind: Role
name: jenkins-operator
apiGroup: rbac.authorization.k8s.io
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: jenkins-operator
labels:
control-plane: controller-manager
spec:
replicas: 1
selector:
matchLabels:
name: jenkins-operator
control-plane: controller-manager
replicas: 1
template:
metadata:
labels:
name: jenkins-operator
control-plane: controller-manager
spec:
serviceAccountName: jenkins-operator
securityContext:
runAsUser: 65532
containers:
- name: jenkins-operator
image: virtuslab/jenkins-operator:v0.5.0
command:
- jenkins-operator
args: []
- command:
- /manager
args:
- --leader-elect
image: virtuslab/jenkins-operator:v0.6.0
name: jenkins-operator
imagePullPolicy: IfNotPresent
securityContext:
allowPrivilegeEscalation: false
livenessProbe:
httpGet:
path: /healthz
port: 8081
initialDelaySeconds: 15
periodSeconds: 20
readinessProbe:
httpGet:
path: /readyz
port: 8081
initialDelaySeconds: 5
periodSeconds: 10
resources:
limits:
cpu: 100m
memory: 30Mi
requests:
cpu: 100m
memory: 20Mi
env:
- name: WATCH_NAMESPACE
valueFrom:
fieldRef:
fieldPath: metadata.namespace
- name: POD_NAME
valueFrom:
fieldRef:
fieldPath: metadata.name
- name: OPERATOR_NAME
value: "jenkins-operator"
terminationGracePeriodSeconds: 10

View File

@ -151,9 +151,9 @@ spec:
type: object
basePlugins:
description: 'BasePlugins contains plugins required by operator
Defaults to : - name: kubernetes version: 1.29.4 - name: workflow-job
Defaults to : - name: kubernetes version: 1.29.6 - name: workflow-job
version: "2.39" - name: workflow-aggregator version: "2.6" - name:
git version: 4.6.0 - name: job-dsl version: "1.74" - name: configuration-as-code
git version: 4.7.2 - name: job-dsl version: "1.74" - name: configuration-as-code
version: "1.51" - name: kubernetes-credentials-provider version: 0.18-1'
items:
description: Plugin defines Jenkins plugin

View File

@ -1,24 +0,0 @@
apiVersion: jenkins.io/v1alpha2
kind: JenkinsImage
metadata:
name: simple-jenkinsimage
spec:
image:
name: jenkins/jenkins
tag: 2.277.4-lts-alpine
plugins:
- name: kubernetes
version: "1.29.4"
- name: workflow-job
version: "2.40"
- name: workflow-aggregator
version: "2.6"
- name: git
version: "4.6.0"
- name: job-dsl
version: "1.77"
- name: configuration-as-code
version: "1.51"
- name: kubernetes-credentials-provider
version: "0.18-1"

View File

@ -16,7 +16,7 @@ spec:
serviceAccountName: jenkins-operator
containers:
- name: jenkins-operator
image: virtuslab/jenkins-operator:v0.5.0
image: virtuslab/jenkins-operator:v0.6.0
command:
- jenkins-operator
args: []

View File

@ -2,12 +2,12 @@ package plugins
const (
configurationAsCodePlugin = "configuration-as-code:1.51"
gitPlugin = "git:4.6.0"
gitPlugin = "git:4.7.2"
jobDslPlugin = "job-dsl:1.77"
kubernetesCredentialsProviderPlugin = "kubernetes-credentials-provider:0.18-1"
kubernetesPlugin = "kubernetes:1.29.4"
kubernetesPlugin = "kubernetes:1.29.6"
workflowAggregatorPlugin = "workflow-aggregator:2.6"
workflowJobPlugin = "workflow-job:2.40"
workflowJobPlugin = "workflow-job:2.41"
)
// basePluginsList contains plugins to install by operator.

View File

@ -129,6 +129,7 @@ var _ = Describe("Jenkins controller priority class", func() {
})
AfterEach(func() {
ShowLogsIfTestHasFailed(CurrentGinkgoTestDescription().Failed, namespace.Name)
DestroyNamespace(namespace)
})

View File

@ -39,6 +39,7 @@ var _ = Describe("Jenkins controller", func() {
})
AfterEach(func() {
ShowLogsIfTestHasFailed(CurrentGinkgoTestDescription().Failed, namespace.Name)
DestroyNamespace(namespace)
})

View File

@ -28,6 +28,7 @@ var _ = Describe("Jenkins controller backup and restore", func() {
})
AfterEach(func() {
ShowLogsIfTestHasFailed(CurrentGinkgoTestDescription().Failed, namespace.Name)
DestroyNamespace(namespace)
})

View File

@ -96,9 +96,9 @@ func createJenkinsCR(name, namespace string, seedJob *[]v1alpha2.SeedJob, groovy
},
InitialDelaySeconds: int32(80),
TimeoutSeconds: int32(4),
FailureThreshold: int32(10),
FailureThreshold: int32(30),
SuccessThreshold: int32(1),
PeriodSeconds: int32(1),
PeriodSeconds: int32(5),
},
VolumeMounts: []corev1.VolumeMount{
{

View File

@ -1,4 +1,4 @@
package helm
package e2e
import (
"bytes"
@ -7,7 +7,6 @@ import (
"io"
"sort"
"github.com/jenkinsci/kubernetes-operator/test/e2e"
"github.com/onsi/ginkgo"
corev1 "k8s.io/api/core/v1"
@ -32,7 +31,7 @@ func getOperatorPod(namespace string) (*corev1.Pod, error) {
Namespace: namespace,
}
pods := &corev1.PodList{}
err := e2e.K8sClient.List(context.TODO(), pods, lo)
err := K8sClient.List(context.TODO(), pods, lo)
if err != nil {
return nil, err
}
@ -47,7 +46,7 @@ func getOperatorLogs(namespace string) (string, error) {
logOptions := corev1.PodLogOptions{TailLines: &podLogTailLimit}
// creates the clientset
clientset, err := kubernetes.NewForConfig(e2e.Cfg)
clientset, err := kubernetes.NewForConfig(Cfg)
if err != nil {
return "", err
}
@ -90,7 +89,7 @@ func getKubernetesEvents(namespace string) ([]v1beta1.Event, error) {
}
events := &v1beta1.EventList{}
err := e2e.K8sClient.List(context.TODO(), events, listOptions)
err := K8sClient.List(context.TODO(), events, listOptions)
if err != nil {
return nil, err
}
@ -124,7 +123,7 @@ func printKubernetesPods(namespace string) {
}
}
func showLogsIfTestHasFailed(failed bool, namespace string) {
func ShowLogsIfTestHasFailed(failed bool, namespace string) {
if failed {
_, _ = fmt.Fprintf(ginkgo.GinkgoWriter, "Test failed. Bellow here you can check logs:")

View File

@ -15,6 +15,7 @@ import (
corev1 "k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/api/resource"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/util/intstr"
)
const pvcName = "pvc-jenkins"
@ -114,6 +115,34 @@ func createJenkinsWithBackupAndRestoreConfigured(name, namespace string) *v1alph
MountPath: "/usr/share/jenkins/ref/plugins",
},
},
ReadinessProbe: &corev1.Probe{
Handler: corev1.Handler{
HTTPGet: &corev1.HTTPGetAction{
Path: "/login",
Port: intstr.FromString("http"),
Scheme: corev1.URISchemeHTTP,
},
},
InitialDelaySeconds: int32(100),
TimeoutSeconds: int32(4),
FailureThreshold: int32(30),
SuccessThreshold: int32(1),
PeriodSeconds: int32(5),
},
LivenessProbe: &corev1.Probe{
Handler: corev1.Handler{
HTTPGet: &corev1.HTTPGetAction{
Path: "/login",
Port: intstr.FromString("http"),
Scheme: corev1.URISchemeHTTP,
},
},
InitialDelaySeconds: int32(80),
TimeoutSeconds: int32(4),
FailureThreshold: int32(30),
SuccessThreshold: int32(1),
PeriodSeconds: int32(5),
},
},
{
Name: containerName,

View File

@ -23,7 +23,7 @@ var _ = Describe("Jenkins controller", func() {
namespace = e2e.CreateNamespace()
})
AfterEach(func() {
showLogsIfTestHasFailed(CurrentGinkgoTestDescription().Failed, namespace.Name)
e2e.ShowLogsIfTestHasFailed(CurrentGinkgoTestDescription().Failed, namespace.Name)
e2e.DestroyNamespace(namespace)
})
Context("when deploying Helm Chart to cluster", func() {

View File

@ -48,7 +48,7 @@ spec:
fsGroup: 1000
containers:
- name: jenkins-master
image: jenkins/jenkins:2.263.2-lts-alpine
image: jenkins/jenkins:2.277.4-lts-alpine
- name: backup # container responsible for the backup and restore
env:
- name: BACKUP_DIR

View File

@ -19,7 +19,7 @@ spec:
master:
containers:
- name: jenkins-master
image: jenkins/jenkins:2.263.2-lts-alpine
image: jenkins/jenkins:2.277.4-lts-alpine
imagePullPolicy: Always
livenessProbe:
failureThreshold: 12

View File

@ -19,7 +19,7 @@ spec:
master:
containers:
- name: jenkins-master
image: jenkins/jenkins:2.263.3-lts-alpine
image: jenkins/jenkins:2.277.4-lts-alpine
imagePullPolicy: Always
livenessProbe:
failureThreshold: 12