code: func preferredObjectKind(possibilities []schema.GroupVersionKind, preferences []schema.GroupVersionKind) schema.GroupVersionKind {
  	// Exact match
  	for _, priority := range preferences {
  		for _, possibility := range possibilities {
  			if possibility == priority {
  				return possibility
  			}
  		}
  	}
  
  	// GroupKind match
  	for _, priority := range preferences {
  		for _, possibility := range possibilities {
  			if possibility.GroupKind() == priority.GroupKind() {
  				return possibility
  			}
  		}
  	}
  
  	// Group match
  	for _, priority := range preferences {
  		for _, possibility := range possibilities {
  			if possibility.Group == priority.Group {
  				return possibility
  			}
  		}
  	}
  
  	// Just pick the first
  	return possibilities[0]
  }
docs: // preferredObjectKind picks the possibility that most closely matches the priority list in this order:
  // GroupVersionKind matches (exact match)
  // GroupKind matches
  // Group matches