parent
							
								
									11231b690c
								
							
						
					
					
						commit
						852d729018
					
				|  | @ -25,7 +25,6 @@ import ( | ||||||
| 	"github.com/operator-framework/operator-sdk/pkg/leader" | 	"github.com/operator-framework/operator-sdk/pkg/leader" | ||||||
| 	"github.com/operator-framework/operator-sdk/pkg/log/zap" | 	"github.com/operator-framework/operator-sdk/pkg/log/zap" | ||||||
| 	"github.com/operator-framework/operator-sdk/pkg/metrics" | 	"github.com/operator-framework/operator-sdk/pkg/metrics" | ||||||
| 	"github.com/operator-framework/operator-sdk/pkg/restmapper" |  | ||||||
| 	sdkVersion "github.com/operator-framework/operator-sdk/version" | 	sdkVersion "github.com/operator-framework/operator-sdk/version" | ||||||
| 	"github.com/pkg/errors" | 	"github.com/pkg/errors" | ||||||
| 	"github.com/spf13/pflag" | 	"github.com/spf13/pflag" | ||||||
|  | @ -36,7 +35,7 @@ import ( | ||||||
| 	"k8s.io/client-go/rest" | 	"k8s.io/client-go/rest" | ||||||
| 	"sigs.k8s.io/controller-runtime/pkg/client/config" | 	"sigs.k8s.io/controller-runtime/pkg/client/config" | ||||||
| 	"sigs.k8s.io/controller-runtime/pkg/manager" | 	"sigs.k8s.io/controller-runtime/pkg/manager" | ||||||
| 	"sigs.k8s.io/controller-runtime/pkg/runtime/signals" | 	"sigs.k8s.io/controller-runtime/pkg/manager/signals" | ||||||
| ) | ) | ||||||
| 
 | 
 | ||||||
| // Change below variables to serve metrics on different host or port.
 | // Change below variables to serve metrics on different host or port.
 | ||||||
