Skip to content

Commit

Permalink
Add PerformanceProfiles to 'oc adm must-gather' (#667)
Browse files Browse the repository at this point in the history
Add PerformanceProfiles as a RelatedObject for the must-gather tool on
non-HyperShift clusters.

Co-authored-by: Jiri Mencak <jmencak@users.noreply.github.com>
  • Loading branch information
openshift-cherrypick-robot and jmencak committed Jun 6, 2023
1 parent 851a61b commit d21fe0d
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion pkg/operator/status.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import (

tunedv1 "github.com/openshift/cluster-node-tuning-operator/pkg/apis/tuned/v1"
"github.com/openshift/cluster-node-tuning-operator/pkg/clusteroperator"
ntoconfig "github.com/openshift/cluster-node-tuning-operator/pkg/config"
ntomf "github.com/openshift/cluster-node-tuning-operator/pkg/manifests"
"github.com/openshift/cluster-node-tuning-operator/pkg/metrics"
)
Expand Down Expand Up @@ -310,14 +311,22 @@ func getRelatedObjects() []configv1.ObjectReference {
tunedMf := ntomf.TunedCustomResource()
dsMf := ntomf.TunedDaemonSet()

return []configv1.ObjectReference{
ret := []configv1.ObjectReference{
// The `resource` property of `relatedObjects` stanza should be the lowercase, plural value like `daemonsets`.
// See BZ1851214
{Group: "", Resource: "namespaces", Name: tunedMf.Namespace},
{Group: "tuned.openshift.io", Resource: "profiles", Name: "", Namespace: tunedMf.Namespace},
{Group: "tuned.openshift.io", Resource: "tuneds", Name: "", Namespace: tunedMf.Namespace},
{Group: "apps", Resource: "daemonsets", Name: dsMf.Name, Namespace: dsMf.Namespace},
}

if !ntoconfig.InHyperShift() {
ret = append(ret, configv1.ObjectReference{
Group: "performance.openshift.io", Resource: "performanceprofiles", Name: "",
})
}

return ret
}

func conditionTrue(conditions []configv1.ClusterOperatorStatusCondition, condType configv1.ClusterStatusConditionType) bool {
Expand Down

0 comments on commit d21fe0d

Please sign in to comment.