Files
kamaji/cmd/root.go
2022-12-03 12:04:04 +01:00

31 lines
842 B
Go

// Copyright 2022 Clastix Labs
// SPDX-License-Identifier: Apache-2.0
package cmd
import (
"math/rand"
"time"
"github.com/spf13/cobra"
"k8s.io/apimachinery/pkg/runtime"
utilruntime "k8s.io/apimachinery/pkg/util/runtime"
clientgoscheme "k8s.io/client-go/kubernetes/scheme"
kamajiv1alpha1 "github.com/clastix/kamaji/api/v1alpha1"
)
func NewCmd(scheme *runtime.Scheme) *cobra.Command {
return &cobra.Command{
Use: "kamaji",
Short: "Build and operate Kubernetes at scale with a fraction of operational burden.",
PersistentPreRun: func(cmd *cobra.Command, args []string) {
// Seed is required to ensure non reproducibility for the certificates generate by Kamaji.
rand.Seed(time.Now().UnixNano())
utilruntime.Must(clientgoscheme.AddToScheme(scheme))
utilruntime.Must(kamajiv1alpha1.AddToScheme(scheme))
},
}
}