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

MGMT-9272 Automatic agent classification labels #3721

Merged

Conversation

avishayt
Copy link
Contributor

Resubmitting this PR which was reverted due to this bug which has now been fixed.

List all the issues related to this PR

  • New Feature
  • Enhancement
  • Bug fix
  • Tests
  • Documentation
  • CI/CD

What environments does this code impact?

  • Automation (CI, tools, etc)
  • Cloud
  • Operator Managed Deployments
  • None

How was this code tested?

  • assisted-test-infra environment
  • dev-scripts environment
  • Reviewer's test appreciated
  • Waiting for CI to do a full test run
  • Manual (Elaborate on how it was tested)
  • No tests needed

Assignees

/assign @filanov
/assign @nmagnezi
/assign @omertuc

Checklist

  • Title and description added to both, commit and PR.
  • Relevant issues have been associated (see CONTRIBUTING guide)
  • Reviewers have been listed
  • This change does not require a documentation update (docstring, docs, README, etc)
  • Does this change include unit-tests (note that code changes require unit-tests)

Reviewers Checklist

  • Are the title and description (in both PR and commit) meaningful and clear?
  • Is there a bug required (and linked) for this change?
  • Should this PR be backported?

This CRD defines the API for users to classify Agents by providing a
query that is run on the Agent's inventory along with a corresponding
label.
The AgentLabel controller updates Agents' labels according to defined
AgentClassification CRs in the same namespace.

The AgentClassification controller maintain counts for each
AgentClassification of how many Agents matched and how many had errors
when trying to match. It also has a finalizer such that the
AgentClassification won't be deleted as long as there are Agents
matching it.
@openshift-ci openshift-ci bot added the size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. label Apr 27, 2022
@openshift-ci openshift-ci bot requested review from adriengentil and carbonin April 27, 2022 08:47
@openshift-ci openshift-ci bot added the api-review Categorizes an issue or PR as actively needing an API review. label Apr 27, 2022
@openshift-ci
Copy link

openshift-ci bot commented Apr 27, 2022

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: avishayt

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-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Apr 27, 2022
@avishayt avishayt changed the title Avishay/mgmt 9272 try again MGMT-9272 Automatic agent classification labels Apr 27, 2022
@codecov
Copy link

codecov bot commented Apr 27, 2022

Codecov Report

Merging #3721 (43080ea) into master (b31fbf3) will increase coverage by 0.00%.
The diff coverage is 66.46%.

Impacted file tree graph

@@           Coverage Diff            @@
##           master    #3721    +/-   ##
========================================
  Coverage   65.90%   65.91%            
========================================
  Files         175      178     +3     
  Lines       24732    25066   +334     
========================================
+ Hits        16300    16522   +222     
- Misses       6831     6924    +93     
- Partials     1601     1620    +19     
Impacted Files Coverage Δ
...al/controller/controllers/agentlabel_controller.go 57.14% <57.14%> (ø)
...ller/controllers/agentclassification_controller.go 57.89% <57.89%> (ø)
...all/v1beta1/agent_classification_admission_hook.go 79.54% <79.54%> (ø)
...nternal/controller/controllers/agent_controller.go 79.26% <100.00%> (+0.05%) ⬆️
internal/network/manifests_generator.go 73.17% <0.00%> (ø)

@omertuc
Copy link
Contributor

omertuc commented Apr 27, 2022

Can you outline the differences from the previous PR, if any?

@avishayt
Copy link
Contributor Author

Can you outline the differences from the previous PR, if any?

No differences. Rebased with no conflicts.

@omertuc
Copy link
Contributor

omertuc commented Apr 27, 2022

/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Apr 27, 2022
@avishayt avishayt force-pushed the avishay/MGMT-9272-try-again branch from 3bd6431 to 43080ea Compare April 27, 2022 10:45
@openshift-ci openshift-ci bot removed the lgtm Indicates that a PR is ready to be merged. label Apr 27, 2022
@omertuc
Copy link
Contributor

omertuc commented Apr 27, 2022

/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Apr 27, 2022
@avishayt
Copy link
Contributor Author

/test e2e-metal-assisted
/test e2e-metal-assisted-capi

@openshift-bot
Copy link
Contributor

/retest-required

Please review the full test history for this PR and help us cut down flakes.

@omertuc
Copy link
Contributor

omertuc commented Apr 27, 2022

Waiting for openshift/assisted-test-infra#1633

@openshift-bot
Copy link
Contributor

/retest-required

Please review the full test history for this PR and help us cut down flakes.

1 similar comment
@openshift-bot
Copy link
Contributor

/retest-required

Please review the full test history for this PR and help us cut down flakes.

@omertuc
Copy link
Contributor

omertuc commented Apr 27, 2022

/retest

@openshift-bot
Copy link
Contributor

/retest-required

Please review the full test history for this PR and help us cut down flakes.

@openshift-ci
Copy link

openshift-ci bot commented Apr 27, 2022

@avishayt: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/prow/e2e-metal-assisted-capi 43080ea link false /test e2e-metal-assisted-capi

Full PR test history. Your PR dashboard.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here.

@openshift-merge-robot openshift-merge-robot merged commit 0ad1709 into openshift:master Apr 27, 2022
flaper87 pushed a commit to flaper87/assisted-service that referenced this pull request Sep 21, 2022
* MGMT-9272: Define AgentClassification CRD

This CRD defines the API for users to classify Agents by providing a
query that is run on the Agent's inventory along with a corresponding
label.

* MGMT-9272: AgentClassification and AgentLabel controllers

The AgentLabel controller updates Agents' labels according to defined
AgentClassification CRs in the same namespace.

The AgentClassification controller maintain counts for each
AgentClassification of how many Agents matched and how many had errors
when trying to match. It also has a finalizer such that the
AgentClassification won't be deleted as long as there are Agents
matching it.

* MGMT-9272: AgentClassification admission hooks

This ensures that:
1. Specified labels are valid and do not change
2. The specified query can be parsed

* MGMT-9272: AgentClassification documentation

* MGMT-9272: go.mod and go.sum

* MGMT-9272: Agent labels subsystem test
danielerez pushed a commit to danielerez/assisted-service that referenced this pull request Oct 15, 2023
* MGMT-9272: Define AgentClassification CRD

This CRD defines the API for users to classify Agents by providing a
query that is run on the Agent's inventory along with a corresponding
label.

* MGMT-9272: AgentClassification and AgentLabel controllers

The AgentLabel controller updates Agents' labels according to defined
AgentClassification CRs in the same namespace.

The AgentClassification controller maintain counts for each
AgentClassification of how many Agents matched and how many had errors
when trying to match. It also has a finalizer such that the
AgentClassification won't be deleted as long as there are Agents
matching it.

* MGMT-9272: AgentClassification admission hooks

This ensures that:
1. Specified labels are valid and do not change
2. The specified query can be parsed

* MGMT-9272: AgentClassification documentation

* MGMT-9272: go.mod and go.sum

* MGMT-9272: Agent labels subsystem test
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api-review Categorizes an issue or PR as actively needing an API review. approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants