Skip to content

Commit

Permalink
Introduce liqoctl offload namespace
Browse files Browse the repository at this point in the history
  • Loading branch information
palexster committed Nov 3, 2021
1 parent 2244a72 commit 2d2ac58
Show file tree
Hide file tree
Showing 8 changed files with 16 additions and 4 deletions.
1 change: 1 addition & 0 deletions apis/discovery/v1alpha1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions apis/net/v1alpha1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions apis/offloading/v1alpha1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions apis/sharing/v1alpha1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions apis/virtualKubelet/v1alpha1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions cmd/liqoctl/cmd/offload.go
Expand Up @@ -43,9 +43,9 @@ func NewOffloadCommand(ctx context.Context) *cobra.Command {
namespaceMappingStrategy := args.NewEnum([]string{string(offloadingv1alpha1.EnforceSameNameMappingStrategyType), string(offloadingv1alpha1.DefaultNameMappingStrategyType)},
string(offloadingv1alpha1.DefaultNameMappingStrategyType))

offloadClusterCmd.PersistentFlags().Var(namespaceMappingStrategy, offload.NamespaceMappingFlag, "Select the desired pod offloading strategy")
offloadClusterCmd.PersistentFlags().Var(namespaceMappingStrategy, offload.NamespaceMappingFlag, "Select the desired namespace mapping strategy")
offloadClusterCmd.PersistentFlags().String(offload.AcceptedLabelsFlag,
"", "The set of labels which characterizes the local cluster when exposed remotely as a virtual node")
"liqo.io/type=virtual-node", "The set of labels which characterizes the local cluster when exposed remotely as a virtual node")
offloadClusterCmd.PersistentFlags().String(offload.DeniedLabelsFlag,
"", "The set of labels which characterizes the local cluster when exposed remotely as a virtual node")
return offloadClusterCmd
Expand Down
6 changes: 4 additions & 2 deletions cmd/liqoctl/main.go
Expand Up @@ -22,7 +22,6 @@ import (
"syscall"
"time"

"github.com/spf13/cobra"
"k8s.io/client-go/kubernetes/scheme"
_ "k8s.io/client-go/plugin/pkg/client/auth"

Expand All @@ -49,5 +48,8 @@ func main() {
}()

cmd := liqocmd.NewRootCommand(ctx)
cobra.CheckErr(cmd.ExecuteContext(ctx))
msg := cmd.ExecuteContext(ctx)
if msg != nil {
os.Exit(1)
}
}
5 changes: 5 additions & 0 deletions pkg/liqoctl/offload/consts.go
Expand Up @@ -31,8 +31,13 @@ $ liqoctl Offload cluster my-cluster
SuccessfulMessage = `
Success 👌!
`
// PodOffloadingStrategyFlag specifies the pod offloading strategy flag name
PodOffloadingStrategyFlag = "pod-offloading-strategy"
// NamespaceMappingFlag specifies the namespace mapping flag name
NamespaceMappingFlag = "namespace-mapping-strategy"
// AcceptedLabelsFlag specifies the accepted labels flag name
AcceptedLabelsFlag = "accepted-cluster-labels"
// DeniedLabelsFlag specifies the accepted labels flag name
DeniedLabelsFlag = "denied-cluster-labels"

)

0 comments on commit 2d2ac58

Please sign in to comment.