Bug 1989398 - .indexignore is not ingore when opm command load dc configuration
Summary: .indexignore is not ingore when opm command load dc configuration
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: OLM
Version: 4.11
Hardware: Unspecified
OS: Unspecified
low
low
Target Milestone: ---
: 4.11.0
Assignee: tflannag
QA Contact: kuiwang
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2021-08-03 06:53 UTC by kuiwang
Modified: 2022-09-07 20:49 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
: 1999246 (view as bug list)
Environment:
Last Closed: 2022-09-07 20:49:23 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2022:6287 0 None None None 2022-09-07 20:49:54 UTC

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


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