INNER CODE UNIT · Go

validateFlags

NVIDIA/gpu-operator · cmd/nvidia-validator/main.go:425

func validateFlags(ctx context.Context, cli *cli.Command) (context.Context, error) {
	if componentFlag == "" {
		return ctx, fmt.Errorf("invalid -c <component-name> flag: must not be empty string")
	}
	if !isValidComponent() {
		return ctx, fmt.Errorf("invalid -c <component-name> flag value: %s", componentFlag)
	}
	if componentFlag == "plugin" {
		if nodeNameFlag == "" {
			return ctx, fmt.Errorf("invalid -n <node-name> flag: must not be empty string for plugin validation")
		}
		if namespaceFlag == "" {
			return ctx, fmt.Errorf("invalid -ns <namespace> flag: must not be empty string for plugin validation")
		}
	}
	if componentFlag == "cuda" && namespaceFlag == "" {
		return ctx, fmt.Errorf("invalid -ns <namespace> flag: must not be empty string for cuda validation")
	}

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…