/
options.go
38 lines (34 loc) · 1.2 KB
/
options.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
// Copyright Contributors to the Open Cluster Management project
package unjoin
import (
"k8s.io/cli-runtime/pkg/genericclioptions"
operatorv1 "open-cluster-management.io/api/operator/v1"
genericclioptionsclusteradm "open-cluster-management.io/clusteradm/pkg/genericclioptions"
)
// Options is holding all the command-line options
type Options struct {
//ClusteradmFlags: The generic options from the clusteradm cli-runtime.
ClusteradmFlags *genericclioptionsclusteradm.ClusteradmFlags
//The name under the cluster must be imported
clusterName string
//Delete the operator by default
purgeOperator bool
//The file to output the resources will be sent to the file.
outputFile string
values Values
Streams genericclioptions.IOStreams
}
type Values struct {
//ClusterName: the name of the joined cluster on the hub
ClusterName string
// DeployMode, KlusterletName and AgentNamespace would be auto filled
DeployMode operatorv1.InstallMode
KlusterletName string
AgentNamespace string
}
func newOptions(clusteradmFlags *genericclioptionsclusteradm.ClusteradmFlags, streams genericclioptions.IOStreams) *Options {
return &Options{
ClusteradmFlags: clusteradmFlags,
Streams: streams,
}
}