Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add dnfmodule repo implementation #488

Merged
merged 1 commit into from
Oct 30, 2023
Merged

add dnfmodule repo implementation #488

merged 1 commit into from
Oct 30, 2023

Conversation

evgeni
Copy link
Member

@evgeni evgeni commented Oct 29, 2023

No description provided.

@evgeni evgeni added the enhancement New feature or request label Oct 29, 2023
@evgeni evgeni force-pushed the dnfmodule branch 2 times, most recently from 8187a6c to 5c740f1 Compare October 29, 2023 13:00
@evgeni evgeni marked this pull request as ready for review October 29, 2023 13:26
@evgeni evgeni force-pushed the dnfmodule branch 2 times, most recently from 085ce40 to c543c11 Compare October 29, 2023 14:44
manifests/repo/dnfmodule.pp Show resolved Hide resolved
@ekohl
Copy link
Member

ekohl commented Oct 29, 2023

This is a new one for me:

        	broken groups or modules: nodejs:18
       	Error: /Stage[main]/Nodejs::Repo::Dnfmodule/Package[nodejs dnf module]/ensure: change from 'purged' to '18' failed: Could not update: Execution of '/usr/bin/dnf module install -d 0 -e 1 -y nodejs:18' returned 1: Error: Problems in request:
       	broken groups or modules: nodejs:18

@evgeni
Copy link
Member Author

evgeni commented Oct 29, 2023

It started once I dropped the enable_only 🤔

@ekohl
Copy link
Member

ekohl commented Oct 29, 2023

It made me look it up: enable_only makes it dnf module enable instead of dnf module install (https://github.com/puppetlabs/puppet/blob/5dae3b1f808d4fe0def1c5673c65273d2466ff43/lib/puppet/provider/package/dnfmodule.rb#L88-L103). I guess that doesn't work for the nodejs module.

@ekohl
Copy link
Member

ekohl commented Oct 29, 2023

And there is code that should catch that error, but looks like that doesn't work.

@evgeni
Copy link
Member Author

evgeni commented Oct 29, 2023

Modules really, really, should never be installed (it was a mistake to allow that). (end-of-rant)

@evgeni evgeni force-pushed the dnfmodule branch 3 times, most recently from 62f02ec to b9a1ad9 Compare October 29, 2023 17:44
@evgeni
Copy link
Member Author

evgeni commented Oct 29, 2023

And there is code that should catch that error, but looks like that doesn't work.

The match is: /^(?:missing|broken) groups or modules: #{Regexp.quote(@resource[:name])}$/, so in our case: ^broken groups or modules: nodejs$, but the output is "… nodejs:18".

I think the match should be /^(?:missing|broken) groups or modules: #{Regexp.quote(args)}$/ instead

Yeah, using 389-ds from the original ticket, I see:

# dnf module install -d 0 -e 1 -y 389-ds
Error: Problems in request:
broken groups or modules: 389-ds

# dnf module install -d 0 -e 1 -y 389-ds:1.4
Error: Problems in request:
broken groups or modules: 389-ds:1.4

# dnf module install -d 0 -e 1 -y 389-ds:1.4/sdf
Error: Problems in request:
missing groups or modules: 389-ds:1.4/sdf

@evgeni
Copy link
Member Author

evgeni commented Oct 29, 2023

also, no idea why exactly 18 has no default profile:

# dnf module list nodejs
Failed to set locale, defaulting to C.UTF-8
Last metadata expiration check: 0:07:22 ago on Sun Oct 29 17:42:59 2023.
CentOS Stream 8 - AppStream
Name                                            Stream                                         Profiles                                                                      Summary                                                   
nodejs                                          10 [d]                                         common [d], development, minimal, s2i                                         Javascript runtime                                        
nodejs                                          12                                             common [d], development, minimal, s2i                                         Javascript runtime                                        
nodejs                                          14                                             common [d], development, minimal, s2i                                         Javascript runtime                                        
nodejs                                          16                                             common [d], development, minimal, s2i                                         Javascript runtime                                        
nodejs                                          18                                             common, development, minimal, s2i                                             Javascript runtime                                        
nodejs                                          20                                             common [d], development, minimal, s2i                                         Javascript runtime                                        

Hint: [d]efault, [e]nabled, [x]disabled, [i]nstalled

@evgeni
Copy link
Member Author

evgeni commented Oct 29, 2023

also, no idea why exactly 18 has no default profile

LOOK MA, TWO BUGS FOR THE PRICE OF ONE!

# dnf module list nodejs
Red Hat Enterprise Linux 8 for x86_64 - AppStream (RPMs)
Name                                           Stream                                            Profiles                                                                     Summary                                                  
nodejs                                         10 [d][e]                                         common [d], development, minimal, s2i                                        Javascript runtime                                       
nodejs                                         12                                                common [d], development, minimal, s2i                                        Javascript runtime                                       
nodejs                                         14                                                common [d], development, minimal, s2i                                        Javascript runtime                                       
nodejs                                         16                                                common [d], development, minimal, s2i                                        Javascript runtime                                       
nodejs                                         18                                                common [d], development, minimal, s2i                                        Javascript runtime                                       
# dnf module list nodejs
Oracle Linux 8 Application Stream (x86_64)
Name                                            Stream                                         Profiles                                                                      Summary                                                   
nodejs                                          10 [d]                                         common [d], development, minimal, s2i                                         Javascript runtime                                        
nodejs                                          12                                             common [d], development, minimal, s2i                                         Javascript runtime                                        
nodejs                                          14                                             common [d], development, minimal, s2i                                         Javascript runtime                                        
nodejs                                          16                                             common [d], development, minimal, s2i                                         Javascript runtime                                        
nodejs                                          18                                             common [d], development, minimal, s2i                                         Javascript runtime                      

@evgeni
Copy link
Member Author

evgeni commented Oct 30, 2023

LOOK MA, TWO BUGS FOR THE PRICE OF ONE!

https://issues.redhat.com/browse/RHEL-14970

@evgeni
Copy link
Member Author

evgeni commented Oct 30, 2023

I think the match should be /^(?:missing|broken) groups or modules: #{Regexp.quote(args)}$/ instead

puppetlabs/puppet#9138

@evgeni evgeni merged commit bf1c3ac into master Oct 30, 2023
23 checks passed
@evgeni evgeni deleted the dnfmodule branch October 30, 2023 07:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants