minor improvements (includes release v0.8.0) #46
                
     Merged
            
            
          
  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.
  
    
  
    
What this PR does / why we need it:
Change 1:
The controller-runtime library already has a
LabelSelectorPredicatefunction, but it takes ametav1.LabelSelectoras an argument and converts it into alabels.Selectorinternally. This PR adds a similar function to the controller library, but it works directly on alabel.Selector, which is useful if the selector is build in code and does not originate from ametav1.LabelSelectoror if it already was converted to alabels.Selectorearlier.Change 2:
The
clusterspackage now allows to create a fakeClusterfrom an existing client. This is useful for testing purposes, but the resultingClusterwill not be fully functional and calling anything butClient()on it will likely result in a panic or undefined behavior.Change 3:
In addition to the
RegisterConfigPathFlagmethod, which adds a--<id>-clusterflag to the given FlagSet, theclusterspackage now also offers aRegisterSingleConfigPathFlagfunction, which works similarly, but names the flag--kubeconfig, which is more intuitive if only a single cluster is passed into the controller as an argument.