Skip to content

Commit 2a9dc4e

Browse files
committed
fix based on review comments
1 parent c46d429 commit 2a9dc4e

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

api/v1alpha1/groupversion_info.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ limitations under the License.
1515
*/
1616

1717
// Package v1alpha1 contains API Schema definitions for the gatling-operator v1alpha1 API group
18-
//+kubebuilder:object:generate=true
19-
//+groupName=gatling-operator.tech.zozo.com
18+
// +kubebuilder:object:generate=true
19+
// +groupName=gatling-operator.tech.zozo.com
2020
package v1alpha1
2121

2222
import (

controllers/gatling_controller.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ func (r *GatlingReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ct
143143

144144
// Implementation of reconciler logic for the runner job
145145
func (r *GatlingReconciler) gatlingRunnerReconcile(ctx context.Context, req ctrl.Request, gatling *gatlingv1alpha1.Gatling, log logr.Logger) (bool, error) {
146-
if err := r.createObjectsForCR(ctx, gatling, req.Namespace, log); err != nil {
146+
if err := r.createVolumesForCR(ctx, gatling, req.Namespace, log); err != nil {
147147
return true, err
148148
}
149149
if gatling.Status.RunnerJobName == "" {
@@ -370,7 +370,7 @@ func doNotRequeue(err error) (ctrl.Result, error) {
370370
return ctrl.Result{}, err
371371
}
372372

373-
func (r *GatlingReconciler) createObjectsForCR(ctx context.Context, gatling *gatlingv1alpha1.Gatling, namespace string, log logr.Logger) error {
373+
func (r *GatlingReconciler) createVolumesForCR(ctx context.Context, gatling *gatlingv1alpha1.Gatling, namespace string, log logr.Logger) error {
374374
// Create Simulation Data ConfigMap if defined to create in CR
375375
if &gatling.Spec.TestScenarioSpec.SimulationData != nil && len(gatling.Spec.TestScenarioSpec.SimulationData) > 0 {
376376
configMapName := gatling.Name + "-simulations-data"
@@ -419,14 +419,14 @@ func (r *GatlingReconciler) createObjectsForCR(ctx context.Context, gatling *gat
419419
// Create PersistentVolume if defined to create in CR
420420
if &gatling.Spec.PersistentVolumeSpec != nil && gatling.Spec.PersistentVolumeSpec.Name != "" {
421421
volumeName := gatling.Spec.PersistentVolumeSpec.Name
422-
foundVolue := &corev1.PersistentVolume{}
423-
if err := r.Get(ctx, client.ObjectKey{Name: volumeName, Namespace: namespace}, foundVolue); err != nil {
422+
foundVolume := &corev1.PersistentVolume{}
423+
if err := r.Get(ctx, client.ObjectKey{Name: volumeName, Namespace: namespace}, foundVolume); err != nil {
424424
if !apierr.IsNotFound(err) {
425425
return err
426426
}
427427
persistentVolume := r.newPersistentVolumeForCR(gatling, volumeName, &gatling.Spec.PersistentVolumeSpec.Spec)
428428
if err := r.createObject(ctx, gatling, persistentVolume); err != nil {
429-
log.Error(err, fmt.Sprintf("Failed to creating new PersistentVolume: namespace %s name %s", gatling.GetNamespace(), volumeName))
429+
log.Error(err, fmt.Sprintf("Failed to creating new PersistentVolume: namespace %s name %s", persistentVolume.GetNamespace(), volumeName))
430430
return err
431431
}
432432
}
@@ -441,7 +441,7 @@ func (r *GatlingReconciler) createObjectsForCR(ctx context.Context, gatling *gat
441441
}
442442
persistentVolumeClaim := r.newPersistentVolumeClaimForCR(gatling, claimName, &gatling.Spec.PersistentVolumeClaimSpec.Spec)
443443
if err := r.createObject(ctx, gatling, persistentVolumeClaim); err != nil {
444-
log.Error(err, fmt.Sprintf("Failed to creating new PersistentVolumeClaim: namespace %s name %s", gatling.GetNamespace(), claimName))
444+
log.Error(err, fmt.Sprintf("Failed to creating new PersistentVolumeClaim: namespace %s name %s", persistentVolumeClaim.GetNamespace(), claimName))
445445
return err
446446
}
447447
}

docs/user-guide.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ For `Gatling load testing related files`, you have 3 options:
5555

5656
- Create custom image to bundle Gatling load testing files with Java runtime and Gatling standalone bundle package
5757
- Add Gatling load testing files as multi-line definitions in `.spec.testScenatioSpec` part of `Gatling CR`
58-
- Set up persistent volumes in `.persistentVolume` and `.persistentVolumeClaim` in `Gatling CR` and load test files from the persistent volumes in Gatling load test files.
58+
- Set up persistent volume in `.persistentVolume` and `.persistentVolumeClaim` in `Gatling CR` and load test files from the persistent volume in Gatling load test files.
5959

6060
### Create Custom Gatling Image to bundle Gatling Load Testing Files
6161

0 commit comments

Comments
 (0)