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

NETOBSERV-1224 Flowcollector does not report status != Ready in OCP Console #403

Merged
merged 3 commits into from
Aug 31, 2023

Conversation

jpinsonneau
Copy link
Contributor

@jpinsonneau jpinsonneau commented Aug 23, 2023

Description

Improve CR status update:

  • Fix condition.Status field. Only the active one should show True
  • Fix Type field. It will now keep latests Ready / Pending / Failed messages with only one of these True
  • Added messages
  • Sorted conditions as oc command only show first item without checking Status field
Screencast.from.2023-08-23.11-15-55.webm
[julien@fedora network-observability-operator]$ oc get flowcollector
NAME      AGENT   SAMPLING (EBPF)   DEPLOYMENT MODEL   STATUS
cluster   EBPF    50                DIRECT             DeploymentInProgress

[julien@fedora network-observability-operator]$ oc get flowcollector
NAME      AGENT   SAMPLING (EBPF)   DEPLOYMENT MODEL   STATUS
cluster   EBPF    50                DIRECT             Ready

Related issues:
https://issues.redhat.com/browse/NETOBSERV-1224
https://issues.redhat.com/browse/NETOBSERV-610

Dependencies

n/a

Checklist

If you are not familiar with our processes or don't know what to answer in the list below, let us know in a comment: the maintainers will take care of that.

  • Is this PR backed with a JIRA ticket? If so, make sure it is written as a title prefix (in general, PRs affecting the NetObserv/Network Observability product should be backed with a JIRA ticket - especially if they bring user facing changes).
  • Does this PR require product documentation?
    • If so, make sure the JIRA epic is labelled with "documentation" and provides a description relevant for doc writers, such as use cases or scenarios. Any required step to activate or configure the feature should be documented there, such as new CRD knobs.
  • Does this PR require a product release notes entry?
    • If so, fill in "Release Note Text" in the JIRA.
  • Is there anything else the QE team should know before testing? E.g: configuration changes, environment setup, etc.
    • If so, make sure it is described in the JIRA ticket.
  • QE requirements (check 1 from the list):
    • Standard QE validation, with pre-merge tests unless stated otherwise.
    • Regression tests only (e.g. refactoring with no user-facing change).
    • No QE (e.g. trivial change with high reviewer's confidence, or per agreement with the QE team).

@jpinsonneau jpinsonneau added the ok-to-test To set manually when a PR is safe to test. Triggers image build on PR. label Aug 23, 2023
@github-actions
Copy link

New images:

  • quay.io/netobserv/network-observability-operator:801a9e0
  • quay.io/netobserv/network-observability-operator-bundle:v0.0.0-801a9e0
  • quay.io/netobserv/network-observability-operator-catalog:v0.0.0-801a9e0

They will expire after two weeks.

To deploy this build:

# Direct deployment, from operator repo
IMAGE=quay.io/netobserv/network-observability-operator:801a9e0 make deploy

# Or using operator-sdk
operator-sdk run bundle quay.io/netobserv/network-observability-operator-bundle:v0.0.0-801a9e0

Or as a Catalog Source:

apiVersion: operators.coreos.com/v1alpha1
kind: CatalogSource
metadata:
  name: netobserv-dev
  namespace: openshift-marketplace
spec:
  sourceType: grpc
  image: quay.io/netobserv/network-observability-operator-catalog:v0.0.0-801a9e0
  displayName: NetObserv development catalog
  publisher: Me
  updateStrategy:
    registryPoll:
      interval: 1m

@github-actions github-actions bot removed the ok-to-test To set manually when a PR is safe to test. Triggers image build on PR. label Aug 23, 2023
@codecov
Copy link

codecov bot commented Aug 23, 2023

Codecov Report

Patch coverage: 64.28% and project coverage change: +0.19% 🎉

Comparison is base (3e5454d) 55.49% compared to head (a0dc9ae) 55.69%.
Report is 2 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #403      +/-   ##
==========================================
+ Coverage   55.49%   55.69%   +0.19%     
==========================================
  Files          45       45              
  Lines        5874     5884      +10     
==========================================
+ Hits         3260     3277      +17     
+ Misses       2393     2387       -6     
+ Partials      221      220       -1     
Flag Coverage Δ
unittests 55.69% <64.28%> (+0.19%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Changed Coverage Δ
controllers/flowcollector_controller.go 52.94% <58.33%> (+0.56%) ⬆️
pkg/conditions/conditions.go 27.36% <66.66%> (+13.73%) ⬆️

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

cond.Status = metav1.ConditionTrue
meta.SetStatusCondition(&fc.Status.Conditions, *cond)
sortConditions(fc)
}
Copy link
Contributor

Choose a reason for hiding this comment

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

while you are here lets add ut for condition package

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sure I'll do that 👌

Copy link
Contributor Author

@jpinsonneau jpinsonneau Aug 24, 2023

Choose a reason for hiding this comment

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

I've added some tests but these seems flaky 🤔
fda8f2a

I'm digging to find why:
-> seems to be related to console plugin reconciliation 🤕

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@jotak can you please explain the following action ?

// Do a dummy change that will trigger reconcile, and make sure SM is created again
UpdateCR(crKey, func(fc *flowslatest.FlowCollector) {
fc.Spec.Processor.LogLevel = "info"
})

Why do we need to trigger the loop ? Is it a behavior related to the test bench ?

As far as I understand, ginkgo run all of these Context in parallel; that's why I get flaky tests checking the status in the middle of the test bench.
If I check for Ready in Cleanup it works but I also need to trigger the reconcile loop which doesn't make sense to me
a0dc9ae

Copy link
Member

Choose a reason for hiding this comment

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

I cannot recall now, maybe this UpdateCR isn't necessary, but I guess if I added that it's because the kube test env didn't trigger the reconcile as I expected (the goal here being to make sure the ServiceMonitor is recreated - I remember I added this test after a bug where SM wasn't reconciled.

I remember that a while ago I removed some condition-checking code in tests because iirc it wasn't working as expected with kube testenv, and led to flaky tests ... but I don't remember all the details

@Amoghrd
Copy link
Contributor

Amoghrd commented Aug 23, 2023

/ok-to-test

@openshift-ci openshift-ci bot added the ok-to-test To set manually when a PR is safe to test. Triggers image build on PR. label Aug 23, 2023
@github-actions
Copy link

New images:

  • quay.io/netobserv/network-observability-operator:117d5bb
  • quay.io/netobserv/network-observability-operator-bundle:v0.0.0-117d5bb
  • quay.io/netobserv/network-observability-operator-catalog:v0.0.0-117d5bb

They will expire after two weeks.

To deploy this build:

# Direct deployment, from operator repo
IMAGE=quay.io/netobserv/network-observability-operator:117d5bb make deploy

# Or using operator-sdk
operator-sdk run bundle quay.io/netobserv/network-observability-operator-bundle:v0.0.0-117d5bb

Or as a Catalog Source:

apiVersion: operators.coreos.com/v1alpha1
kind: CatalogSource
metadata:
  name: netobserv-dev
  namespace: openshift-marketplace
spec:
  sourceType: grpc
  image: quay.io/netobserv/network-observability-operator-catalog:v0.0.0-117d5bb
  displayName: NetObserv development catalog
  publisher: Me
  updateStrategy:
    registryPoll:
      interval: 1m

@Amoghrd
Copy link
Contributor

Amoghrd commented Aug 23, 2023

/label qe-approved

@openshift-ci openshift-ci bot added the qe-approved QE has approved this pull request label Aug 23, 2023
@github-actions github-actions bot removed the ok-to-test To set manually when a PR is safe to test. Triggers image build on PR. label Aug 24, 2023
@Amoghrd
Copy link
Contributor

Amoghrd commented Aug 25, 2023

Shoould this be tested again? @jpinsonneau

@jpinsonneau
Copy link
Contributor Author

Shoould this be tested again? @jpinsonneau

No need @Amoghrd, only unit tests were added. I'm just waiting for devs LGTM 😄
Thanks !

Copy link
Member

@jotak jotak left a comment

Choose a reason for hiding this comment

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

LGTM

@jotak
Copy link
Member

jotak commented Aug 29, 2023

@jpinsonneau I checked " Does this PR require a product release notes entry? ", I guess it's needed here? If so can you add it to the JIRA?

@jpinsonneau
Copy link
Contributor Author

/approve

@openshift-ci
Copy link

openshift-ci bot commented Aug 31, 2023

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: jpinsonneau

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-merge-robot openshift-merge-robot merged commit e647167 into netobserv:main Aug 31, 2023
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved lgtm qe-approved QE has approved this pull request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants