@@ -29,22 +29,22 @@ import (
2929)
3030
3131const (
32- // ClusterScopedResources defines the subpath, relative to the top-level must-gather directory.
32+ // clusterScopedResources defines the subpath, relative to the top-level must-gather directory.
3333 // A top-level must-gather directory is of the following format:
3434 // must-gather-dir/quay-io-openshift-kni-performance-addon-operator-must-gather-sha256-<Image SHA>
3535 // Here we find the cluster-scoped definitions saved by must-gather
36- ClusterScopedResources = "cluster-scoped-resources"
37- // CoreNodes defines the subpath, relative to ClusterScopedResources, on which we find node-specific data
38- CoreNodes = "core/nodes"
39- // MCPools defines the subpath, relative to ClusterScopedResources, on which we find the machine config pool definitions
40- MCPools = "machineconfiguration.openshift.io/machineconfigpools"
41- // YAMLSuffix is the extension of the yaml files saved by must-gather
42- YAMLSuffix = ".yaml"
43- // Nodes defines the subpath, relative to top-level must-gather directory, on which we find node-specific data
44- Nodes = "nodes"
45- // SysInfoFileName defines the name of the file where ghw snapshot is stored
46- SysInfoFileName = "sysinfo.tgz"
47- // defines the sub path relative to ClusterScopedResources, on which OCP infrastructure object is
36+ clusterScopedResources = "cluster-scoped-resources"
37+ // coreNodes defines the subpath, relative to ClusterScopedResources, on which we find node-specific data
38+ coreNodes = "core/nodes"
39+ // mcpools defines the subpath, relative to ClusterScopedResources, on which we find the machine config pool definitions
40+ mcpools = "machineconfiguration.openshift.io/machineconfigpools"
41+ // yamlSuffix is the extension of the yaml files saved by must-gather
42+ yamlSuffix = ".yaml"
43+ // nodes defines the subpath, relative to top-level must-gather directory, on which we find node-specific data
44+ nodes = "nodes"
45+ // sysInfoFileName defines the name of the file where ghw snapshot is stored
46+ sysInfoFileName = "sysinfo.tgz"
47+ // configOCPInfra defines the sub path relative to ClusterScopedResources, on which OCP infrastructure object is
4848 configOCPInfra = "config.openshift.io/infrastructures"
4949)
5050
@@ -80,7 +80,7 @@ func getMustGatherFullPaths(mustGatherPath string, suffix string) (string, error
8080
8181func getNode (mustGatherDirPath , nodeName string ) (* v1.Node , error ) {
8282 var node v1.Node
83- nodePathSuffix := path .Join (ClusterScopedResources , CoreNodes , nodeName )
83+ nodePathSuffix := path .Join (clusterScopedResources , coreNodes , nodeName )
8484 path , err := getMustGatherFullPaths (mustGatherDirPath , nodePathSuffix )
8585 if err != nil {
8686 return nil , fmt .Errorf ("failed to get MachineConfigPool for %s: %v" , nodeName , err )
@@ -103,7 +103,7 @@ func getNode(mustGatherDirPath, nodeName string) (*v1.Node, error) {
103103func GetNodeList (mustGatherDirPath string ) ([]* v1.Node , error ) {
104104 machines := make ([]* v1.Node , 0 )
105105
106- nodePathSuffix := path .Join (ClusterScopedResources , CoreNodes )
106+ nodePathSuffix := path .Join (clusterScopedResources , coreNodes )
107107 nodePath , err := getMustGatherFullPaths (mustGatherDirPath , nodePathSuffix )
108108 if err != nil {
109109 return nil , fmt .Errorf ("failed to get Nodes from must gather directory: %v" , err )
@@ -131,7 +131,7 @@ func GetNodeList(mustGatherDirPath string) ([]*v1.Node, error) {
131131func GetMCPList (mustGatherDirPath string ) ([]* machineconfigv1.MachineConfigPool , error ) {
132132 pools := make ([]* machineconfigv1.MachineConfigPool , 0 )
133133
134- mcpPathSuffix := path .Join (ClusterScopedResources , MCPools )
134+ mcpPathSuffix := path .Join (clusterScopedResources , mcpools )
135135 mcpPath , err := getMustGatherFullPaths (mustGatherDirPath , mcpPathSuffix )
136136 if err != nil {
137137 return nil , fmt .Errorf ("failed to get MCPs: %v" , err )
@@ -161,7 +161,7 @@ func GetMCPList(mustGatherDirPath string) ([]*machineconfigv1.MachineConfigPool,
161161func GetMCP (mustGatherDirPath , mcpName string ) (* machineconfigv1.MachineConfigPool , error ) {
162162 var mcp machineconfigv1.MachineConfigPool
163163
164- mcpPathSuffix := path .Join (ClusterScopedResources , MCPools , mcpName + YAMLSuffix )
164+ mcpPathSuffix := path .Join (clusterScopedResources , mcpools , mcpName + yamlSuffix )
165165 mcpPath , err := getMustGatherFullPaths (mustGatherDirPath , mcpPathSuffix )
166166 if err != nil {
167167 return nil , fmt .Errorf ("failed to obtain MachineConfigPool %s: %v" , mcpName , err )
0 commit comments