netobserv / network-observability-operator

An OpenShift / Kubernetes operator for network observability
Apache License 2.0
155 stars 24 forks source link

NETOBSERV-1377: Add controller to deploy netobserv network policy #690

Closed OlivierCazade closed 2 months ago

OlivierCazade commented 3 months ago

Description

Add controller to deploy netobserv network policy

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.

codecov[bot] commented 3 months ago

Codecov Report

Attention: Patch coverage is 62.42038% with 59 lines in your changes missing coverage. Please review.

Project coverage is 65.98%. Comparing base (bc0bcef) to head (5a3c92b). Report is 31 commits behind head on main.

Files Patch % Lines
controllers/networkpolicy/np_objects.go 58.88% 35 Missing and 2 partials :warning:
...pis/flowcollector/v1beta2/zz_generated.deepcopy.go 43.75% 9 Missing :warning:
controllers/reconcilers/reconcilers.go 46.66% 8 Missing :warning:
controllers/networkpolicy/np_controller.go 86.11% 2 Missing and 3 partials :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #690 +/- ## ========================================== - Coverage 66.60% 65.98% -0.62% ========================================== Files 70 74 +4 Lines 8115 8541 +426 ========================================== + Hits 5405 5636 +231 - Misses 2315 2503 +188 - Partials 395 402 +7 ``` | [Flag](https://app.codecov.io/gh/netobserv/network-observability-operator/pull/690/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=netobserv) | Coverage Δ | | |---|---|---| | [unittests](https://app.codecov.io/gh/netobserv/network-observability-operator/pull/690/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=netobserv) | `65.98% <62.42%> (-0.62%)` | :arrow_down: | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=netobserv#carryforward-flags-in-the-pull-request-comment) to find out more. | [Files](https://app.codecov.io/gh/netobserv/network-observability-operator/pull/690?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=netobserv) | Coverage Δ | | |---|---|---| | [...s/flowcollector/v1beta1/zz\_generated.conversion.go](https://app.codecov.io/gh/netobserv/network-observability-operator/pull/690?src=pr&el=tree&filepath=apis%2Fflowcollector%2Fv1beta1%2Fzz_generated.conversion.go&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=netobserv#diff-YXBpcy9mbG93Y29sbGVjdG9yL3YxYmV0YTEvenpfZ2VuZXJhdGVkLmNvbnZlcnNpb24uZ28=) | `39.27% <ø> (ø)` | | | [apis/flowcollector/v1beta2/flowcollector\_types.go](https://app.codecov.io/gh/netobserv/network-observability-operator/pull/690?src=pr&el=tree&filepath=apis%2Fflowcollector%2Fv1beta2%2Fflowcollector_types.go&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=netobserv#diff-YXBpcy9mbG93Y29sbGVjdG9yL3YxYmV0YTIvZmxvd2NvbGxlY3Rvcl90eXBlcy5nbw==) | `100.00% <ø> (ø)` | | | [pkg/manager/manager.go](https://app.codecov.io/gh/netobserv/network-observability-operator/pull/690?src=pr&el=tree&filepath=pkg%2Fmanager%2Fmanager.go&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=netobserv#diff-cGtnL21hbmFnZXIvbWFuYWdlci5nbw==) | `66.66% <ø> (ø)` | | | [pkg/manager/status/status\_manager.go](https://app.codecov.io/gh/netobserv/network-observability-operator/pull/690?src=pr&el=tree&filepath=pkg%2Fmanager%2Fstatus%2Fstatus_manager.go&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=netobserv#diff-cGtnL21hbmFnZXIvc3RhdHVzL3N0YXR1c19tYW5hZ2VyLmdv) | `89.47% <ø> (+1.75%)` | :arrow_up: | | [controllers/networkpolicy/np\_controller.go](https://app.codecov.io/gh/netobserv/network-observability-operator/pull/690?src=pr&el=tree&filepath=controllers%2Fnetworkpolicy%2Fnp_controller.go&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=netobserv#diff-Y29udHJvbGxlcnMvbmV0d29ya3BvbGljeS9ucF9jb250cm9sbGVyLmdv) | `86.11% <86.11%> (ø)` | | | [controllers/reconcilers/reconcilers.go](https://app.codecov.io/gh/netobserv/network-observability-operator/pull/690?src=pr&el=tree&filepath=controllers%2Freconcilers%2Freconcilers.go&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=netobserv#diff-Y29udHJvbGxlcnMvcmVjb25jaWxlcnMvcmVjb25jaWxlcnMuZ28=) | `59.39% <46.66%> (-1.62%)` | :arrow_down: | | [...pis/flowcollector/v1beta2/zz\_generated.deepcopy.go](https://app.codecov.io/gh/netobserv/network-observability-operator/pull/690?src=pr&el=tree&filepath=apis%2Fflowcollector%2Fv1beta2%2Fzz_generated.deepcopy.go&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=netobserv#diff-YXBpcy9mbG93Y29sbGVjdG9yL3YxYmV0YTIvenpfZ2VuZXJhdGVkLmRlZXBjb3B5Lmdv) | `42.72% <43.75%> (-1.05%)` | :arrow_down: | | [controllers/networkpolicy/np\_objects.go](https://app.codecov.io/gh/netobserv/network-observability-operator/pull/690?src=pr&el=tree&filepath=controllers%2Fnetworkpolicy%2Fnp_objects.go&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=netobserv#diff-Y29udHJvbGxlcnMvbmV0d29ya3BvbGljeS9ucF9vYmplY3RzLmdv) | `58.88% <58.88%> (ø)` | | ... and [17 files with indirect coverage changes](https://app.codecov.io/gh/netobserv/network-observability-operator/pull/690/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=netobserv)
Amoghrd commented 2 months ago

