Files
troubleshoot/pkg/specs/specs.go
Evans Mungai ff03bfa9cd chore: make spec loaders internal APIs (#1313)
* chore: make specs an internal package

* Some minor improvements

* Use LoadClusterSpecs in support bundle implementation

* Remove change accidentally committed

* Use LoadFromCLIArgs in preflight CLI implementation

* Update comment

* Fix edge case where the label selector is an empty string

* Fix failing test
2023-08-30 14:02:30 +01:00

18 lines
748 B
Go

package specs
import (
"context"
specs "github.com/replicatedhq/troubleshoot/internal/specs"
"k8s.io/apimachinery/pkg/labels"
"k8s.io/client-go/kubernetes"
)
// SplitTroubleshootSecretLabelSelector splits a label selector into two selectors, if applicable:
// 1. troubleshoot.io/kind=support-bundle and non-troubleshoot (if contains) labels selector.
// 2. troubleshoot.sh/kind=support-bundle and non-troubleshoot (if contains) labels selector.
// Deprecated: Remove in a future version (v1.0). Future loader functions will be created
func SplitTroubleshootSecretLabelSelector(client kubernetes.Interface, labelSelector labels.Selector) ([]string, error) {
return specs.SplitTroubleshootSecretLabelSelector(context.TODO(), labelSelector)
}