|  | @ -97,7 +96,6 @@ func main() { | ||||||
| 	// Create a new Cmd to provide shared dependencies and start components
 | 	// Create a new Cmd to provide shared dependencies and start components
 | ||||||
| 	mgr, err := manager.New(cfg, manager.Options{ | 	mgr, err := manager.New(cfg, manager.Options{ | ||||||
| 		Namespace:          namespace, | 		Namespace:          namespace, | ||||||
| 		MapperProvider:     restmapper.NewDynamicRESTMapper, |  | ||||||
| 		MetricsBindAddress: fmt.Sprintf("%s:%d", metricsHost, metricsPort), | 		MetricsBindAddress: fmt.Sprintf("%s:%d", metricsHost, metricsPort), | ||||||
| 	}) | 	}) | ||||||
| 	if err != nil { | 	if err != nil { | ||||||
|  |  | ||||||
|  | @ -1,6 +1,6 @@ | ||||||
| # Setup variables for the Makefile | # Setup variables for the Makefile | ||||||
| NAME=kubernetes-operator | NAME=kubernetes-operator | ||||||
| OPERATOR_SDK_VERSION=0.10.0 | OPERATOR_SDK_VERSION=0.15.1 | ||||||
| GO_VERSION=1.13.1 | GO_VERSION=1.13.1 | ||||||
| PKG=github.com/jenkinsci/kubernetes-operator | PKG=github.com/jenkinsci/kubernetes-operator | ||||||
| DOCKER_ORGANIZATION=virtuslab | DOCKER_ORGANIZATION=virtuslab | ||||||
|  |  | ||||||
|  | @ -19,12 +19,12 @@ spec: | ||||||
|         apiVersion: |         apiVersion: | ||||||
|           description: 'APIVersion defines the versioned schema of this representation |           description: 'APIVersion defines the versioned schema of this representation | ||||||
|             of an object. Servers should convert recognized schemas to the latest |             of an object. Servers should convert recognized schemas to the latest | ||||||
|             internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#resources' |             internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' | ||||||
|           type: string |           type: string | ||||||
|         kind: |         kind: | ||||||
|           description: 'Kind is a string value representing the REST resource this |           description: 'Kind is a string value representing the REST resource this | ||||||
|             object represents. Servers may infer this from the endpoint the client |             object represents. Servers may infer this from the endpoint the client | ||||||
|             submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds' |             submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' | ||||||
|           type: string |           type: string | ||||||
|         metadata: |         metadata: | ||||||
|           type: object |           type: object | ||||||
|  | @ -248,7 +248,7 @@ spec: | ||||||
|                                       type: string |                                       type: string | ||||||
|                                     optional: |                                     optional: | ||||||
|                                       description: Specify whether the ConfigMap or |                                       description: Specify whether the ConfigMap or | ||||||
|                                         it's key must be defined |                                         its key must be defined | ||||||
|                                       type: boolean |                                       type: boolean | ||||||
|                                   required: |                                   required: | ||||||
|                                   - key |                                   - key | ||||||
|  | @ -306,7 +306,7 @@ spec: | ||||||
|                                         kind, uid?' |                                         kind, uid?' | ||||||
|                                       type: string |                                       type: string | ||||||
|                                     optional: |                                     optional: | ||||||
|                                       description: Specify whether the Secret or it's |                                       description: Specify whether the Secret or its | ||||||
|                                         key must be defined |                                         key must be defined | ||||||
|                                       type: boolean |                                       type: boolean | ||||||
|                                   required: |                                   required: | ||||||
|  | @ -465,12 +465,17 @@ spec: | ||||||
|                             type: object |                             type: object | ||||||
|                           preStop: |                           preStop: | ||||||
|                             description: 'PreStop is called immediately before a container |                             description: 'PreStop is called immediately before a container | ||||||
|                               is terminated. The container is terminated after the |                               is terminated due to an API request or management event | ||||||
|                               handler completes. The reason for termination is passed |                               such as liveness/startup probe failure, preemption, | ||||||
|                               to the handler. Regardless of the outcome of the handler, |                               resource contention, etc. The handler is not called | ||||||
|                               the container is eventually terminated. Other management |                               if the container crashes or exits. The reason for termination | ||||||
|                               of the container blocks until the hook completes. More |                               is passed to the handler. The Pod''s termination grace | ||||||
|                               info: https://kubernetes.io/docs/concepts/containers/container-lifecycle-hooks/#container-hooks' |                               period countdown begins before the PreStop hooked is | ||||||
|  |                               executed. Regardless of the outcome of the handler, | ||||||
|  |                               the container will eventually terminate within the Pod''s | ||||||
|  |                               termination grace period. Other management of the container | ||||||
|  |                               blocks until the hook completes or until the termination | ||||||
|  |                               grace period is reached. More info: https://kubernetes.io/docs/concepts/containers/container-lifecycle-hooks/#container-hooks' | ||||||
|                             properties: |                             properties: | ||||||
|                               exec: |                               exec: | ||||||
|                                 description: One and only one of the following should |                                 description: One and only one of the following should | ||||||
|  | @ -642,7 +647,8 @@ spec: | ||||||
|                           successThreshold: |                           successThreshold: | ||||||
|                             description: Minimum consecutive successes for the probe |                             description: Minimum consecutive successes for the probe | ||||||
|                               to be considered successful after having failed. Defaults |                               to be considered successful after having failed. Defaults | ||||||
|                               to 1. Must be 1 for liveness. Minimum value is 1. |                               to 1. Must be 1 for liveness and startup. Minimum value | ||||||
|  |                               is 1. | ||||||
|                             format: int32 |                             format: int32 | ||||||
|                             type: integer |                             type: integer | ||||||
|                           tcpSocket: |                           tcpSocket: | ||||||
|  | @ -805,7 +811,8 @@ spec: | ||||||
|                           successThreshold: |                           successThreshold: | ||||||
|                             description: Minimum consecutive successes for the probe |                             description: Minimum consecutive successes for the probe | ||||||
|                               to be considered successful after having failed. Defaults |                               to be considered successful after having failed. Defaults | ||||||
|                               to 1. Must be 1 for liveness. Minimum value is 1. |                               to 1. Must be 1 for liveness and startup. Minimum value | ||||||
|  |                               is 1. | ||||||
|                             format: int32 |                             format: int32 | ||||||
|                             type: integer |                             type: integer | ||||||
|                           tcpSocket: |                           tcpSocket: | ||||||
|  | @ -955,6 +962,38 @@ spec: | ||||||
|                                   to the container. |                                   to the container. | ||||||
|                                 type: string |                                 type: string | ||||||
|                             type: object |                             type: object | ||||||
|  |                           windowsOptions: | ||||||
|  |                             description: The Windows specific settings applied to | ||||||
|  |                               all containers. If unspecified, the options from the | ||||||
|  |                               PodSecurityContext will be used. If set in both SecurityContext | ||||||
|  |                               and PodSecurityContext, the value specified in SecurityContext | ||||||
|  |                               takes precedence. | ||||||
|  |                             properties: | ||||||
|  |                               gmsaCredentialSpec: | ||||||
|  |                                 description: GMSACredentialSpec is where the GMSA | ||||||
|  |                                   admission webhook (https://github.com/kubernetes-sigs/windows-gmsa) | ||||||
|  |                                   inlines the contents of the GMSA credential spec | ||||||
|  |                                   named by the GMSACredentialSpecName field. This | ||||||
|  |                                   field is alpha-level and is only honored by servers | ||||||
|  |                                   that enable the WindowsGMSA feature flag. | ||||||
|  |                                 type: string | ||||||
|  |                               gmsaCredentialSpecName: | ||||||
|  |                                 description: GMSACredentialSpecName is the name of | ||||||
|  |                                   the GMSA credential spec to use. This field is alpha-level | ||||||
|  |                                   and is only honored by servers that enable the WindowsGMSA | ||||||
|  |                                   feature flag. | ||||||
|  |                                 type: string | ||||||
|  |                               runAsUserName: | ||||||
|  |                                 description: The UserName in Windows to run the entrypoint | ||||||
|  |                                   of the container process. Defaults to the user specified | ||||||
|  |                                   in image metadata if unspecified. May also be set | ||||||
|  |                                   in PodSecurityContext. If set in both SecurityContext | ||||||
|  |                                   and PodSecurityContext, the value specified in SecurityContext | ||||||
|  |                                   takes precedence. This field is alpha-level and | ||||||
|  |                                   it is only honored by servers that enable the WindowsRunAsUserName | ||||||
|  |                                   feature flag. | ||||||
|  |                                 type: string | ||||||
|  |                             type: object | ||||||
|                         type: object |                         type: object | ||||||
|                       volumeMounts: |                       volumeMounts: | ||||||
|                         description: Pod volumes to mount into the container's filesystem. |                         description: Pod volumes to mount into the container's filesystem. | ||||||
|  | @ -984,6 +1023,14 @@ spec: | ||||||
|                                 volume should be mounted. Defaults to "" (volume's |                                 volume should be mounted. Defaults to "" (volume's | ||||||
|                                 root). |                                 root). | ||||||
|                               type: string |                               type: string | ||||||
|  |                             subPathExpr: | ||||||
|  |                               description: Expanded path within the volume from which | ||||||
|  |                                 the container's volume should be mounted. Behaves | ||||||
|  |                                 similarly to SubPath but environment variable references | ||||||
|  |                                 $(VAR_NAME) are expanded using the container's environment. | ||||||
|  |                                 Defaults to "" (volume's root). SubPathExpr and SubPath | ||||||
|  |                                 are mutually exclusive. This field is beta in 1.15. | ||||||
|  |                               type: string | ||||||
|                           required: |                           required: | ||||||
|                           - mountPath |                           - mountPath | ||||||
|                           - name |                           - name | ||||||
|  | @ -1154,6 +1201,36 @@ spec: | ||||||
|                         - value |                         - value | ||||||
|                         type: object |                         type: object | ||||||
|                       type: array |                       type: array | ||||||
|  |                     windowsOptions: | ||||||
|  |                       description: The Windows specific settings applied to all containers. | ||||||
|  |                         If unspecified, the options within a container's SecurityContext | ||||||
|  |                         will be used. If set in both SecurityContext and PodSecurityContext, | ||||||
|  |                         the value specified in SecurityContext takes precedence. | ||||||
|  |                       properties: | ||||||
|  |                         gmsaCredentialSpec: | ||||||
|  |                           description: GMSACredentialSpec is where the GMSA admission | ||||||
|  |                             webhook (https://github.com/kubernetes-sigs/windows-gmsa) | ||||||
|  |                             inlines the contents of the GMSA credential spec named | ||||||
|  |                             by the GMSACredentialSpecName field. This field is alpha-level | ||||||
|  |                             and is only honored by servers that enable the WindowsGMSA | ||||||
|  |                             feature flag. | ||||||
|  |                           type: string | ||||||
|  |                         gmsaCredentialSpecName: | ||||||
|  |                           description: GMSACredentialSpecName is the name of the GMSA | ||||||
|  |                             credential spec to use. This field is alpha-level and | ||||||
|  |                             is only honored by servers that enable the WindowsGMSA | ||||||
|  |                             feature flag. | ||||||
|  |                           type: string | ||||||
|  |                         runAsUserName: | ||||||
|  |                           description: The UserName in Windows to run the entrypoint | ||||||
|  |                             of the container process. Defaults to the user specified | ||||||
|  |                             in image metadata if unspecified. May also be set in PodSecurityContext. | ||||||
|  |                             If set in both SecurityContext and PodSecurityContext, | ||||||
|  |                             the value specified in SecurityContext takes precedence. | ||||||
|  |                             This field is alpha-level and it is only honored by servers | ||||||
|  |                             that enable the WindowsRunAsUserName feature flag. | ||||||
|  |                           type: string | ||||||
|  |                       type: object | ||||||
|                   type: object |                   type: object | ||||||
|                 tolerations: |                 tolerations: | ||||||
|                   description: If specified, the pod's tolerations. |                   description: If specified, the pod's tolerations. | ||||||
|  | @ -1294,7 +1371,7 @@ spec: | ||||||
|                         properties: |                         properties: | ||||||
|                           monitors: |                           monitors: | ||||||
|                             description: 'Required: Monitors is a collection of Ceph |                             description: 'Required: Monitors is a collection of Ceph | ||||||
|                               monitors More info: https://releases.k8s.io/HEAD/examples/volumes/cephfs/README.md#how-to-use-it' |                               monitors More info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it' | ||||||
|                             items: |                             items: | ||||||
|                               type: string |                               type: string | ||||||
|                             type: array |                             type: array | ||||||
|  | @ -1305,17 +1382,17 @@ spec: | ||||||
|                           readOnly: |                           readOnly: | ||||||
|                             description: 'Optional: Defaults to false (read/write). |                             description: 'Optional: Defaults to false (read/write). | ||||||
|                               ReadOnly here will force the ReadOnly setting in VolumeMounts. |                               ReadOnly here will force the ReadOnly setting in VolumeMounts. | ||||||
|                               More info: https://releases.k8s.io/HEAD/examples/volumes/cephfs/README.md#how-to-use-it' |                               More info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it' | ||||||
|                             type: boolean |                             type: boolean | ||||||
|                           secretFile: |                           secretFile: | ||||||
|                             description: 'Optional: SecretFile is the path to key |                             description: 'Optional: SecretFile is the path to key | ||||||
|                               ring for User, default is /etc/ceph/user.secret More |                               ring for User, default is /etc/ceph/user.secret More | ||||||
|                               info: https://releases.k8s.io/HEAD/examples/volumes/cephfs/README.md#how-to-use-it' |                               info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it' | ||||||
|                             type: string |                             type: string | ||||||
|                           secretRef: |                           secretRef: | ||||||
|                             description: 'Optional: SecretRef is reference to the |                             description: 'Optional: SecretRef is reference to the | ||||||
|                               authentication secret for User, default is empty. More |                               authentication secret for User, default is empty. More | ||||||
|                               info: https://releases.k8s.io/HEAD/examples/volumes/cephfs/README.md#how-to-use-it' |                               info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it' | ||||||
|                             properties: |                             properties: | ||||||
|                               name: |                               name: | ||||||
|                                 description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names |                                 description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names | ||||||
|  | @ -1325,25 +1402,25 @@ spec: | ||||||
|                             type: object |                             type: object | ||||||
|                           user: |                           user: | ||||||
|                             description: 'Optional: User is the rados user name, default |                             description: 'Optional: User is the rados user name, default | ||||||
|                               is admin More info: https://releases.k8s.io/HEAD/examples/volumes/cephfs/README.md#how-to-use-it' |                               is admin More info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it' | ||||||
|                             type: string |                             type: string | ||||||
|                         required: |                         required: | ||||||
|                         - monitors |                         - monitors | ||||||
|                         type: object |                         type: object | ||||||
|                       cinder: |                       cinder: | ||||||
|                         description: 'Cinder represents a cinder volume attached and |                         description: 'Cinder represents a cinder volume attached and | ||||||
|                           mounted on kubelets host machine More info: https://releases.k8s.io/HEAD/examples/mysql-cinder-pd/README.md' |                           mounted on kubelets host machine. More info: https://examples.k8s.io/mysql-cinder-pd/README.md' | ||||||
|                         properties: |                         properties: | ||||||
|                           fsType: |                           fsType: | ||||||
|                             description: 'Filesystem type to mount. Must be a filesystem |                             description: 'Filesystem type to mount. Must be a filesystem | ||||||
|                               type supported by the host operating system. Examples: |                               type supported by the host operating system. Examples: | ||||||
|                               "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" |                               "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" | ||||||
|                               if unspecified. More info: https://releases.k8s.io/HEAD/examples/mysql-cinder-pd/README.md' |                               if unspecified. More info: https://examples.k8s.io/mysql-cinder-pd/README.md' | ||||||
|                             type: string |                             type: string | ||||||
|                           readOnly: |                           readOnly: | ||||||
|                             description: 'Optional: Defaults to false (read/write). |                             description: 'Optional: Defaults to false (read/write). | ||||||
|                               ReadOnly here will force the ReadOnly setting in VolumeMounts. |                               ReadOnly here will force the ReadOnly setting in VolumeMounts. | ||||||
|                               More info: https://releases.k8s.io/HEAD/examples/mysql-cinder-pd/README.md' |                               More info: https://examples.k8s.io/mysql-cinder-pd/README.md' | ||||||
|                             type: boolean |                             type: boolean | ||||||
|                           secretRef: |                           secretRef: | ||||||
|                             description: 'Optional: points to a secret object containing |                             description: 'Optional: points to a secret object containing | ||||||
|  | @ -1357,7 +1434,7 @@ spec: | ||||||
|                             type: object |                             type: object | ||||||
|                           volumeID: |                           volumeID: | ||||||
|                             description: 'volume id used to identify the volume in |                             description: 'volume id used to identify the volume in | ||||||
|                               cinder More info: https://releases.k8s.io/HEAD/examples/mysql-cinder-pd/README.md' |                               cinder. More info: https://examples.k8s.io/mysql-cinder-pd/README.md' | ||||||
|                             type: string |                             type: string | ||||||
|                         required: |                         required: | ||||||
|                         - volumeID |                         - volumeID | ||||||
|  | @ -1416,10 +1493,55 @@ spec: | ||||||
|                               TODO: Add other useful fields. apiVersion, kind, uid?' |                               TODO: Add other useful fields. apiVersion, kind, uid?' | ||||||
|                             type: string |                             type: string | ||||||
|                           optional: |                           optional: | ||||||
|                             description: Specify whether the ConfigMap or it's keys |                             description: Specify whether the ConfigMap or its keys | ||||||
|                               must be defined |                               must be defined | ||||||
|                             type: boolean |                             type: boolean | ||||||
|                         type: object |                         type: object | ||||||
|  |                       csi: | ||||||
|  |                         description: CSI (Container Storage Interface) represents | ||||||
|  |                           storage that is handled by an external CSI driver (Alpha | ||||||
|  |                           feature). | ||||||
|  |                         properties: | ||||||
|  |                           driver: | ||||||
|  |                             description: Driver is the name of the CSI driver that | ||||||
|  |                               handles this volume. Consult with your admin for the | ||||||
|  |                               correct name as registered in the cluster. | ||||||
|  |                             type: string | ||||||
|  |                           fsType: | ||||||
|  |                             description: Filesystem type to mount. Ex. "ext4", "xfs", | ||||||
|  |                               "ntfs". If not provided, the empty value is passed to | ||||||
|  |                               the associated CSI driver which will determine the default | ||||||
|  |                               filesystem to apply. | ||||||
|  |                             type: string | ||||||
|  |                           nodePublishSecretRef: | ||||||
|  |                             description: NodePublishSecretRef is a reference to the | ||||||
|  |                               secret object containing sensitive information to pass | ||||||
|  |                               to the CSI driver to complete the CSI NodePublishVolume | ||||||
|  |                               and NodeUnpublishVolume calls. This field is optional, | ||||||
|  |                               and  may be empty if no secret is required. If the secret | ||||||
|  |                               object contains more than one secret, all secret references | ||||||
|  |                               are passed. | ||||||
|  |                             properties: | ||||||
|  |                               name: | ||||||
|  |                                 description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names | ||||||
|  |                                   TODO: Add other useful fields. apiVersion, kind, | ||||||
|  |                                   uid?' | ||||||
|  |                                 type: string | ||||||
|  |                             type: object | ||||||
|  |                           readOnly: | ||||||
|  |                             description: Specifies a read-only configuration for the | ||||||
|  |                               volume. Defaults to false (read/write). | ||||||
|  |                             type: boolean | ||||||
|  |                           volumeAttributes: | ||||||
|  |                             additionalProperties: | ||||||
|  |                               type: string | ||||||
|  |                             description: VolumeAttributes stores driver-specific properties | ||||||
|  |                               that are passed to the CSI driver. Consult your driver's | ||||||
|  |                               documentation for supported values. | ||||||
|  |                             type: object | ||||||
|  |                         required: | ||||||
|  |                         - driver | ||||||
|  |                         type: object | ||||||
|                       downwardAPI: |                       downwardAPI: | ||||||
|                         description: DownwardAPI represents downward API about the |                         description: DownwardAPI represents downward API about the | ||||||
|                           pod that should populate this volume |                           pod that should populate this volume | ||||||
|  | @ -1663,20 +1785,20 @@ spec: | ||||||
|                         type: object |                         type: object | ||||||
|                       glusterfs: |                       glusterfs: | ||||||
|                         description: 'Glusterfs represents a Glusterfs mount on the |                         description: 'Glusterfs represents a Glusterfs mount on the | ||||||
|                           host that shares a pod''s lifetime. More info: https://releases.k8s.io/HEAD/examples/volumes/glusterfs/README.md' |                           host that shares a pod''s lifetime. More info: https://examples.k8s.io/volumes/glusterfs/README.md' | ||||||
|                         properties: |                         properties: | ||||||
|                           endpoints: |                           endpoints: | ||||||
|                             description: 'EndpointsName is the endpoint name that |                             description: 'EndpointsName is the endpoint name that | ||||||
|                               details Glusterfs topology. More info: https://releases.k8s.io/HEAD/examples/volumes/glusterfs/README.md#create-a-pod' |                               details Glusterfs topology. More info: https://examples.k8s.io/volumes/glusterfs/README.md#create-a-pod' | ||||||
|                             type: string |                             type: string | ||||||
|                           path: |                           path: | ||||||
|                             description: 'Path is the Glusterfs volume path. More |                             description: 'Path is the Glusterfs volume path. More | ||||||
|                               info: https://releases.k8s.io/HEAD/examples/volumes/glusterfs/README.md#create-a-pod' |                               info: https://examples.k8s.io/volumes/glusterfs/README.md#create-a-pod' | ||||||
|                             type: string |                             type: string | ||||||
|                           readOnly: |                           readOnly: | ||||||
|                             description: 'ReadOnly here will force the Glusterfs volume |                             description: 'ReadOnly here will force the Glusterfs volume | ||||||
|                               to be mounted with read-only permissions. Defaults to |                               to be mounted with read-only permissions. Defaults to | ||||||
|                               false. More info: https://releases.k8s.io/HEAD/examples/volumes/glusterfs/README.md#create-a-pod' |                               false. More info: https://examples.k8s.io/volumes/glusterfs/README.md#create-a-pod' | ||||||
|                             type: boolean |                             type: boolean | ||||||
|                         required: |                         required: | ||||||
|                         - endpoints |                         - endpoints | ||||||
|  | @ -1706,7 +1828,7 @@ spec: | ||||||
|                       iscsi: |                       iscsi: | ||||||
|                         description: 'ISCSI represents an ISCSI Disk resource that |                         description: 'ISCSI represents an ISCSI Disk resource that | ||||||
|                           is attached to a kubelet''s host machine and then exposed |                           is attached to a kubelet''s host machine and then exposed | ||||||
|                           to the pod. More info: https://releases.k8s.io/HEAD/examples/volumes/iscsi/README.md' |                           to the pod. More info: https://examples.k8s.io/volumes/iscsi/README.md' | ||||||
|                         properties: |                         properties: | ||||||
|                           chapAuthDiscovery: |                           chapAuthDiscovery: | ||||||
|                             description: whether support iSCSI Discovery CHAP authentication |                             description: whether support iSCSI Discovery CHAP authentication | ||||||
|  | @ -1922,7 +2044,7 @@ spec: | ||||||
|                                       type: string |                                       type: string | ||||||
|                                     optional: |                                     optional: | ||||||
|                                       description: Specify whether the ConfigMap or |                                       description: Specify whether the ConfigMap or | ||||||
|                                         it's keys must be defined |                                         its keys must be defined | ||||||
|                                       type: boolean |                                       type: boolean | ||||||
|                                   type: object |                                   type: object | ||||||
|                                 downwardAPI: |                                 downwardAPI: | ||||||
|  | @ -2114,6 +2236,11 @@ spec: | ||||||
|                               pair (multiple entries are separated with commas) which |                               pair (multiple entries are separated with commas) which | ||||||
|                               acts as the central registry for volumes |                               acts as the central registry for volumes | ||||||
|                             type: string |                             type: string | ||||||
|  |                           tenant: | ||||||
|  |                             description: Tenant owning the given Quobyte volume in | ||||||
|  |                               the Backend Used with dynamically provisioned Quobyte | ||||||
|  |                               volumes, value is set by the plugin | ||||||
|  |                             type: string | ||||||
|                           user: |                           user: | ||||||
|                             description: User to map volume access to Defaults to |                             description: User to map volume access to Defaults to | ||||||
|                               serivceaccount user |                               serivceaccount user | ||||||
|  | @ -2128,7 +2255,7 @@ spec: | ||||||
|                         type: object |                         type: object | ||||||
|                       rbd: |                       rbd: | ||||||
|                         description: 'RBD represents a Rados Block Device mount on |                         description: 'RBD represents a Rados Block Device mount on | ||||||
|                           the host that shares a pod''s lifetime. More info: https://releases.k8s.io/HEAD/examples/volumes/rbd/README.md' |                           the host that shares a pod''s lifetime. More info: https://examples.k8s.io/volumes/rbd/README.md' | ||||||
|                         properties: |                         properties: | ||||||
|                           fsType: |                           fsType: | ||||||
|                             description: 'Filesystem type of the volume that you want |                             description: 'Filesystem type of the volume that you want | ||||||
|  | @ -2140,30 +2267,30 @@ spec: | ||||||
|                               compromising the machine' |                               compromising the machine' | ||||||
|                             type: string |                             type: string | ||||||
|                           image: |                           image: | ||||||
|                             description: 'The rados image name. More info: https://releases.k8s.io/HEAD/examples/volumes/rbd/README.md#how-to-use-it' |                             description: 'The rados image name. More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it' | ||||||
|                             type: string |                             type: string | ||||||
|                           keyring: |                           keyring: | ||||||
|                             description: 'Keyring is the path to key ring for RBDUser. |                             description: 'Keyring is the path to key ring for RBDUser. | ||||||
|                               Default is /etc/ceph/keyring. More info: https://releases.k8s.io/HEAD/examples/volumes/rbd/README.md#how-to-use-it' |                               Default is /etc/ceph/keyring. More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it' | ||||||
|                             type: string |                             type: string | ||||||
|                           monitors: |                           monitors: | ||||||
|                             description: 'A collection of Ceph monitors. More info: |                             description: 'A collection of Ceph monitors. More info: | ||||||
|                               https://releases.k8s.io/HEAD/examples/volumes/rbd/README.md#how-to-use-it' |                               https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it' | ||||||
|                             items: |                             items: | ||||||
|                               type: string |                               type: string | ||||||
|                             type: array |                             type: array | ||||||
|                           pool: |                           pool: | ||||||
|                             description: 'The rados pool name. Default is rbd. More |                             description: 'The rados pool name. Default is rbd. More | ||||||
|                               info: https://releases.k8s.io/HEAD/examples/volumes/rbd/README.md#how-to-use-it' |                               info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it' | ||||||
|                             type: string |                             type: string | ||||||
|                           readOnly: |                           readOnly: | ||||||
|                             description: 'ReadOnly here will force the ReadOnly setting |                             description: 'ReadOnly here will force the ReadOnly setting | ||||||
|                               in VolumeMounts. Defaults to false. More info: https://releases.k8s.io/HEAD/examples/volumes/rbd/README.md#how-to-use-it' |                               in VolumeMounts. Defaults to false. More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it' | ||||||
|                             type: boolean |                             type: boolean | ||||||
|                           secretRef: |                           secretRef: | ||||||
|                             description: 'SecretRef is name of the authentication |                             description: 'SecretRef is name of the authentication | ||||||
|                               secret for RBDUser. If provided overrides keyring. Default |                               secret for RBDUser. If provided overrides keyring. Default | ||||||
|                               is nil. More info: https://releases.k8s.io/HEAD/examples/volumes/rbd/README.md#how-to-use-it' |                               is nil. More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it' | ||||||
|                             properties: |                             properties: | ||||||
|                               name: |                               name: | ||||||
|                                 description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names |                                 description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names | ||||||
|  | @ -2173,7 +2300,7 @@ spec: | ||||||
|                             type: object |                             type: object | ||||||
|                           user: |                           user: | ||||||
|                             description: 'The rados user name. Default is admin. More |                             description: 'The rados user name. Default is admin. More | ||||||
|                               info: https://releases.k8s.io/HEAD/examples/volumes/rbd/README.md#how-to-use-it' |                               info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it' | ||||||
|                             type: string |                             type: string | ||||||
|                         required: |                         required: | ||||||
|                         - image |                         - image | ||||||
|  | @ -2286,7 +2413,7 @@ spec: | ||||||
|                               type: object |                               type: object | ||||||
|                             type: array |                             type: array | ||||||
|                           optional: |                           optional: | ||||||
|                             description: Specify whether the Secret or it's keys must |                             description: Specify whether the Secret or its keys must | ||||||
|                               be defined |                               be defined | ||||||
|                             type: boolean |                             type: boolean | ||||||
|                           secretName: |                           secretName: | ||||||
|  |  | ||||||
							
								
								
									
										71
									
								
								go.mod
								
								
								
								
							
							
						
						
									
										71
									
								
								go.mod
								
								
								
								
							|  | @ -11,46 +11,61 @@ require ( | ||||||
| 	github.com/emersion/go-smtp v0.11.2 | 	github.com/emersion/go-smtp v0.11.2 | ||||||
| 	github.com/go-logr/logr v0.1.0 | 	github.com/go-logr/logr v0.1.0 | ||||||
| 	github.com/go-logr/zapr v0.1.1 | 	github.com/go-logr/zapr v0.1.1 | ||||||
| 	github.com/go-openapi/spec v0.19.0 | 	github.com/go-openapi/spec v0.19.4 | ||||||
| 	github.com/golang/mock v1.2.0 | 	github.com/golang/mock v1.3.1 | ||||||
| 	github.com/mailgun/mailgun-go/v3 v3.6.0 | 	github.com/mailgun/mailgun-go/v3 v3.6.0 | ||||||
| 	github.com/operator-framework/operator-sdk v0.8.2-0.20190522220659-031d71ef8154 | 	github.com/operator-framework/operator-sdk v0.15.1 | ||||||
| 	github.com/pkg/errors v0.8.1 | 	github.com/pkg/errors v0.8.1 | ||||||
| 	github.com/robfig/cron v1.2.0 | 	github.com/robfig/cron v1.2.0 | ||||||
| 	github.com/spf13/pflag v1.0.3 | 	github.com/spf13/pflag v1.0.5 | ||||||
| 	github.com/stretchr/testify v1.3.0 | 	github.com/stretchr/testify v1.4.0 | ||||||
| 	go.uber.org/zap v1.9.1 | 	go.uber.org/zap v1.10.0 | ||||||
| 	golang.org/x/lint v0.0.0-20200130185559-910be7a94367 // indirect | 	golang.org/x/net v0.0.0-20191028085509-fe3aa8a45271 | ||||||
| 	golang.org/x/net v0.0.0-20190909003024-a7b16738d86b | 	golang.org/x/tools v0.0.0-20200210192313-1ace956b0e17 // indirect | ||||||
| 	golang.org/x/sys v0.0.0-20190910064555-bbd175535a8b // indirect |  | ||||||
| 	golang.org/x/text v0.3.2 // indirect |  | ||||||
| 	golang.org/x/tools v0.0.0-20200205141839-4abfd4a1628e // indirect |  | ||||||
| 	gopkg.in/alexcesaro/quotedprintable.v3 v3.0.0-20150716171945-2caba252f4dc // indirect | 	gopkg.in/alexcesaro/quotedprintable.v3 v3.0.0-20150716171945-2caba252f4dc // indirect | ||||||
| 	gopkg.in/gomail.v2 v2.0.0-20160411212932-81ebce5c23df | 	gopkg.in/gomail.v2 v2.0.0-20160411212932-81ebce5c23df | ||||||
| 	k8s.io/api v0.0.0-20190612125737-db0771252981 | 	k8s.io/api v0.0.0 | ||||||
| 	k8s.io/apimachinery v0.0.0-20190612125636-6a5db36e93ad | 	k8s.io/apimachinery v0.0.0 | ||||||
| 	k8s.io/cli-runtime v0.0.0-20181213153952-835b10687cb6 | 	k8s.io/cli-runtime v0.0.0 | ||||||
| 	k8s.io/client-go v11.0.0+incompatible | 	k8s.io/client-go v12.0.0+incompatible | ||||||
| 	k8s.io/code-generator v0.0.0-20181203235156-f8cba74510f3 | 	k8s.io/code-generator v0.0.0 | ||||||
| 	k8s.io/gengo v0.0.0-20190327210449-e17681d19d3a | 	k8s.io/gengo v0.0.0-20191010091904-7fa3014cb28f | ||||||
| 	k8s.io/kube-openapi v0.0.0-20190320154901-5e45bb682580 | 	k8s.io/kube-openapi v0.0.0-20190918143330-0270cf2f1c1d | ||||||
| 	sigs.k8s.io/controller-runtime v0.1.10 | 	sigs.k8s.io/controller-runtime v0.4.0 | ||||||
| 	sigs.k8s.io/controller-tools v0.1.10 | 	sigs.k8s.io/controller-tools v0.2.4 | ||||||
| ) | ) | ||||||
| 
 | 
 | ||||||
| // Pinned to kubernetes-1.13.1 | // Pinned to kubernetes-1.16.2 | ||||||
| replace ( | replace ( | ||||||
| 	k8s.io/api => k8s.io/api v0.0.0-20181213150558-05914d821849 | 	github.com/Azure/go-autorest => github.com/Azure/go-autorest v12.2.0+incompatible | ||||||
| 	k8s.io/apiextensions-apiserver => k8s.io/apiextensions-apiserver v0.0.0-20181213153335-0fe22c71c476 | 	k8s.io/api => k8s.io/api v0.0.0-20191016110408-35e52d86657a | ||||||
| 	k8s.io/apimachinery => k8s.io/apimachinery v0.0.0-20181127025237-2b1284ed4c93 | 	k8s.io/apiextensions-apiserver => k8s.io/apiextensions-apiserver v0.0.0-20191016113550-5357c4baaf65 | ||||||
| 	k8s.io/client-go => k8s.io/client-go v0.0.0-20181213151034-8d9ed539ba31 | 	k8s.io/apimachinery => k8s.io/apimachinery v0.0.0-20191004115801-a2eda9f80ab8 | ||||||
|  | 	k8s.io/apiserver => k8s.io/apiserver v0.0.0-20191016112112-5190913f932d | ||||||
|  | 	k8s.io/cli-runtime => k8s.io/cli-runtime v0.0.0-20191016114015-74ad18325ed5 | ||||||
|  | 	k8s.io/client-go => k8s.io/client-go v0.0.0-20191016111102-bec269661e48 | ||||||
|  | 	k8s.io/cloud-provider => k8s.io/cloud-provider v0.0.0-20191016115326-20453efc2458 | ||||||
|  | 	k8s.io/cluster-bootstrap => k8s.io/cluster-bootstrap v0.0.0-20191016115129-c07a134afb42 | ||||||
|  | 	k8s.io/component-base => k8s.io/component-base v0.0.0-20191016111319-039242c015a9 | ||||||
|  | 	k8s.io/cri-api => k8s.io/cri-api v0.0.0-20190828162817-608eb1dad4ac | ||||||
|  | 	k8s.io/csi-translation-lib => k8s.io/csi-translation-lib v0.0.0-20191016115521-756ffa5af0bd | ||||||
|  | 	k8s.io/kube-aggregator => k8s.io/kube-aggregator v0.0.0-20191016112429-9587704a8ad4 | ||||||
|  | 	k8s.io/kube-controller-manager => k8s.io/kube-controller-manager v0.0.0-20191016114939-2b2b218dc1df | ||||||
|  | 	k8s.io/kube-proxy => k8s.io/kube-proxy v0.0.0-20191016114407-2e83b6f20229 | ||||||
|  | 	k8s.io/kube-scheduler => k8s.io/kube-scheduler v0.0.0-20191016114748-65049c67a58b | ||||||
|  | 	k8s.io/kubectl => k8s.io/kubectl v0.0.0-20191016120415-2ed914427d51 | ||||||
|  | 	k8s.io/kubelet => k8s.io/kubelet v0.0.0-20191016114556-7841ed97f1b2 | ||||||
|  | 	k8s.io/legacy-cloud-providers => k8s.io/legacy-cloud-providers v0.0.0-20191016115753-cf0698c3a16b | ||||||
|  | 	k8s.io/metrics => k8s.io/metrics v0.0.0-20191016113814-3b1a734dba6e | ||||||
|  | 	k8s.io/sample-apiserver => k8s.io/sample-apiserver v0.0.0-20191016112829-06bb3c9d77c9 | ||||||
| ) | ) | ||||||
| 
 | 
 | ||||||
| replace ( | replace ( | ||||||
| 	github.com/coreos/prometheus-operator => github.com/coreos/prometheus-operator v0.29.0 | 	github.com/coreos/prometheus-operator => github.com/coreos/prometheus-operator v0.35.1 | ||||||
| 	github.com/operator-framework/operator-sdk => github.com/operator-framework/operator-sdk v0.10.0 | 	github.com/docker/docker => github.com/moby/moby v0.7.3-0.20190826074503-38ab9da00309 | ||||||
|  | 	github.com/operator-framework/operator-sdk => github.com/operator-framework/operator-sdk v0.15.1 | ||||||
| 	k8s.io/code-generator => k8s.io/code-generator v0.0.0-20181117043124-c2090bec4d9b | 	k8s.io/code-generator => k8s.io/code-generator v0.0.0-20181117043124-c2090bec4d9b | ||||||
| 	k8s.io/kube-openapi => k8s.io/kube-openapi v0.0.0-20180711000925-0cf8f7e6ed1d | 	k8s.io/kube-openapi => k8s.io/kube-openapi v0.0.0-20180711000925-0cf8f7e6ed1d | ||||||
| 	sigs.k8s.io/controller-runtime => sigs.k8s.io/controller-runtime v0.1.10 | 	sigs.k8s.io/controller-runtime => sigs.k8s.io/controller-runtime v0.4.0 | ||||||
| 	sigs.k8s.io/controller-tools => sigs.k8s.io/controller-tools v0.1.11-0.20190411181648-9d55346c2bde | 	sigs.k8s.io/controller-tools => sigs.k8s.io/controller-tools v0.1.11-0.20190411181648-9d55346c2bde | ||||||
| ) | ) | ||||||
|  |  | ||||||
|  | @ -6,7 +6,7 @@ package v1alpha2 | ||||||
| import ( | import ( | ||||||
| 	metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" | 	metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" | ||||||
| 	"k8s.io/apimachinery/pkg/runtime/schema" | 	"k8s.io/apimachinery/pkg/runtime/schema" | ||||||
| 	"sigs.k8s.io/controller-runtime/pkg/runtime/scheme" | 	"sigs.k8s.io/controller-runtime/pkg/scheme" | ||||||
| ) | ) | ||||||
| 
 | 
 | ||||||
| const ( | const ( | ||||||
|  |  | ||||||
|  | @ -257,7 +257,7 @@ func (in *JenkinsAPISettings) DeepCopy() *JenkinsAPISettings { | ||||||
| func (in *JenkinsList) DeepCopyInto(out *JenkinsList) { | func (in *JenkinsList) DeepCopyInto(out *JenkinsList) { | ||||||
| 	*out = *in | 	*out = *in | ||||||
| 	out.TypeMeta = in.TypeMeta | 	out.TypeMeta = in.TypeMeta | ||||||
| 	out.ListMeta = in.ListMeta | 	in.ListMeta.DeepCopyInto(&out.ListMeta) | ||||||
| 	if in.Items != nil { | 	if in.Items != nil { | ||||||
| 		in, out := &in.Items, &out.Items | 		in, out := &in.Items, &out.Items | ||||||
| 		*out = make([]Jenkins, len(*in)) | 		*out = make([]Jenkins, len(*in)) | ||||||
|  |  | ||||||
|  | @ -26,14 +26,14 @@ func schema_pkg_apis_jenkins_v1alpha2_Jenkins(ref common.ReferenceCallback) comm | ||||||
| 				Properties: map[string]spec.Schema{ | 				Properties: map[string]spec.Schema{ | ||||||
| 					"kind": { | 					"kind": { | ||||||
| 						SchemaProps: spec.SchemaProps{ | 						SchemaProps: spec.SchemaProps{ | ||||||
| 							Description: "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds", | 							Description: "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", | ||||||
| 							Type:        []string{"string"}, | 							Type:        []string{"string"}, | ||||||
| 							Format:      "", | 							Format:      "", | ||||||
| 						}, | 						}, | ||||||
| 					}, | 					}, | ||||||
| 					"apiVersion": { | 					"apiVersion": { | ||||||
| 						SchemaProps: spec.SchemaProps{ | 						SchemaProps: spec.SchemaProps{ | ||||||
| 							Description: "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#resources", | 							Description: "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources", | ||||||
| 							Type:        []string{"string"}, | 							Type:        []string{"string"}, | ||||||
| 							Format:      "", | 							Format:      "", | ||||||
| 						}, | 						}, | ||||||
|  |  | ||||||
|  | @ -402,7 +402,7 @@ func (r *ReconcileJenkinsBaseConfiguration) ensureExtraRBAC(meta metav1.ObjectMe | ||||||
| 	} | 	} | ||||||
| 
 | 
 | ||||||
| 	roleBindings := &rbacv1.RoleBindingList{} | 	roleBindings := &rbacv1.RoleBindingList{} | ||||||
| 	err = r.Client.List(context.TODO(), &client.ListOptions{Namespace: r.Configuration.Jenkins.Namespace}, roleBindings) | 	err = r.Client.List(context.TODO(), roleBindings, client.InNamespace(r.Configuration.Jenkins.Namespace)) | ||||||
| 	if err != nil { | 	if err != nil { | ||||||
| 		return stackerr.WithStack(err) | 		return stackerr.WithStack(err) | ||||||
| 	} | 	} | ||||||
|  | @ -857,7 +857,7 @@ func (r *ReconcileJenkinsBaseConfiguration) detectJenkinsMasterPodStartingIssues | ||||||
| 		now := time.Now().UTC() | 		now := time.Now().UTC() | ||||||
| 		if now.After(timeout) { | 		if now.After(timeout) { | ||||||
| 			events := &corev1.EventList{} | 			events := &corev1.EventList{} | ||||||
| 			err = r.Client.List(context.TODO(), &client.ListOptions{Namespace: r.Configuration.Jenkins.Namespace}, events) | 			err = r.Client.List(context.TODO(), events, client.InNamespace(r.Configuration.Jenkins.Namespace)) | ||||||
| 			if err != nil { | 			if err != nil { | ||||||
| 				return false, stackerr.WithStack(err) | 				return false, stackerr.WithStack(err) | ||||||
| 			} | 			} | ||||||
|  |  | ||||||
|  | @ -748,7 +748,7 @@ func TestEnsureExtraRBAC(t *testing.T) { | ||||||
| 
 | 
 | ||||||
| 	fetchAllRoleBindings := func(client k8sclient.Client) (roleBindings *rbacv1.RoleBindingList, err error) { | 	fetchAllRoleBindings := func(client k8sclient.Client) (roleBindings *rbacv1.RoleBindingList, err error) { | ||||||
| 		roleBindings = &rbacv1.RoleBindingList{} | 		roleBindings = &rbacv1.RoleBindingList{} | ||||||
| 		err = client.List(context.TODO(), &k8sclient.ListOptions{Namespace: namespace}, roleBindings) | 		err = client.List(context.TODO(), roleBindings, k8sclient.InNamespace(namespace)) | ||||||
| 		return | 		return | ||||||
| 	} | 	} | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -18,7 +18,7 @@ import ( | ||||||
| 	corev1 "k8s.io/api/core/v1" | 	corev1 "k8s.io/api/core/v1" | ||||||
| 	metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" | 	metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" | ||||||
| 	"sigs.k8s.io/controller-runtime/pkg/client/fake" | 	"sigs.k8s.io/controller-runtime/pkg/client/fake" | ||||||
| 	logf "sigs.k8s.io/controller-runtime/pkg/runtime/log" | 	logf "sigs.k8s.io/controller-runtime/pkg/log/zap" | ||||||
| ) | ) | ||||||
| 
 | 
 | ||||||
| func TestValidatePlugins(t *testing.T) { | func TestValidatePlugins(t *testing.T) { | ||||||
|  | @ -166,7 +166,7 @@ func TestReconcileJenkinsBaseConfiguration_validateImagePullSecrets(t *testing.T | ||||||
| 		baseReconcileLoop := New(configuration.Configuration{ | 		baseReconcileLoop := New(configuration.Configuration{ | ||||||
| 			Client:  fakeClient, | 			Client:  fakeClient, | ||||||
| 			Jenkins: &jenkins, | 			Jenkins: &jenkins, | ||||||
| 		}, logf.ZapLogger(false), client.JenkinsAPIConnectionSettings{}) | 		}, logf.Logger(false), client.JenkinsAPIConnectionSettings{}) | ||||||
| 
 | 
 | ||||||
| 		got, err := baseReconcileLoop.validateImagePullSecrets() | 		got, err := baseReconcileLoop.validateImagePullSecrets() | ||||||
| 		fmt.Println(got) | 		fmt.Println(got) | ||||||
|  | @ -262,7 +262,7 @@ func TestReconcileJenkinsBaseConfiguration_validateImagePullSecrets(t *testing.T | ||||||
| 		baseReconcileLoop := New(configuration.Configuration{ | 		baseReconcileLoop := New(configuration.Configuration{ | ||||||
| 			Client:  fakeClient, | 			Client:  fakeClient, | ||||||
| 			Jenkins: &jenkins, | 			Jenkins: &jenkins, | ||||||
| 		}, logf.ZapLogger(false), client.JenkinsAPIConnectionSettings{}) | 		}, logf.Logger(false), client.JenkinsAPIConnectionSettings{}) | ||||||
| 
 | 
 | ||||||
| 		got, _ := baseReconcileLoop.validateImagePullSecrets() | 		got, _ := baseReconcileLoop.validateImagePullSecrets() | ||||||
| 
 | 
 | ||||||
|  | @ -298,7 +298,7 @@ func TestReconcileJenkinsBaseConfiguration_validateImagePullSecrets(t *testing.T | ||||||
| 		baseReconcileLoop := New(configuration.Configuration{ | 		baseReconcileLoop := New(configuration.Configuration{ | ||||||
| 			Client:  fakeClient, | 			Client:  fakeClient, | ||||||
| 			Jenkins: &jenkins, | 			Jenkins: &jenkins, | ||||||
| 		}, logf.ZapLogger(false), client.JenkinsAPIConnectionSettings{}) | 		}, logf.Logger(false), client.JenkinsAPIConnectionSettings{}) | ||||||
| 
 | 
 | ||||||
| 		got, _ := baseReconcileLoop.validateImagePullSecrets() | 		got, _ := baseReconcileLoop.validateImagePullSecrets() | ||||||
| 
 | 
 | ||||||
|  | @ -334,7 +334,7 @@ func TestReconcileJenkinsBaseConfiguration_validateImagePullSecrets(t *testing.T | ||||||
| 		baseReconcileLoop := New(configuration.Configuration{ | 		baseReconcileLoop := New(configuration.Configuration{ | ||||||
| 			Client:  fakeClient, | 			Client:  fakeClient, | ||||||
| 			Jenkins: &jenkins, | 			Jenkins: &jenkins, | ||||||
| 		}, logf.ZapLogger(false), client.JenkinsAPIConnectionSettings{}) | 		}, logf.Logger(false), client.JenkinsAPIConnectionSettings{}) | ||||||
| 
 | 
 | ||||||
| 		got, _ := baseReconcileLoop.validateImagePullSecrets() | 		got, _ := baseReconcileLoop.validateImagePullSecrets() | ||||||
| 
 | 
 | ||||||
|  | @ -367,7 +367,7 @@ func TestValidateJenkinsMasterPodEnvs(t *testing.T) { | ||||||
| 		} | 		} | ||||||
| 		baseReconcileLoop := New(configuration.Configuration{ | 		baseReconcileLoop := New(configuration.Configuration{ | ||||||
| 			Jenkins: &jenkins, | 			Jenkins: &jenkins, | ||||||
| 		}, logf.ZapLogger(false), client.JenkinsAPIConnectionSettings{}) | 		}, logf.Logger(false), client.JenkinsAPIConnectionSettings{}) | ||||||
| 		got := baseReconcileLoop.validateJenkinsMasterPodEnvs() | 		got := baseReconcileLoop.validateJenkinsMasterPodEnvs() | ||||||
| 		assert.Nil(t, got) | 		assert.Nil(t, got) | ||||||
| 	}) | 	}) | ||||||
|  | @ -390,7 +390,7 @@ func TestValidateJenkinsMasterPodEnvs(t *testing.T) { | ||||||
| 		} | 		} | ||||||
| 		baseReconcileLoop := New(configuration.Configuration{ | 		baseReconcileLoop := New(configuration.Configuration{ | ||||||
| 			Jenkins: &jenkins, | 			Jenkins: &jenkins, | ||||||
| 		}, logf.ZapLogger(false), client.JenkinsAPIConnectionSettings{}) | 		}, logf.Logger(false), client.JenkinsAPIConnectionSettings{}) | ||||||
| 		got := baseReconcileLoop.validateJenkinsMasterPodEnvs() | 		got := baseReconcileLoop.validateJenkinsMasterPodEnvs() | ||||||
| 
 | 
 | ||||||
| 		assert.Equal(t, got, []string{"Jenkins Master container env 'JAVA_OPTS' doesn't have required flag '-Djava.awt.headless=true'"}) | 		assert.Equal(t, got, []string{"Jenkins Master container env 'JAVA_OPTS' doesn't have required flag '-Djava.awt.headless=true'"}) | ||||||
|  | @ -414,7 +414,7 @@ func TestValidateJenkinsMasterPodEnvs(t *testing.T) { | ||||||
| 		} | 		} | ||||||
| 		baseReconcileLoop := New(configuration.Configuration{ | 		baseReconcileLoop := New(configuration.Configuration{ | ||||||
| 			Jenkins: &jenkins, | 			Jenkins: &jenkins, | ||||||
| 		}, logf.ZapLogger(false), client.JenkinsAPIConnectionSettings{}) | 		}, logf.Logger(false), client.JenkinsAPIConnectionSettings{}) | ||||||
| 		got := baseReconcileLoop.validateJenkinsMasterPodEnvs() | 		got := baseReconcileLoop.validateJenkinsMasterPodEnvs() | ||||||
| 
 | 
 | ||||||
| 		assert.Equal(t, got, []string{"Jenkins Master container env 'JAVA_OPTS' doesn't have required flag '-Djenkins.install.runSetupWizard=false'"}) | 		assert.Equal(t, got, []string{"Jenkins Master container env 'JAVA_OPTS' doesn't have required flag '-Djenkins.install.runSetupWizard=false'"}) | ||||||
|  | @ -436,7 +436,7 @@ func TestValidateReservedVolumes(t *testing.T) { | ||||||
| 		} | 		} | ||||||
| 		baseReconcileLoop := New(configuration.Configuration{ | 		baseReconcileLoop := New(configuration.Configuration{ | ||||||
| 			Jenkins: &jenkins, | 			Jenkins: &jenkins, | ||||||
| 		}, logf.ZapLogger(false), client.JenkinsAPIConnectionSettings{}) | 		}, logf.Logger(false), client.JenkinsAPIConnectionSettings{}) | ||||||
| 		got := baseReconcileLoop.validateReservedVolumes() | 		got := baseReconcileLoop.validateReservedVolumes() | ||||||
| 		assert.Nil(t, got) | 		assert.Nil(t, got) | ||||||
| 	}) | 	}) | ||||||
|  | @ -454,7 +454,7 @@ func TestValidateReservedVolumes(t *testing.T) { | ||||||
| 		} | 		} | ||||||
| 		baseReconcileLoop := New(configuration.Configuration{ | 		baseReconcileLoop := New(configuration.Configuration{ | ||||||
| 			Jenkins: &jenkins, | 			Jenkins: &jenkins, | ||||||
| 		}, logf.ZapLogger(false), client.JenkinsAPIConnectionSettings{}) | 		}, logf.Logger(false), client.JenkinsAPIConnectionSettings{}) | ||||||
| 		got := baseReconcileLoop.validateReservedVolumes() | 		got := baseReconcileLoop.validateReservedVolumes() | ||||||
| 
 | 
 | ||||||
| 		assert.Equal(t, got, []string{"Jenkins Master pod volume 'jenkins-home' is reserved please choose different one"}) | 		assert.Equal(t, got, []string{"Jenkins Master pod volume 'jenkins-home' is reserved please choose different one"}) | ||||||
|  | @ -470,7 +470,7 @@ func TestValidateContainerVolumeMounts(t *testing.T) { | ||||||
| 		} | 		} | ||||||
| 		baseReconcileLoop := New(configuration.Configuration{ | 		baseReconcileLoop := New(configuration.Configuration{ | ||||||
| 			Jenkins: &jenkins, | 			Jenkins: &jenkins, | ||||||
| 		}, logf.ZapLogger(false), client.JenkinsAPIConnectionSettings{}) | 		}, logf.Logger(false), client.JenkinsAPIConnectionSettings{}) | ||||||
| 		got := baseReconcileLoop.validateContainerVolumeMounts(v1alpha2.Container{}) | 		got := baseReconcileLoop.validateContainerVolumeMounts(v1alpha2.Container{}) | ||||||
| 		assert.Nil(t, got) | 		assert.Nil(t, got) | ||||||
| 	}) | 	}) | ||||||
|  | @ -498,7 +498,7 @@ func TestValidateContainerVolumeMounts(t *testing.T) { | ||||||
| 		} | 		} | ||||||
| 		baseReconcileLoop := New(configuration.Configuration{ | 		baseReconcileLoop := New(configuration.Configuration{ | ||||||
| 			Jenkins: &jenkins, | 			Jenkins: &jenkins, | ||||||
| 		}, logf.ZapLogger(false), client.JenkinsAPIConnectionSettings{}) | 		}, logf.Logger(false), client.JenkinsAPIConnectionSettings{}) | ||||||
| 		got := baseReconcileLoop.validateContainerVolumeMounts(jenkins.Spec.Master.Containers[0]) | 		got := baseReconcileLoop.validateContainerVolumeMounts(jenkins.Spec.Master.Containers[0]) | ||||||
| 		assert.Nil(t, got) | 		assert.Nil(t, got) | ||||||
| 	}) | 	}) | ||||||
|  | @ -526,7 +526,7 @@ func TestValidateContainerVolumeMounts(t *testing.T) { | ||||||
| 		} | 		} | ||||||
| 		baseReconcileLoop := New(configuration.Configuration{ | 		baseReconcileLoop := New(configuration.Configuration{ | ||||||
| 			Jenkins: &jenkins, | 			Jenkins: &jenkins, | ||||||
| 		}, logf.ZapLogger(false), client.JenkinsAPIConnectionSettings{}) | 		}, logf.Logger(false), client.JenkinsAPIConnectionSettings{}) | ||||||
| 		got := baseReconcileLoop.validateContainerVolumeMounts(jenkins.Spec.Master.Containers[0]) | 		got := baseReconcileLoop.validateContainerVolumeMounts(jenkins.Spec.Master.Containers[0]) | ||||||
| 		assert.Equal(t, got, []string{"mountPath not set for 'example' volume mount in container ''"}) | 		assert.Equal(t, got, []string{"mountPath not set for 'example' volume mount in container ''"}) | ||||||
| 	}) | 	}) | ||||||
|  | @ -549,7 +549,7 @@ func TestValidateContainerVolumeMounts(t *testing.T) { | ||||||
| 		} | 		} | ||||||
| 		baseReconcileLoop := New(configuration.Configuration{ | 		baseReconcileLoop := New(configuration.Configuration{ | ||||||
| 			Jenkins: &jenkins, | 			Jenkins: &jenkins, | ||||||
| 		}, logf.ZapLogger(false), client.JenkinsAPIConnectionSettings{}) | 		}, logf.Logger(false), client.JenkinsAPIConnectionSettings{}) | ||||||
| 		got := baseReconcileLoop.validateContainerVolumeMounts(jenkins.Spec.Master.Containers[0]) | 		got := baseReconcileLoop.validateContainerVolumeMounts(jenkins.Spec.Master.Containers[0]) | ||||||
| 
 | 
 | ||||||
