-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Making GetModuleReady/GetDevicePluginReadyLabels functions public (#672…
…) (#937) since "ready" labels are public APIs of KMM, operators using KMM may want to schedule they workloads based on the presence of those labels.
- Loading branch information
1 parent
78a172a
commit 929622c
Showing
3 changed files
with
54 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
package labels | ||
|
||
import ( | ||
"github.com/rh-ecosystem-edge/kernel-module-management/internal/utils" | ||
) | ||
|
||
func GetKernelModuleReadyNodeLabel(namespace, moduleName string) string { | ||
return utils.GetKernelModuleReadyNodeLabel(namespace, moduleName) | ||
} | ||
|
||
func GetDevicePluginNodeLabel(namespace, moduleName string) string { | ||
return utils.GetDevicePluginNodeLabel(namespace, moduleName) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
package labels | ||
|
||
import ( | ||
. "github.com/onsi/ginkgo/v2" | ||
. "github.com/onsi/gomega" | ||
) | ||
|
||
var _ = Describe("GetModuleReadyAndDevicePluginReadyLabels", func() { | ||
It("module ready label", func() { | ||
res := GetKernelModuleReadyNodeLabel("some-namespace", "some-module") | ||
Expect(res).To(Equal("kmm.node.kubernetes.io/some-namespace.some-module.ready")) | ||
}) | ||
|
||
It("device-plugin ready label", func() { | ||
res := GetDevicePluginNodeLabel("some-namespace", "some-module") | ||
Expect(res).To(Equal("kmm.node.kubernetes.io/some-namespace.some-module.device-plugin-ready")) | ||
}) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
package labels | ||
|
||
import ( | ||
"testing" | ||
|
||
. "github.com/onsi/ginkgo/v2" | ||
. "github.com/onsi/gomega" | ||
"github.com/rh-ecosystem-edge/kernel-module-management/internal/test" | ||
"k8s.io/apimachinery/pkg/runtime" | ||
) | ||
|
||
var scheme *runtime.Scheme | ||
|
||
func TestSuite(t *testing.T) { | ||
RegisterFailHandler(Fail) | ||
|
||
var err error | ||
|
||
scheme, err = test.TestScheme() | ||
Expect(err).NotTo(HaveOccurred()) | ||
|
||
RunSpecs(t, "Job Suite") | ||
} |