- 
        Couldn't load subscription status. 
- Fork 2.8k
Checking for multiple registries when login/logout #24888
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
          
     Closed
      
      
    
  
     Closed
                    Changes from all commits
      Commits
    
    
  File filter
Filter by extension
Conversations
          Failed to load comments.   
        
        
          
      Loading
        
  Jump to
        
          Jump to file
        
      
      
          Failed to load files.   
        
        
          
      Loading
        
  Diff view
Diff view
There are no files selected for viewing
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              
      
      Oops, something went wrong.
        
    
  
  Add this suggestion to a batch that can be applied as a single commit.
  This suggestion is invalid because no changes were made to the code.
  Suggestions cannot be applied while the pull request is closed.
  Suggestions cannot be applied while viewing a subset of changes.
  Only one suggestion per line can be applied in a batch.
  Add this suggestion to a batch that can be applied as a single commit.
  Applying suggestions on deleted lines is not supported.
  You must change the existing code in this line in order to create a valid suggestion.
  Outdated suggestions cannot be applied.
  This suggestion has been applied or marked resolved.
  Suggestions cannot be applied from pending reviews.
  Suggestions cannot be applied on multi-line comments.
  Suggestions cannot be applied while the pull request is queued to merge.
  Suggestion cannot be applied right now. Please check back later.
  
    
  
    
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a breaking change so we cannot accept this until a 6.0 IMO.
And most importantly this code is broken. You always reject more than one registry even if one was specifed as argument on the cli (in the args array)
Any the login code seem shared between buildah and skopeo as well so if we decide to fix this we should fix this for all in https://github.com/containers/common/blob/main/pkg/auth/auth.go
And if you look into that code you see there is already an AcceptUnspecifiedRegistry option which is quite whay you do here but it we can add another case there for this new behavior.
https://github.com/containers/common/blob/514bf04d8e6a6ac19b71147b534875ca8001785f/pkg/auth/auth.go#L137
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So if I understand correctly thatregistriesFromFileis gonna fail regardless if we add which registry we wish to login?I understand your point now. The approach there is more elegant that this one. Do you want me to modify to something similar to that? https://github.com/containers/common/blob/514bf04d8e6a6ac19b71147b534875ca8001785f/pkg/auth/auth.go#L137