Bug 2107715 - Day 2 agent does not show error when setting illegal role
Summary: Day 2 agent does not show error when setting illegal role
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Advanced Cluster Management for Kubernetes
Classification: Red Hat
Component: Infrastructure Operator
Version: rhacm-2.6
Hardware: Unspecified
OS: Unspecified
unspecified
high
Target Milestone: ---
: rhacm-2.7
Assignee: Mat Kowalski
QA Contact: Chad Crum
Derek
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2022-07-15 18:01 UTC by Trey West
Modified: 2022-11-23 14:47 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2022-11-23 14:47:09 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github openshift assisted-service pull 4501 0 None open Bug 2107715: Add validation for Agent's role 2022-10-14 09:50:36 UTC
Github stolostron backlog issues 24325 0 None None None 2022-07-15 20:05:35 UTC
Red Hat Issue Tracker MGMTBUGSM-473 0 None None None 2022-07-15 18:06:59 UTC

Description Trey West 2022-07-15 18:01:14 UTC
Description of problem:

When adding a day 2 worker with an illegal role (not master, worker, auto-assign), the agent resource shows that specsynced is successful. However, the agentclusterinstall shows backend error for specsynced. The agent should report the backend error instead of success.


Release image:
4.11.0-rc.1

Snapshot:
2.1.0-DOWNANDBACK-2022-07-08-09-45-12

Steps to Reproduce:
1. Set bmac.agent-install.openshift.io/role BMH annotation to invalid role in day 2 worker 
2. Create BMH resource

Actual results:
Agent registers and says it is ready to begin the installation

Expected results:
Agent validations are failing and specsynced reports "Illegal role defined"

Comment 5 Michael Filanov 2022-07-17 11:03:55 UTC
I'm not sure that it's an actual issue, the error is on a cluster level, for example if you set 5 hosts as masters in day1 how will we know which of the hosts are invalid? 
So we enable to set roles to the agent and let the cluster validations to handle it. 
Closing this ticket, if you disagree and you think that we should improve the UX feel free to reopen.

Comment 6 Michael Filanov 2022-07-18 12:21:01 UTC
Talked with Trey about it, reopening this issue. 
Looks like user is able to put boostrap in the role and host doesn't return an error in this case.
i would expect to see a sync error

Comment 8 Michael Filanov 2022-08-17 07:10:37 UTC
moved to 2.6.1 we will add webhook validation

Comment 9 Trey West 2022-10-21 12:37:55 UTC
Verified on 2.2.0-DOWNANDBACK-2022-10-19-15-57-21

$ oc get agent 520291c1-c628-4dde-8790-6c713f10b341 -o json | jq -r '.status.conditions[]|select(.type=="SpecSynced")'
{
  "lastTransitionTime": "2022-10-21T12:33:05Z",
  "message": "The Spec could not be synced due to backend error: Requested role (bootstrap) is invalid for host 520291c1-c628-4dde-8790-6c713f10b341 from infraEnv fe006351-cb4b-4670-88c5-628d29cad8df",
  "reason": "BackendError",
  "status": "False",
  "type": "SpecSynced"
}


Note You need to log in before you can comment on or make changes to this bug.