GoogleCloudPlatform / GoogleCloudPlatform/osconfig
Yum updates not respecting excludes, if excludes have wildcards.
- Dominant language
- Go
- Stars
- 99
- Forks
- 113
- Avg merge
- 2d 10h
- Merged PRs (30d)
- 5
Description
It seems that according to the docs, the "Exclude" function on yum_updates should be the same as
`yum update -x ` or `yum update --exclude `, however both those syntax support wildcards. When I try to use wildcards in our excludes, the excludes are ignored and the packages we're trying to exclude are updated. If I put in the specific package name, things are ignored as expected, however this is not always the best scenario, as some packages have version numbers (of dependency packages) embedded in their name, so a wildcard is required to properly exclude them.
Examples
Yum update (no excludes)
```yum update
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
Resolving Dependencies
--> Running transaction check
---> Package google-cloud-sdk.x86_64 0:394.0.0-1 will be updated
---> Package google-cloud-sdk.x86_64 0:395.0.0-1 will be an update
--> Finished Dependency Resolution
Dependencies Resolved
==========================================================================================================================================================================================================================================
Package Arch Version Repository Size
==========================================================================================================================================================================================================================================
Updating:
google-cloud-sdk x86_64 395.0.0-1 google-cloud-sdk 104 M
Transaction Summary
==========================================================================================================================================================================================================================================
Upgrade 1 Package
```
Yum update to exclude google-cloud-sdk
```
yum update -x google-*
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
No packages marked for update
```
```
yum update --exclude google-*
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
No packages marked for update
```
That's how it should work, but when I add google-* to the excludes in OSPatch Management, google-cloud-sdk gets updated.

Output of log:
```
Running in dryrun mode, not updating 1 packages: ["google-cloud-sdk x86_64 395.0.0-1"]
```
The above output indicates that the package would be updated if it wasn't in dryrun.
Contributor guide
Assessment
This issue has not been assessed yet.