| 		assert.Equal(t, got, []string{"Not found volume for 'missing-volume' volume mount in container ''"}) | 		assert.Equal(t, got, []string{"Not found volume for 'missing-volume' volume mount in container ''"}) | ||||||
|  | @ -571,7 +571,7 @@ func TestValidateConfigMapVolume(t *testing.T) { | ||||||
| 		fakeClient := fake.NewFakeClient() | 		fakeClient := fake.NewFakeClient() | ||||||
| 		baseReconcileLoop := New(configuration.Configuration{ | 		baseReconcileLoop := New(configuration.Configuration{ | ||||||
| 			Client: fakeClient, | 			Client: fakeClient, | ||||||
| 		}, logf.ZapLogger(false), client.JenkinsAPIConnectionSettings{}) | 		}, logf.Logger(false), client.JenkinsAPIConnectionSettings{}) | ||||||
| 
 | 
 | ||||||
| 		got, err := baseReconcileLoop.validateConfigMapVolume(volume) | 		got, err := baseReconcileLoop.validateConfigMapVolume(volume) | ||||||
| 
 | 
 | ||||||
|  | @ -599,7 +599,7 @@ func TestValidateConfigMapVolume(t *testing.T) { | ||||||
| 		baseReconcileLoop := New(configuration.Configuration{ | 		baseReconcileLoop := New(configuration.Configuration{ | ||||||
| 			Client:  fakeClient, | 			Client:  fakeClient, | ||||||
| 			Jenkins: jenkins, | 			Jenkins: jenkins, | ||||||
| 		}, logf.ZapLogger(false), client.JenkinsAPIConnectionSettings{}) | 		}, logf.Logger(false), client.JenkinsAPIConnectionSettings{}) | ||||||
| 
 | 
 | ||||||
| 		got, err := baseReconcileLoop.validateConfigMapVolume(volume) | 		got, err := baseReconcileLoop.validateConfigMapVolume(volume) | ||||||
| 
 | 
 | ||||||
|  | @ -625,13 +625,13 @@ func TestValidateConfigMapVolume(t *testing.T) { | ||||||
| 		baseReconcileLoop := New(configuration.Configuration{ | 		baseReconcileLoop := New(configuration.Configuration{ | ||||||
| 			Client:  fakeClient, | 			Client:  fakeClient, | ||||||
| 			Jenkins: jenkins, | 			Jenkins: jenkins, | ||||||
| 		}, logf.ZapLogger(false), client.JenkinsAPIConnectionSettings{}) | 		}, logf.Logger(false), client.JenkinsAPIConnectionSettings{}) | ||||||
| 
 | 
 | ||||||
| 		got, err := baseReconcileLoop.validateConfigMapVolume(volume) | 		got, err := baseReconcileLoop.validateConfigMapVolume(volume) | ||||||
| 
 | 
 | ||||||
| 		assert.NoError(t, err) | 		assert.NoError(t, err) | ||||||
| 
 | 
 | ||||||
| 		assert.Equal(t, got, []string{"ConfigMap 'configmap-name' not found for volume '{volume-name {nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil &ConfigMapVolumeSource{LocalObjectReference:LocalObjectReference{Name:configmap-name,},Items:[],DefaultMode:nil,Optional:*false,} nil nil nil nil nil nil nil nil}}'"}) | 		assert.Equal(t, got, []string{"ConfigMap 'configmap-name' not found for volume '{volume-name {nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil &ConfigMapVolumeSource{LocalObjectReference:LocalObjectReference{Name:configmap-name,},Items:[]KeyToPath{},DefaultMode:nil,Optional:*false,} nil nil nil nil nil nil nil nil nil}}'"}) | ||||||
| 	}) | 	}) | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
|  | @ -650,7 +650,7 @@ func TestValidateSecretVolume(t *testing.T) { | ||||||
| 		fakeClient := fake.NewFakeClient() | 		fakeClient := fake.NewFakeClient() | ||||||
| 		baseReconcileLoop := New(configuration.Configuration{ | 		baseReconcileLoop := New(configuration.Configuration{ | ||||||
| 			Client: fakeClient, | 			Client: fakeClient, | ||||||
| 		}, logf.ZapLogger(false), client.JenkinsAPIConnectionSettings{}) | 		}, logf.Logger(false), client.JenkinsAPIConnectionSettings{}) | ||||||
| 
 | 
 | ||||||
| 		got, err := baseReconcileLoop.validateSecretVolume(volume) | 		got, err := baseReconcileLoop.validateSecretVolume(volume) | ||||||
| 
 | 
 | ||||||
|  | @ -676,7 +676,7 @@ func TestValidateSecretVolume(t *testing.T) { | ||||||
| 		baseReconcileLoop := New(configuration.Configuration{ | 		baseReconcileLoop := New(configuration.Configuration{ | ||||||
| 			Client:  fakeClient, | 			Client:  fakeClient, | ||||||
| 			Jenkins: jenkins, | 			Jenkins: jenkins, | ||||||
| 		}, logf.ZapLogger(false), client.JenkinsAPIConnectionSettings{}) | 		}, logf.Logger(false), client.JenkinsAPIConnectionSettings{}) | ||||||
| 
 | 
 | ||||||
| 		got, err := baseReconcileLoop.validateSecretVolume(volume) | 		got, err := baseReconcileLoop.validateSecretVolume(volume) | ||||||
| 
 | 
 | ||||||
|  | @ -700,12 +700,12 @@ func TestValidateSecretVolume(t *testing.T) { | ||||||
| 		baseReconcileLoop := New(configuration.Configuration{ | 		baseReconcileLoop := New(configuration.Configuration{ | ||||||
| 			Client:  fakeClient, | 			Client:  fakeClient, | ||||||
| 			Jenkins: jenkins, | 			Jenkins: jenkins, | ||||||
| 		}, logf.ZapLogger(false), client.JenkinsAPIConnectionSettings{}) | 		}, logf.Logger(false), client.JenkinsAPIConnectionSettings{}) | ||||||
| 		got, err := baseReconcileLoop.validateSecretVolume(volume) | 		got, err := baseReconcileLoop.validateSecretVolume(volume) | ||||||
| 
 | 
 | ||||||
| 		assert.NoError(t, err) | 		assert.NoError(t, err) | ||||||
| 
 | 
 | ||||||
| 		assert.Equal(t, got, []string{"Secret 'secret-name' not found for volume '{volume-name {nil nil nil nil nil &SecretVolumeSource{SecretName:secret-name,Items:[],DefaultMode:nil,Optional:*false,} nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil}}'"}) | 		assert.Equal(t, got, []string{"Secret 'secret-name' not found for volume '{volume-name {nil nil nil nil nil &SecretVolumeSource{SecretName:secret-name,Items:[]KeyToPath{},DefaultMode:nil,Optional:*false,} nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil}}'"}) | ||||||
| 	}) | 	}) | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
|  | @ -724,7 +724,7 @@ func TestValidateCustomization(t *testing.T) { | ||||||
| 		baseReconcileLoop := New(configuration.Configuration{ | 		baseReconcileLoop := New(configuration.Configuration{ | ||||||
| 			Jenkins: jenkins, | 			Jenkins: jenkins, | ||||||
| 			Client:  fakeClient, | 			Client:  fakeClient, | ||||||
| 		}, logf.ZapLogger(false), client.JenkinsAPIConnectionSettings{}) | 		}, logf.Logger(false), client.JenkinsAPIConnectionSettings{}) | ||||||
| 
 | 
 | ||||||
| 		got, err := baseReconcileLoop.validateCustomization(customization, "spec.groovyScripts") | 		got, err := baseReconcileLoop.validateCustomization(customization, "spec.groovyScripts") | ||||||
| 
 | 
 | ||||||
|  | @ -746,7 +746,7 @@ func TestValidateCustomization(t *testing.T) { | ||||||
| 		baseReconcileLoop := New(configuration.Configuration{ | 		baseReconcileLoop := New(configuration.Configuration{ | ||||||
| 			Jenkins: jenkins, | 			Jenkins: jenkins, | ||||||
| 			Client:  fakeClient, | 			Client:  fakeClient, | ||||||
| 		}, logf.ZapLogger(false), client.JenkinsAPIConnectionSettings{}) | 		}, logf.Logger(false), client.JenkinsAPIConnectionSettings{}) | ||||||
| 		err := fakeClient.Create(context.TODO(), secret) | 		err := fakeClient.Create(context.TODO(), secret) | ||||||
| 		require.NoError(t, err) | 		require.NoError(t, err) | ||||||
| 
 | 
 | ||||||
|  | @ -777,7 +777,7 @@ func TestValidateCustomization(t *testing.T) { | ||||||
| 		baseReconcileLoop := New(configuration.Configuration{ | 		baseReconcileLoop := New(configuration.Configuration{ | ||||||
| 			Jenkins: jenkins, | 			Jenkins: jenkins, | ||||||
| 			Client:  fakeClient, | 			Client:  fakeClient, | ||||||
| 		}, logf.ZapLogger(false), client.JenkinsAPIConnectionSettings{}) | 		}, logf.Logger(false), client.JenkinsAPIConnectionSettings{}) | ||||||
| 		err := fakeClient.Create(context.TODO(), secret) | 		err := fakeClient.Create(context.TODO(), secret) | ||||||
| 		require.NoError(t, err) | 		require.NoError(t, err) | ||||||
| 		err = fakeClient.Create(context.TODO(), configMap) | 		err = fakeClient.Create(context.TODO(), configMap) | ||||||
|  | @ -804,7 +804,7 @@ func TestValidateCustomization(t *testing.T) { | ||||||
| 		baseReconcileLoop := New(configuration.Configuration{ | 		baseReconcileLoop := New(configuration.Configuration{ | ||||||
| 			Jenkins: jenkins, | 			Jenkins: jenkins, | ||||||
| 			Client:  fakeClient, | 			Client:  fakeClient, | ||||||
| 		}, logf.ZapLogger(false), client.JenkinsAPIConnectionSettings{}) | 		}, logf.Logger(false), client.JenkinsAPIConnectionSettings{}) | ||||||
| 		err := fakeClient.Create(context.TODO(), configMap) | 		err := fakeClient.Create(context.TODO(), configMap) | ||||||
| 		require.NoError(t, err) | 		require.NoError(t, err) | ||||||
| 
 | 
 | ||||||
|  | @ -829,7 +829,7 @@ func TestValidateCustomization(t *testing.T) { | ||||||
| 		baseReconcileLoop := New(configuration.Configuration{ | 		baseReconcileLoop := New(configuration.Configuration{ | ||||||
| 			Jenkins: jenkins, | 			Jenkins: jenkins, | ||||||
| 			Client:  fakeClient, | 			Client:  fakeClient, | ||||||
| 		}, logf.ZapLogger(false), client.JenkinsAPIConnectionSettings{}) | 		}, logf.Logger(false), client.JenkinsAPIConnectionSettings{}) | ||||||
| 		err := fakeClient.Create(context.TODO(), secret) | 		err := fakeClient.Create(context.TODO(), secret) | ||||||
| 		require.NoError(t, err) | 		require.NoError(t, err) | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -21,7 +21,7 @@ import ( | ||||||
| 	"k8s.io/client-go/kubernetes" | 	"k8s.io/client-go/kubernetes" | ||||||
| 	"k8s.io/client-go/kubernetes/scheme" | 	"k8s.io/client-go/kubernetes/scheme" | ||||||
| 	"sigs.k8s.io/controller-runtime/pkg/client/fake" | 	"sigs.k8s.io/controller-runtime/pkg/client/fake" | ||||||
| 	logf "sigs.k8s.io/controller-runtime/pkg/runtime/log" | 	logf "sigs.k8s.io/controller-runtime/pkg/log/zap" | ||||||
| ) | ) | ||||||
| 
 | 
 | ||||||
| func jenkinsCustomResource() *v1alpha2.Jenkins { | func jenkinsCustomResource() *v1alpha2.Jenkins { | ||||||
|  | @ -67,7 +67,7 @@ func jenkinsCustomResource() *v1alpha2.Jenkins { | ||||||
| func TestEnsureSeedJobs(t *testing.T) { | func TestEnsureSeedJobs(t *testing.T) { | ||||||
| 	t.Run("happy", func(t *testing.T) { | 	t.Run("happy", func(t *testing.T) { | ||||||
| 		// given
 | 		// given
 | ||||||
| 		logger := logf.ZapLogger(false) | 		logger := logf.Logger(false) | ||||||
| 		ctrl := gomock.NewController(t) | 		ctrl := gomock.NewController(t) | ||||||
| 		ctx := context.TODO() | 		ctx := context.TODO() | ||||||
| 		defer ctrl.Finish() | 		defer ctrl.Finish() | ||||||
|  | @ -118,7 +118,7 @@ func TestEnsureSeedJobs(t *testing.T) { | ||||||
| 
 | 
 | ||||||
| 	t.Run("delete agent deployment when no seed jobs", func(t *testing.T) { | 	t.Run("delete agent deployment when no seed jobs", func(t *testing.T) { | ||||||
| 		// given
 | 		// given
 | ||||||
| 		logger := logf.ZapLogger(false) | 		logger := logf.Logger(false) | ||||||
| 		ctrl := gomock.NewController(t) | 		ctrl := gomock.NewController(t) | ||||||
| 		ctx := context.TODO() | 		ctx := context.TODO() | ||||||
| 		defer ctrl.Finish() | 		defer ctrl.Finish() | ||||||
|  | @ -169,7 +169,7 @@ func TestEnsureSeedJobs(t *testing.T) { | ||||||
| func TestCreateAgent(t *testing.T) { | func TestCreateAgent(t *testing.T) { | ||||||
| 	t.Run("don't fail when deployment is already created", func(t *testing.T) { | 	t.Run("don't fail when deployment is already created", func(t *testing.T) { | ||||||
| 		// given
 | 		// given
 | ||||||
| 		logger := logf.ZapLogger(false) | 		logger := logf.Logger(false) | ||||||
| 		ctrl := gomock.NewController(t) | 		ctrl := gomock.NewController(t) | ||||||
| 		ctx := context.TODO() | 		ctx := context.TODO() | ||||||
| 		defer ctrl.Finish() | 		defer ctrl.Finish() | ||||||
|  |  | ||||||
|  | @ -12,7 +12,8 @@ import ( | ||||||
| 	metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" | 	metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" | ||||||
| 	"k8s.io/client-go/kubernetes" | 	"k8s.io/client-go/kubernetes" | ||||||
| 	"sigs.k8s.io/controller-runtime/pkg/client/fake" | 	"sigs.k8s.io/controller-runtime/pkg/client/fake" | ||||||
| 	logf "sigs.k8s.io/controller-runtime/pkg/runtime/log" | 
 | ||||||
|  | 	logf "sigs.k8s.io/controller-runtime/pkg/log/zap" | ||||||
| ) | ) | ||||||
| 
 | 
 | ||||||
| var fakePrivateKey = `-----BEGIN RSA PRIVATE KEY----- | var fakePrivateKey = `-----BEGIN RSA PRIVATE KEY----- | ||||||
|  | @ -82,7 +83,7 @@ func TestValidateSeedJobs(t *testing.T) { | ||||||
| 			Notifications: nil, | 			Notifications: nil, | ||||||
| 		} | 		} | ||||||
| 
 | 
 | ||||||
| 		seedJobs := New(nil, config, logf.ZapLogger(false)) | 		seedJobs := New(nil, config, logf.Logger(false)) | ||||||
| 		result, err := seedJobs.ValidateSeedJobs(jenkins) | 		result, err := seedJobs.ValidateSeedJobs(jenkins) | ||||||
| 
 | 
 | ||||||
| 		assert.NoError(t, err) | 		assert.NoError(t, err) | ||||||
|  | @ -110,7 +111,7 @@ func TestValidateSeedJobs(t *testing.T) { | ||||||
| 			Notifications: nil, | 			Notifications: nil, | ||||||
| 		} | 		} | ||||||
| 
 | 
 | ||||||
| 		seedJobs := New(nil, config, logf.ZapLogger(false)) | 		seedJobs := New(nil, config, logf.Logger(false)) | ||||||
| 		result, err := seedJobs.ValidateSeedJobs(jenkins) | 		result, err := seedJobs.ValidateSeedJobs(jenkins) | ||||||
| 
 | 
 | ||||||
| 		assert.NoError(t, err) | 		assert.NoError(t, err) | ||||||
|  | @ -150,7 +151,7 @@ func TestValidateSeedJobs(t *testing.T) { | ||||||
| 			Notifications: nil, | 			Notifications: nil, | ||||||
| 		} | 		} | ||||||
| 
 | 
 | ||||||
| 		seedJobs := New(nil, config, logf.ZapLogger(false)) | 		seedJobs := New(nil, config, logf.Logger(false)) | ||||||
| 		result, err := seedJobs.ValidateSeedJobs(jenkins) | 		result, err := seedJobs.ValidateSeedJobs(jenkins) | ||||||
| 
 | 
 | ||||||
| 		assert.NoError(t, err) | 		assert.NoError(t, err) | ||||||
|  | @ -189,7 +190,7 @@ func TestValidateSeedJobs(t *testing.T) { | ||||||
| 			Notifications: nil, | 			Notifications: nil, | ||||||
| 		} | 		} | ||||||
| 
 | 
 | ||||||
| 		seedJobs := New(nil, config, logf.ZapLogger(false)) | 		seedJobs := New(nil, config, logf.Logger(false)) | ||||||
| 		result, err := seedJobs.ValidateSeedJobs(jenkins) | 		result, err := seedJobs.ValidateSeedJobs(jenkins) | ||||||
| 
 | 
 | ||||||
| 		assert.NoError(t, err) | 		assert.NoError(t, err) | ||||||
|  | @ -229,7 +230,7 @@ func TestValidateSeedJobs(t *testing.T) { | ||||||
| 			Notifications: nil, | 			Notifications: nil, | ||||||
| 		} | 		} | ||||||
| 
 | 
 | ||||||
| 		seedJobs := New(nil, config, logf.ZapLogger(false)) | 		seedJobs := New(nil, config, logf.Logger(false)) | ||||||
| 		result, err := seedJobs.ValidateSeedJobs(jenkins) | 		result, err := seedJobs.ValidateSeedJobs(jenkins) | ||||||
| 
 | 
 | ||||||
| 		assert.NoError(t, err) | 		assert.NoError(t, err) | ||||||
|  | @ -260,7 +261,7 @@ func TestValidateSeedJobs(t *testing.T) { | ||||||
| 			Notifications: nil, | 			Notifications: nil, | ||||||
| 		} | 		} | ||||||
| 
 | 
 | ||||||
| 		seedJobs := New(nil, config, logf.ZapLogger(false)) | 		seedJobs := New(nil, config, logf.Logger(false)) | ||||||
| 		result, err := seedJobs.ValidateSeedJobs(jenkins) | 		result, err := seedJobs.ValidateSeedJobs(jenkins) | ||||||
| 
 | 
 | ||||||
| 		assert.NoError(t, err) | 		assert.NoError(t, err) | ||||||
|  | @ -289,7 +290,7 @@ func TestValidateSeedJobs(t *testing.T) { | ||||||
| 			Notifications: nil, | 			Notifications: nil, | ||||||
| 		} | 		} | ||||||
| 
 | 
 | ||||||
| 		seedJobs := New(nil, config, logf.ZapLogger(false)) | 		seedJobs := New(nil, config, logf.Logger(false)) | ||||||
| 		result, err := seedJobs.ValidateSeedJobs(jenkins) | 		result, err := seedJobs.ValidateSeedJobs(jenkins) | ||||||
| 
 | 
 | ||||||
| 		assert.NoError(t, err) | 		assert.NoError(t, err) | ||||||
|  | @ -318,7 +319,7 @@ func TestValidateSeedJobs(t *testing.T) { | ||||||
| 			Notifications: nil, | 			Notifications: nil, | ||||||
| 		} | 		} | ||||||
| 
 | 
 | ||||||
| 		seedJobs := New(nil, config, logf.ZapLogger(false)) | 		seedJobs := New(nil, config, logf.Logger(false)) | ||||||
| 		result, err := seedJobs.ValidateSeedJobs(jenkins) | 		result, err := seedJobs.ValidateSeedJobs(jenkins) | ||||||
| 
 | 
 | ||||||
| 		assert.NoError(t, err) | 		assert.NoError(t, err) | ||||||
|  | @ -347,7 +348,7 @@ func TestValidateSeedJobs(t *testing.T) { | ||||||
| 			Notifications: nil, | 			Notifications: nil, | ||||||
| 		} | 		} | ||||||
| 
 | 
 | ||||||
| 		seedJobs := New(nil, config, logf.ZapLogger(false)) | 		seedJobs := New(nil, config, logf.Logger(false)) | ||||||
| 		result, err := seedJobs.ValidateSeedJobs(jenkins) | 		result, err := seedJobs.ValidateSeedJobs(jenkins) | ||||||
| 
 | 
 | ||||||
| 		assert.NoError(t, err) | 		assert.NoError(t, err) | ||||||
|  | @ -387,7 +388,7 @@ func TestValidateSeedJobs(t *testing.T) { | ||||||
| 			Notifications: nil, | 			Notifications: nil, | ||||||
| 		} | 		} | ||||||
| 
 | 
 | ||||||
| 		seedJobs := New(nil, config, logf.ZapLogger(false)) | 		seedJobs := New(nil, config, logf.Logger(false)) | ||||||
| 		result, err := seedJobs.ValidateSeedJobs(jenkins) | 		result, err := seedJobs.ValidateSeedJobs(jenkins) | ||||||
| 
 | 
 | ||||||
| 		assert.NoError(t, err) | 		assert.NoError(t, err) | ||||||
|  | @ -426,7 +427,7 @@ func TestValidateSeedJobs(t *testing.T) { | ||||||
| 			Notifications: nil, | 			Notifications: nil, | ||||||
| 		} | 		} | ||||||
| 
 | 
 | ||||||
| 		seedJobs := New(nil, config, logf.ZapLogger(false)) | 		seedJobs := New(nil, config, logf.Logger(false)) | ||||||
| 		result, err := seedJobs.ValidateSeedJobs(jenkins) | 		result, err := seedJobs.ValidateSeedJobs(jenkins) | ||||||
| 
 | 
 | ||||||
| 		assert.NoError(t, err) | 		assert.NoError(t, err) | ||||||
|  | @ -466,7 +467,7 @@ func TestValidateSeedJobs(t *testing.T) { | ||||||
| 			Notifications: nil, | 			Notifications: nil, | ||||||
| 		} | 		} | ||||||
| 
 | 
 | ||||||
| 		seedJobs := New(nil, config, logf.ZapLogger(false)) | 		seedJobs := New(nil, config, logf.Logger(false)) | ||||||
| 		result, err := seedJobs.ValidateSeedJobs(jenkins) | 		result, err := seedJobs.ValidateSeedJobs(jenkins) | ||||||
| 
 | 
 | ||||||
| 		assert.NoError(t, err) | 		assert.NoError(t, err) | ||||||
|  | @ -505,7 +506,7 @@ func TestValidateSeedJobs(t *testing.T) { | ||||||
| 			Notifications: nil, | 			Notifications: nil, | ||||||
| 		} | 		} | ||||||
| 
 | 
 | ||||||
| 		seedJobs := New(nil, config, logf.ZapLogger(false)) | 		seedJobs := New(nil, config, logf.Logger(false)) | ||||||
| 		result, err := seedJobs.ValidateSeedJobs(jenkins) | 		result, err := seedJobs.ValidateSeedJobs(jenkins) | ||||||
| 
 | 
 | ||||||
| 		assert.NoError(t, err) | 		assert.NoError(t, err) | ||||||
|  | @ -544,7 +545,7 @@ func TestValidateSeedJobs(t *testing.T) { | ||||||
| 			Notifications: nil, | 			Notifications: nil, | ||||||
| 		} | 		} | ||||||
| 
 | 
 | ||||||
| 		seedJobs := New(nil, config, logf.ZapLogger(false)) | 		seedJobs := New(nil, config, logf.Logger(false)) | ||||||
| 		result, err := seedJobs.ValidateSeedJobs(jenkins) | 		result, err := seedJobs.ValidateSeedJobs(jenkins) | ||||||
| 
 | 
 | ||||||
| 		assert.NoError(t, err) | 		assert.NoError(t, err) | ||||||
|  | @ -576,7 +577,7 @@ func TestValidateSeedJobs(t *testing.T) { | ||||||
| 			Notifications: nil, | 			Notifications: nil, | ||||||
| 		} | 		} | ||||||
| 
 | 
 | ||||||
| 		seedJobs := New(nil, config, logf.ZapLogger(false)) | 		seedJobs := New(nil, config, logf.Logger(false)) | ||||||
| 		result, err := seedJobs.ValidateSeedJobs(jenkins) | 		result, err := seedJobs.ValidateSeedJobs(jenkins) | ||||||
| 
 | 
 | ||||||
| 		assert.NoError(t, err) | 		assert.NoError(t, err) | ||||||
|  | @ -609,7 +610,7 @@ func TestValidateSeedJobs(t *testing.T) { | ||||||
| 			Notifications: nil, | 			Notifications: nil, | ||||||
| 		} | 		} | ||||||
| 
 | 
 | ||||||
| 		seedJobs := New(nil, config, logf.ZapLogger(false)) | 		seedJobs := New(nil, config, logf.Logger(false)) | ||||||
| 		result, err := seedJobs.ValidateSeedJobs(jenkins) | 		result, err := seedJobs.ValidateSeedJobs(jenkins) | ||||||
| 
 | 
 | ||||||
| 		assert.NoError(t, err) | 		assert.NoError(t, err) | ||||||
|  | @ -640,7 +641,7 @@ func TestValidateSeedJobs(t *testing.T) { | ||||||
| 			Notifications: nil, | 			Notifications: nil, | ||||||
| 		} | 		} | ||||||
| 
 | 
 | ||||||
| 		seedJobs := New(nil, config, logf.ZapLogger(false)) | 		seedJobs := New(nil, config, logf.Logger(false)) | ||||||
| 		result, err := seedJobs.ValidateSeedJobs(jenkins) | 		result, err := seedJobs.ValidateSeedJobs(jenkins) | ||||||
| 
 | 
 | ||||||
| 		assert.NoError(t, err) | 		assert.NoError(t, err) | ||||||
|  | @ -677,7 +678,7 @@ func TestValidateSeedJobs(t *testing.T) { | ||||||
| 			Notifications: nil, | 			Notifications: nil, | ||||||
| 		} | 		} | ||||||
| 
 | 
 | ||||||
| 		seedJobs := New(nil, config, logf.ZapLogger(false)) | 		seedJobs := New(nil, config, logf.Logger(false)) | ||||||
| 		result, err := seedJobs.ValidateSeedJobs(jenkins) | 		result, err := seedJobs.ValidateSeedJobs(jenkins) | ||||||
| 
 | 
 | ||||||
| 		assert.NoError(t, err) | 		assert.NoError(t, err) | ||||||
|  | @ -708,7 +709,7 @@ func TestValidateSeedJobs(t *testing.T) { | ||||||
| 			Notifications: nil, | 			Notifications: nil, | ||||||
| 		} | 		} | ||||||
| 
 | 
 | ||||||
| 		seedJobs := New(nil, config, logf.ZapLogger(false)) | 		seedJobs := New(nil, config, logf.Logger(false)) | ||||||
| 		result, err := seedJobs.ValidateSeedJobs(jenkins) | 		result, err := seedJobs.ValidateSeedJobs(jenkins) | ||||||
| 
 | 
 | ||||||
| 		assert.NoError(t, err) | 		assert.NoError(t, err) | ||||||
|  | @ -745,7 +746,7 @@ func TestValidateSeedJobs(t *testing.T) { | ||||||
| 			Notifications: nil, | 			Notifications: nil, | ||||||
| 		} | 		} | ||||||
| 
 | 
 | ||||||
| 		seedJobs := New(nil, config, logf.ZapLogger(false)) | 		seedJobs := New(nil, config, logf.Logger(false)) | ||||||
| 		result, err := seedJobs.ValidateSeedJobs(jenkins) | 		result, err := seedJobs.ValidateSeedJobs(jenkins) | ||||||
| 
 | 
 | ||||||
| 		assert.NoError(t, err) | 		assert.NoError(t, err) | ||||||
|  | @ -765,7 +766,7 @@ func TestValidateIfIDIsUnique(t *testing.T) { | ||||||
| 			Notifications: nil, | 			Notifications: nil, | ||||||
| 		} | 		} | ||||||
| 
 | 
 | ||||||
| 		ctrl := New(nil, config, logf.ZapLogger(false)) | 		ctrl := New(nil, config, logf.Logger(false)) | ||||||
| 		got := ctrl.validateIfIDIsUnique(seedJobs) | 		got := ctrl.validateIfIDIsUnique(seedJobs) | ||||||
| 		assert.Nil(t, got) | 		assert.Nil(t, got) | ||||||
| 	}) | 	}) | ||||||
|  | @ -780,7 +781,7 @@ func TestValidateIfIDIsUnique(t *testing.T) { | ||||||
| 			Notifications: nil, | 			Notifications: nil, | ||||||
| 		} | 		} | ||||||
| 
 | 
 | ||||||
