- 
                Notifications
    
You must be signed in to change notification settings  - Fork 1.2k
 
⚠️ Add client.{GroupVersionKindFor, IsObjectNamespaced} #2136
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 client.{GroupVersionKindFor, IsObjectNamespaced} #2136
Conversation
| 
           [APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: vincepri The full list of commands accepted by this bot can be found here. The pull request process is described here 
Needs approval from an approver in each of these files:
 
      
 Approvers can indicate their approval by writing   | 
    
| 
           /assign @alvaroaleman @sbueringer  | 
    
| 
           LGTM I required something like this in more than 1 place and it is definitely useful to see it provided by controller-runtime.  | 
    
6a54172    to
    6a48014      
    Compare
  
            
          
                pkg/client/apiutil/apimachinery.go
              
                Outdated
          
        
      | 
               | 
          ||
| // IsGVKNamespaced returns true if the object having the provided | ||
| // GVK is namespace scoped. | ||
| func IsGVKNamespaced(gvk schema.GroupVersionKind, scheme *runtime.Scheme, restmapper meta.RESTMapper) (bool, error) { | 
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.
scheme is unused, maybe drop?
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.
done, thanks!
6a48014    to
    00bd96a      
    Compare
  
    Add commonly used utilities that can be nicely wrapped in the built-in clients, in more details GroupVersionKindFor(obj) can be used to retrieve the GVK for a given object, while IsObjectNamespace can be used to determine if an object is global, or namespace scoped. Signed-off-by: Vince Prignano <[email protected]>
00bd96a    to
    c783d25      
    Compare
  
    | 
           /lgtm  | 
    
Add commonly used utilities that can be nicely wrapped in the built-in clients, in more details GroupVersionKindFor(obj) can be used to retrieve the GVK for a given object, while IsObjectNamespace can be used to determine if an object is global, or namespace scoped.
Signed-off-by: Vince Prignano [email protected]