Skip to content

Commit

Permalink
support mutil container runtime
Browse files Browse the repository at this point in the history
Signed-off-by: pixiake <[email protected]>
  • Loading branch information
pixiake committed Nov 25, 2020
2 parents f562ea8 + c4fb3a1 commit 443bbe8
Show file tree
Hide file tree
Showing 9 changed files with 331 additions and 252 deletions.
8 changes: 4 additions & 4 deletions cmd/cert.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ package cmd

import "github.com/spf13/cobra"

var certCmd = &cobra.Command{
Use: "cert",
Short: "cluster cert",
var certsCmd = &cobra.Command{
Use: "certs",
Short: "cluster certs",
}

func init() {
rootCmd.AddCommand(certCmd)
rootCmd.AddCommand(certsCmd)
}
10 changes: 5 additions & 5 deletions cmd/list_cert.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,17 @@ import (
"github.com/spf13/cobra"
)

var listClusterCertCmd = &cobra.Command{
Use: "list",
Short: "list a cluster cert",
var listClusterCertsCmd = &cobra.Command{
Use: "check-expiration",
Short: "Check certificates expiration for a Kubernetes cluster",
Run: func(cmd *cobra.Command, args []string) {
logger := util.InitLogger(opt.Verbose)
cert.ListCluster(opt.ClusterCfgFile, logger, opt.Verbose)
},
}

func init() {
certCmd.AddCommand(listClusterCertCmd)
certsCmd.AddCommand(listClusterCertsCmd)

listClusterCertCmd.Flags().StringVarP(&opt.ClusterCfgFile, "filename", "f", "", "Path to a configuration file")
listClusterCertsCmd.Flags().StringVarP(&opt.ClusterCfgFile, "filename", "f", "", "Path to a configuration file")
}
22 changes: 22 additions & 0 deletions cmd/renew_cert.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
package cmd

import (
"github.com/kubesphere/kubekey/pkg/cert"
"github.com/kubesphere/kubekey/pkg/util"
"github.com/spf13/cobra"
)

var renewClusterCertsCmd = &cobra.Command{
Use: "renew",
Short: "renew a cluster certs",
Run: func(cmd *cobra.Command, args []string) {
logger := util.InitLogger(opt.Verbose)
cert.RenewClusterCerts(opt.ClusterCfgFile, logger, opt.Verbose)
},
}

func init() {
certsCmd.AddCommand(renewClusterCertsCmd)

renewClusterCertsCmd.Flags().StringVarP(&opt.ClusterCfgFile, "filename", "f", "", "Path to a configuration file")
}
1 change: 0 additions & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ require (
k8s.io/apimachinery v0.18.8
k8s.io/cli-runtime v0.18.8
k8s.io/client-go v0.18.8
k8s.io/code-generator v0.18.8
k8s.io/kubectl v0.18.8
rsc.io/letsencrypt v0.0.3 // indirect
sigs.k8s.io/controller-runtime v0.6.2
Expand Down
Loading

0 comments on commit 443bbe8

Please sign in to comment.