| 		ctrl := New(nil, config, logf.ZapLogger(false)) | 		ctrl := New(nil, config, logf.Logger(false)) | ||||||
| 		got := ctrl.validateIfIDIsUnique(seedJobs) | 		got := ctrl.validateIfIDIsUnique(seedJobs) | ||||||
| 
 | 
 | ||||||
| 		assert.Equal(t, got, []string{"'first' seed job ID is not unique"}) | 		assert.Equal(t, got, []string{"'first' seed job ID is not unique"}) | ||||||
|  |  | ||||||
|  | @ -6,7 +6,7 @@ import ( | ||||||
| 	"github.com/go-logr/logr" | 	"github.com/go-logr/logr" | ||||||
| 	"github.com/go-logr/zapr" | 	"github.com/go-logr/zapr" | ||||||
| 	"go.uber.org/zap" | 	"go.uber.org/zap" | ||||||
| 	logf "sigs.k8s.io/controller-runtime/pkg/runtime/log" | 	logf "sigs.k8s.io/controller-runtime/pkg/log" | ||||||
| ) | ) | ||||||
| 
 | 
 | ||||||
| // Log represents global logger
 | // Log represents global logger
 | ||||||
|  |  | ||||||
|  | @ -2,11 +2,12 @@ package e2e | ||||||
| 
 | 
 | ||||||
