Bug 1968425 - [master] AgentLabelSelector is required yet not supported
Summary: [master] AgentLabelSelector is required yet not supported
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: assisted-installer
Version: 4.8
Hardware: Unspecified
OS: Unspecified
low
medium
Target Milestone: ---
: 4.9.0
Assignee: Fred Rolland
QA Contact: Yuri Obshansky
URL:
Whiteboard: KNI-EDGE-JUKE-4.8 AI-Team-Hive
Depends On:
Blocks: 1970401
TreeView+ depends on / blocked
 
Reported: 2021-06-07 11:38 UTC by Osher De Paz
Modified: 2021-10-18 17:33 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: No Doc Update
Doc Text:
Clone Of:
: 1970401 (view as bug list)
Environment:
Last Closed: 2021-10-18 17:32:56 UTC
Target Upstream Version:
Embargoed:
frolland: needinfo-


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github openshift assisted-service pull 1998 0 None open Bug 1968425: Apply labels from infraenv to Agents 2021-06-16 14:41:26 UTC
Red Hat Product Errata RHSA-2021:3759 0 None None None 2021-10-18 17:33:23 UTC

Internal Links: 1970401

Description Osher De Paz 2021-06-07 11:38:17 UTC
It seems like AgentLabelSelector is a required field in InfraEnv CR, yet not really being used.
I would expect it to be optional, and/or be explained that it's not yet implemented:

oc explain infraenv.spec.agentLabelSelector
KIND:     InfraEnv
VERSION:  agent-install.openshift.io/v1beta1

RESOURCE: agentLabelSelector <Object>

DESCRIPTION:
     AgentLabelSelector specifies a label that should be applied to Agents that
     boot from the installation media of this InfraEnv. This is how a user would
     identify which agents are associated with a particular InfraEnv.

FIELDS:
   ...

Also, kubectl explain already have a --api-version option for a distinctive instructions per-version. So we should make good use of it.

Comment 2 Michael Filanov 2021-06-08 06:59:53 UTC
@atraeger @mhrivnak why is agent label selector required? if it's something that will be used by the users then it should be optional no?

Comment 3 Avishay Traeger 2021-06-08 09:16:37 UTC
@mhrivnak I also don't see why it should be required.  What do you think?

Comment 4 Ronnie Lazar 2021-06-08 09:39:17 UTC
If it should not be required, I guess we must change this in 4.8.0, no?

Comment 5 Avishay Traeger 2021-06-08 09:45:41 UTC
Yes but let's wait for confirmation from @mhrivnak

Comment 6 Michael Filanov 2021-06-10 12:19:02 UTC
Summary:
 - Make the labels optional.
 - Copy labels once when agent register.

Comment 7 Michael Hrivnak 2021-06-14 22:58:41 UTC
If it defaults to empty, and there are two InfraEnvs in the same namespace where a selector and label were not provided, then it won't be possible to identify which Agents go with which InfraEnv. Requiring a selector up-front, just like one is required on a Deployment, ReplicaSet, MachineSet, etc., is easy and avoids potential ambiguity or collision.

It would make sense to suggest a convention of "infraenv: <Name of infraenv>"

Comment 8 Michael Filanov 2021-06-15 06:16:04 UTC
It doesn't mean that users will set a unique value, for all we know it can be foo: bar for all the infra env. 
As far as i know eventually we will need to know what is the InfraEnv in order to access the host in the backend (related to late binding plans) so in case of labels we can add an infra env label regardless of what we have in the agent label selector. 
Or even add it to the spec/status.
@mhrivnak  What do you think?

Comment 9 Michael Hrivnak 2021-06-15 13:25:41 UTC
If we auto-generate a unique label and selector, I think that would be fine.

Comment 10 Michael Filanov 2021-06-15 16:02:58 UTC
in the same namespace it will be a different label selector if we take the name. because agents will be in the same namespace then i think that it will be fine.

Comment 11 Michael Filanov 2021-06-15 16:05:17 UTC
Just to be clear, my suggestion is just to add a label to the agents with the name of infra env.

Comment 12 Michael Filanov 2021-06-16 14:05:42 UTC
Summary in the of the meeting that we had:

- Move agent labels selector from the spec to the status
- When agent register we create it with all the labels from agent labels list + add addition label that will mark the infra env it was created by.

Comment 17 errata-xmlrpc 2021-10-18 17:32:56 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (Moderate: OpenShift Container Platform 4.9.0 bug fix and security update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHSA-2021:3759


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