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

Implement Equals function using TestTags #3

Merged
merged 21 commits into from
Oct 24, 2024

Conversation

matthijswolters-rl
Copy link
Collaborator

It is mentioned in a comment in the code itself but because of the discrepency between the fields in the EndpointMonitor CR and the Statuscake API it is not immediately clear how to compare an old monitor with an updated monitor. The way I have elected to check this is to use the TestTags field to include some kind of identifier that should be updated on any change. So if the tags have changed then the monitor should be updated.

How to test:

  1. run a local kubernetes cluster and set KUBECONFIG to the correct kubeconfig
  2. run make install in repo dir
  3. run the local docker registry docker run -d -p 5000:5000 --name registry registry:2
  4. build the image and push it
  • docker build -t localhost:5000/controller:latest .
  • docker push localhost:5000/controller:latest
  1. add the secret imc-config and test-secret and the endpoint monitor (ask me for the commands)
  2. run make deploy
  3. edit the deployment in ingressmonitorcontroller-system to use the image localhost:5000/controller:latest
  4. kill the pod so it pulls the most recent version

@matthijswolters-rl matthijswolters-rl force-pushed the feature/add-raw-post-data branch from 424ed61 to 65ae645 Compare October 3, 2024 15:03
It is mentioned in a comment in the code itself but because of the
discrepency between the fields in the EndpointMonitor CR and the
Statuscake API it is not immediately clear how to compare an old monitor
with an updated monitor. The way I have elected to check this is to use
the TestTags field to include some kind of identifier that should be
updated on any change. So if the tags have changed then the monitor
should be updated.
@matthijswolters-rl matthijswolters-rl force-pushed the feature/impl-equals-func-statuscake branch from c9a1b4d to 28c025a Compare October 3, 2024 15:06
@tomhemmes-rl tomhemmes-rl removed their request for review October 15, 2024 08:50
Base automatically changed from feature/add-raw-post-data to master October 23, 2024 08:45
Copy link

@robinderooij-rl robinderooij-rl left a comment

Choose a reason for hiding this comment

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

Impressed. Awesome!

@matthijswolters-rl matthijswolters-rl merged commit 70ce314 into master Oct 24, 2024
1 check passed
@matthijswolters-rl matthijswolters-rl deleted the feature/impl-equals-func-statuscake branch October 24, 2024 09:30
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