| import ( | import ( | ||||||
| 	goctx "context" | 	goctx "context" | ||||||
| 	"golang.org/x/net/context" |  | ||||||
| 	"net/http" | 	"net/http" | ||||||
| 	"testing" | 	"testing" | ||||||
| 	"time" | 	"time" | ||||||
| 
 | 
 | ||||||
|  | 	"golang.org/x/net/context" | ||||||
|  | 
 | ||||||
| 	"github.com/jenkinsci/kubernetes-operator/internal/try" | 	"github.com/jenkinsci/kubernetes-operator/internal/try" | ||||||
| 	"github.com/jenkinsci/kubernetes-operator/pkg/apis/jenkins/v1alpha2" | 	"github.com/jenkinsci/kubernetes-operator/pkg/apis/jenkins/v1alpha2" | ||||||
| 	jenkinsclient "github.com/jenkinsci/kubernetes-operator/pkg/controller/jenkins/client" | 	jenkinsclient "github.com/jenkinsci/kubernetes-operator/pkg/controller/jenkins/client" | ||||||
|  | @ -136,7 +137,7 @@ func WaitUntilJenkinsConditionSet(retryInterval time.Duration, retries int, jenk | ||||||
| func waitUntilNamespaceDestroyed(namespace string) error { | func waitUntilNamespaceDestroyed(namespace string) error { | ||||||
| 	err := try.Until(func() (bool, error) { | 	err := try.Until(func() (bool, error) { | ||||||
| 		var namespaceList v1.NamespaceList | 		var namespaceList v1.NamespaceList | ||||||
| 		err := framework.Global.Client.List(context.TODO(), &client.ListOptions{}, &namespaceList) | 		err := framework.Global.Client.List(context.TODO(), &namespaceList, &client.ListOptions{}) | ||||||
| 		if err != nil { | 		if err != nil { | ||||||
| 			return true, err | 			return true, err | ||||||
| 		} | 		} | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue