Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(#89): add support for pulling the Locust image from private registries #98

Conversation

jachinte
Copy link
Contributor

@jachinte jachinte commented Mar 13, 2023

This pull request implements the feature proposed in #89

I've added some documentation in the getting started page.

Please let me know your thoughts on this PR.


Note that I could've used Helm's convention to specify images (i.e., an image object with properties repository, tag and pullPolicy, plus an additional property imagePullSecrets) but decided against this because the operator already uses the key image. Doing so would've introduced a breaking change.

@jachinte jachinte force-pushed the 89-feature-request-add-image-pull-secrets branch 2 times, most recently from 2ed7a23 to 5ca9d73 Compare March 13, 2023 08:33
@jachinte jachinte marked this pull request as ready for review March 13, 2023 08:34
Copy link
Owner

@AbdelrhmanHamouda AbdelrhmanHamouda left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for your kind contribution. It is something that is truly appreciated. I would also like to add additional recognition of writing code that feels native to the implementation already in place.

All and all, amazing work. I have left few comments that I believe are missing to make this PR complete. I would also kindly ask you to include some screenshots / snippets of the generated jobs / pods running with this option. This is so i don't have to setup a private registry myself somewhere and try to test this.

As always nothing is set in stone and everything can be discussed if you have a different opinion.

docs/getting_started.md Outdated Show resolved Hide resolved
docs/helm_deploy.md Outdated Show resolved Hide resolved
docs/getting_started.md Outdated Show resolved Hide resolved
docs/getting_started.md Outdated Show resolved Hide resolved
@AbdelrhmanHamouda
Copy link
Owner

Hello @jachinte,
I am about to start implementation of a new feature and would like to have your work merged first before I do that.
I understand of course that this is a contribution you provided on your own time but if your time will allow to give this more attention soon, I will wait. Otherwise I will move forward and if needed this PR when the time comes can be reconciled.

jachinte added a commit to VarxenHQ/locust-k8s-operator that referenced this pull request Apr 3, 2023
jachinte added a commit to VarxenHQ/locust-k8s-operator that referenced this pull request Apr 3, 2023
jachinte added a commit to VarxenHQ/locust-k8s-operator that referenced this pull request Apr 3, 2023
jachinte added a commit to VarxenHQ/locust-k8s-operator that referenced this pull request Apr 3, 2023
jachinte added a commit to VarxenHQ/locust-k8s-operator that referenced this pull request Apr 3, 2023
jachinte added a commit to VarxenHQ/locust-k8s-operator that referenced this pull request Apr 3, 2023
jachinte added a commit to VarxenHQ/locust-k8s-operator that referenced this pull request Apr 3, 2023
jachinte added a commit to VarxenHQ/locust-k8s-operator that referenced this pull request Apr 3, 2023
jachinte added a commit to VarxenHQ/locust-k8s-operator that referenced this pull request Apr 3, 2023
jachinte added a commit to VarxenHQ/locust-k8s-operator that referenced this pull request Apr 3, 2023
jachinte added a commit to VarxenHQ/locust-k8s-operator that referenced this pull request Apr 3, 2023
jachinte added a commit to VarxenHQ/locust-k8s-operator that referenced this pull request Apr 3, 2023
jachinte added a commit to VarxenHQ/locust-k8s-operator that referenced this pull request Apr 3, 2023
jachinte added a commit to VarxenHQ/locust-k8s-operator that referenced this pull request Apr 3, 2023
@jachinte jachinte force-pushed the 89-feature-request-add-image-pull-secrets branch from b04034b to 7b257c4 Compare April 3, 2023 15:24
jachinte added a commit to VarxenHQ/locust-k8s-operator that referenced this pull request Apr 3, 2023
@jachinte jachinte force-pushed the 89-feature-request-add-image-pull-secrets branch from 7b257c4 to d3c554c Compare April 3, 2023 15:36
@jachinte jachinte force-pushed the 89-feature-request-add-image-pull-secrets branch from d3c554c to 59ed7b7 Compare April 3, 2023 15:38
@jachinte
Copy link
Contributor Author

jachinte commented Apr 3, 2023

Hi @AbdelrhmanHamouda,
First of all, thank you for the detailed review and nice suggestions. I really appreciate it and feel welcomed to contribute.

I've applied the changes you suggested. I also added the the missing option Never to the imagePullPolicy option. I don't see a reason not to do it.

Here are some screenshots using a private image from the Github Container Registry, on a local k3s cluster:

Create a local cluster using k3d

1-k3s-cluster

Create the target namespace and a configmap based on the test module

2-configmap

Install the operator in the target namespace

Note that I packaged the operator locally and published a custom image to Docker Hub
3-helm-install

Create a secret in the target namespace for using the Github Container Registry

5-secret

The custom resource

6-lotest

Deploy the custom resource and monitor created jobs, pods and locust tests

7-jobs-pods-lotests

Inspect the latest events to confirm everything worked as expected

8-events

@AbdelrhmanHamouda
Copy link
Owner

thank you for the nice contribution. The failing test seems to be coming from a change in the github action that is not related to this PR. I will have to work on it independently

@AbdelrhmanHamouda
Copy link
Owner

@jachinte As expected that merging the other PRs caused a conflict on this one. I would resolve it myself but I see that you didn't allow changes by the reviewer. To be this PR is ready to merge, simply solve the conflict and I will merge directly.

@codecov
Copy link

codecov bot commented Apr 21, 2023

Codecov Report

Merging #98 (81b5468) into master (dabc29a) will not change coverage.
The diff coverage is 87.50%.

@@            Coverage Diff            @@
##             master      #98   +/-   ##
=========================================
  Coverage     94.70%   94.70%           
  Complexity       79       79           
=========================================
  Files            12       12           
  Lines           378      378           
  Branches         11       11           
=========================================
  Hits            358      358           
  Misses           16       16           
  Partials          4        4           
Impacted Files Coverage Δ
...cust/operator/controller/utils/LoadGenHelpers.java 96.59% <80.00%> (ø)
...utils/resource/manage/ResourceCreationHelpers.java 99.40% <90.90%> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@jachinte
Copy link
Contributor Author

@AbdelrhmanHamouda I've resolved the merge conflicts.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants