Bug 1989398

Summary: .indexignore is not ingore when opm command load dc configuration
Product: OpenShift Container Platform Reporter: kuiwang
Component: OLMAssignee: tflannag
OLM sub component: OLM QA Contact: kuiwang
Status: CLOSED ERRATA Docs Contact:
Severity: low    
Priority: low CC: pegoncal, tflannag, vdinh, vlaad
Version: 4.11Keywords: Reopened, Triaged
Target Milestone: ---   
Target Release: 4.11.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
: 1999246 (view as bug list) Environment:
Last Closed: 2022-09-07 20:49:23 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:

Description kuiwang 2021-08-03 06:53:31 UTC
Description of problem:
When adding .indexignore into dc configuration directory, it does not ignore itself when loading dc configuration directory.

the WA is to add "/.indexignore" into .indexignore.

but refer to .gitignore, we should not need to add such line into .indexignore

Version-Release number of selected component (if applicable):
[root@preserve-olm-env OCP-43248]# opm version
Version: version.Version{OpmVersion:"cf7140bf3", GitCommit:"cf7140bf3c404454892c9c972b0d9e839a46f619", BuildDate:"2021-08-02T05:12:33Z", GoOs:"linux", GoArch:"amd64"}

How reproducible:
Always


Steps to Reproduce:
[root@preserve-olm-env OCP-43248]# tree configs-DD/
configs-DD/
├── etcd
│   └── etcd.json
├── example-operator
│   └── example-operator.json
└── index.json

2 directories, 3 files
[root@preserve-olm-env OCP-43248]# opm validate configs-DD/


[root@preserve-olm-env OCP-43248]# #make wrong etcd.json so that validate failure
[root@preserve-olm-env OCP-43248]# diff configs-DD/etcd/etcd.json wrong-etcd.json 
6d5
< }
[root@preserve-olm-env OCP-43248]# cp -f wrong-etcd.json configs-DD/etcd/etcd.json 
cp: overwrite 'configs-DD/etcd/etcd.json'? y
[root@preserve-olm-env OCP-43248]# opm validate configs-DD/
FATA[0000] json: offset 132: invalid character '{' after object key:value pair 


[root@preserve-olm-env OCP-43248]# #create ignore file to ignore etcd and pass validation
[root@preserve-olm-env OCP-43248]# echo "/etcd" > configs-DD/.indexignore
[root@preserve-olm-env OCP-43248]# echo "/etcd/*" >> configs-DD/.indexignore
[root@preserve-olm-env OCP-43248]# cat configs-DD/.indexignore
/etcd
/etcd/*
[root@preserve-olm-env OCP-43248]# opm validate configs-DD/
FATA[0000] json: cannot unmarshal string into Go value of type declcfg.tmp 



# here is the WA
[root@preserve-olm-env OCP-43248]# echo "/.indexignore" >> configs-DD/.indexignore
[root@preserve-olm-env OCP-43248]# cat configs-DD/.indexignore
/etcd
/etcd/*
/.indexignore
[root@preserve-olm-env OCP-43248]# opm validate configs-DD/


Actual results:
does not ignore .indexignore default

Expected results:
should ignore .indexignore default, no need to add itself into .ignore .indexignore explicitly.


Additional info:

Comment 4 kuiwang 2021-08-16 01:11:53 UTC
Why we do not port it to downstream although there is workaround for downstream?
We should have a fix on downstream.

Thanks

Comment 10 Per da Silva 2022-04-05 09:22:06 UTC
Moving this back to ON_QA and asking for verification

Comment 16 errata-xmlrpc 2022-09-07 20:49:23 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.11.3 packages 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-2022:6287