• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

NVIDIA / skyhook / 20320280516

17 Dec 2025 11:15PM UTC coverage: 75.452% (+0.5%) from 74.903%
20320280516

push

github

web-flow
feat(cli): add package and node management commands with lifecycle controls (#123)

Add comprehensive CLI commands for managing Skyhook packages and nodes:

Package Commands:
- `package rerun`: Force re-execution of packages on specific nodes
  - Support for stage-specific re-runs (apply, config, interrupt, post-interrupt)
  - Node matching via exact names or regex patterns
- `package status`: Query package status across the cluster
- `package logs`: Retrieve package execution logs with follow/tail support

Node Commands:
- `node list`: List all nodes with Skyhook status
- `node status`: Display detailed status for specific nodes
- `node ignore`: Add/remove ignore label to pause operations on nodes
- `node reset`: Reset node state for a Skyhook

Lifecycle Commands:
- `pause`: Pause Skyhook reconciliation temporarily
- `resume`: Resume paused Skyhook operations
- `disable`: Disable a Skyhook completely
- `enable`: Re-enable a disabled Skyhook

Also includes:
- Comprehensive unit tests with K8s dynamic client mocks
- CLI e2e test suite using chainsaw (lifecycle, node, package tests)
- CI integration for CLI tests in operator-ci workflow
- Shared utilities for node matching, label management, and patch-based updates

1142 of 1535 new or added lines in 16 files covered. (74.4%)

2 existing lines in 1 file now uncovered.

5803 of 7691 relevant lines covered (75.45%)

1.11 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

50.0
/operator/internal/cli/enable.go
1
/*
2
 * SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
3
 * SPDX-License-Identifier: Apache-2.0
4
 *
5
 *
6
 * Licensed under the Apache License, Version 2.0 (the "License");
7
 * you may not use this file except in compliance with the License.
8
 * You may obtain a copy of the License at
9
 *
10
 * http://www.apache.org/licenses/LICENSE-2.0
11
 *
12
 * Unless required by applicable law or agreed to in writing, software
13
 * distributed under the License is distributed on an "AS IS" BASIS,
14
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
 * See the License for the specific language governing permissions and
16
 * limitations under the License.
17
 */
18

19
package cli
20

21
import (
22
        "fmt"
23

24
        "github.com/spf13/cobra"
25

26
        "github.com/NVIDIA/skyhook/operator/internal/cli/client"
27
        cliContext "github.com/NVIDIA/skyhook/operator/internal/cli/context"
28
        "github.com/NVIDIA/skyhook/operator/internal/cli/utils"
29
)
30

31
// NewEnableCmd creates the enable command
32
func NewEnableCmd(ctx *cliContext.CLIContext) *cobra.Command {
1✔
33
        cmd := &cobra.Command{
1✔
34
                Use:   "enable <skyhook-name>",
1✔
35
                Short: "Enable a disabled Skyhook",
1✔
36
                Long: `Enable a disabled Skyhook by removing the disable annotation.
1✔
37

1✔
38
The operator will resume normal processing after this command.`,
1✔
39
                Example: `  # Enable a disabled Skyhook
1✔
40
  kubectl skyhook enable gpu-init`,
1✔
41
                Args: cobra.ExactArgs(1),
1✔
42
                RunE: func(cmd *cobra.Command, args []string) error {
1✔
NEW
43
                        skyhookName := args[0]
×
NEW
44

×
NEW
45
                        clientFactory := client.NewFactory(ctx.GlobalFlags.ConfigFlags)
×
NEW
46
                        kubeClient, err := clientFactory.Client()
×
NEW
47
                        if err != nil {
×
NEW
48
                                return fmt.Errorf("initializing kubernetes client: %w", err)
×
NEW
49
                        }
×
50

NEW
51
                        if err := utils.RemoveSkyhookAnnotation(cmd.Context(), kubeClient.Dynamic(), skyhookName, utils.DisableAnnotation); err != nil {
×
NEW
52
                                return err
×
NEW
53
                        }
×
NEW
54
                        _, _ = fmt.Fprintf(cmd.OutOrStdout(), "Skyhook %q enabled\n", skyhookName)
×
NEW
55
                        return nil
×
56
                },
57
        }
58

59
        return cmd
1✔
60
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc