k8s/io/kubernetes/federation/pkg/kubefed/util.AdminConfig 示例代码

2022-03-03

以下示例是关于golang中包含util.AdminConfig用法的示例代码,想了解util.AdminConfig的具体用法?util.AdminConfig怎么用?util.AdminConfig使用的例子?那么可以参考以下10个相关示例代码来学习它的具体使用方法。

示例1:
join.go开发语言: Go项目名称: ddysher代码行数: 700
91// federation.
92func NewCmdJoin(f cmdutil.Factory, cmdOut io.Writer, config util.AdminConfig) *cobra.Command {
93	opts := &joinFederation{}
118// Complete ensures that options are valid and marshals them if necessary.
119func (j *joinFederation) Complete(cmd *cobra.Command, args []string, config util.AdminConfig) error {
120	err := j.commonOptions.SetName(cmd, args)
143// TODO: This currently only verifies a few things. Add more checks.
144func (j *joinFederation) performPreflightChecks(config util.AdminConfig) error {
145	joiningClusterFactory := j.joningClusterFactory(config)
171// joiningClusterClientset returns a factory for the joining cluster.
172func (j *joinFederation) joningClusterFactory(config util.AdminConfig) cmdutil.Factory {
173	return config.ClusterFactory(j.options.clusterContext, j.commonOptions.Kubeconfig)
176// Run is the implementation of the `join federation` command.
177func (j *joinFederation) Run(f cmdutil.Factory, cmdOut io.Writer, config util.AdminConfig, cmd *cobra.Command) error {
178	clusterContext := j.options.clusterContext
示例2:
join.go开发语言: Go项目名称: detiber代码行数: 700
91// federation.
92func NewCmdJoin(f cmdutil.Factory, cmdOut io.Writer, config util.AdminConfig) *cobra.Command {
93	opts := &joinFederation{}
118// Complete ensures that options are valid and marshals them if necessary.
119func (j *joinFederation) Complete(cmd *cobra.Command, args []string, config util.AdminConfig) error {
120	err := j.commonOptions.SetName(cmd, args)
143// TODO: This currently only verifies a few things. Add more checks.
144func (j *joinFederation) performPreflightChecks(config util.AdminConfig) error {
145	joiningClusterFactory := j.joningClusterFactory(config)
171// joiningClusterClientset returns a factory for the joining cluster.
172func (j *joinFederation) joningClusterFactory(config util.AdminConfig) cmdutil.Factory {
173	return config.ClusterFactory(j.options.clusterContext, j.commonOptions.Kubeconfig)
176// Run is the implementation of the `join federation` command.
177func (j *joinFederation) Run(f cmdutil.Factory, cmdOut io.Writer, config util.AdminConfig, cmd *cobra.Command) error {
178	clusterContext := j.options.clusterContext
示例3:
init.go开发语言: Go项目名称: ddysher代码行数: 1183
175// control plane inside a set of host clusters.
176func NewCmdInit(cmdOut io.Writer, config util.AdminConfig, defaultServerImage, defaultEtcdImage string) *cobra.Command {
177	opts := &initFederation{}
256// for details.
257func (i *initFederation) Run(cmdOut io.Writer, config util.AdminConfig) error {
258	hostFactory := config.ClusterFactory(i.commonOptions.Host, i.commonOptions.Kubeconfig)
1022
1023func waitSrvHealthy(cmdOut io.Writer, config util.AdminConfig, context, kubeconfig string) error {
1024	fedClientSet, err := config.FederationClientset(context, kubeconfig)
1056
1057func updateKubeconfig(config util.AdminConfig, name, endpoint, kubeConfigPath string, credentials *credentials, dryRun bool) error {
1058	po := config.PathOptions()
示例4:
init.go开发语言: Go项目名称: detiber代码行数: 1183
175// control plane inside a set of host clusters.
176func NewCmdInit(cmdOut io.Writer, config util.AdminConfig, defaultServerImage, defaultEtcdImage string) *cobra.Command {
177	opts := &initFederation{}
256// for details.
257func (i *initFederation) Run(cmdOut io.Writer, config util.AdminConfig) error {
258	hostFactory := config.ClusterFactory(i.commonOptions.Host, i.commonOptions.Kubeconfig)
1022
1023func waitSrvHealthy(cmdOut io.Writer, config util.AdminConfig, context, kubeconfig string) error {
1024	fedClientSet, err := config.FederationClientset(context, kubeconfig)
1056
1057func updateKubeconfig(config util.AdminConfig, name, endpoint, kubeConfigPath string, credentials *credentials, dryRun bool) error {
1058	po := config.PathOptions()
示例5:
init.go开发语言: Go项目名称: cjcullen代码行数: 593
103// control plane inside a set of host clusters.
104func NewCmdInit(cmdOut io.Writer, config util.AdminConfig) *cobra.Command {
105	cmd := &cobra.Command{
133// for details.
134func initFederation(cmdOut io.Writer, config util.AdminConfig, cmd *cobra.Command, args []string) error {
135	initFlags, err := util.GetSubcommandFlags(cmd, args)
553
554func updateKubeconfig(config util.AdminConfig, name, endpoint string, entKeyPairs *entityKeyPairs) error {
555	po := config.PathOptions()
示例6:
unjoin.go开发语言: Go项目名称: ddysher代码行数: 333
69// from a federation.
70func NewCmdUnjoin(f cmdutil.Factory, cmdOut, cmdErr io.Writer, config util.AdminConfig) *cobra.Command {
71	opts := &unjoinFederation{}
91// unjoinFederation is the implementation of the `unjoin` command.
92func (u *unjoinFederation) Run(f cmdutil.Factory, cmdOut, cmdErr io.Writer, config util.AdminConfig) error {
93	if u.options.clusterContext == "" {
示例7:
unjoin.go开发语言: Go项目名称: detiber代码行数: 333
69// from a federation.
70func NewCmdUnjoin(f cmdutil.Factory, cmdOut, cmdErr io.Writer, config util.AdminConfig) *cobra.Command {
71	opts := &unjoinFederation{}
91// unjoinFederation is the implementation of the `unjoin` command.
92func (u *unjoinFederation) Run(f cmdutil.Factory, cmdOut, cmdErr io.Writer, config util.AdminConfig) error {
93	if u.options.clusterContext == "" {
示例8:
join.go开发语言: Go项目名称: cjcullen代码行数: 224
58// federation.
59func NewCmdJoin(f cmdutil.Factory, cmdOut io.Writer, config util.AdminConfig) *cobra.Command {
60	cmd := &cobra.Command{
79// joinFederation is the implementation of the `join federation` command.
80func joinFederation(f cmdutil.Factory, cmdOut io.Writer, config util.AdminConfig, cmd *cobra.Command, args []string) error {
81	joinFlags, err := util.GetSubcommandFlags(cmd, args)
示例9:
unjoin.go开发语言: Go项目名称: cjcullen代码行数: 152
51// from a federation.
52func NewCmdUnjoin(f cmdutil.Factory, cmdOut, cmdErr io.Writer, config util.AdminConfig) *cobra.Command {
53	cmd := &cobra.Command{
68// unjoinFederation is the implementation of the `unjoin` command.
69func unjoinFederation(f cmdutil.Factory, cmdOut, cmdErr io.Writer, config util.AdminConfig, cmd *cobra.Command, args []string) error {
70	unjoinFlags, err := util.GetSubcommandFlags(cmd, args)
示例10:
testing.go开发语言: Go项目名称: ddysher代码行数: 187
42
43func NewFakeAdminConfig(hostFactory cmdutil.Factory, targetFactory cmdutil.Factory, targetClusterContext, kubeconfigGlobal string) (util.AdminConfig, error) {
44	pathOptions := clientcmd.NewDefaultPathOptions()

本文地址:https://www.itbaoku.cn/snippets/415559.html