Bug 1968172

Summary: [master] Infra env require pullSecretRef although it shouldn't be required
Product: OpenShift Container Platform Reporter: Eran Cohen <ercohen>
Component: assisted-installerAssignee: Nir Magnezi <nmagnezi>
assisted-installer sub component: Deployment Operator QA Contact: Omri Hochman <ohochman>
Status: CLOSED CURRENTRELEASE Docs Contact:
Severity: medium    
Priority: unspecified CC: aos-bugs, atraeger, ccrum, mfilanov
Version: 4.8   
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard: AI-Team-Hive KNI-EDGE-4.8 KNI-EDGE-JUKE-4.8
Fixed In Version: OCP-Metal-v1.0.22.1 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
: 1968385 (view as bug list) Environment:
Last Closed: 2022-08-28 08:45:59 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1968385    

Description Eran Cohen 2021-06-06 13:17:09 UTC
Description of problem:

Tried to apply the following CR and got a validation error

apiVersion: agent-install.openshift.io/v1beta1
kind: InfraEnv
metadata:
  name: osher
  namespace: assisted-installer
spec:
  clusterRef:
    name: first-scenario
    namespace: namespace-1
  agentLabelSelector:
    matchLabels: {}
  sshAuthorizedKey: 'ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQDKkS0souhtF+JS5bb8ycdsOO/UHownMiu6OCRvgR7C+8CGa0xzxc0+0oB5RrzWvd/+o3K9Xx+ZE0jwe7WZaKvXKXehP5dmrlFe/2SZkvwNN64/K14lZjhokNBy8HqysrKWxiSof6+GrHkjQIXrbtvBjuhsdLMc7sVoIHultxga8PfIR8qkUMaLc4FW6OnJtjhIaYVIatZazatL8FCnjh/wTlxcPg5753oxftH0e8kR8YXKpRm+E8CMQXhsGo91mlXg7y0/Kj6ICXVNoNDVdN81OiZXcE7ZkNsT6Il2yNJtVXhBZ1Bgh8j1LH60BUkiLHchDjNL+ZJxKdcW/hOmpY26nDBBK1TAE2s1eO/UDMaaR39CMo1C18tnnGEGgFDKWPf8hpmatzG1F+OAAcwbXIhe6YwLj0SfyOwpb422imxWg6teFSIhFNyLIoEnfKsZj8Zvz0N1O7GC7S1Ic4KGbYN+HkIK1HTA9jWwbcI/mfIjnHofG8k1COZhAffUn4iZswU= root.lab.eng.rdu2.redhat.com'

[root@rdu-infra-edge-06 ~]# kubectl apply -f infra-env.yaml
error: error validating "infra-env.yaml": error validating data: ValidationError(InfraEnv.spec): missing required field "pullSecretRef" in io.openshift.agent-install.v1beta1.InfraEnv.spec; if you choose to ignore these errors, turn validation off with --validate=false


Version-Release number of selected component (if applicable):


How reproducible:
100%
Steps to Reproduce:
1.Deploy the operator
2.Try applying the CR above
3.

Actual results:
error: error validating "infra-env.yaml": error validating data: ValidationError(InfraEnv.spec): missing required field "pullSecretRef" in io.openshift.agent-install.v1beta1.InfraEnv.spec; if you choose to ignore these errors, turn validation off with --validate=false

Expected results:


Additional info:

Comment 1 Michael Filanov 2021-06-06 13:23:07 UTC
I'm not sure that it's a bug because it will be required next version, @atraeger what do you think?

Comment 2 Eran Cohen 2021-06-06 15:14:33 UTC
This is the example we have in the docs https://github.com/openshift/assisted-service/blob/master/docs/crds/infraEnv.yaml#L12
It says it's not required, so either we fix the docs to say it's required or we fix the code so it won't get validated. Currently from a user perspective, it's confusing.

Comment 3 Avishay Traeger 2021-06-07 06:16:40 UTC
Let's treat it as required so that we don't break the API later on.

Comment 4 Nir Magnezi 2021-06-07 08:53:12 UTC
Per comment #3, I reverted the doc update: https://github.com/openshift/assisted-service/pull/1938

Comment 5 Chad Crum 2021-06-07 23:12:20 UTC
Verified the doc update was reverted.