// NewComponentExtraArgs creates a new ComponentExtraArgs
357583
func NewComponentExtraArgs(opts util.ExtraOptionSlice, version semver.Version, featureGates string) ([]ComponentExtraArgs, error) {
	var kubeadmExtraArgs []ComponentExtraArgs
	for _, extraOpt := range opts {
		if _, ok := componentToKubeadmConfigKey[extraOpt.Component]; !ok {
			return nil, fmt.Errorf("Unknown component %s.  Valid components and kubeadm config are %v", componentToKubeadmConfigKey, componentToKubeadmConfigKey)
		}
	}

	keys := []string{}
	for k := range componentToKubeadmConfigKey {
		keys = append(keys, k)
	}
	sort.Strings(keys)

	for _, component := range keys {
		kubeadmComponentKey := componentToKubeadmConfigKey[component]
		if kubeadmComponentKey == "" {
			continue
		}
		extraConfig, err := ExtraConfigForComponent(component, opts, version)
		if err != nil {
			return nil, errors.Wrapf(err, "getting kubeadm extra args for %s", component)
		}
		if featureGates != "" {
			extraConfig["feature-gates"] = featureGates
		}
		if len(extraConfig) > 0 {
			kubeadmExtraArgs = append(kubeadmExtraArgs, ComponentExtraArgs{
				Component: kubeadmComponentKey,
				Options:   extraConfig,
			})
		}
	}

	return kubeadmExtraArgs, nil
}
1288001
func NewRunScriptArgs(scriptID ScriptID) *RunScriptArgs {
	args := new(RunScriptArgs)
	args.ScriptID = scriptID
	return args
}
752597
func (f *RBForwarder) PushComponents(components []interface{}) {
	for _, component := range components {
		f.p.PushComponent(component.(utils.Composer))
	}
}
68444
func (ctx *Context) SetComponentAccessToken(verifyTicket string) (*ComponentAccessToken, error) {
	body := map[string]string{
		"component_appid":         ctx.AppID,
		"component_appsecret":     ctx.AppSecret,
		"component_verify_ticket": verifyTicket,
	}
	respBody, err := util.PostJSON(componentAccessTokenURL, body)
	if err != nil {
		return nil, err
	}

	at := &ComponentAccessToken{}
	if err := json.Unmarshal(respBody, at); err != nil {
		return nil, err
	}

	accessTokenCacheKey := fmt.Sprintf("component_access_token_%s", ctx.AppID)
	expires := at.ExpiresIn - 1500
	ctx.Cache.Set(accessTokenCacheKey, at.AccessToken, time.Duration(expires)*time.Second)
	return at, nil
}
823595
func nextComponent(path []byte, start int) []byte {
	v := bytes.IndexByte(path[start:], os.PathSeparator)
	if v < 0 {
		return path
	}
	return path[0 : start+v]
}
858656
func (k *ksonnetApp) SetComponentParams(environment string, component string, param string, value string) error {
	_, err := k.ksCmd("param", "set", component, param, value, "--env", environment)
	return err
}
1331953
func NewPropertiesSearchArg(Queries []*PropertiesSearchQuery) *PropertiesSearchArg {
	s := new(PropertiesSearchArg)
	s.Queries = Queries
	s.TemplateFilter = &TemplateFilter{Tagged: dropbox.Tagged{"filter_none"}}
	return s
}
349188
func (a *Account) ListComponents() ([]Component, error) {
	components := make([]Component, 0)
	err := a.get(a.auth, "/api/v2/components", &components)
	return components, err
}
410742
func NewContext(cfg *AppContextConfig) *appContext {
	conns, _ := cfg.Client.GetConnectionCount()
	nodeHeight, _ := cfg.Client.GetBlockCount()

	// auxDataSource is an interface that could have a value of pointer type.
	if cfg.DBSource == nil || reflect.ValueOf(cfg.DBSource).IsNil() {
		log.Errorf("NewContext: a DataSourceAux is required.")
		return nil
	}

	return &appContext{
		nodeClient:    cfg.Client,
		Params:        cfg.Params,
		BlockData:     cfg.DataSource,
		AuxDataSource: cfg.DBSource,
		xcBot:         cfg.XcBot,
		AgendaDB:      cfg.AgendasDBInstance,
		Status:        apitypes.NewStatus(uint32(nodeHeight), conns, APIVersion, appver.Version(), cfg.Params.Name),
		JSONIndent:    cfg.JsonIndent,
		maxCSVAddrs:   cfg.MaxAddrs,
		charts:        cfg.Charts,
	}
}
1112571
func NewMembersListContinueArg(Cursor string) *MembersListContinueArg {
	s := new(MembersListContinueArg)
	s.Cursor = Cursor
	return s
}
133333
func NewImageSourceRepository(compRef ComponentReference, from, to string) *SourceRepository {
	return &SourceRepository{
		sourceImage:      compRef,
		sourceImageFrom:  from,
		sourceImageTo:    to,
		ignoreRepository: true,
		location:         compRef.Input().From,
		strategy:         newapp.StrategySource,
	}
}
1216909
func NewGetMetadataArgs(securityOrigin string, databaseName string, objectStoreName string) *GetMetadataArgs {
	args := new(GetMetadataArgs)
	args.SecurityOrigin = securityOrigin
	args.DatabaseName = databaseName
	args.ObjectStoreName = objectStoreName
	return args
}
1077414
func BuildSelfhostedComponentLabels(component string) map[string]string {
	return map[string]string{
		"k8s-app": kubeadmconstants.AddSelfHostedPrefix(component),
	}
}
1194098
func NewQuerySelectorArgs(nodeID NodeID, selector string) *QuerySelectorArgs {
	args := new(QuerySelectorArgs)
	args.NodeID = nodeID
	args.Selector = selector
	return args
}
1178017
func NewExcludedUsersListContinueArg(Cursor string) *ExcludedUsersListContinueArg {
	s := new(ExcludedUsersListContinueArg)
	s.Cursor = Cursor
	return s
}
840509
func NewAddScriptToEvaluateOnLoadArgs(scriptSource string) *AddScriptToEvaluateOnLoadArgs {
	args := new(AddScriptToEvaluateOnLoadArgs)
	args.ScriptSource = scriptSource
	return args
}
681202
func NewGroupsMembersListContinueArg(Cursor string) *GroupsMembersListContinueArg {
	s := new(GroupsMembersListContinueArg)
	s.Cursor = Cursor
	return s
}