mirror of
https://github.com/NVIDIA/nvidia-container-toolkit
synced 2025-06-26 18:18:24 +00:00
Define a basic logger interface
Signed-off-by: Evan Lezar <elezar@nvidia.com>
This commit is contained in:
@@ -20,16 +20,16 @@ import (
|
||||
"fmt"
|
||||
"strings"
|
||||
|
||||
"github.com/sirupsen/logrus"
|
||||
"github.com/NVIDIA/nvidia-container-toolkit/internal/logger"
|
||||
)
|
||||
|
||||
type factory struct {
|
||||
logger *logrus.Logger
|
||||
logger logger.Interface
|
||||
properties map[string]Property
|
||||
}
|
||||
|
||||
// New creates a new constraint for the supplied requirements and properties
|
||||
func New(logger *logrus.Logger, requirements []string, properties map[string]Property) (Constraint, error) {
|
||||
func New(logger logger.Interface, requirements []string, properties map[string]Property) (Constraint, error) {
|
||||
if len(requirements) == 0 {
|
||||
return &always{}, nil
|
||||
}
|
||||
|
||||
@@ -17,19 +17,19 @@
|
||||
package requirements
|
||||
|
||||
import (
|
||||
"github.com/NVIDIA/nvidia-container-toolkit/internal/logger"
|
||||
"github.com/NVIDIA/nvidia-container-toolkit/internal/requirements/constraints"
|
||||
"github.com/sirupsen/logrus"
|
||||
)
|
||||
|
||||
// Requirements represents a collection of requirements that can be compared to properties
|
||||
type Requirements struct {
|
||||
logger *logrus.Logger
|
||||
logger logger.Interface
|
||||
requirements []string
|
||||
properties map[string]constraints.Property
|
||||
}
|
||||
|
||||
// New creates a new set of requirements
|
||||
func New(logger *logrus.Logger, requirements []string) *Requirements {
|
||||
func New(logger logger.Interface, requirements []string) *Requirements {
|
||||
r := Requirements{
|
||||
logger: logger,
|
||||
requirements: requirements,
|
||||
|
||||
Reference in New Issue
Block a user