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 Verify Weight #37

Merged
merged 6 commits into from
Sep 7, 2023

Conversation

mvgmb
Copy link
Contributor

@mvgmb mvgmb commented Aug 28, 2023

Closes #22

The weight verification takes into account the following scenarios:

Valid HTTPProxy

When the HTTPProxy is valid and does not contain errors.

status:
  conditions:
  - lastTransitionTime: "2023-08-10T22:27:04Z"
    message: Valid HTTPProxy
    observedGeneration: 43
    reason: Valid
    status: "True"
    type: Valid
  currentStatus: valid
  description: Valid HTTPProxy

Invalid HTTProxy

When the HTTPProxy contains an error or its state is invalid.

status:
  conditions:
  - errors:
    - message: 'fqdn "example.com" is used in multiple
        HTTPProxies: argo-rollouts-demo/demo, test-demo/demo'
      reason: DuplicateVhost
      status: "True"
      type: VirtualHostError
    lastTransitionTime: "2023-08-10T22:26:30Z"
    message: At least one error present, see Errors for details
    observedGeneration: 1
    reason: ErrorPresent
    status: "False"
    type: Valid
  currentStatus: invalid
  description: At least one error present, see Errors for details

Outdated HTTPProxy

When the HTTPProxy status' observedGeneration field does not match the metadata's generation field don't match. This happens when the operator is unavailable or is having issues updating the HTTPProxy.

apiVersion: projectcontour.io/v1
kind: HTTPProxy
metadata:
  generation: 50
  name: demo
status:
  conditions:
  - lastTransitionTime: "2023-08-10T22:40:39Z"
    message: Valid HTTPProxy
    observedGeneration: 49 # current generation is 50, meaning the operator still hasn't reflected changes made to manifest
    reason: Valid
    status: "True"
    type: Valid
  currentStatus: valid
  description: Valid HTTPProxy

Signed-off-by: Mario Bezerra <mario.bezerra@incognia.com>
Signed-off-by: Mario Bezerra <mario.bezerra@incognia.com>
Signed-off-by: Mario Bezerra <mario.bezerra@incognia.com>
Signed-off-by: Mario Bezerra <mario.bezerra@incognia.com>
@wilsonwu wilsonwu requested a review from izturn August 29, 2023 02:27
pkg/mocks/plugin.go Outdated Show resolved Hide resolved
pkg/mocks/plugin.go Outdated Show resolved Hide resolved
pkg/plugin/plugin.go Outdated Show resolved Hide resolved
pkg/plugin/plugin.go Outdated Show resolved Hide resolved
pkg/plugin/plugin.go Outdated Show resolved Hide resolved
pkg/plugin/plugin_test.go Outdated Show resolved Hide resolved
@izturn
Copy link
Collaborator

izturn commented Sep 4, 2023

@mvgmb ping

@mvgmb mvgmb force-pushed the feat/implement-verify-weight branch from 7bff54a to 632f289 Compare September 6, 2023 13:25
Signed-off-by: Mario Bezerra <mario.bezerra@incognia.com>
@mvgmb mvgmb force-pushed the feat/implement-verify-weight branch from 632f289 to 3a3fc4a Compare September 6, 2023 13:38
@mvgmb mvgmb requested a review from izturn September 6, 2023 13:44
Copy link
Collaborator

@izturn izturn left a comment

Choose a reason for hiding this comment

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

LGTM @mvgmb thx

@izturn izturn merged commit e610db1 into argoproj-labs:main Sep 7, 2023
4 checks passed
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.

Implement VerifyWeight function
2 participants