/ok-to-test

github-actions[bot] commented 2 months ago

New images:

They will expire after two weeks.

To deploy this build:

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

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

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-8afb9c0
  displayName: NetObserv development catalog
  publisher: Me
  updateStrategy:
    registryPoll:
      interval: 1m
Amoghrd commented 2 months ago

@OlivierCazade networkPolicy seems to be disabled by default

Screenshot 2024-07-24 at 3 21 41 PM
jotak commented 2 months ago

hey @Amoghrd I think this is ok to test /lgtm

openshift-ci-robot commented 2 months ago

@OlivierCazade: This pull request references NETOBSERV-1377 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the story to target the "4.17.0" version, but no target version was set.

In response to [this](https://github.com/netobserv/network-observability-operator/pull/690): >## Description > >Add controller to deploy netobserv network policy > >## 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. > >* [X] 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. >* [X] Does this PR require a product release notes entry? > * [X] 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): > * [X] 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). > Instructions for interacting with me using PR comments are available [here](https://prow.ci.openshift.org/command-help?repo=netobserv%2Fnetwork-observability-operator). If you have questions or suggestions related to my behavior, please file an issue against the [openshift-eng/jira-lifecycle-plugin](https://github.com/openshift-eng/jira-lifecycle-plugin/issues/new) repository.
Amoghrd commented 2 months ago

/ok-to-test

github-actions[bot] commented 2 months ago

New images:

They will expire after two weeks.

To deploy this build:

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

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

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-e618cc3
  displayName: NetObserv development catalog
  publisher: Me
  updateStrategy:
    registryPoll:
      interval: 1m
Amoghrd commented 2 months ago

/label qe-approved

openshift-ci-robot commented 2 months ago

@OlivierCazade: This pull request references NETOBSERV-1377 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the story to target the "4.17.0" version, but no target version was set.

In response to [this](https://github.com/netobserv/network-observability-operator/pull/690): >## Description > >Add controller to deploy netobserv network policy > >## 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. > >* [X] 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. >* [X] Does this PR require a product release notes entry? > * [X] 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): > * [X] 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). > Instructions for interacting with me using PR comments are available [here](https://prow.ci.openshift.org/command-help?repo=netobserv%2Fnetwork-observability-operator). If you have questions or suggestions related to my behavior, please file an issue against the [openshift-eng/jira-lifecycle-plugin](https://github.com/openshift-eng/jira-lifecycle-plugin/issues/new) repository.
jotak commented 2 months ago

/lgtm /approve

openshift-ci[bot] commented 2 months ago

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: jotak

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: - ~~[OWNERS](https://github.com/netobserv/network-observability-operator/blob/main/OWNERS)~~ [jotak] Approvers can indicate their approval by writing `/approve` in a comment Approvers can cancel approval by writing `/approve cancel` in a comment
openshift-ci[bot] commented 2 months ago

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: jotak

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: - ~~[OWNERS](https://github.com/netobserv/network-observability-operator/blob/main/OWNERS)~~ [jotak] Approvers can indicate their approval by writing `/approve` in a comment Approvers can cancel approval by writing `/approve cancel` in a comment