repository_name
stringlengths
5
48
func_path_in_repository
stringlengths
4
155
func_name
stringlengths
1
118
whole_func_string
stringlengths
52
3.87M
language
stringclasses
1 value
func_code_string
stringlengths
52
3.87M
func_code_tokens
listlengths
21
188k
func_documentation_string
stringlengths
31
26.3k
func_documentation_tokens
listlengths
1
3.92k
split_name
stringclasses
1 value
func_code_url
stringlengths
85
252
kubernetes/kubernetes
staging/src/k8s.io/apimachinery/pkg/runtime/extension.go
MarshalJSON
func (re RawExtension) MarshalJSON() ([]byte, error) { if re.Raw == nil { // TODO: this is to support legacy behavior of JSONPrinter and YAMLPrinter, which // expect to call json.Marshal on arbitrary versioned objects (even those not in // the scheme). pkg/kubectl/resource#AsVersionedObjects and its interaction ...
go
func (re RawExtension) MarshalJSON() ([]byte, error) { if re.Raw == nil { // TODO: this is to support legacy behavior of JSONPrinter and YAMLPrinter, which // expect to call json.Marshal on arbitrary versioned objects (even those not in // the scheme). pkg/kubectl/resource#AsVersionedObjects and its interaction ...
[ "func", "(", "re", "RawExtension", ")", "MarshalJSON", "(", ")", "(", "[", "]", "byte", ",", "error", ")", "{", "if", "re", ".", "Raw", "==", "nil", "{", "// TODO: this is to support legacy behavior of JSONPrinter and YAMLPrinter, which", "// expect to call json.Marsh...
// MarshalJSON may get called on pointers or values, so implement MarshalJSON on value. // http://stackoverflow.com/questions/21390979/custom-marshaljson-never-gets-called-in-go
[ "MarshalJSON", "may", "get", "called", "on", "pointers", "or", "values", "so", "implement", "MarshalJSON", "on", "value", ".", "http", ":", "//", "stackoverflow", ".", "com", "/", "questions", "/", "21390979", "/", "custom", "-", "marshaljson", "-", "never",...
train
https://github.com/kubernetes/kubernetes/blob/6a8a3682919652ae668c389ed2f60efb770eed03/staging/src/k8s.io/apimachinery/pkg/runtime/extension.go#L37-L51
kubernetes/kubernetes
staging/src/k8s.io/client-go/tools/clientcmd/validation.go
IsContextNotFound
func IsContextNotFound(err error) bool { if err == nil { return false } if _, ok := err.(*errContextNotFound); ok || err == ErrNoContext { return true } return strings.Contains(err.Error(), "context was not found for specified context") }
go
func IsContextNotFound(err error) bool { if err == nil { return false } if _, ok := err.(*errContextNotFound); ok || err == ErrNoContext { return true } return strings.Contains(err.Error(), "context was not found for specified context") }
[ "func", "IsContextNotFound", "(", "err", "error", ")", "bool", "{", "if", "err", "==", "nil", "{", "return", "false", "\n", "}", "\n", "if", "_", ",", "ok", ":=", "err", ".", "(", "*", "errContextNotFound", ")", ";", "ok", "||", "err", "==", "ErrNo...
// IsContextNotFound returns a boolean indicating whether the error is known to // report that a context was not found
[ "IsContextNotFound", "returns", "a", "boolean", "indicating", "whether", "the", "error", "is", "known", "to", "report", "that", "a", "context", "was", "not", "found" ]
train
https://github.com/kubernetes/kubernetes/blob/6a8a3682919652ae668c389ed2f60efb770eed03/staging/src/k8s.io/client-go/tools/clientcmd/validation.go#L48-L56
kubernetes/kubernetes
staging/src/k8s.io/client-go/tools/clientcmd/validation.go
IsEmptyConfig
func IsEmptyConfig(err error) bool { switch t := err.(type) { case errConfigurationInvalid: return len(t) == 1 && t[0] == ErrEmptyConfig } return err == ErrEmptyConfig }
go
func IsEmptyConfig(err error) bool { switch t := err.(type) { case errConfigurationInvalid: return len(t) == 1 && t[0] == ErrEmptyConfig } return err == ErrEmptyConfig }
[ "func", "IsEmptyConfig", "(", "err", "error", ")", "bool", "{", "switch", "t", ":=", "err", ".", "(", "type", ")", "{", "case", "errConfigurationInvalid", ":", "return", "len", "(", "t", ")", "==", "1", "&&", "t", "[", "0", "]", "==", "ErrEmptyConfig...
// IsEmptyConfig returns true if the provided error indicates the provided configuration // is empty.
[ "IsEmptyConfig", "returns", "true", "if", "the", "provided", "error", "indicates", "the", "provided", "configuration", "is", "empty", "." ]
train
https://github.com/kubernetes/kubernetes/blob/6a8a3682919652ae668c389ed2f60efb770eed03/staging/src/k8s.io/client-go/tools/clientcmd/validation.go#L60-L66
kubernetes/kubernetes
staging/src/k8s.io/client-go/tools/clientcmd/validation.go
IsConfigurationInvalid
func IsConfigurationInvalid(err error) bool { switch err.(type) { case *errContextNotFound, errConfigurationInvalid: return true } return IsContextNotFound(err) }
go
func IsConfigurationInvalid(err error) bool { switch err.(type) { case *errContextNotFound, errConfigurationInvalid: return true } return IsContextNotFound(err) }
[ "func", "IsConfigurationInvalid", "(", "err", "error", ")", "bool", "{", "switch", "err", ".", "(", "type", ")", "{", "case", "*", "errContextNotFound", ",", "errConfigurationInvalid", ":", "return", "true", "\n", "}", "\n", "return", "IsContextNotFound", "(",...
// IsConfigurationInvalid returns true if the provided error indicates the configuration is invalid.
[ "IsConfigurationInvalid", "returns", "true", "if", "the", "provided", "error", "indicates", "the", "configuration", "is", "invalid", "." ]
train
https://github.com/kubernetes/kubernetes/blob/6a8a3682919652ae668c389ed2f60efb770eed03/staging/src/k8s.io/client-go/tools/clientcmd/validation.go#L95-L101
kubernetes/kubernetes
staging/src/k8s.io/client-go/tools/clientcmd/validation.go
Validate
func Validate(config clientcmdapi.Config) error { validationErrors := make([]error, 0) if clientcmdapi.IsConfigEmpty(&config) { return newErrConfigurationInvalid([]error{ErrEmptyConfig}) } if len(config.CurrentContext) != 0 { if _, exists := config.Contexts[config.CurrentContext]; !exists { validationError...
go
func Validate(config clientcmdapi.Config) error { validationErrors := make([]error, 0) if clientcmdapi.IsConfigEmpty(&config) { return newErrConfigurationInvalid([]error{ErrEmptyConfig}) } if len(config.CurrentContext) != 0 { if _, exists := config.Contexts[config.CurrentContext]; !exists { validationError...
[ "func", "Validate", "(", "config", "clientcmdapi", ".", "Config", ")", "error", "{", "validationErrors", ":=", "make", "(", "[", "]", "error", ",", "0", ")", "\n\n", "if", "clientcmdapi", ".", "IsConfigEmpty", "(", "&", "config", ")", "{", "return", "new...
// Validate checks for errors in the Config. It does not return early so that it can find as many errors as possible.
[ "Validate", "checks", "for", "errors", "in", "the", "Config", ".", "It", "does", "not", "return", "early", "so", "that", "it", "can", "find", "as", "many", "errors", "as", "possible", "." ]
train
https://github.com/kubernetes/kubernetes/blob/6a8a3682919652ae668c389ed2f60efb770eed03/staging/src/k8s.io/client-go/tools/clientcmd/validation.go#L104-L130
kubernetes/kubernetes
staging/src/k8s.io/client-go/tools/clientcmd/validation.go
ConfirmUsable
func ConfirmUsable(config clientcmdapi.Config, passedContextName string) error { validationErrors := make([]error, 0) if clientcmdapi.IsConfigEmpty(&config) { return newErrConfigurationInvalid([]error{ErrEmptyConfig}) } var contextName string if len(passedContextName) != 0 { contextName = passedContextName ...
go
func ConfirmUsable(config clientcmdapi.Config, passedContextName string) error { validationErrors := make([]error, 0) if clientcmdapi.IsConfigEmpty(&config) { return newErrConfigurationInvalid([]error{ErrEmptyConfig}) } var contextName string if len(passedContextName) != 0 { contextName = passedContextName ...
[ "func", "ConfirmUsable", "(", "config", "clientcmdapi", ".", "Config", ",", "passedContextName", "string", ")", "error", "{", "validationErrors", ":=", "make", "(", "[", "]", "error", ",", "0", ")", "\n\n", "if", "clientcmdapi", ".", "IsConfigEmpty", "(", "&...
// ConfirmUsable looks a particular context and determines if that particular part of the config is useable. There might still be errors in the config, // but no errors in the sections requested or referenced. It does not return early so that it can find as many errors as possible.
[ "ConfirmUsable", "looks", "a", "particular", "context", "and", "determines", "if", "that", "particular", "part", "of", "the", "config", "is", "useable", ".", "There", "might", "still", "be", "errors", "in", "the", "config", "but", "no", "errors", "in", "the"...
train
https://github.com/kubernetes/kubernetes/blob/6a8a3682919652ae668c389ed2f60efb770eed03/staging/src/k8s.io/client-go/tools/clientcmd/validation.go#L134-L164
kubernetes/kubernetes
staging/src/k8s.io/client-go/tools/clientcmd/validation.go
validateClusterInfo
func validateClusterInfo(clusterName string, clusterInfo clientcmdapi.Cluster) []error { validationErrors := make([]error, 0) emptyCluster := clientcmdapi.NewCluster() if reflect.DeepEqual(*emptyCluster, clusterInfo) { return []error{ErrEmptyCluster} } if len(clusterInfo.Server) == 0 { if len(clusterName) ==...
go
func validateClusterInfo(clusterName string, clusterInfo clientcmdapi.Cluster) []error { validationErrors := make([]error, 0) emptyCluster := clientcmdapi.NewCluster() if reflect.DeepEqual(*emptyCluster, clusterInfo) { return []error{ErrEmptyCluster} } if len(clusterInfo.Server) == 0 { if len(clusterName) ==...
[ "func", "validateClusterInfo", "(", "clusterName", "string", ",", "clusterInfo", "clientcmdapi", ".", "Cluster", ")", "[", "]", "error", "{", "validationErrors", ":=", "make", "(", "[", "]", "error", ",", "0", ")", "\n\n", "emptyCluster", ":=", "clientcmdapi",...
// validateClusterInfo looks for conflicts and errors in the cluster info
[ "validateClusterInfo", "looks", "for", "conflicts", "and", "errors", "in", "the", "cluster", "info" ]
train
https://github.com/kubernetes/kubernetes/blob/6a8a3682919652ae668c389ed2f60efb770eed03/staging/src/k8s.io/client-go/tools/clientcmd/validation.go#L167-L195
kubernetes/kubernetes
staging/src/k8s.io/client-go/tools/clientcmd/validation.go
validateAuthInfo
func validateAuthInfo(authInfoName string, authInfo clientcmdapi.AuthInfo) []error { validationErrors := make([]error, 0) usingAuthPath := false methods := make([]string, 0, 3) if len(authInfo.Token) != 0 { methods = append(methods, "token") } if len(authInfo.Username) != 0 || len(authInfo.Password) != 0 { m...
go
func validateAuthInfo(authInfoName string, authInfo clientcmdapi.AuthInfo) []error { validationErrors := make([]error, 0) usingAuthPath := false methods := make([]string, 0, 3) if len(authInfo.Token) != 0 { methods = append(methods, "token") } if len(authInfo.Username) != 0 || len(authInfo.Password) != 0 { m...
[ "func", "validateAuthInfo", "(", "authInfoName", "string", ",", "authInfo", "clientcmdapi", ".", "AuthInfo", ")", "[", "]", "error", "{", "validationErrors", ":=", "make", "(", "[", "]", "error", ",", "0", ")", "\n\n", "usingAuthPath", ":=", "false", "\n", ...
// validateAuthInfo looks for conflicts and errors in the auth info
[ "validateAuthInfo", "looks", "for", "conflicts", "and", "errors", "in", "the", "auth", "info" ]
train
https://github.com/kubernetes/kubernetes/blob/6a8a3682919652ae668c389ed2f60efb770eed03/staging/src/k8s.io/client-go/tools/clientcmd/validation.go#L198-L269
kubernetes/kubernetes
staging/src/k8s.io/client-go/tools/clientcmd/validation.go
validateContext
func validateContext(contextName string, context clientcmdapi.Context, config clientcmdapi.Config) []error { validationErrors := make([]error, 0) if len(contextName) == 0 { validationErrors = append(validationErrors, fmt.Errorf("empty context name for %#v is not allowed", context)) } if len(context.AuthInfo) ==...
go
func validateContext(contextName string, context clientcmdapi.Context, config clientcmdapi.Config) []error { validationErrors := make([]error, 0) if len(contextName) == 0 { validationErrors = append(validationErrors, fmt.Errorf("empty context name for %#v is not allowed", context)) } if len(context.AuthInfo) ==...
[ "func", "validateContext", "(", "contextName", "string", ",", "context", "clientcmdapi", ".", "Context", ",", "config", "clientcmdapi", ".", "Config", ")", "[", "]", "error", "{", "validationErrors", ":=", "make", "(", "[", "]", "error", ",", "0", ")", "\n...
// validateContext looks for errors in the context. It is not transitive, so errors in the reference authInfo or cluster configs are not included in this return
[ "validateContext", "looks", "for", "errors", "in", "the", "context", ".", "It", "is", "not", "transitive", "so", "errors", "in", "the", "reference", "authInfo", "or", "cluster", "configs", "are", "not", "included", "in", "this", "return" ]
train
https://github.com/kubernetes/kubernetes/blob/6a8a3682919652ae668c389ed2f60efb770eed03/staging/src/k8s.io/client-go/tools/clientcmd/validation.go#L272-L298
kubernetes/kubernetes
pkg/kubectl/cmd/delete/delete_flags.go
NewDeleteCommandFlags
func NewDeleteCommandFlags(usage string) *DeleteFlags { cascade := true gracePeriod := -1 // setup command defaults all := false allNamespaces := false force := false ignoreNotFound := false now := false output := "" labelSelector := "" fieldSelector := "" timeout := time.Duration(0) wait := true filena...
go
func NewDeleteCommandFlags(usage string) *DeleteFlags { cascade := true gracePeriod := -1 // setup command defaults all := false allNamespaces := false force := false ignoreNotFound := false now := false output := "" labelSelector := "" fieldSelector := "" timeout := time.Duration(0) wait := true filena...
[ "func", "NewDeleteCommandFlags", "(", "usage", "string", ")", "*", "DeleteFlags", "{", "cascade", ":=", "true", "\n", "gracePeriod", ":=", "-", "1", "\n\n", "// setup command defaults", "all", ":=", "false", "\n", "allNamespaces", ":=", "false", "\n", "force", ...
// NewDeleteCommandFlags provides default flags and values for use with the "delete" command
[ "NewDeleteCommandFlags", "provides", "default", "flags", "and", "values", "for", "use", "with", "the", "delete", "command" ]
train
https://github.com/kubernetes/kubernetes/blob/6a8a3682919652ae668c389ed2f60efb770eed03/pkg/kubectl/cmd/delete/delete_flags.go#L141-L179
kubernetes/kubernetes
pkg/kubectl/cmd/delete/delete_flags.go
NewDeleteFlags
func NewDeleteFlags(usage string) *DeleteFlags { cascade := true gracePeriod := -1 force := false timeout := time.Duration(0) wait := false filenames := []string{} kustomize := "" recursive := false return &DeleteFlags{ FileNameFlags: &genericclioptions.FileNameFlags{Usage: usage, Filenames: &filenames, K...
go
func NewDeleteFlags(usage string) *DeleteFlags { cascade := true gracePeriod := -1 force := false timeout := time.Duration(0) wait := false filenames := []string{} kustomize := "" recursive := false return &DeleteFlags{ FileNameFlags: &genericclioptions.FileNameFlags{Usage: usage, Filenames: &filenames, K...
[ "func", "NewDeleteFlags", "(", "usage", "string", ")", "*", "DeleteFlags", "{", "cascade", ":=", "true", "\n", "gracePeriod", ":=", "-", "1", "\n\n", "force", ":=", "false", "\n", "timeout", ":=", "time", ".", "Duration", "(", "0", ")", "\n", "wait", "...
// NewDeleteFlags provides default flags and values for use in commands outside of "delete"
[ "NewDeleteFlags", "provides", "default", "flags", "and", "values", "for", "use", "in", "commands", "outside", "of", "delete" ]
train
https://github.com/kubernetes/kubernetes/blob/6a8a3682919652ae668c389ed2f60efb770eed03/pkg/kubectl/cmd/delete/delete_flags.go#L182-L205
kubernetes/kubernetes
pkg/cloudprovider/providers/gce/gce_loadbalancer_external.go
ensureExternalLoadBalancer
func (g *Cloud) ensureExternalLoadBalancer(clusterName string, clusterID string, apiService *v1.Service, existingFwdRule *compute.ForwardingRule, nodes []*v1.Node) (*v1.LoadBalancerStatus, error) { if len(nodes) == 0 { return nil, fmt.Errorf("Cannot EnsureLoadBalancer() with no hosts") } hostNames := nodeNames(no...
go
func (g *Cloud) ensureExternalLoadBalancer(clusterName string, clusterID string, apiService *v1.Service, existingFwdRule *compute.ForwardingRule, nodes []*v1.Node) (*v1.LoadBalancerStatus, error) { if len(nodes) == 0 { return nil, fmt.Errorf("Cannot EnsureLoadBalancer() with no hosts") } hostNames := nodeNames(no...
[ "func", "(", "g", "*", "Cloud", ")", "ensureExternalLoadBalancer", "(", "clusterName", "string", ",", "clusterID", "string", ",", "apiService", "*", "v1", ".", "Service", ",", "existingFwdRule", "*", "compute", ".", "ForwardingRule", ",", "nodes", "[", "]", ...
// ensureExternalLoadBalancer is the external implementation of LoadBalancer.EnsureLoadBalancer. // Our load balancers in GCE consist of four separate GCE resources - a static // IP address, a firewall rule, a target pool, and a forwarding rule. This // function has to manage all of them. // // Due to an interesting se...
[ "ensureExternalLoadBalancer", "is", "the", "external", "implementation", "of", "LoadBalancer", ".", "EnsureLoadBalancer", ".", "Our", "load", "balancers", "in", "GCE", "consist", "of", "four", "separate", "GCE", "resources", "-", "a", "static", "IP", "address", "a...
train
https://github.com/kubernetes/kubernetes/blob/6a8a3682919652ae668c389ed2f60efb770eed03/pkg/cloudprovider/providers/gce/gce_loadbalancer_external.go#L47-L275
kubernetes/kubernetes
pkg/cloudprovider/providers/gce/gce_loadbalancer_external.go
updateExternalLoadBalancer
func (g *Cloud) updateExternalLoadBalancer(clusterName string, service *v1.Service, nodes []*v1.Node) error { hosts, err := g.getInstancesByNames(nodeNames(nodes)) if err != nil { return err } loadBalancerName := g.GetLoadBalancerName(context.TODO(), clusterName, service) return g.updateTargetPool(loadBalancerN...
go
func (g *Cloud) updateExternalLoadBalancer(clusterName string, service *v1.Service, nodes []*v1.Node) error { hosts, err := g.getInstancesByNames(nodeNames(nodes)) if err != nil { return err } loadBalancerName := g.GetLoadBalancerName(context.TODO(), clusterName, service) return g.updateTargetPool(loadBalancerN...
[ "func", "(", "g", "*", "Cloud", ")", "updateExternalLoadBalancer", "(", "clusterName", "string", ",", "service", "*", "v1", ".", "Service", ",", "nodes", "[", "]", "*", "v1", ".", "Node", ")", "error", "{", "hosts", ",", "err", ":=", "g", ".", "getIn...
// updateExternalLoadBalancer is the external implementation of LoadBalancer.UpdateLoadBalancer.
[ "updateExternalLoadBalancer", "is", "the", "external", "implementation", "of", "LoadBalancer", ".", "UpdateLoadBalancer", "." ]
train
https://github.com/kubernetes/kubernetes/blob/6a8a3682919652ae668c389ed2f60efb770eed03/pkg/cloudprovider/providers/gce/gce_loadbalancer_external.go#L278-L286
kubernetes/kubernetes
pkg/cloudprovider/providers/gce/gce_loadbalancer_external.go
ensureExternalLoadBalancerDeleted
func (g *Cloud) ensureExternalLoadBalancerDeleted(clusterName, clusterID string, service *v1.Service) error { loadBalancerName := g.GetLoadBalancerName(context.TODO(), clusterName, service) serviceName := types.NamespacedName{Namespace: service.Namespace, Name: service.Name} lbRefStr := fmt.Sprintf("%v(%v)", loadBal...
go
func (g *Cloud) ensureExternalLoadBalancerDeleted(clusterName, clusterID string, service *v1.Service) error { loadBalancerName := g.GetLoadBalancerName(context.TODO(), clusterName, service) serviceName := types.NamespacedName{Namespace: service.Namespace, Name: service.Name} lbRefStr := fmt.Sprintf("%v(%v)", loadBal...
[ "func", "(", "g", "*", "Cloud", ")", "ensureExternalLoadBalancerDeleted", "(", "clusterName", ",", "clusterID", "string", ",", "service", "*", "v1", ".", "Service", ")", "error", "{", "loadBalancerName", ":=", "g", ".", "GetLoadBalancerName", "(", "context", "...
// ensureExternalLoadBalancerDeleted is the external implementation of LoadBalancer.EnsureLoadBalancerDeleted
[ "ensureExternalLoadBalancerDeleted", "is", "the", "external", "implementation", "of", "LoadBalancer", ".", "EnsureLoadBalancerDeleted" ]
train
https://github.com/kubernetes/kubernetes/blob/6a8a3682919652ae668c389ed2f60efb770eed03/pkg/cloudprovider/providers/gce/gce_loadbalancer_external.go#L289-L351
kubernetes/kubernetes
pkg/cloudprovider/providers/gce/gce_loadbalancer_external.go
DeleteExternalTargetPoolAndChecks
func (g *Cloud) DeleteExternalTargetPoolAndChecks(service *v1.Service, name, region, clusterID string, hcNames ...string) error { serviceName := types.NamespacedName{Namespace: service.Namespace, Name: service.Name} lbRefStr := fmt.Sprintf("%v(%v)", name, serviceName) if err := g.DeleteTargetPool(name, region); err...
go
func (g *Cloud) DeleteExternalTargetPoolAndChecks(service *v1.Service, name, region, clusterID string, hcNames ...string) error { serviceName := types.NamespacedName{Namespace: service.Namespace, Name: service.Name} lbRefStr := fmt.Sprintf("%v(%v)", name, serviceName) if err := g.DeleteTargetPool(name, region); err...
[ "func", "(", "g", "*", "Cloud", ")", "DeleteExternalTargetPoolAndChecks", "(", "service", "*", "v1", ".", "Service", ",", "name", ",", "region", ",", "clusterID", "string", ",", "hcNames", "...", "string", ")", "error", "{", "serviceName", ":=", "types", "...
// DeleteExternalTargetPoolAndChecks Deletes an external load balancer pool and verifies the operation
[ "DeleteExternalTargetPoolAndChecks", "Deletes", "an", "external", "load", "balancer", "pool", "and", "verifies", "the", "operation" ]
train
https://github.com/kubernetes/kubernetes/blob/6a8a3682919652ae668c389ed2f60efb770eed03/pkg/cloudprovider/providers/gce/gce_loadbalancer_external.go#L354-L414
kubernetes/kubernetes
pkg/cloudprovider/providers/gce/gce_loadbalancer_external.go
verifyUserRequestedIP
func verifyUserRequestedIP(s CloudAddressService, region, requestedIP, fwdRuleIP, lbRef string, desiredNetTier cloud.NetworkTier) (isUserOwnedIP bool, err error) { if requestedIP == "" { return false, nil } // If a specific IP address has been requested, we have to respect the // user's request and use that IP. I...
go
func verifyUserRequestedIP(s CloudAddressService, region, requestedIP, fwdRuleIP, lbRef string, desiredNetTier cloud.NetworkTier) (isUserOwnedIP bool, err error) { if requestedIP == "" { return false, nil } // If a specific IP address has been requested, we have to respect the // user's request and use that IP. I...
[ "func", "verifyUserRequestedIP", "(", "s", "CloudAddressService", ",", "region", ",", "requestedIP", ",", "fwdRuleIP", ",", "lbRef", "string", ",", "desiredNetTier", "cloud", ".", "NetworkTier", ")", "(", "isUserOwnedIP", "bool", ",", "err", "error", ")", "{", ...
// verifyUserRequestedIP checks the user-provided IP to see whether it meets // all the expected attributes for the load balancer, and returns an error if // the verification failed. It also returns a boolean to indicate whether the // IP address is considered owned by the user (i.e., not managed by the // controller.
[ "verifyUserRequestedIP", "checks", "the", "user", "-", "provided", "IP", "to", "see", "whether", "it", "meets", "all", "the", "expected", "attributes", "for", "the", "load", "balancer", "and", "returns", "an", "error", "if", "the", "verification", "failed", "....
train
https://github.com/kubernetes/kubernetes/blob/6a8a3682919652ae668c389ed2f60efb770eed03/pkg/cloudprovider/providers/gce/gce_loadbalancer_external.go#L421-L464
kubernetes/kubernetes
pkg/cloudprovider/providers/gce/gce_loadbalancer_external.go
mergeHTTPHealthChecks
func mergeHTTPHealthChecks(hc, newHC *compute.HttpHealthCheck) *compute.HttpHealthCheck { if hc.CheckIntervalSec > newHC.CheckIntervalSec { newHC.CheckIntervalSec = hc.CheckIntervalSec } if hc.TimeoutSec > newHC.TimeoutSec { newHC.TimeoutSec = hc.TimeoutSec } if hc.UnhealthyThreshold > newHC.UnhealthyThreshold...
go
func mergeHTTPHealthChecks(hc, newHC *compute.HttpHealthCheck) *compute.HttpHealthCheck { if hc.CheckIntervalSec > newHC.CheckIntervalSec { newHC.CheckIntervalSec = hc.CheckIntervalSec } if hc.TimeoutSec > newHC.TimeoutSec { newHC.TimeoutSec = hc.TimeoutSec } if hc.UnhealthyThreshold > newHC.UnhealthyThreshold...
[ "func", "mergeHTTPHealthChecks", "(", "hc", ",", "newHC", "*", "compute", ".", "HttpHealthCheck", ")", "*", "compute", ".", "HttpHealthCheck", "{", "if", "hc", ".", "CheckIntervalSec", ">", "newHC", ".", "CheckIntervalSec", "{", "newHC", ".", "CheckIntervalSec",...
// mergeHTTPHealthChecks reconciles HttpHealthCheck configures to be no smaller // than the default values. // E.g. old health check interval is 2s, new default is 8. // The HC interval will be reconciled to 8 seconds. // If the existing health check is larger than the default interval, // the configuration will be kep...
[ "mergeHTTPHealthChecks", "reconciles", "HttpHealthCheck", "configures", "to", "be", "no", "smaller", "than", "the", "default", "values", ".", "E", ".", "g", ".", "old", "health", "check", "interval", "is", "2s", "new", "default", "is", "8", ".", "The", "HC",...
train
https://github.com/kubernetes/kubernetes/blob/6a8a3682919652ae668c389ed2f60efb770eed03/pkg/cloudprovider/providers/gce/gce_loadbalancer_external.go#L639-L653
kubernetes/kubernetes
pkg/cloudprovider/providers/gce/gce_loadbalancer_external.go
needToUpdateHTTPHealthChecks
func needToUpdateHTTPHealthChecks(hc, newHC *compute.HttpHealthCheck) bool { changed := hc.Port != newHC.Port || hc.RequestPath != newHC.RequestPath || hc.Description != newHC.Description changed = changed || hc.CheckIntervalSec < newHC.CheckIntervalSec || hc.TimeoutSec < newHC.TimeoutSec changed = changed || hc.Unh...
go
func needToUpdateHTTPHealthChecks(hc, newHC *compute.HttpHealthCheck) bool { changed := hc.Port != newHC.Port || hc.RequestPath != newHC.RequestPath || hc.Description != newHC.Description changed = changed || hc.CheckIntervalSec < newHC.CheckIntervalSec || hc.TimeoutSec < newHC.TimeoutSec changed = changed || hc.Unh...
[ "func", "needToUpdateHTTPHealthChecks", "(", "hc", ",", "newHC", "*", "compute", ".", "HttpHealthCheck", ")", "bool", "{", "changed", ":=", "hc", ".", "Port", "!=", "newHC", ".", "Port", "||", "hc", ".", "RequestPath", "!=", "newHC", ".", "RequestPath", "|...
// needToUpdateHTTPHealthChecks checks whether the http healthcheck needs to be // updated.
[ "needToUpdateHTTPHealthChecks", "checks", "whether", "the", "http", "healthcheck", "needs", "to", "be", "updated", "." ]
train
https://github.com/kubernetes/kubernetes/blob/6a8a3682919652ae668c389ed2f60efb770eed03/pkg/cloudprovider/providers/gce/gce_loadbalancer_external.go#L657-L662
kubernetes/kubernetes
pkg/cloudprovider/providers/gce/gce_loadbalancer_external.go
forwardingRuleNeedsUpdate
func (g *Cloud) forwardingRuleNeedsUpdate(name, region string, loadBalancerIP string, ports []v1.ServicePort) (exists bool, needsUpdate bool, ipAddress string, err error) { fwd, err := g.GetRegionForwardingRule(name, region) if err != nil { if isHTTPErrorCode(err, http.StatusNotFound) { return false, true, "", n...
go
func (g *Cloud) forwardingRuleNeedsUpdate(name, region string, loadBalancerIP string, ports []v1.ServicePort) (exists bool, needsUpdate bool, ipAddress string, err error) { fwd, err := g.GetRegionForwardingRule(name, region) if err != nil { if isHTTPErrorCode(err, http.StatusNotFound) { return false, true, "", n...
[ "func", "(", "g", "*", "Cloud", ")", "forwardingRuleNeedsUpdate", "(", "name", ",", "region", "string", ",", "loadBalancerIP", "string", ",", "ports", "[", "]", "v1", ".", "ServicePort", ")", "(", "exists", "bool", ",", "needsUpdate", "bool", ",", "ipAddre...
// Passing nil for requested IP is perfectly fine - it just means that no specific // IP is being requested. // Returns whether the forwarding rule exists, whether it needs to be updated, // what its IP address is (if it exists), and any error we encountered.
[ "Passing", "nil", "for", "requested", "IP", "is", "perfectly", "fine", "-", "it", "just", "means", "that", "no", "specific", "IP", "is", "being", "requested", ".", "Returns", "whether", "the", "forwarding", "rule", "exists", "whether", "it", "needs", "to", ...
train
https://github.com/kubernetes/kubernetes/blob/6a8a3682919652ae668c389ed2f60efb770eed03/pkg/cloudprovider/providers/gce/gce_loadbalancer_external.go#L702-L737
kubernetes/kubernetes
pkg/cloudprovider/providers/gce/gce_loadbalancer_external.go
targetPoolNeedsRecreation
func (g *Cloud) targetPoolNeedsRecreation(name, region string, affinityType v1.ServiceAffinity) (exists bool, needsRecreation bool, err error) { tp, err := g.GetTargetPool(name, region) if err != nil { if isHTTPErrorCode(err, http.StatusNotFound) { return false, true, nil } // Err on the side of caution in c...
go
func (g *Cloud) targetPoolNeedsRecreation(name, region string, affinityType v1.ServiceAffinity) (exists bool, needsRecreation bool, err error) { tp, err := g.GetTargetPool(name, region) if err != nil { if isHTTPErrorCode(err, http.StatusNotFound) { return false, true, nil } // Err on the side of caution in c...
[ "func", "(", "g", "*", "Cloud", ")", "targetPoolNeedsRecreation", "(", "name", ",", "region", "string", ",", "affinityType", "v1", ".", "ServiceAffinity", ")", "(", "exists", "bool", ",", "needsRecreation", "bool", ",", "err", "error", ")", "{", "tp", ",",...
// Doesn't check whether the hosts have changed, since host updating is handled // separately.
[ "Doesn", "t", "check", "whether", "the", "hosts", "have", "changed", "since", "host", "updating", "is", "handled", "separately", "." ]
train
https://github.com/kubernetes/kubernetes/blob/6a8a3682919652ae668c389ed2f60efb770eed03/pkg/cloudprovider/providers/gce/gce_loadbalancer_external.go#L741-L764
kubernetes/kubernetes
pkg/cloudprovider/providers/gce/gce_loadbalancer_external.go
deleteFWDRuleWithWrongTier
func deleteFWDRuleWithWrongTier(s CloudForwardingRuleService, region, name, logPrefix string, desiredNetTier cloud.NetworkTier) error { tierStr, err := s.getNetworkTierFromForwardingRule(name, region) if isNotFound(err) { return nil } else if err != nil { return err } existingTier := cloud.NetworkTierGCEValueT...
go
func deleteFWDRuleWithWrongTier(s CloudForwardingRuleService, region, name, logPrefix string, desiredNetTier cloud.NetworkTier) error { tierStr, err := s.getNetworkTierFromForwardingRule(name, region) if isNotFound(err) { return nil } else if err != nil { return err } existingTier := cloud.NetworkTierGCEValueT...
[ "func", "deleteFWDRuleWithWrongTier", "(", "s", "CloudForwardingRuleService", ",", "region", ",", "name", ",", "logPrefix", "string", ",", "desiredNetTier", "cloud", ".", "NetworkTier", ")", "error", "{", "tierStr", ",", "err", ":=", "s", ".", "getNetworkTierFromF...
// deleteFWDRuleWithWrongTier checks the network tier of existing forwarding // rule and delete the rule if the tier does not matched the desired tier.
[ "deleteFWDRuleWithWrongTier", "checks", "the", "network", "tier", "of", "existing", "forwarding", "rule", "and", "delete", "the", "rule", "if", "the", "tier", "does", "not", "matched", "the", "desired", "tier", "." ]
train
https://github.com/kubernetes/kubernetes/blob/6a8a3682919652ae668c389ed2f60efb770eed03/pkg/cloudprovider/providers/gce/gce_loadbalancer_external.go#L1083-L1098
kubernetes/kubernetes
pkg/cloudprovider/providers/gce/gce_loadbalancer_external.go
deleteAddressWithWrongTier
func deleteAddressWithWrongTier(s CloudAddressService, region, name, logPrefix string, desiredNetTier cloud.NetworkTier) error { // We only check the IP address matching the reserved name that the // controller assigned to the LB. We make the assumption that an address of // such name is owned by the controller and ...
go
func deleteAddressWithWrongTier(s CloudAddressService, region, name, logPrefix string, desiredNetTier cloud.NetworkTier) error { // We only check the IP address matching the reserved name that the // controller assigned to the LB. We make the assumption that an address of // such name is owned by the controller and ...
[ "func", "deleteAddressWithWrongTier", "(", "s", "CloudAddressService", ",", "region", ",", "name", ",", "logPrefix", "string", ",", "desiredNetTier", "cloud", ".", "NetworkTier", ")", "error", "{", "// We only check the IP address matching the reserved name that the", "// c...
// deleteAddressWithWrongTier checks the network tier of existing address // and delete the address if the tier does not matched the desired tier.
[ "deleteAddressWithWrongTier", "checks", "the", "network", "tier", "of", "existing", "address", "and", "delete", "the", "address", "if", "the", "tier", "does", "not", "matched", "the", "desired", "tier", "." ]
train
https://github.com/kubernetes/kubernetes/blob/6a8a3682919652ae668c389ed2f60efb770eed03/pkg/cloudprovider/providers/gce/gce_loadbalancer_external.go#L1102-L1126
kubernetes/kubernetes
pkg/volume/rbd/disk_manager.go
diskSetUp
func diskSetUp(manager diskManager, b rbdMounter, volPath string, mounter mount.Interface, fsGroup *int64) error { globalPDPath := manager.MakeGlobalPDName(*b.rbd) notMnt, err := mounter.IsLikelyNotMountPoint(globalPDPath) if err != nil && !os.IsNotExist(err) { klog.Errorf("cannot validate mountpoint: %s", globalP...
go
func diskSetUp(manager diskManager, b rbdMounter, volPath string, mounter mount.Interface, fsGroup *int64) error { globalPDPath := manager.MakeGlobalPDName(*b.rbd) notMnt, err := mounter.IsLikelyNotMountPoint(globalPDPath) if err != nil && !os.IsNotExist(err) { klog.Errorf("cannot validate mountpoint: %s", globalP...
[ "func", "diskSetUp", "(", "manager", "diskManager", ",", "b", "rbdMounter", ",", "volPath", "string", ",", "mounter", "mount", ".", "Interface", ",", "fsGroup", "*", "int64", ")", "error", "{", "globalPDPath", ":=", "manager", ".", "MakeGlobalPDName", "(", "...
// utility to mount a disk based filesystem
[ "utility", "to", "mount", "a", "disk", "based", "filesystem" ]
train
https://github.com/kubernetes/kubernetes/blob/6a8a3682919652ae668c389ed2f60efb770eed03/pkg/volume/rbd/disk_manager.go#L60-L102
kubernetes/kubernetes
pkg/volume/rbd/disk_manager.go
diskTearDown
func diskTearDown(manager diskManager, c rbdUnmounter, volPath string, mounter mount.Interface) error { notMnt, err := mounter.IsLikelyNotMountPoint(volPath) if err != nil && !os.IsNotExist(err) { klog.Errorf("cannot validate mountpoint: %s", volPath) return err } if notMnt { klog.V(3).Infof("volume path %s i...
go
func diskTearDown(manager diskManager, c rbdUnmounter, volPath string, mounter mount.Interface) error { notMnt, err := mounter.IsLikelyNotMountPoint(volPath) if err != nil && !os.IsNotExist(err) { klog.Errorf("cannot validate mountpoint: %s", volPath) return err } if notMnt { klog.V(3).Infof("volume path %s i...
[ "func", "diskTearDown", "(", "manager", "diskManager", ",", "c", "rbdUnmounter", ",", "volPath", "string", ",", "mounter", "mount", ".", "Interface", ")", "error", "{", "notMnt", ",", "err", ":=", "mounter", ".", "IsLikelyNotMountPoint", "(", "volPath", ")", ...
// utility to tear down a disk based filesystem
[ "utility", "to", "tear", "down", "a", "disk", "based", "filesystem" ]
train
https://github.com/kubernetes/kubernetes/blob/6a8a3682919652ae668c389ed2f60efb770eed03/pkg/volume/rbd/disk_manager.go#L105-L134
kubernetes/kubernetes
staging/src/k8s.io/apiserver/pkg/admission/plugin/webhook/rules/rules.go
Matches
func (r *Matcher) Matches() bool { return r.scope() && r.operation() && r.group() && r.version() && r.resource() }
go
func (r *Matcher) Matches() bool { return r.scope() && r.operation() && r.group() && r.version() && r.resource() }
[ "func", "(", "r", "*", "Matcher", ")", "Matches", "(", ")", "bool", "{", "return", "r", ".", "scope", "(", ")", "&&", "r", ".", "operation", "(", ")", "&&", "r", ".", "group", "(", ")", "&&", "r", ".", "version", "(", ")", "&&", "r", ".", "...
// Matches returns if the Attr matches the Rule.
[ "Matches", "returns", "if", "the", "Attr", "matches", "the", "Rule", "." ]
train
https://github.com/kubernetes/kubernetes/blob/6a8a3682919652ae668c389ed2f60efb770eed03/staging/src/k8s.io/apiserver/pkg/admission/plugin/webhook/rules/rules.go#L35-L41
kubernetes/kubernetes
staging/src/k8s.io/apiserver/pkg/admission/plugin/webhook/rules/rules.go
IsWebhookConfigurationResource
func IsWebhookConfigurationResource(attr admission.Attributes) bool { gvk := attr.GetKind() if gvk.Group == "admissionregistration.k8s.io" { if gvk.Kind == "ValidatingWebhookConfiguration" || gvk.Kind == "MutatingWebhookConfiguration" { return true } } return false }
go
func IsWebhookConfigurationResource(attr admission.Attributes) bool { gvk := attr.GetKind() if gvk.Group == "admissionregistration.k8s.io" { if gvk.Kind == "ValidatingWebhookConfiguration" || gvk.Kind == "MutatingWebhookConfiguration" { return true } } return false }
[ "func", "IsWebhookConfigurationResource", "(", "attr", "admission", ".", "Attributes", ")", "bool", "{", "gvk", ":=", "attr", ".", "GetKind", "(", ")", "\n", "if", "gvk", ".", "Group", "==", "\"", "\"", "{", "if", "gvk", ".", "Kind", "==", "\"", "\"", ...
// IsWebhookConfigurationResource determines if an admission.Attributes object is describing // the admission of a ValidatingWebhookConfiguration or a MutatingWebhookConfiguration
[ "IsWebhookConfigurationResource", "determines", "if", "an", "admission", ".", "Attributes", "object", "is", "describing", "the", "admission", "of", "a", "ValidatingWebhookConfiguration", "or", "a", "MutatingWebhookConfiguration" ]
train
https://github.com/kubernetes/kubernetes/blob/6a8a3682919652ae668c389ed2f60efb770eed03/staging/src/k8s.io/apiserver/pkg/admission/plugin/webhook/rules/rules.go#L121-L129
kubernetes/kubernetes
pkg/apis/admissionregistration/zz_generated.deepcopy.go
DeepCopy
func (in *MutatingWebhookConfiguration) DeepCopy() *MutatingWebhookConfiguration { if in == nil { return nil } out := new(MutatingWebhookConfiguration) in.DeepCopyInto(out) return out }
go
func (in *MutatingWebhookConfiguration) DeepCopy() *MutatingWebhookConfiguration { if in == nil { return nil } out := new(MutatingWebhookConfiguration) in.DeepCopyInto(out) return out }
[ "func", "(", "in", "*", "MutatingWebhookConfiguration", ")", "DeepCopy", "(", ")", "*", "MutatingWebhookConfiguration", "{", "if", "in", "==", "nil", "{", "return", "nil", "\n", "}", "\n", "out", ":=", "new", "(", "MutatingWebhookConfiguration", ")", "\n", "...
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MutatingWebhookConfiguration.
[ "DeepCopy", "is", "an", "autogenerated", "deepcopy", "function", "copying", "the", "receiver", "creating", "a", "new", "MutatingWebhookConfiguration", "." ]
train
https://github.com/kubernetes/kubernetes/blob/6a8a3682919652ae668c389ed2f60efb770eed03/pkg/apis/admissionregistration/zz_generated.deepcopy.go#L44-L51
kubernetes/kubernetes
pkg/apis/admissionregistration/zz_generated.deepcopy.go
DeepCopyObject
func (in *MutatingWebhookConfiguration) DeepCopyObject() runtime.Object { if c := in.DeepCopy(); c != nil { return c } return nil }
go
func (in *MutatingWebhookConfiguration) DeepCopyObject() runtime.Object { if c := in.DeepCopy(); c != nil { return c } return nil }
[ "func", "(", "in", "*", "MutatingWebhookConfiguration", ")", "DeepCopyObject", "(", ")", "runtime", ".", "Object", "{", "if", "c", ":=", "in", ".", "DeepCopy", "(", ")", ";", "c", "!=", "nil", "{", "return", "c", "\n", "}", "\n", "return", "nil", "\n...
// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
[ "DeepCopyObject", "is", "an", "autogenerated", "deepcopy", "function", "copying", "the", "receiver", "creating", "a", "new", "runtime", ".", "Object", "." ]
train
https://github.com/kubernetes/kubernetes/blob/6a8a3682919652ae668c389ed2f60efb770eed03/pkg/apis/admissionregistration/zz_generated.deepcopy.go#L54-L59
kubernetes/kubernetes
pkg/apis/admissionregistration/zz_generated.deepcopy.go
DeepCopyInto
func (in *MutatingWebhookConfigurationList) DeepCopyInto(out *MutatingWebhookConfigurationList) { *out = *in out.TypeMeta = in.TypeMeta out.ListMeta = in.ListMeta if in.Items != nil { in, out := &in.Items, &out.Items *out = make([]MutatingWebhookConfiguration, len(*in)) for i := range *in { (*in)[i].DeepCo...
go
func (in *MutatingWebhookConfigurationList) DeepCopyInto(out *MutatingWebhookConfigurationList) { *out = *in out.TypeMeta = in.TypeMeta out.ListMeta = in.ListMeta if in.Items != nil { in, out := &in.Items, &out.Items *out = make([]MutatingWebhookConfiguration, len(*in)) for i := range *in { (*in)[i].DeepCo...
[ "func", "(", "in", "*", "MutatingWebhookConfigurationList", ")", "DeepCopyInto", "(", "out", "*", "MutatingWebhookConfigurationList", ")", "{", "*", "out", "=", "*", "in", "\n", "out", ".", "TypeMeta", "=", "in", ".", "TypeMeta", "\n", "out", ".", "ListMeta"...
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
[ "DeepCopyInto", "is", "an", "autogenerated", "deepcopy", "function", "copying", "the", "receiver", "writing", "into", "out", ".", "in", "must", "be", "non", "-", "nil", "." ]
train
https://github.com/kubernetes/kubernetes/blob/6a8a3682919652ae668c389ed2f60efb770eed03/pkg/apis/admissionregistration/zz_generated.deepcopy.go#L62-L74
kubernetes/kubernetes
pkg/apis/admissionregistration/zz_generated.deepcopy.go
DeepCopy
func (in *MutatingWebhookConfigurationList) DeepCopy() *MutatingWebhookConfigurationList { if in == nil { return nil } out := new(MutatingWebhookConfigurationList) in.DeepCopyInto(out) return out }
go
func (in *MutatingWebhookConfigurationList) DeepCopy() *MutatingWebhookConfigurationList { if in == nil { return nil } out := new(MutatingWebhookConfigurationList) in.DeepCopyInto(out) return out }
[ "func", "(", "in", "*", "MutatingWebhookConfigurationList", ")", "DeepCopy", "(", ")", "*", "MutatingWebhookConfigurationList", "{", "if", "in", "==", "nil", "{", "return", "nil", "\n", "}", "\n", "out", ":=", "new", "(", "MutatingWebhookConfigurationList", ")",...
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MutatingWebhookConfigurationList.
[ "DeepCopy", "is", "an", "autogenerated", "deepcopy", "function", "copying", "the", "receiver", "creating", "a", "new", "MutatingWebhookConfigurationList", "." ]
train
https://github.com/kubernetes/kubernetes/blob/6a8a3682919652ae668c389ed2f60efb770eed03/pkg/apis/admissionregistration/zz_generated.deepcopy.go#L77-L84
kubernetes/kubernetes
pkg/apis/admissionregistration/zz_generated.deepcopy.go
DeepCopyObject
func (in *MutatingWebhookConfigurationList) DeepCopyObject() runtime.Object { if c := in.DeepCopy(); c != nil { return c } return nil }
go
func (in *MutatingWebhookConfigurationList) DeepCopyObject() runtime.Object { if c := in.DeepCopy(); c != nil { return c } return nil }
[ "func", "(", "in", "*", "MutatingWebhookConfigurationList", ")", "DeepCopyObject", "(", ")", "runtime", ".", "Object", "{", "if", "c", ":=", "in", ".", "DeepCopy", "(", ")", ";", "c", "!=", "nil", "{", "return", "c", "\n", "}", "\n", "return", "nil", ...
// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
[ "DeepCopyObject", "is", "an", "autogenerated", "deepcopy", "function", "copying", "the", "receiver", "creating", "a", "new", "runtime", ".", "Object", "." ]
train
https://github.com/kubernetes/kubernetes/blob/6a8a3682919652ae668c389ed2f60efb770eed03/pkg/apis/admissionregistration/zz_generated.deepcopy.go#L87-L92
kubernetes/kubernetes
pkg/apis/admissionregistration/zz_generated.deepcopy.go
DeepCopyInto
func (in *Rule) DeepCopyInto(out *Rule) { *out = *in if in.APIGroups != nil { in, out := &in.APIGroups, &out.APIGroups *out = make([]string, len(*in)) copy(*out, *in) } if in.APIVersions != nil { in, out := &in.APIVersions, &out.APIVersions *out = make([]string, len(*in)) copy(*out, *in) } if in.Resou...
go
func (in *Rule) DeepCopyInto(out *Rule) { *out = *in if in.APIGroups != nil { in, out := &in.APIGroups, &out.APIGroups *out = make([]string, len(*in)) copy(*out, *in) } if in.APIVersions != nil { in, out := &in.APIVersions, &out.APIVersions *out = make([]string, len(*in)) copy(*out, *in) } if in.Resou...
[ "func", "(", "in", "*", "Rule", ")", "DeepCopyInto", "(", "out", "*", "Rule", ")", "{", "*", "out", "=", "*", "in", "\n", "if", "in", ".", "APIGroups", "!=", "nil", "{", "in", ",", "out", ":=", "&", "in", ".", "APIGroups", ",", "&", "out", "....
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
[ "DeepCopyInto", "is", "an", "autogenerated", "deepcopy", "function", "copying", "the", "receiver", "writing", "into", "out", ".", "in", "must", "be", "non", "-", "nil", "." ]
train
https://github.com/kubernetes/kubernetes/blob/6a8a3682919652ae668c389ed2f60efb770eed03/pkg/apis/admissionregistration/zz_generated.deepcopy.go#L95-L118
kubernetes/kubernetes
pkg/apis/admissionregistration/zz_generated.deepcopy.go
DeepCopy
func (in *Rule) DeepCopy() *Rule { if in == nil { return nil } out := new(Rule) in.DeepCopyInto(out) return out }
go
func (in *Rule) DeepCopy() *Rule { if in == nil { return nil } out := new(Rule) in.DeepCopyInto(out) return out }
[ "func", "(", "in", "*", "Rule", ")", "DeepCopy", "(", ")", "*", "Rule", "{", "if", "in", "==", "nil", "{", "return", "nil", "\n", "}", "\n", "out", ":=", "new", "(", "Rule", ")", "\n", "in", ".", "DeepCopyInto", "(", "out", ")", "\n", "return",...
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Rule.
[ "DeepCopy", "is", "an", "autogenerated", "deepcopy", "function", "copying", "the", "receiver", "creating", "a", "new", "Rule", "." ]
train
https://github.com/kubernetes/kubernetes/blob/6a8a3682919652ae668c389ed2f60efb770eed03/pkg/apis/admissionregistration/zz_generated.deepcopy.go#L121-L128
kubernetes/kubernetes
pkg/apis/admissionregistration/zz_generated.deepcopy.go
DeepCopyInto
func (in *RuleWithOperations) DeepCopyInto(out *RuleWithOperations) { *out = *in if in.Operations != nil { in, out := &in.Operations, &out.Operations *out = make([]OperationType, len(*in)) copy(*out, *in) } in.Rule.DeepCopyInto(&out.Rule) return }
go
func (in *RuleWithOperations) DeepCopyInto(out *RuleWithOperations) { *out = *in if in.Operations != nil { in, out := &in.Operations, &out.Operations *out = make([]OperationType, len(*in)) copy(*out, *in) } in.Rule.DeepCopyInto(&out.Rule) return }
[ "func", "(", "in", "*", "RuleWithOperations", ")", "DeepCopyInto", "(", "out", "*", "RuleWithOperations", ")", "{", "*", "out", "=", "*", "in", "\n", "if", "in", ".", "Operations", "!=", "nil", "{", "in", ",", "out", ":=", "&", "in", ".", "Operations...
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
[ "DeepCopyInto", "is", "an", "autogenerated", "deepcopy", "function", "copying", "the", "receiver", "writing", "into", "out", ".", "in", "must", "be", "non", "-", "nil", "." ]
train
https://github.com/kubernetes/kubernetes/blob/6a8a3682919652ae668c389ed2f60efb770eed03/pkg/apis/admissionregistration/zz_generated.deepcopy.go#L131-L140
kubernetes/kubernetes
pkg/apis/admissionregistration/zz_generated.deepcopy.go
DeepCopy
func (in *RuleWithOperations) DeepCopy() *RuleWithOperations { if in == nil { return nil } out := new(RuleWithOperations) in.DeepCopyInto(out) return out }
go
func (in *RuleWithOperations) DeepCopy() *RuleWithOperations { if in == nil { return nil } out := new(RuleWithOperations) in.DeepCopyInto(out) return out }
[ "func", "(", "in", "*", "RuleWithOperations", ")", "DeepCopy", "(", ")", "*", "RuleWithOperations", "{", "if", "in", "==", "nil", "{", "return", "nil", "\n", "}", "\n", "out", ":=", "new", "(", "RuleWithOperations", ")", "\n", "in", ".", "DeepCopyInto", ...
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RuleWithOperations.
[ "DeepCopy", "is", "an", "autogenerated", "deepcopy", "function", "copying", "the", "receiver", "creating", "a", "new", "RuleWithOperations", "." ]
train
https://github.com/kubernetes/kubernetes/blob/6a8a3682919652ae668c389ed2f60efb770eed03/pkg/apis/admissionregistration/zz_generated.deepcopy.go#L143-L150
kubernetes/kubernetes
pkg/apis/admissionregistration/zz_generated.deepcopy.go
DeepCopyInto
func (in *ServiceReference) DeepCopyInto(out *ServiceReference) { *out = *in if in.Path != nil { in, out := &in.Path, &out.Path *out = new(string) **out = **in } return }
go
func (in *ServiceReference) DeepCopyInto(out *ServiceReference) { *out = *in if in.Path != nil { in, out := &in.Path, &out.Path *out = new(string) **out = **in } return }
[ "func", "(", "in", "*", "ServiceReference", ")", "DeepCopyInto", "(", "out", "*", "ServiceReference", ")", "{", "*", "out", "=", "*", "in", "\n", "if", "in", ".", "Path", "!=", "nil", "{", "in", ",", "out", ":=", "&", "in", ".", "Path", ",", "&",...
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
[ "DeepCopyInto", "is", "an", "autogenerated", "deepcopy", "function", "copying", "the", "receiver", "writing", "into", "out", ".", "in", "must", "be", "non", "-", "nil", "." ]
train
https://github.com/kubernetes/kubernetes/blob/6a8a3682919652ae668c389ed2f60efb770eed03/pkg/apis/admissionregistration/zz_generated.deepcopy.go#L153-L161
kubernetes/kubernetes
pkg/apis/admissionregistration/zz_generated.deepcopy.go
DeepCopy
func (in *ServiceReference) DeepCopy() *ServiceReference { if in == nil { return nil } out := new(ServiceReference) in.DeepCopyInto(out) return out }
go
func (in *ServiceReference) DeepCopy() *ServiceReference { if in == nil { return nil } out := new(ServiceReference) in.DeepCopyInto(out) return out }
[ "func", "(", "in", "*", "ServiceReference", ")", "DeepCopy", "(", ")", "*", "ServiceReference", "{", "if", "in", "==", "nil", "{", "return", "nil", "\n", "}", "\n", "out", ":=", "new", "(", "ServiceReference", ")", "\n", "in", ".", "DeepCopyInto", "(",...
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ServiceReference.
[ "DeepCopy", "is", "an", "autogenerated", "deepcopy", "function", "copying", "the", "receiver", "creating", "a", "new", "ServiceReference", "." ]
train
https://github.com/kubernetes/kubernetes/blob/6a8a3682919652ae668c389ed2f60efb770eed03/pkg/apis/admissionregistration/zz_generated.deepcopy.go#L164-L171
kubernetes/kubernetes
pkg/apis/admissionregistration/zz_generated.deepcopy.go
DeepCopyInto
func (in *ValidatingWebhookConfiguration) DeepCopyInto(out *ValidatingWebhookConfiguration) { *out = *in out.TypeMeta = in.TypeMeta in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) if in.Webhooks != nil { in, out := &in.Webhooks, &out.Webhooks *out = make([]Webhook, len(*in)) for i := range *in { (*in)[i].DeepC...
go
func (in *ValidatingWebhookConfiguration) DeepCopyInto(out *ValidatingWebhookConfiguration) { *out = *in out.TypeMeta = in.TypeMeta in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) if in.Webhooks != nil { in, out := &in.Webhooks, &out.Webhooks *out = make([]Webhook, len(*in)) for i := range *in { (*in)[i].DeepC...
[ "func", "(", "in", "*", "ValidatingWebhookConfiguration", ")", "DeepCopyInto", "(", "out", "*", "ValidatingWebhookConfiguration", ")", "{", "*", "out", "=", "*", "in", "\n", "out", ".", "TypeMeta", "=", "in", ".", "TypeMeta", "\n", "in", ".", "ObjectMeta", ...
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
[ "DeepCopyInto", "is", "an", "autogenerated", "deepcopy", "function", "copying", "the", "receiver", "writing", "into", "out", ".", "in", "must", "be", "non", "-", "nil", "." ]
train
https://github.com/kubernetes/kubernetes/blob/6a8a3682919652ae668c389ed2f60efb770eed03/pkg/apis/admissionregistration/zz_generated.deepcopy.go#L174-L186
kubernetes/kubernetes
pkg/apis/admissionregistration/zz_generated.deepcopy.go
DeepCopy
func (in *ValidatingWebhookConfiguration) DeepCopy() *ValidatingWebhookConfiguration { if in == nil { return nil } out := new(ValidatingWebhookConfiguration) in.DeepCopyInto(out) return out }
go
func (in *ValidatingWebhookConfiguration) DeepCopy() *ValidatingWebhookConfiguration { if in == nil { return nil } out := new(ValidatingWebhookConfiguration) in.DeepCopyInto(out) return out }
[ "func", "(", "in", "*", "ValidatingWebhookConfiguration", ")", "DeepCopy", "(", ")", "*", "ValidatingWebhookConfiguration", "{", "if", "in", "==", "nil", "{", "return", "nil", "\n", "}", "\n", "out", ":=", "new", "(", "ValidatingWebhookConfiguration", ")", "\n...
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ValidatingWebhookConfiguration.
[ "DeepCopy", "is", "an", "autogenerated", "deepcopy", "function", "copying", "the", "receiver", "creating", "a", "new", "ValidatingWebhookConfiguration", "." ]
train
https://github.com/kubernetes/kubernetes/blob/6a8a3682919652ae668c389ed2f60efb770eed03/pkg/apis/admissionregistration/zz_generated.deepcopy.go#L189-L196
kubernetes/kubernetes
pkg/apis/admissionregistration/zz_generated.deepcopy.go
DeepCopyObject
func (in *ValidatingWebhookConfiguration) DeepCopyObject() runtime.Object { if c := in.DeepCopy(); c != nil { return c } return nil }
go
func (in *ValidatingWebhookConfiguration) DeepCopyObject() runtime.Object { if c := in.DeepCopy(); c != nil { return c } return nil }
[ "func", "(", "in", "*", "ValidatingWebhookConfiguration", ")", "DeepCopyObject", "(", ")", "runtime", ".", "Object", "{", "if", "c", ":=", "in", ".", "DeepCopy", "(", ")", ";", "c", "!=", "nil", "{", "return", "c", "\n", "}", "\n", "return", "nil", "...
// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
[ "DeepCopyObject", "is", "an", "autogenerated", "deepcopy", "function", "copying", "the", "receiver", "creating", "a", "new", "runtime", ".", "Object", "." ]
train
https://github.com/kubernetes/kubernetes/blob/6a8a3682919652ae668c389ed2f60efb770eed03/pkg/apis/admissionregistration/zz_generated.deepcopy.go#L199-L204
kubernetes/kubernetes
pkg/apis/admissionregistration/zz_generated.deepcopy.go
DeepCopyInto
func (in *ValidatingWebhookConfigurationList) DeepCopyInto(out *ValidatingWebhookConfigurationList) { *out = *in out.TypeMeta = in.TypeMeta out.ListMeta = in.ListMeta if in.Items != nil { in, out := &in.Items, &out.Items *out = make([]ValidatingWebhookConfiguration, len(*in)) for i := range *in { (*in)[i]....
go
func (in *ValidatingWebhookConfigurationList) DeepCopyInto(out *ValidatingWebhookConfigurationList) { *out = *in out.TypeMeta = in.TypeMeta out.ListMeta = in.ListMeta if in.Items != nil { in, out := &in.Items, &out.Items *out = make([]ValidatingWebhookConfiguration, len(*in)) for i := range *in { (*in)[i]....
[ "func", "(", "in", "*", "ValidatingWebhookConfigurationList", ")", "DeepCopyInto", "(", "out", "*", "ValidatingWebhookConfigurationList", ")", "{", "*", "out", "=", "*", "in", "\n", "out", ".", "TypeMeta", "=", "in", ".", "TypeMeta", "\n", "out", ".", "ListM...
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
[ "DeepCopyInto", "is", "an", "autogenerated", "deepcopy", "function", "copying", "the", "receiver", "writing", "into", "out", ".", "in", "must", "be", "non", "-", "nil", "." ]
train
https://github.com/kubernetes/kubernetes/blob/6a8a3682919652ae668c389ed2f60efb770eed03/pkg/apis/admissionregistration/zz_generated.deepcopy.go#L207-L219
kubernetes/kubernetes
pkg/apis/admissionregistration/zz_generated.deepcopy.go
DeepCopy
func (in *ValidatingWebhookConfigurationList) DeepCopy() *ValidatingWebhookConfigurationList { if in == nil { return nil } out := new(ValidatingWebhookConfigurationList) in.DeepCopyInto(out) return out }
go
func (in *ValidatingWebhookConfigurationList) DeepCopy() *ValidatingWebhookConfigurationList { if in == nil { return nil } out := new(ValidatingWebhookConfigurationList) in.DeepCopyInto(out) return out }
[ "func", "(", "in", "*", "ValidatingWebhookConfigurationList", ")", "DeepCopy", "(", ")", "*", "ValidatingWebhookConfigurationList", "{", "if", "in", "==", "nil", "{", "return", "nil", "\n", "}", "\n", "out", ":=", "new", "(", "ValidatingWebhookConfigurationList", ...
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ValidatingWebhookConfigurationList.
[ "DeepCopy", "is", "an", "autogenerated", "deepcopy", "function", "copying", "the", "receiver", "creating", "a", "new", "ValidatingWebhookConfigurationList", "." ]
train
https://github.com/kubernetes/kubernetes/blob/6a8a3682919652ae668c389ed2f60efb770eed03/pkg/apis/admissionregistration/zz_generated.deepcopy.go#L222-L229
kubernetes/kubernetes
pkg/apis/admissionregistration/zz_generated.deepcopy.go
DeepCopyObject
func (in *ValidatingWebhookConfigurationList) DeepCopyObject() runtime.Object { if c := in.DeepCopy(); c != nil { return c } return nil }
go
func (in *ValidatingWebhookConfigurationList) DeepCopyObject() runtime.Object { if c := in.DeepCopy(); c != nil { return c } return nil }
[ "func", "(", "in", "*", "ValidatingWebhookConfigurationList", ")", "DeepCopyObject", "(", ")", "runtime", ".", "Object", "{", "if", "c", ":=", "in", ".", "DeepCopy", "(", ")", ";", "c", "!=", "nil", "{", "return", "c", "\n", "}", "\n", "return", "nil",...
// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
[ "DeepCopyObject", "is", "an", "autogenerated", "deepcopy", "function", "copying", "the", "receiver", "creating", "a", "new", "runtime", ".", "Object", "." ]
train
https://github.com/kubernetes/kubernetes/blob/6a8a3682919652ae668c389ed2f60efb770eed03/pkg/apis/admissionregistration/zz_generated.deepcopy.go#L232-L237
kubernetes/kubernetes
pkg/apis/admissionregistration/zz_generated.deepcopy.go
DeepCopyInto
func (in *Webhook) DeepCopyInto(out *Webhook) { *out = *in in.ClientConfig.DeepCopyInto(&out.ClientConfig) if in.Rules != nil { in, out := &in.Rules, &out.Rules *out = make([]RuleWithOperations, len(*in)) for i := range *in { (*in)[i].DeepCopyInto(&(*out)[i]) } } if in.FailurePolicy != nil { in, out :...
go
func (in *Webhook) DeepCopyInto(out *Webhook) { *out = *in in.ClientConfig.DeepCopyInto(&out.ClientConfig) if in.Rules != nil { in, out := &in.Rules, &out.Rules *out = make([]RuleWithOperations, len(*in)) for i := range *in { (*in)[i].DeepCopyInto(&(*out)[i]) } } if in.FailurePolicy != nil { in, out :...
[ "func", "(", "in", "*", "Webhook", ")", "DeepCopyInto", "(", "out", "*", "Webhook", ")", "{", "*", "out", "=", "*", "in", "\n", "in", ".", "ClientConfig", ".", "DeepCopyInto", "(", "&", "out", ".", "ClientConfig", ")", "\n", "if", "in", ".", "Rules...
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
[ "DeepCopyInto", "is", "an", "autogenerated", "deepcopy", "function", "copying", "the", "receiver", "writing", "into", "out", ".", "in", "must", "be", "non", "-", "nil", "." ]
train
https://github.com/kubernetes/kubernetes/blob/6a8a3682919652ae668c389ed2f60efb770eed03/pkg/apis/admissionregistration/zz_generated.deepcopy.go#L240-L276
kubernetes/kubernetes
pkg/apis/admissionregistration/zz_generated.deepcopy.go
DeepCopy
func (in *Webhook) DeepCopy() *Webhook { if in == nil { return nil } out := new(Webhook) in.DeepCopyInto(out) return out }
go
func (in *Webhook) DeepCopy() *Webhook { if in == nil { return nil } out := new(Webhook) in.DeepCopyInto(out) return out }
[ "func", "(", "in", "*", "Webhook", ")", "DeepCopy", "(", ")", "*", "Webhook", "{", "if", "in", "==", "nil", "{", "return", "nil", "\n", "}", "\n", "out", ":=", "new", "(", "Webhook", ")", "\n", "in", ".", "DeepCopyInto", "(", "out", ")", "\n", ...
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Webhook.
[ "DeepCopy", "is", "an", "autogenerated", "deepcopy", "function", "copying", "the", "receiver", "creating", "a", "new", "Webhook", "." ]
train
https://github.com/kubernetes/kubernetes/blob/6a8a3682919652ae668c389ed2f60efb770eed03/pkg/apis/admissionregistration/zz_generated.deepcopy.go#L279-L286
kubernetes/kubernetes
pkg/apis/admissionregistration/zz_generated.deepcopy.go
DeepCopyInto
func (in *WebhookClientConfig) DeepCopyInto(out *WebhookClientConfig) { *out = *in if in.URL != nil { in, out := &in.URL, &out.URL *out = new(string) **out = **in } if in.Service != nil { in, out := &in.Service, &out.Service *out = new(ServiceReference) (*in).DeepCopyInto(*out) } if in.CABundle != nil...
go
func (in *WebhookClientConfig) DeepCopyInto(out *WebhookClientConfig) { *out = *in if in.URL != nil { in, out := &in.URL, &out.URL *out = new(string) **out = **in } if in.Service != nil { in, out := &in.Service, &out.Service *out = new(ServiceReference) (*in).DeepCopyInto(*out) } if in.CABundle != nil...
[ "func", "(", "in", "*", "WebhookClientConfig", ")", "DeepCopyInto", "(", "out", "*", "WebhookClientConfig", ")", "{", "*", "out", "=", "*", "in", "\n", "if", "in", ".", "URL", "!=", "nil", "{", "in", ",", "out", ":=", "&", "in", ".", "URL", ",", ...
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
[ "DeepCopyInto", "is", "an", "autogenerated", "deepcopy", "function", "copying", "the", "receiver", "writing", "into", "out", ".", "in", "must", "be", "non", "-", "nil", "." ]
train
https://github.com/kubernetes/kubernetes/blob/6a8a3682919652ae668c389ed2f60efb770eed03/pkg/apis/admissionregistration/zz_generated.deepcopy.go#L289-L307
kubernetes/kubernetes
pkg/apis/admissionregistration/zz_generated.deepcopy.go
DeepCopy
func (in *WebhookClientConfig) DeepCopy() *WebhookClientConfig { if in == nil { return nil } out := new(WebhookClientConfig) in.DeepCopyInto(out) return out }
go
func (in *WebhookClientConfig) DeepCopy() *WebhookClientConfig { if in == nil { return nil } out := new(WebhookClientConfig) in.DeepCopyInto(out) return out }
[ "func", "(", "in", "*", "WebhookClientConfig", ")", "DeepCopy", "(", ")", "*", "WebhookClientConfig", "{", "if", "in", "==", "nil", "{", "return", "nil", "\n", "}", "\n", "out", ":=", "new", "(", "WebhookClientConfig", ")", "\n", "in", ".", "DeepCopyInto...
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new WebhookClientConfig.
[ "DeepCopy", "is", "an", "autogenerated", "deepcopy", "function", "copying", "the", "receiver", "creating", "a", "new", "WebhookClientConfig", "." ]
train
https://github.com/kubernetes/kubernetes/blob/6a8a3682919652ae668c389ed2f60efb770eed03/pkg/apis/admissionregistration/zz_generated.deepcopy.go#L310-L317
kubernetes/kubernetes
pkg/util/node/node.go
GetHostname
func GetHostname(hostnameOverride string) (string, error) { hostName := hostnameOverride if len(hostName) == 0 { nodeName, err := os.Hostname() if err != nil { return "", fmt.Errorf("couldn't determine hostname: %v", err) } hostName = nodeName } // Trim whitespaces first to avoid getting an empty hostna...
go
func GetHostname(hostnameOverride string) (string, error) { hostName := hostnameOverride if len(hostName) == 0 { nodeName, err := os.Hostname() if err != nil { return "", fmt.Errorf("couldn't determine hostname: %v", err) } hostName = nodeName } // Trim whitespaces first to avoid getting an empty hostna...
[ "func", "GetHostname", "(", "hostnameOverride", "string", ")", "(", "string", ",", "error", ")", "{", "hostName", ":=", "hostnameOverride", "\n", "if", "len", "(", "hostName", ")", "==", "0", "{", "nodeName", ",", "err", ":=", "os", ".", "Hostname", "(",...
// GetHostname returns OS's hostname if 'hostnameOverride' is empty; otherwise, return 'hostnameOverride'.
[ "GetHostname", "returns", "OS", "s", "hostname", "if", "hostnameOverride", "is", "empty", ";", "otherwise", "return", "hostnameOverride", "." ]
train
https://github.com/kubernetes/kubernetes/blob/6a8a3682919652ae668c389ed2f60efb770eed03/pkg/util/node/node.go#L47-L64
kubernetes/kubernetes
pkg/util/node/node.go
GetPreferredNodeAddress
func GetPreferredNodeAddress(node *v1.Node, preferredAddressTypes []v1.NodeAddressType) (string, error) { for _, addressType := range preferredAddressTypes { for _, address := range node.Status.Addresses { if address.Type == addressType { return address.Address, nil } } } return "", &NoMatchError{addre...
go
func GetPreferredNodeAddress(node *v1.Node, preferredAddressTypes []v1.NodeAddressType) (string, error) { for _, addressType := range preferredAddressTypes { for _, address := range node.Status.Addresses { if address.Type == addressType { return address.Address, nil } } } return "", &NoMatchError{addre...
[ "func", "GetPreferredNodeAddress", "(", "node", "*", "v1", ".", "Node", ",", "preferredAddressTypes", "[", "]", "v1", ".", "NodeAddressType", ")", "(", "string", ",", "error", ")", "{", "for", "_", ",", "addressType", ":=", "range", "preferredAddressTypes", ...
// GetPreferredNodeAddress returns the address of the provided node, using the provided preference order. // If none of the preferred address types are found, an error is returned.
[ "GetPreferredNodeAddress", "returns", "the", "address", "of", "the", "provided", "node", "using", "the", "provided", "preference", "order", ".", "If", "none", "of", "the", "preferred", "address", "types", "are", "found", "an", "error", "is", "returned", "." ]
train
https://github.com/kubernetes/kubernetes/blob/6a8a3682919652ae668c389ed2f60efb770eed03/pkg/util/node/node.go#L79-L88
kubernetes/kubernetes
pkg/util/node/node.go
GetNodeHostIP
func GetNodeHostIP(node *v1.Node) (net.IP, error) { addresses := node.Status.Addresses addressMap := make(map[v1.NodeAddressType][]v1.NodeAddress) for i := range addresses { addressMap[addresses[i].Type] = append(addressMap[addresses[i].Type], addresses[i]) } if addresses, ok := addressMap[v1.NodeInternalIP]; ok...
go
func GetNodeHostIP(node *v1.Node) (net.IP, error) { addresses := node.Status.Addresses addressMap := make(map[v1.NodeAddressType][]v1.NodeAddress) for i := range addresses { addressMap[addresses[i].Type] = append(addressMap[addresses[i].Type], addresses[i]) } if addresses, ok := addressMap[v1.NodeInternalIP]; ok...
[ "func", "GetNodeHostIP", "(", "node", "*", "v1", ".", "Node", ")", "(", "net", ".", "IP", ",", "error", ")", "{", "addresses", ":=", "node", ".", "Status", ".", "Addresses", "\n", "addressMap", ":=", "make", "(", "map", "[", "v1", ".", "NodeAddressTy...
// GetNodeHostIP returns the provided node's IP, based on the priority: // 1. NodeInternalIP // 2. NodeExternalIP
[ "GetNodeHostIP", "returns", "the", "provided", "node", "s", "IP", "based", "on", "the", "priority", ":", "1", ".", "NodeInternalIP", "2", ".", "NodeExternalIP" ]
train
https://github.com/kubernetes/kubernetes/blob/6a8a3682919652ae668c389ed2f60efb770eed03/pkg/util/node/node.go#L93-L106
kubernetes/kubernetes
pkg/util/node/node.go
GetNodeIP
func GetNodeIP(client clientset.Interface, hostname string) net.IP { var nodeIP net.IP node, err := client.CoreV1().Nodes().Get(hostname, metav1.GetOptions{}) if err != nil { klog.Warningf("Failed to retrieve node info: %v", err) return nil } nodeIP, err = GetNodeHostIP(node) if err != nil { klog.Warningf("...
go
func GetNodeIP(client clientset.Interface, hostname string) net.IP { var nodeIP net.IP node, err := client.CoreV1().Nodes().Get(hostname, metav1.GetOptions{}) if err != nil { klog.Warningf("Failed to retrieve node info: %v", err) return nil } nodeIP, err = GetNodeHostIP(node) if err != nil { klog.Warningf("...
[ "func", "GetNodeIP", "(", "client", "clientset", ".", "Interface", ",", "hostname", "string", ")", "net", ".", "IP", "{", "var", "nodeIP", "net", ".", "IP", "\n", "node", ",", "err", ":=", "client", ".", "CoreV1", "(", ")", ".", "Nodes", "(", ")", ...
// GetNodeIP returns the ip of node with the provided hostname
[ "GetNodeIP", "returns", "the", "ip", "of", "node", "with", "the", "provided", "hostname" ]
train
https://github.com/kubernetes/kubernetes/blob/6a8a3682919652ae668c389ed2f60efb770eed03/pkg/util/node/node.go#L109-L122
kubernetes/kubernetes
pkg/util/node/node.go
GetZoneKey
func GetZoneKey(node *v1.Node) string { labels := node.Labels if labels == nil { return "" } region, _ := labels[v1.LabelZoneRegion] failureDomain, _ := labels[v1.LabelZoneFailureDomain] if region == "" && failureDomain == "" { return "" } // We include the null character just in case region or failureDo...
go
func GetZoneKey(node *v1.Node) string { labels := node.Labels if labels == nil { return "" } region, _ := labels[v1.LabelZoneRegion] failureDomain, _ := labels[v1.LabelZoneFailureDomain] if region == "" && failureDomain == "" { return "" } // We include the null character just in case region or failureDo...
[ "func", "GetZoneKey", "(", "node", "*", "v1", ".", "Node", ")", "string", "{", "labels", ":=", "node", ".", "Labels", "\n", "if", "labels", "==", "nil", "{", "return", "\"", "\"", "\n", "}", "\n\n", "region", ",", "_", ":=", "labels", "[", "v1", ...
// GetZoneKey is a helper function that builds a string identifier that is unique per failure-zone; // it returns empty-string for no zone.
[ "GetZoneKey", "is", "a", "helper", "function", "that", "builds", "a", "string", "identifier", "that", "is", "unique", "per", "failure", "-", "zone", ";", "it", "returns", "empty", "-", "string", "for", "no", "zone", "." ]
train
https://github.com/kubernetes/kubernetes/blob/6a8a3682919652ae668c389ed2f60efb770eed03/pkg/util/node/node.go#L126-L143
kubernetes/kubernetes
pkg/util/node/node.go
SetNodeCondition
func SetNodeCondition(c clientset.Interface, node types.NodeName, condition v1.NodeCondition) error { generatePatch := func(condition v1.NodeCondition) ([]byte, error) { raw, err := json.Marshal(&[]v1.NodeCondition{condition}) if err != nil { return nil, err } return []byte(fmt.Sprintf(`{"status":{"conditio...
go
func SetNodeCondition(c clientset.Interface, node types.NodeName, condition v1.NodeCondition) error { generatePatch := func(condition v1.NodeCondition) ([]byte, error) { raw, err := json.Marshal(&[]v1.NodeCondition{condition}) if err != nil { return nil, err } return []byte(fmt.Sprintf(`{"status":{"conditio...
[ "func", "SetNodeCondition", "(", "c", "clientset", ".", "Interface", ",", "node", "types", ".", "NodeName", ",", "condition", "v1", ".", "NodeCondition", ")", "error", "{", "generatePatch", ":=", "func", "(", "condition", "v1", ".", "NodeCondition", ")", "("...
// SetNodeCondition updates specific node condition with patch operation.
[ "SetNodeCondition", "updates", "specific", "node", "condition", "with", "patch", "operation", "." ]
train
https://github.com/kubernetes/kubernetes/blob/6a8a3682919652ae668c389ed2f60efb770eed03/pkg/util/node/node.go#L146-L161
kubernetes/kubernetes
pkg/util/node/node.go
PatchNodeCIDR
func PatchNodeCIDR(c clientset.Interface, node types.NodeName, cidr string) error { raw, err := json.Marshal(cidr) if err != nil { return fmt.Errorf("failed to json.Marshal CIDR: %v", err) } patchBytes := []byte(fmt.Sprintf(`{"spec":{"podCIDR":%s}}`, raw)) if _, err := c.CoreV1().Nodes().Patch(string(node), ty...
go
func PatchNodeCIDR(c clientset.Interface, node types.NodeName, cidr string) error { raw, err := json.Marshal(cidr) if err != nil { return fmt.Errorf("failed to json.Marshal CIDR: %v", err) } patchBytes := []byte(fmt.Sprintf(`{"spec":{"podCIDR":%s}}`, raw)) if _, err := c.CoreV1().Nodes().Patch(string(node), ty...
[ "func", "PatchNodeCIDR", "(", "c", "clientset", ".", "Interface", ",", "node", "types", ".", "NodeName", ",", "cidr", "string", ")", "error", "{", "raw", ",", "err", ":=", "json", ".", "Marshal", "(", "cidr", ")", "\n", "if", "err", "!=", "nil", "{",...
// PatchNodeCIDR patches the specified node's CIDR to the given value.
[ "PatchNodeCIDR", "patches", "the", "specified", "node", "s", "CIDR", "to", "the", "given", "value", "." ]
train
https://github.com/kubernetes/kubernetes/blob/6a8a3682919652ae668c389ed2f60efb770eed03/pkg/util/node/node.go#L164-L176
kubernetes/kubernetes
pkg/apis/core/install/install.go
Install
func Install(scheme *runtime.Scheme) { utilruntime.Must(core.AddToScheme(scheme)) utilruntime.Must(v1.AddToScheme(scheme)) utilruntime.Must(scheme.SetVersionPriority(v1.SchemeGroupVersion)) }
go
func Install(scheme *runtime.Scheme) { utilruntime.Must(core.AddToScheme(scheme)) utilruntime.Must(v1.AddToScheme(scheme)) utilruntime.Must(scheme.SetVersionPriority(v1.SchemeGroupVersion)) }
[ "func", "Install", "(", "scheme", "*", "runtime", ".", "Scheme", ")", "{", "utilruntime", ".", "Must", "(", "core", ".", "AddToScheme", "(", "scheme", ")", ")", "\n", "utilruntime", ".", "Must", "(", "v1", ".", "AddToScheme", "(", "scheme", ")", ")", ...
// Install registers the API group and adds types to a scheme
[ "Install", "registers", "the", "API", "group", "and", "adds", "types", "to", "a", "scheme" ]
train
https://github.com/kubernetes/kubernetes/blob/6a8a3682919652ae668c389ed2f60efb770eed03/pkg/apis/core/install/install.go#L34-L38
kubernetes/kubernetes
cmd/kubeadm/app/phases/controlplane/manifests.go
CreateInitStaticPodManifestFiles
func CreateInitStaticPodManifestFiles(manifestDir string, cfg *kubeadmapi.InitConfiguration) error { klog.V(1).Infoln("[control-plane] creating static Pod files") return CreateStaticPodFiles(manifestDir, &cfg.ClusterConfiguration, &cfg.LocalAPIEndpoint, kubeadmconstants.KubeAPIServer, kubeadmconstants.KubeControllerM...
go
func CreateInitStaticPodManifestFiles(manifestDir string, cfg *kubeadmapi.InitConfiguration) error { klog.V(1).Infoln("[control-plane] creating static Pod files") return CreateStaticPodFiles(manifestDir, &cfg.ClusterConfiguration, &cfg.LocalAPIEndpoint, kubeadmconstants.KubeAPIServer, kubeadmconstants.KubeControllerM...
[ "func", "CreateInitStaticPodManifestFiles", "(", "manifestDir", "string", ",", "cfg", "*", "kubeadmapi", ".", "InitConfiguration", ")", "error", "{", "klog", ".", "V", "(", "1", ")", ".", "Infoln", "(", "\"", "\"", ")", "\n", "return", "CreateStaticPodFiles", ...
// CreateInitStaticPodManifestFiles will write all static pod manifest files needed to bring up the control plane.
[ "CreateInitStaticPodManifestFiles", "will", "write", "all", "static", "pod", "manifest", "files", "needed", "to", "bring", "up", "the", "control", "plane", "." ]
train
https://github.com/kubernetes/kubernetes/blob/6a8a3682919652ae668c389ed2f60efb770eed03/cmd/kubeadm/app/phases/controlplane/manifests.go#L43-L46
kubernetes/kubernetes
cmd/kubeadm/app/phases/controlplane/manifests.go
GetStaticPodSpecs
func GetStaticPodSpecs(cfg *kubeadmapi.ClusterConfiguration, endpoint *kubeadmapi.APIEndpoint, k8sVersion *version.Version) map[string]v1.Pod { // Get the required hostpath mounts mounts := getHostPathVolumesForTheControlPlane(cfg) // Prepare static pod specs staticPodSpecs := map[string]v1.Pod{ kubeadmconstants...
go
func GetStaticPodSpecs(cfg *kubeadmapi.ClusterConfiguration, endpoint *kubeadmapi.APIEndpoint, k8sVersion *version.Version) map[string]v1.Pod { // Get the required hostpath mounts mounts := getHostPathVolumesForTheControlPlane(cfg) // Prepare static pod specs staticPodSpecs := map[string]v1.Pod{ kubeadmconstants...
[ "func", "GetStaticPodSpecs", "(", "cfg", "*", "kubeadmapi", ".", "ClusterConfiguration", ",", "endpoint", "*", "kubeadmapi", ".", "APIEndpoint", ",", "k8sVersion", "*", "version", ".", "Version", ")", "map", "[", "string", "]", "v1", ".", "Pod", "{", "// Get...
// GetStaticPodSpecs returns all staticPodSpecs actualized to the context of the current configuration // NB. this methods holds the information about how kubeadm creates static pod manifests.
[ "GetStaticPodSpecs", "returns", "all", "staticPodSpecs", "actualized", "to", "the", "context", "of", "the", "current", "configuration", "NB", ".", "this", "methods", "holds", "the", "information", "about", "how", "kubeadm", "creates", "static", "pod", "manifests", ...
train
https://github.com/kubernetes/kubernetes/blob/6a8a3682919652ae668c389ed2f60efb770eed03/cmd/kubeadm/app/phases/controlplane/manifests.go#L50-L88
kubernetes/kubernetes
cmd/kubeadm/app/phases/controlplane/manifests.go
CreateStaticPodFiles
func CreateStaticPodFiles(manifestDir string, cfg *kubeadmapi.ClusterConfiguration, endpoint *kubeadmapi.APIEndpoint, componentNames ...string) error { // TODO: Move the "pkg/util/version".Version object into the internal API instead of always parsing the string k8sVersion, err := version.ParseSemantic(cfg.Kubernetes...
go
func CreateStaticPodFiles(manifestDir string, cfg *kubeadmapi.ClusterConfiguration, endpoint *kubeadmapi.APIEndpoint, componentNames ...string) error { // TODO: Move the "pkg/util/version".Version object into the internal API instead of always parsing the string k8sVersion, err := version.ParseSemantic(cfg.Kubernetes...
[ "func", "CreateStaticPodFiles", "(", "manifestDir", "string", ",", "cfg", "*", "kubeadmapi", ".", "ClusterConfiguration", ",", "endpoint", "*", "kubeadmapi", ".", "APIEndpoint", ",", "componentNames", "...", "string", ")", "error", "{", "// TODO: Move the \"pkg/util/v...
// CreateStaticPodFiles creates all the requested static pod files.
[ "CreateStaticPodFiles", "creates", "all", "the", "requested", "static", "pod", "files", "." ]
train
https://github.com/kubernetes/kubernetes/blob/6a8a3682919652ae668c389ed2f60efb770eed03/cmd/kubeadm/app/phases/controlplane/manifests.go#L107-L135
kubernetes/kubernetes
cmd/kubeadm/app/phases/controlplane/manifests.go
getAPIServerCommand
func getAPIServerCommand(cfg *kubeadmapi.ClusterConfiguration, localAPIEndpoint *kubeadmapi.APIEndpoint) []string { defaultArguments := map[string]string{ "advertise-address": localAPIEndpoint.AdvertiseAddress, "insecure-port": "0", "enable-admission-plugins": "NodeRestrict...
go
func getAPIServerCommand(cfg *kubeadmapi.ClusterConfiguration, localAPIEndpoint *kubeadmapi.APIEndpoint) []string { defaultArguments := map[string]string{ "advertise-address": localAPIEndpoint.AdvertiseAddress, "insecure-port": "0", "enable-admission-plugins": "NodeRestrict...
[ "func", "getAPIServerCommand", "(", "cfg", "*", "kubeadmapi", ".", "ClusterConfiguration", ",", "localAPIEndpoint", "*", "kubeadmapi", ".", "APIEndpoint", ")", "[", "]", "string", "{", "defaultArguments", ":=", "map", "[", "string", "]", "string", "{", "\"", "...
// getAPIServerCommand builds the right API server command from the given config object and version
[ "getAPIServerCommand", "builds", "the", "right", "API", "server", "command", "from", "the", "given", "config", "object", "and", "version" ]
train
https://github.com/kubernetes/kubernetes/blob/6a8a3682919652ae668c389ed2f60efb770eed03/cmd/kubeadm/app/phases/controlplane/manifests.go#L138-L201
kubernetes/kubernetes
cmd/kubeadm/app/phases/controlplane/manifests.go
getAuthzModes
func getAuthzModes(authzModeExtraArgs string) string { modes := []string{ authzmodes.ModeNode, authzmodes.ModeRBAC, } if strings.Contains(authzModeExtraArgs, authzmodes.ModeABAC) { modes = append(modes, authzmodes.ModeABAC) } if strings.Contains(authzModeExtraArgs, authzmodes.ModeWebhook) { modes = append(...
go
func getAuthzModes(authzModeExtraArgs string) string { modes := []string{ authzmodes.ModeNode, authzmodes.ModeRBAC, } if strings.Contains(authzModeExtraArgs, authzmodes.ModeABAC) { modes = append(modes, authzmodes.ModeABAC) } if strings.Contains(authzModeExtraArgs, authzmodes.ModeWebhook) { modes = append(...
[ "func", "getAuthzModes", "(", "authzModeExtraArgs", "string", ")", "string", "{", "modes", ":=", "[", "]", "string", "{", "authzmodes", ".", "ModeNode", ",", "authzmodes", ".", "ModeRBAC", ",", "}", "\n", "if", "strings", ".", "Contains", "(", "authzModeExtr...
// getAuthzModes gets the authorization-related parameters to the api server // Node,RBAC should be fixed in this order at the beginning // AlwaysAllow and AlwaysDeny is ignored as they are only for testing
[ "getAuthzModes", "gets", "the", "authorization", "-", "related", "parameters", "to", "the", "api", "server", "Node", "RBAC", "should", "be", "fixed", "in", "this", "order", "at", "the", "beginning", "AlwaysAllow", "and", "AlwaysDeny", "is", "ignored", "as", "t...
train
https://github.com/kubernetes/kubernetes/blob/6a8a3682919652ae668c389ed2f60efb770eed03/cmd/kubeadm/app/phases/controlplane/manifests.go#L206-L218
kubernetes/kubernetes
cmd/kubeadm/app/phases/controlplane/manifests.go
calcNodeCidrSize
func calcNodeCidrSize(podSubnet string) string { maskSize := "24" if ip, podCidr, err := net.ParseCIDR(podSubnet); err == nil { if ip.To4() == nil { var nodeCidrSize int podNetSize, totalBits := podCidr.Mask.Size() switch { case podNetSize == 112: // Special case, allows 256 nodes, 256 pods/node ...
go
func calcNodeCidrSize(podSubnet string) string { maskSize := "24" if ip, podCidr, err := net.ParseCIDR(podSubnet); err == nil { if ip.To4() == nil { var nodeCidrSize int podNetSize, totalBits := podCidr.Mask.Size() switch { case podNetSize == 112: // Special case, allows 256 nodes, 256 pods/node ...
[ "func", "calcNodeCidrSize", "(", "podSubnet", "string", ")", "string", "{", "maskSize", ":=", "\"", "\"", "\n", "if", "ip", ",", "podCidr", ",", "err", ":=", "net", ".", "ParseCIDR", "(", "podSubnet", ")", ";", "err", "==", "nil", "{", "if", "ip", "....
// calcNodeCidrSize determines the size of the subnets used on each node, based // on the pod subnet provided. For IPv4, we assume that the pod subnet will // be /16 and use /24. If the pod subnet cannot be parsed, the IPv4 value will // be used (/24). // // For IPv6, the algorithm will do two three. First, the node C...
[ "calcNodeCidrSize", "determines", "the", "size", "of", "the", "subnets", "used", "on", "each", "node", "based", "on", "the", "pod", "subnet", "provided", ".", "For", "IPv4", "we", "assume", "that", "the", "pod", "subnet", "will", "be", "/", "16", "and", ...
train
https://github.com/kubernetes/kubernetes/blob/6a8a3682919652ae668c389ed2f60efb770eed03/cmd/kubeadm/app/phases/controlplane/manifests.go#L241-L262
kubernetes/kubernetes
cmd/kubeadm/app/phases/controlplane/manifests.go
getControllerManagerCommand
func getControllerManagerCommand(cfg *kubeadmapi.ClusterConfiguration, k8sVersion *version.Version) []string { kubeconfigFile := filepath.Join(kubeadmconstants.KubernetesDir, kubeadmconstants.ControllerManagerKubeConfigFileName) caFile := filepath.Join(cfg.CertificatesDir, kubeadmconstants.CACertName) defaultArgum...
go
func getControllerManagerCommand(cfg *kubeadmapi.ClusterConfiguration, k8sVersion *version.Version) []string { kubeconfigFile := filepath.Join(kubeadmconstants.KubernetesDir, kubeadmconstants.ControllerManagerKubeConfigFileName) caFile := filepath.Join(cfg.CertificatesDir, kubeadmconstants.CACertName) defaultArgum...
[ "func", "getControllerManagerCommand", "(", "cfg", "*", "kubeadmapi", ".", "ClusterConfiguration", ",", "k8sVersion", "*", "version", ".", "Version", ")", "[", "]", "string", "{", "kubeconfigFile", ":=", "filepath", ".", "Join", "(", "kubeadmconstants", ".", "Ku...
// getControllerManagerCommand builds the right controller manager command from the given config object and version
[ "getControllerManagerCommand", "builds", "the", "right", "controller", "manager", "command", "from", "the", "given", "config", "object", "and", "version" ]
train
https://github.com/kubernetes/kubernetes/blob/6a8a3682919652ae668c389ed2f60efb770eed03/cmd/kubeadm/app/phases/controlplane/manifests.go#L265-L306
kubernetes/kubernetes
cmd/kubeadm/app/phases/controlplane/manifests.go
getSchedulerCommand
func getSchedulerCommand(cfg *kubeadmapi.ClusterConfiguration) []string { defaultArguments := map[string]string{ "bind-address": "127.0.0.1", "leader-elect": "true", "kubeconfig": filepath.Join(kubeadmconstants.KubernetesDir, kubeadmconstants.SchedulerKubeConfigFileName), } command := []string{"kube-schedul...
go
func getSchedulerCommand(cfg *kubeadmapi.ClusterConfiguration) []string { defaultArguments := map[string]string{ "bind-address": "127.0.0.1", "leader-elect": "true", "kubeconfig": filepath.Join(kubeadmconstants.KubernetesDir, kubeadmconstants.SchedulerKubeConfigFileName), } command := []string{"kube-schedul...
[ "func", "getSchedulerCommand", "(", "cfg", "*", "kubeadmapi", ".", "ClusterConfiguration", ")", "[", "]", "string", "{", "defaultArguments", ":=", "map", "[", "string", "]", "string", "{", "\"", "\"", ":", "\"", "\"", ",", "\"", "\"", ":", "\"", "\"", ...
// getSchedulerCommand builds the right scheduler command from the given config object and version
[ "getSchedulerCommand", "builds", "the", "right", "scheduler", "command", "from", "the", "given", "config", "object", "and", "version" ]
train
https://github.com/kubernetes/kubernetes/blob/6a8a3682919652ae668c389ed2f60efb770eed03/cmd/kubeadm/app/phases/controlplane/manifests.go#L309-L319
kubernetes/kubernetes
cmd/kubeadm/app/phases/controlplane/manifests.go
getProxyEnvVars
func getProxyEnvVars() []v1.EnvVar { envs := []v1.EnvVar{} for _, env := range os.Environ() { pos := strings.Index(env, "=") if pos == -1 { // malformed environment variable, skip it. continue } name := env[:pos] value := env[pos+1:] if strings.HasSuffix(strings.ToLower(name), "_proxy") && value != ...
go
func getProxyEnvVars() []v1.EnvVar { envs := []v1.EnvVar{} for _, env := range os.Environ() { pos := strings.Index(env, "=") if pos == -1 { // malformed environment variable, skip it. continue } name := env[:pos] value := env[pos+1:] if strings.HasSuffix(strings.ToLower(name), "_proxy") && value != ...
[ "func", "getProxyEnvVars", "(", ")", "[", "]", "v1", ".", "EnvVar", "{", "envs", ":=", "[", "]", "v1", ".", "EnvVar", "{", "}", "\n", "for", "_", ",", "env", ":=", "range", "os", ".", "Environ", "(", ")", "{", "pos", ":=", "strings", ".", "Inde...
// getProxyEnvVars builds a list of environment variables to use in the control plane containers in order to use the right proxy
[ "getProxyEnvVars", "builds", "a", "list", "of", "environment", "variables", "to", "use", "in", "the", "control", "plane", "containers", "in", "order", "to", "use", "the", "right", "proxy" ]
train
https://github.com/kubernetes/kubernetes/blob/6a8a3682919652ae668c389ed2f60efb770eed03/cmd/kubeadm/app/phases/controlplane/manifests.go#L322-L338
kubernetes/kubernetes
pkg/controller/nodelifecycle/config/zz_generated.deepcopy.go
DeepCopyInto
func (in *NodeLifecycleControllerConfiguration) DeepCopyInto(out *NodeLifecycleControllerConfiguration) { *out = *in out.NodeStartupGracePeriod = in.NodeStartupGracePeriod out.NodeMonitorGracePeriod = in.NodeMonitorGracePeriod out.PodEvictionTimeout = in.PodEvictionTimeout return }
go
func (in *NodeLifecycleControllerConfiguration) DeepCopyInto(out *NodeLifecycleControllerConfiguration) { *out = *in out.NodeStartupGracePeriod = in.NodeStartupGracePeriod out.NodeMonitorGracePeriod = in.NodeMonitorGracePeriod out.PodEvictionTimeout = in.PodEvictionTimeout return }
[ "func", "(", "in", "*", "NodeLifecycleControllerConfiguration", ")", "DeepCopyInto", "(", "out", "*", "NodeLifecycleControllerConfiguration", ")", "{", "*", "out", "=", "*", "in", "\n", "out", ".", "NodeStartupGracePeriod", "=", "in", ".", "NodeStartupGracePeriod", ...
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
[ "DeepCopyInto", "is", "an", "autogenerated", "deepcopy", "function", "copying", "the", "receiver", "writing", "into", "out", ".", "in", "must", "be", "non", "-", "nil", "." ]
train
https://github.com/kubernetes/kubernetes/blob/6a8a3682919652ae668c389ed2f60efb770eed03/pkg/controller/nodelifecycle/config/zz_generated.deepcopy.go#L24-L30
kubernetes/kubernetes
pkg/controller/nodelifecycle/config/zz_generated.deepcopy.go
DeepCopy
func (in *NodeLifecycleControllerConfiguration) DeepCopy() *NodeLifecycleControllerConfiguration { if in == nil { return nil } out := new(NodeLifecycleControllerConfiguration) in.DeepCopyInto(out) return out }
go
func (in *NodeLifecycleControllerConfiguration) DeepCopy() *NodeLifecycleControllerConfiguration { if in == nil { return nil } out := new(NodeLifecycleControllerConfiguration) in.DeepCopyInto(out) return out }
[ "func", "(", "in", "*", "NodeLifecycleControllerConfiguration", ")", "DeepCopy", "(", ")", "*", "NodeLifecycleControllerConfiguration", "{", "if", "in", "==", "nil", "{", "return", "nil", "\n", "}", "\n", "out", ":=", "new", "(", "NodeLifecycleControllerConfigurat...
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NodeLifecycleControllerConfiguration.
[ "DeepCopy", "is", "an", "autogenerated", "deepcopy", "function", "copying", "the", "receiver", "creating", "a", "new", "NodeLifecycleControllerConfiguration", "." ]
train
https://github.com/kubernetes/kubernetes/blob/6a8a3682919652ae668c389ed2f60efb770eed03/pkg/controller/nodelifecycle/config/zz_generated.deepcopy.go#L33-L40
kubernetes/kubernetes
pkg/api/endpoints/util.go
RepackSubsets
func RepackSubsets(subsets []api.EndpointSubset) []api.EndpointSubset { // First map each unique port definition to the sets of hosts that // offer it. allAddrs := map[addressKey]*api.EndpointAddress{} portToAddrReadyMap := map[api.EndpointPort]addressSet{} for i := range subsets { if len(subsets[i].Ports) == 0 ...
go
func RepackSubsets(subsets []api.EndpointSubset) []api.EndpointSubset { // First map each unique port definition to the sets of hosts that // offer it. allAddrs := map[addressKey]*api.EndpointAddress{} portToAddrReadyMap := map[api.EndpointPort]addressSet{} for i := range subsets { if len(subsets[i].Ports) == 0 ...
[ "func", "RepackSubsets", "(", "subsets", "[", "]", "api", ".", "EndpointSubset", ")", "[", "]", "api", ".", "EndpointSubset", "{", "// First map each unique port definition to the sets of hosts that", "// offer it.", "allAddrs", ":=", "map", "[", "addressKey", "]", "*...
// RepackSubsets takes a slice of EndpointSubset objects, expands it to the full // representation, and then repacks that into the canonical layout. This // ensures that code which operates on these objects can rely on the common // form for things like comparison. The result is a newly allocated slice.
[ "RepackSubsets", "takes", "a", "slice", "of", "EndpointSubset", "objects", "expands", "it", "to", "the", "full", "representation", "and", "then", "repacks", "that", "into", "the", "canonical", "layout", ".", "This", "ensures", "that", "code", "which", "operates"...
train
https://github.com/kubernetes/kubernetes/blob/6a8a3682919652ae668c389ed2f60efb770eed03/pkg/api/endpoints/util.go#L35-L87
kubernetes/kubernetes
pkg/api/endpoints/util.go
mapAddressesByPort
func mapAddressesByPort(subset *api.EndpointSubset, port api.EndpointPort, allAddrs map[addressKey]*api.EndpointAddress, portToAddrReadyMap map[api.EndpointPort]addressSet) { for k := range subset.Addresses { mapAddressByPort(&subset.Addresses[k], port, true, allAddrs, portToAddrReadyMap) } for k := range subset.N...
go
func mapAddressesByPort(subset *api.EndpointSubset, port api.EndpointPort, allAddrs map[addressKey]*api.EndpointAddress, portToAddrReadyMap map[api.EndpointPort]addressSet) { for k := range subset.Addresses { mapAddressByPort(&subset.Addresses[k], port, true, allAddrs, portToAddrReadyMap) } for k := range subset.N...
[ "func", "mapAddressesByPort", "(", "subset", "*", "api", ".", "EndpointSubset", ",", "port", "api", ".", "EndpointPort", ",", "allAddrs", "map", "[", "addressKey", "]", "*", "api", ".", "EndpointAddress", ",", "portToAddrReadyMap", "map", "[", "api", ".", "E...
// mapAddressesByPort adds all ready and not-ready addresses into a map by a single port.
[ "mapAddressesByPort", "adds", "all", "ready", "and", "not", "-", "ready", "addresses", "into", "a", "map", "by", "a", "single", "port", "." ]
train
https://github.com/kubernetes/kubernetes/blob/6a8a3682919652ae668c389ed2f60efb770eed03/pkg/api/endpoints/util.go#L96-L103
kubernetes/kubernetes
staging/src/k8s.io/legacy-cloud-providers/vsphere/vclib/pbm.go
NewPbmClient
func NewPbmClient(ctx context.Context, client *vim25.Client) (*PbmClient, error) { pbmClient, err := pbm.NewClient(ctx, client) if err != nil { klog.Errorf("Failed to create new Pbm Client. err: %+v", err) return nil, err } return &PbmClient{pbmClient}, nil }
go
func NewPbmClient(ctx context.Context, client *vim25.Client) (*PbmClient, error) { pbmClient, err := pbm.NewClient(ctx, client) if err != nil { klog.Errorf("Failed to create new Pbm Client. err: %+v", err) return nil, err } return &PbmClient{pbmClient}, nil }
[ "func", "NewPbmClient", "(", "ctx", "context", ".", "Context", ",", "client", "*", "vim25", ".", "Client", ")", "(", "*", "PbmClient", ",", "error", ")", "{", "pbmClient", ",", "err", ":=", "pbm", ".", "NewClient", "(", "ctx", ",", "client", ")", "\n...
// NewPbmClient returns a new PBM Client object
[ "NewPbmClient", "returns", "a", "new", "PBM", "Client", "object" ]
train
https://github.com/kubernetes/kubernetes/blob/6a8a3682919652ae668c389ed2f60efb770eed03/staging/src/k8s.io/legacy-cloud-providers/vsphere/vclib/pbm.go#L36-L43
kubernetes/kubernetes
staging/src/k8s.io/legacy-cloud-providers/vsphere/vclib/pbm.go
IsDatastoreCompatible
func (pbmClient *PbmClient) IsDatastoreCompatible(ctx context.Context, storagePolicyID string, datastore *Datastore) (bool, string, error) { faultMessage := "" placementHub := pbmtypes.PbmPlacementHub{ HubType: datastore.Reference().Type, HubId: datastore.Reference().Value, } hubs := []pbmtypes.PbmPlacementHu...
go
func (pbmClient *PbmClient) IsDatastoreCompatible(ctx context.Context, storagePolicyID string, datastore *Datastore) (bool, string, error) { faultMessage := "" placementHub := pbmtypes.PbmPlacementHub{ HubType: datastore.Reference().Type, HubId: datastore.Reference().Value, } hubs := []pbmtypes.PbmPlacementHu...
[ "func", "(", "pbmClient", "*", "PbmClient", ")", "IsDatastoreCompatible", "(", "ctx", "context", ".", "Context", ",", "storagePolicyID", "string", ",", "datastore", "*", "Datastore", ")", "(", "bool", ",", "string", ",", "error", ")", "{", "faultMessage", ":...
// IsDatastoreCompatible check if the datastores is compatible for given storage policy id // if datastore is not compatible with policy, fault message with the Datastore Name is returned
[ "IsDatastoreCompatible", "check", "if", "the", "datastores", "is", "compatible", "for", "given", "storage", "policy", "id", "if", "datastore", "is", "not", "compatible", "with", "policy", "fault", "message", "with", "the", "Datastore", "Name", "is", "returned" ]
train
https://github.com/kubernetes/kubernetes/blob/6a8a3682919652ae668c389ed2f60efb770eed03/staging/src/k8s.io/legacy-cloud-providers/vsphere/vclib/pbm.go#L47-L84
kubernetes/kubernetes
staging/src/k8s.io/legacy-cloud-providers/vsphere/vclib/pbm.go
GetCompatibleDatastores
func (pbmClient *PbmClient) GetCompatibleDatastores(ctx context.Context, dc *Datacenter, storagePolicyID string, datastores []*DatastoreInfo) ([]*DatastoreInfo, string, error) { var ( dsMorNameMap = getDsMorNameMap(ctx, datastores) localizedMessagesForNotCompatibleDatastores = "" ) ...
go
func (pbmClient *PbmClient) GetCompatibleDatastores(ctx context.Context, dc *Datacenter, storagePolicyID string, datastores []*DatastoreInfo) ([]*DatastoreInfo, string, error) { var ( dsMorNameMap = getDsMorNameMap(ctx, datastores) localizedMessagesForNotCompatibleDatastores = "" ) ...
[ "func", "(", "pbmClient", "*", "PbmClient", ")", "GetCompatibleDatastores", "(", "ctx", "context", ".", "Context", ",", "dc", "*", "Datacenter", ",", "storagePolicyID", "string", ",", "datastores", "[", "]", "*", "DatastoreInfo", ")", "(", "[", "]", "*", "...
// GetCompatibleDatastores filters and returns compatible list of datastores for given storage policy id // For Non Compatible Datastores, fault message with the Datastore Name is also returned
[ "GetCompatibleDatastores", "filters", "and", "returns", "compatible", "list", "of", "datastores", "for", "given", "storage", "policy", "id", "For", "Non", "Compatible", "Datastores", "fault", "message", "with", "the", "Datastore", "Name", "is", "also", "returned" ]
train
https://github.com/kubernetes/kubernetes/blob/6a8a3682919652ae668c389ed2f60efb770eed03/staging/src/k8s.io/legacy-cloud-providers/vsphere/vclib/pbm.go#L88-L121
kubernetes/kubernetes
staging/src/k8s.io/legacy-cloud-providers/vsphere/vclib/pbm.go
GetPlacementCompatibilityResult
func (pbmClient *PbmClient) GetPlacementCompatibilityResult(ctx context.Context, storagePolicyID string, datastore []*DatastoreInfo) (pbm.PlacementCompatibilityResult, error) { var hubs []pbmtypes.PbmPlacementHub for _, ds := range datastore { hubs = append(hubs, pbmtypes.PbmPlacementHub{ HubType: ds.Reference()...
go
func (pbmClient *PbmClient) GetPlacementCompatibilityResult(ctx context.Context, storagePolicyID string, datastore []*DatastoreInfo) (pbm.PlacementCompatibilityResult, error) { var hubs []pbmtypes.PbmPlacementHub for _, ds := range datastore { hubs = append(hubs, pbmtypes.PbmPlacementHub{ HubType: ds.Reference()...
[ "func", "(", "pbmClient", "*", "PbmClient", ")", "GetPlacementCompatibilityResult", "(", "ctx", "context", ".", "Context", ",", "storagePolicyID", "string", ",", "datastore", "[", "]", "*", "DatastoreInfo", ")", "(", "pbm", ".", "PlacementCompatibilityResult", ","...
// GetPlacementCompatibilityResult gets placement compatibility result based on storage policy requirements.
[ "GetPlacementCompatibilityResult", "gets", "placement", "compatibility", "result", "based", "on", "storage", "policy", "requirements", "." ]
train
https://github.com/kubernetes/kubernetes/blob/6a8a3682919652ae668c389ed2f60efb770eed03/staging/src/k8s.io/legacy-cloud-providers/vsphere/vclib/pbm.go#L124-L145
kubernetes/kubernetes
staging/src/k8s.io/legacy-cloud-providers/vsphere/vclib/pbm.go
getDatastoreFromPlacementHub
func getDatastoreFromPlacementHub(datastore []*DatastoreInfo, pbmPlacementHub pbmtypes.PbmPlacementHub) *DatastoreInfo { for _, ds := range datastore { if ds.Reference().Type == pbmPlacementHub.HubType && ds.Reference().Value == pbmPlacementHub.HubId { return ds } } return nil }
go
func getDatastoreFromPlacementHub(datastore []*DatastoreInfo, pbmPlacementHub pbmtypes.PbmPlacementHub) *DatastoreInfo { for _, ds := range datastore { if ds.Reference().Type == pbmPlacementHub.HubType && ds.Reference().Value == pbmPlacementHub.HubId { return ds } } return nil }
[ "func", "getDatastoreFromPlacementHub", "(", "datastore", "[", "]", "*", "DatastoreInfo", ",", "pbmPlacementHub", "pbmtypes", ".", "PbmPlacementHub", ")", "*", "DatastoreInfo", "{", "for", "_", ",", "ds", ":=", "range", "datastore", "{", "if", "ds", ".", "Refe...
// getDataStoreForPlacementHub returns matching datastore associated with given pbmPlacementHub
[ "getDataStoreForPlacementHub", "returns", "matching", "datastore", "associated", "with", "given", "pbmPlacementHub" ]
train
https://github.com/kubernetes/kubernetes/blob/6a8a3682919652ae668c389ed2f60efb770eed03/staging/src/k8s.io/legacy-cloud-providers/vsphere/vclib/pbm.go#L148-L155
kubernetes/kubernetes
staging/src/k8s.io/legacy-cloud-providers/vsphere/vclib/pbm.go
getDsMorNameMap
func getDsMorNameMap(ctx context.Context, datastores []*DatastoreInfo) map[string]string { dsMorNameMap := make(map[string]string) for _, ds := range datastores { dsObjectName, err := ds.ObjectName(ctx) if err == nil { dsMorNameMap[ds.Reference().Value] = dsObjectName } else { klog.Errorf("Error occurred ...
go
func getDsMorNameMap(ctx context.Context, datastores []*DatastoreInfo) map[string]string { dsMorNameMap := make(map[string]string) for _, ds := range datastores { dsObjectName, err := ds.ObjectName(ctx) if err == nil { dsMorNameMap[ds.Reference().Value] = dsObjectName } else { klog.Errorf("Error occurred ...
[ "func", "getDsMorNameMap", "(", "ctx", "context", ".", "Context", ",", "datastores", "[", "]", "*", "DatastoreInfo", ")", "map", "[", "string", "]", "string", "{", "dsMorNameMap", ":=", "make", "(", "map", "[", "string", "]", "string", ")", "\n", "for", ...
// getDsMorNameMap returns map of ds Mor and Datastore Object Name
[ "getDsMorNameMap", "returns", "map", "of", "ds", "Mor", "and", "Datastore", "Object", "Name" ]
train
https://github.com/kubernetes/kubernetes/blob/6a8a3682919652ae668c389ed2f60efb770eed03/staging/src/k8s.io/legacy-cloud-providers/vsphere/vclib/pbm.go#L158-L169
kubernetes/kubernetes
pkg/kubelet/kuberuntime/helpers_windows.go
milliCPUToShares
func milliCPUToShares(milliCPU int64, hyperv bool) int64 { var minShares int64 = minSharesProcess if hyperv { minShares = minSharesHyperV } if milliCPU == 0 { // Return here to really match kernel default for zero milliCPU. return minShares } // Conceptually (milliCPU / milliCPUToCPU) * sharesPerCPU, but ...
go
func milliCPUToShares(milliCPU int64, hyperv bool) int64 { var minShares int64 = minSharesProcess if hyperv { minShares = minSharesHyperV } if milliCPU == 0 { // Return here to really match kernel default for zero milliCPU. return minShares } // Conceptually (milliCPU / milliCPUToCPU) * sharesPerCPU, but ...
[ "func", "milliCPUToShares", "(", "milliCPU", "int64", ",", "hyperv", "bool", ")", "int64", "{", "var", "minShares", "int64", "=", "minSharesProcess", "\n", "if", "hyperv", "{", "minShares", "=", "minSharesHyperV", "\n", "}", "\n\n", "if", "milliCPU", "==", "...
// milliCPUToShares converts milliCPU to CPU shares
[ "milliCPUToShares", "converts", "milliCPU", "to", "CPU", "shares" ]
train
https://github.com/kubernetes/kubernetes/blob/6a8a3682919652ae668c389ed2f60efb770eed03/pkg/kubelet/kuberuntime/helpers_windows.go#L34-L55
kubernetes/kubernetes
pkg/kubelet/cm/cpumanager/cpu_assignment.go
isSocketFree
func (a *cpuAccumulator) isSocketFree(socketID int) bool { return a.details.CPUsInSocket(socketID).Size() == a.topo.CPUsPerSocket() }
go
func (a *cpuAccumulator) isSocketFree(socketID int) bool { return a.details.CPUsInSocket(socketID).Size() == a.topo.CPUsPerSocket() }
[ "func", "(", "a", "*", "cpuAccumulator", ")", "isSocketFree", "(", "socketID", "int", ")", "bool", "{", "return", "a", ".", "details", ".", "CPUsInSocket", "(", "socketID", ")", ".", "Size", "(", ")", "==", "a", ".", "topo", ".", "CPUsPerSocket", "(", ...
// Returns true if the supplied socket is fully available in `topoDetails`.
[ "Returns", "true", "if", "the", "supplied", "socket", "is", "fully", "available", "in", "topoDetails", "." ]
train
https://github.com/kubernetes/kubernetes/blob/6a8a3682919652ae668c389ed2f60efb770eed03/pkg/kubelet/cm/cpumanager/cpu_assignment.go#L52-L54
kubernetes/kubernetes
pkg/kubelet/cm/cpumanager/cpu_assignment.go
isCoreFree
func (a *cpuAccumulator) isCoreFree(coreID int) bool { return a.details.CPUsInCore(coreID).Size() == a.topo.CPUsPerCore() }
go
func (a *cpuAccumulator) isCoreFree(coreID int) bool { return a.details.CPUsInCore(coreID).Size() == a.topo.CPUsPerCore() }
[ "func", "(", "a", "*", "cpuAccumulator", ")", "isCoreFree", "(", "coreID", "int", ")", "bool", "{", "return", "a", ".", "details", ".", "CPUsInCore", "(", "coreID", ")", ".", "Size", "(", ")", "==", "a", ".", "topo", ".", "CPUsPerCore", "(", ")", "...
// Returns true if the supplied core is fully available in `topoDetails`.
[ "Returns", "true", "if", "the", "supplied", "core", "is", "fully", "available", "in", "topoDetails", "." ]
train
https://github.com/kubernetes/kubernetes/blob/6a8a3682919652ae668c389ed2f60efb770eed03/pkg/kubelet/cm/cpumanager/cpu_assignment.go#L57-L59
kubernetes/kubernetes
pkg/kubelet/cm/cpumanager/cpu_assignment.go
freeSockets
func (a *cpuAccumulator) freeSockets() []int { return a.details.Sockets().Filter(a.isSocketFree).ToSlice() }
go
func (a *cpuAccumulator) freeSockets() []int { return a.details.Sockets().Filter(a.isSocketFree).ToSlice() }
[ "func", "(", "a", "*", "cpuAccumulator", ")", "freeSockets", "(", ")", "[", "]", "int", "{", "return", "a", ".", "details", ".", "Sockets", "(", ")", ".", "Filter", "(", "a", ".", "isSocketFree", ")", ".", "ToSlice", "(", ")", "\n", "}" ]
// Returns free socket IDs as a slice sorted by: // - socket ID, ascending.
[ "Returns", "free", "socket", "IDs", "as", "a", "slice", "sorted", "by", ":", "-", "socket", "ID", "ascending", "." ]
train
https://github.com/kubernetes/kubernetes/blob/6a8a3682919652ae668c389ed2f60efb770eed03/pkg/kubelet/cm/cpumanager/cpu_assignment.go#L63-L65
kubernetes/kubernetes
pkg/kubelet/cm/cpumanager/cpu_assignment.go
freeCores
func (a *cpuAccumulator) freeCores() []int { socketIDs := a.details.Sockets().ToSlice() sort.Slice(socketIDs, func(i, j int) bool { iCores := a.details.CoresInSocket(socketIDs[i]).Filter(a.isCoreFree) jCores := a.details.CoresInSocket(socketIDs[j]).Filter(a.isCoreFree) return iCores.Size() < jCores.Size() ...
go
func (a *cpuAccumulator) freeCores() []int { socketIDs := a.details.Sockets().ToSlice() sort.Slice(socketIDs, func(i, j int) bool { iCores := a.details.CoresInSocket(socketIDs[i]).Filter(a.isCoreFree) jCores := a.details.CoresInSocket(socketIDs[j]).Filter(a.isCoreFree) return iCores.Size() < jCores.Size() ...
[ "func", "(", "a", "*", "cpuAccumulator", ")", "freeCores", "(", ")", "[", "]", "int", "{", "socketIDs", ":=", "a", ".", "details", ".", "Sockets", "(", ")", ".", "ToSlice", "(", ")", "\n", "sort", ".", "Slice", "(", "socketIDs", ",", "func", "(", ...
// Returns core IDs as a slice sorted by: // - the number of whole available cores on the socket, ascending // - socket ID, ascending // - core ID, ascending
[ "Returns", "core", "IDs", "as", "a", "slice", "sorted", "by", ":", "-", "the", "number", "of", "whole", "available", "cores", "on", "the", "socket", "ascending", "-", "socket", "ID", "ascending", "-", "core", "ID", "ascending" ]
train
https://github.com/kubernetes/kubernetes/blob/6a8a3682919652ae668c389ed2f60efb770eed03/pkg/kubelet/cm/cpumanager/cpu_assignment.go#L71-L85
kubernetes/kubernetes
pkg/kubelet/cm/cpumanager/cpu_assignment.go
freeCPUs
func (a *cpuAccumulator) freeCPUs() []int { result := []int{} cores := a.details.Cores().ToSlice() sort.Slice( cores, func(i, j int) bool { iCore := cores[i] jCore := cores[j] iCPUs := a.topo.CPUDetails.CPUsInCore(iCore).ToSlice() jCPUs := a.topo.CPUDetails.CPUsInCore(jCore).ToSlice() iSocket :...
go
func (a *cpuAccumulator) freeCPUs() []int { result := []int{} cores := a.details.Cores().ToSlice() sort.Slice( cores, func(i, j int) bool { iCore := cores[i] jCore := cores[j] iCPUs := a.topo.CPUDetails.CPUsInCore(iCore).ToSlice() jCPUs := a.topo.CPUDetails.CPUsInCore(jCore).ToSlice() iSocket :...
[ "func", "(", "a", "*", "cpuAccumulator", ")", "freeCPUs", "(", ")", "[", "]", "int", "{", "result", ":=", "[", "]", "int", "{", "}", "\n", "cores", ":=", "a", ".", "details", ".", "Cores", "(", ")", ".", "ToSlice", "(", ")", "\n\n", "sort", "."...
// Returns CPU IDs as a slice sorted by: // - socket affinity with result // - number of CPUs available on the same socket // - number of CPUs available on the same core // - socket ID. // - core ID.
[ "Returns", "CPU", "IDs", "as", "a", "slice", "sorted", "by", ":", "-", "socket", "affinity", "with", "result", "-", "number", "of", "CPUs", "available", "on", "the", "same", "socket", "-", "number", "of", "CPUs", "available", "on", "the", "same", "core",...
train
https://github.com/kubernetes/kubernetes/blob/6a8a3682919652ae668c389ed2f60efb770eed03/pkg/kubelet/cm/cpumanager/cpu_assignment.go#L93-L135
kubernetes/kubernetes
pkg/kubelet/util/pluginwatcher/plugin_watcher.go
NewWatcher
func NewWatcher(sockDir string, deprecatedSockDir string) *Watcher { return &Watcher{ path: sockDir, deprecatedPath: deprecatedSockDir, fs: &utilfs.DefaultFs{}, handlers: make(map[string]PluginHandler), plugins: make(map[string]pathInfo), pluginsPool: make(map[string]map[strin...
go
func NewWatcher(sockDir string, deprecatedSockDir string) *Watcher { return &Watcher{ path: sockDir, deprecatedPath: deprecatedSockDir, fs: &utilfs.DefaultFs{}, handlers: make(map[string]PluginHandler), plugins: make(map[string]pathInfo), pluginsPool: make(map[string]map[strin...
[ "func", "NewWatcher", "(", "sockDir", "string", ",", "deprecatedSockDir", "string", ")", "*", "Watcher", "{", "return", "&", "Watcher", "{", "path", ":", "sockDir", ",", "deprecatedPath", ":", "deprecatedSockDir", ",", "fs", ":", "&", "utilfs", ".", "Default...
// NewWatcher provides a new watcher // deprecatedSockDir refers to a pre-GA directory that was used by older plugins // for socket registration. New plugins should not use this directory.
[ "NewWatcher", "provides", "a", "new", "watcher", "deprecatedSockDir", "refers", "to", "a", "pre", "-", "GA", "directory", "that", "was", "used", "by", "older", "plugins", "for", "socket", "registration", ".", "New", "plugins", "should", "not", "use", "this", ...
train
https://github.com/kubernetes/kubernetes/blob/6a8a3682919652ae668c389ed2f60efb770eed03/pkg/kubelet/util/pluginwatcher/plugin_watcher.go#L61-L71
kubernetes/kubernetes
pkg/kubelet/util/pluginwatcher/plugin_watcher.go
Start
func (w *Watcher) Start() error { klog.V(2).Infof("Plugin Watcher Start at %s", w.path) w.stopCh = make(chan interface{}) // Creating the directory to be watched if it doesn't exist yet, // and walks through the directory to discover the existing plugins. if err := w.init(); err != nil { return err } fsWatch...
go
func (w *Watcher) Start() error { klog.V(2).Infof("Plugin Watcher Start at %s", w.path) w.stopCh = make(chan interface{}) // Creating the directory to be watched if it doesn't exist yet, // and walks through the directory to discover the existing plugins. if err := w.init(); err != nil { return err } fsWatch...
[ "func", "(", "w", "*", "Watcher", ")", "Start", "(", ")", "error", "{", "klog", ".", "V", "(", "2", ")", ".", "Infof", "(", "\"", "\"", ",", "w", ".", "path", ")", "\n", "w", ".", "stopCh", "=", "make", "(", "chan", "interface", "{", "}", "...
// Start watches for the creation of plugin sockets at the path
[ "Start", "watches", "for", "the", "creation", "of", "plugin", "sockets", "at", "the", "path" ]
train
https://github.com/kubernetes/kubernetes/blob/6a8a3682919652ae668c389ed2f60efb770eed03/pkg/kubelet/util/pluginwatcher/plugin_watcher.go#L89-L151
kubernetes/kubernetes
pkg/kubelet/util/pluginwatcher/plugin_watcher.go
Stop
func (w *Watcher) Stop() error { close(w.stopCh) c := make(chan struct{}) go func() { defer close(c) w.wg.Wait() }() select { case <-c: case <-time.After(11 * time.Second): return fmt.Errorf("timeout on stopping watcher") } w.fsWatcher.Close() return nil }
go
func (w *Watcher) Stop() error { close(w.stopCh) c := make(chan struct{}) go func() { defer close(c) w.wg.Wait() }() select { case <-c: case <-time.After(11 * time.Second): return fmt.Errorf("timeout on stopping watcher") } w.fsWatcher.Close() return nil }
[ "func", "(", "w", "*", "Watcher", ")", "Stop", "(", ")", "error", "{", "close", "(", "w", ".", "stopCh", ")", "\n\n", "c", ":=", "make", "(", "chan", "struct", "{", "}", ")", "\n", "go", "func", "(", ")", "{", "defer", "close", "(", "c", ")",...
// Stop stops probing the creation of plugin sockets at the path
[ "Stop", "stops", "probing", "the", "creation", "of", "plugin", "sockets", "at", "the", "path" ]
train
https://github.com/kubernetes/kubernetes/blob/6a8a3682919652ae668c389ed2f60efb770eed03/pkg/kubelet/util/pluginwatcher/plugin_watcher.go#L154-L172
kubernetes/kubernetes
pkg/kubelet/util/pluginwatcher/plugin_watcher.go
traversePluginDir
func (w *Watcher) traversePluginDir(dir string) error { return w.fs.Walk(dir, func(path string, info os.FileInfo, err error) error { if err != nil { if path == dir { return fmt.Errorf("error accessing path: %s error: %v", path, err) } klog.Errorf("error accessing path: %s error: %v", path, err) retu...
go
func (w *Watcher) traversePluginDir(dir string) error { return w.fs.Walk(dir, func(path string, info os.FileInfo, err error) error { if err != nil { if path == dir { return fmt.Errorf("error accessing path: %s error: %v", path, err) } klog.Errorf("error accessing path: %s error: %v", path, err) retu...
[ "func", "(", "w", "*", "Watcher", ")", "traversePluginDir", "(", "dir", "string", ")", "error", "{", "return", "w", ".", "fs", ".", "Walk", "(", "dir", ",", "func", "(", "path", "string", ",", "info", "os", ".", "FileInfo", ",", "err", "error", ")"...
// Walks through the plugin directory discover any existing plugin sockets. // Goroutines started here will be waited for in Stop() before cleaning up. // Ignore all errors except root dir not being walkable
[ "Walks", "through", "the", "plugin", "directory", "discover", "any", "existing", "plugin", "sockets", ".", "Goroutines", "started", "here", "will", "be", "waited", "for", "in", "Stop", "()", "before", "cleaning", "up", ".", "Ignore", "all", "errors", "except",...
train
https://github.com/kubernetes/kubernetes/blob/6a8a3682919652ae668c389ed2f60efb770eed03/pkg/kubelet/util/pluginwatcher/plugin_watcher.go#L187-L222
kubernetes/kubernetes
pkg/kubelet/util/pluginwatcher/plugin_watcher.go
handleCreateEvent
func (w *Watcher) handleCreateEvent(event fsnotify.Event) error { klog.V(6).Infof("Handling create event: %v", event) if w.containsBlacklistedDir(event.Name) { return nil } fi, err := os.Stat(event.Name) if err != nil { return fmt.Errorf("stat file %s failed: %v", event.Name, err) } if strings.HasPrefix(f...
go
func (w *Watcher) handleCreateEvent(event fsnotify.Event) error { klog.V(6).Infof("Handling create event: %v", event) if w.containsBlacklistedDir(event.Name) { return nil } fi, err := os.Stat(event.Name) if err != nil { return fmt.Errorf("stat file %s failed: %v", event.Name, err) } if strings.HasPrefix(f...
[ "func", "(", "w", "*", "Watcher", ")", "handleCreateEvent", "(", "event", "fsnotify", ".", "Event", ")", "error", "{", "klog", ".", "V", "(", "6", ")", ".", "Infof", "(", "\"", "\"", ",", "event", ")", "\n\n", "if", "w", ".", "containsBlacklistedDir"...
// Handle filesystem notify event. // Files names: // - MUST NOT start with a '.'
[ "Handle", "filesystem", "notify", "event", ".", "Files", "names", ":", "-", "MUST", "NOT", "start", "with", "a", "." ]
train
https://github.com/kubernetes/kubernetes/blob/6a8a3682919652ae668c389ed2f60efb770eed03/pkg/kubelet/util/pluginwatcher/plugin_watcher.go#L227-L254
kubernetes/kubernetes
pkg/kubelet/util/pluginwatcher/plugin_watcher.go
dial
func dial(unixSocketPath string, timeout time.Duration) (registerapi.RegistrationClient, *grpc.ClientConn, error) { ctx, cancel := context.WithTimeout(context.Background(), timeout) defer cancel() c, err := grpc.DialContext(ctx, unixSocketPath, grpc.WithInsecure(), grpc.WithBlock(), grpc.WithDialer(func(addr stri...
go
func dial(unixSocketPath string, timeout time.Duration) (registerapi.RegistrationClient, *grpc.ClientConn, error) { ctx, cancel := context.WithTimeout(context.Background(), timeout) defer cancel() c, err := grpc.DialContext(ctx, unixSocketPath, grpc.WithInsecure(), grpc.WithBlock(), grpc.WithDialer(func(addr stri...
[ "func", "dial", "(", "unixSocketPath", "string", ",", "timeout", "time", ".", "Duration", ")", "(", "registerapi", ".", "RegistrationClient", ",", "*", "grpc", ".", "ClientConn", ",", "error", ")", "{", "ctx", ",", "cancel", ":=", "context", ".", "WithTime...
// Dial establishes the gRPC communication with the picked up plugin socket. https://godoc.org/google.golang.org/grpc#Dial
[ "Dial", "establishes", "the", "gRPC", "communication", "with", "the", "picked", "up", "plugin", "socket", ".", "https", ":", "//", "godoc", ".", "org", "/", "google", ".", "golang", ".", "org", "/", "grpc#Dial" ]
train
https://github.com/kubernetes/kubernetes/blob/6a8a3682919652ae668c389ed2f60efb770eed03/pkg/kubelet/util/pluginwatcher/plugin_watcher.go#L421-L436
kubernetes/kubernetes
pkg/kubelet/util/pluginwatcher/plugin_watcher.go
containsBlacklistedDir
func (w *Watcher) containsBlacklistedDir(path string) bool { return strings.HasPrefix(path, w.deprecatedPath+"/kubernetes.io/") || path == w.deprecatedPath+"/kubernetes.io" }
go
func (w *Watcher) containsBlacklistedDir(path string) bool { return strings.HasPrefix(path, w.deprecatedPath+"/kubernetes.io/") || path == w.deprecatedPath+"/kubernetes.io" }
[ "func", "(", "w", "*", "Watcher", ")", "containsBlacklistedDir", "(", "path", "string", ")", "bool", "{", "return", "strings", ".", "HasPrefix", "(", "path", ",", "w", ".", "deprecatedPath", "+", "\"", "\"", ")", "||", "path", "==", "w", ".", "deprecat...
// While deprecated dir is supported, to add extra protection around #69015 // we will explicitly blacklist kubernetes.io directory.
[ "While", "deprecated", "dir", "is", "supported", "to", "add", "extra", "protection", "around", "#69015", "we", "will", "explicitly", "blacklist", "kubernetes", ".", "io", "directory", "." ]
train
https://github.com/kubernetes/kubernetes/blob/6a8a3682919652ae668c389ed2f60efb770eed03/pkg/kubelet/util/pluginwatcher/plugin_watcher.go#L440-L443
kubernetes/kubernetes
staging/src/k8s.io/code-generator/cmd/register-gen/args/args.go
NewDefaults
func NewDefaults() *args.GeneratorArgs { genericArgs := args.Default().WithoutDefaultFlagParsing() genericArgs.OutputFileBaseName = "zz_generated.register" return genericArgs }
go
func NewDefaults() *args.GeneratorArgs { genericArgs := args.Default().WithoutDefaultFlagParsing() genericArgs.OutputFileBaseName = "zz_generated.register" return genericArgs }
[ "func", "NewDefaults", "(", ")", "*", "args", ".", "GeneratorArgs", "{", "genericArgs", ":=", "args", ".", "Default", "(", ")", ".", "WithoutDefaultFlagParsing", "(", ")", "\n", "genericArgs", ".", "OutputFileBaseName", "=", "\"", "\"", "\n", "return", "gene...
// NewDefaults returns default arguments for the generator.
[ "NewDefaults", "returns", "default", "arguments", "for", "the", "generator", "." ]
train
https://github.com/kubernetes/kubernetes/blob/6a8a3682919652ae668c389ed2f60efb770eed03/staging/src/k8s.io/code-generator/cmd/register-gen/args/args.go#L26-L30
kubernetes/kubernetes
pkg/kubelet/apis/well_known_labels.go
IsKubeletLabel
func IsKubeletLabel(key string) bool { if kubeletLabels.Has(key) { return true } namespace := getLabelNamespace(key) for allowedNamespace := range kubeletLabelNamespaces { if namespace == allowedNamespace || strings.HasSuffix(namespace, "."+allowedNamespace) { return true } } return false }
go
func IsKubeletLabel(key string) bool { if kubeletLabels.Has(key) { return true } namespace := getLabelNamespace(key) for allowedNamespace := range kubeletLabelNamespaces { if namespace == allowedNamespace || strings.HasSuffix(namespace, "."+allowedNamespace) { return true } } return false }
[ "func", "IsKubeletLabel", "(", "key", "string", ")", "bool", "{", "if", "kubeletLabels", ".", "Has", "(", "key", ")", "{", "return", "true", "\n", "}", "\n\n", "namespace", ":=", "getLabelNamespace", "(", "key", ")", "\n", "for", "allowedNamespace", ":=", ...
// IsKubeletLabel returns true if the label key is one that kubelets are allowed to set on their own Node object. // This checks if the key is in the KubeletLabels() list, or has a namespace in the KubeletLabelNamespaces() list.
[ "IsKubeletLabel", "returns", "true", "if", "the", "label", "key", "is", "one", "that", "kubelets", "are", "allowed", "to", "set", "on", "their", "own", "Node", "object", ".", "This", "checks", "if", "the", "key", "is", "in", "the", "KubeletLabels", "()", ...
train
https://github.com/kubernetes/kubernetes/blob/6a8a3682919652ae668c389ed2f60efb770eed03/pkg/kubelet/apis/well_known_labels.go#L78-L91
kubernetes/kubernetes
staging/src/k8s.io/client-go/kubernetes/typed/autoscaling/v2beta1/horizontalpodautoscaler.go
Get
func (c *horizontalPodAutoscalers) Get(name string, options v1.GetOptions) (result *v2beta1.HorizontalPodAutoscaler, err error) { result = &v2beta1.HorizontalPodAutoscaler{} err = c.client.Get(). Namespace(c.ns). Resource("horizontalpodautoscalers"). Name(name). VersionedParams(&options, scheme.ParameterCodec...
go
func (c *horizontalPodAutoscalers) Get(name string, options v1.GetOptions) (result *v2beta1.HorizontalPodAutoscaler, err error) { result = &v2beta1.HorizontalPodAutoscaler{} err = c.client.Get(). Namespace(c.ns). Resource("horizontalpodautoscalers"). Name(name). VersionedParams(&options, scheme.ParameterCodec...
[ "func", "(", "c", "*", "horizontalPodAutoscalers", ")", "Get", "(", "name", "string", ",", "options", "v1", ".", "GetOptions", ")", "(", "result", "*", "v2beta1", ".", "HorizontalPodAutoscaler", ",", "err", "error", ")", "{", "result", "=", "&", "v2beta1",...
// Get takes name of the horizontalPodAutoscaler, and returns the corresponding horizontalPodAutoscaler object, and an error if there is any.
[ "Get", "takes", "name", "of", "the", "horizontalPodAutoscaler", "and", "returns", "the", "corresponding", "horizontalPodAutoscaler", "object", "and", "an", "error", "if", "there", "is", "any", "." ]
train
https://github.com/kubernetes/kubernetes/blob/6a8a3682919652ae668c389ed2f60efb770eed03/staging/src/k8s.io/client-go/kubernetes/typed/autoscaling/v2beta1/horizontalpodautoscaler.go#L67-L77
kubernetes/kubernetes
staging/src/k8s.io/client-go/kubernetes/typed/autoscaling/v2beta1/horizontalpodautoscaler.go
Create
func (c *horizontalPodAutoscalers) Create(horizontalPodAutoscaler *v2beta1.HorizontalPodAutoscaler) (result *v2beta1.HorizontalPodAutoscaler, err error) { result = &v2beta1.HorizontalPodAutoscaler{} err = c.client.Post(). Namespace(c.ns). Resource("horizontalpodautoscalers"). Body(horizontalPodAutoscaler). Do...
go
func (c *horizontalPodAutoscalers) Create(horizontalPodAutoscaler *v2beta1.HorizontalPodAutoscaler) (result *v2beta1.HorizontalPodAutoscaler, err error) { result = &v2beta1.HorizontalPodAutoscaler{} err = c.client.Post(). Namespace(c.ns). Resource("horizontalpodautoscalers"). Body(horizontalPodAutoscaler). Do...
[ "func", "(", "c", "*", "horizontalPodAutoscalers", ")", "Create", "(", "horizontalPodAutoscaler", "*", "v2beta1", ".", "HorizontalPodAutoscaler", ")", "(", "result", "*", "v2beta1", ".", "HorizontalPodAutoscaler", ",", "err", "error", ")", "{", "result", "=", "&...
// Create takes the representation of a horizontalPodAutoscaler and creates it. Returns the server's representation of the horizontalPodAutoscaler, and an error, if there is any.
[ "Create", "takes", "the", "representation", "of", "a", "horizontalPodAutoscaler", "and", "creates", "it", ".", "Returns", "the", "server", "s", "representation", "of", "the", "horizontalPodAutoscaler", "and", "an", "error", "if", "there", "is", "any", "." ]
train
https://github.com/kubernetes/kubernetes/blob/6a8a3682919652ae668c389ed2f60efb770eed03/staging/src/k8s.io/client-go/kubernetes/typed/autoscaling/v2beta1/horizontalpodautoscaler.go#L112-L121
kubernetes/kubernetes
staging/src/k8s.io/client-go/kubernetes/typed/autoscaling/v2beta1/horizontalpodautoscaler.go
Patch
func (c *horizontalPodAutoscalers) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v2beta1.HorizontalPodAutoscaler, err error) { result = &v2beta1.HorizontalPodAutoscaler{} err = c.client.Patch(pt). Namespace(c.ns). Resource("horizontalpodautoscalers"). SubResource(subresour...
go
func (c *horizontalPodAutoscalers) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v2beta1.HorizontalPodAutoscaler, err error) { result = &v2beta1.HorizontalPodAutoscaler{} err = c.client.Patch(pt). Namespace(c.ns). Resource("horizontalpodautoscalers"). SubResource(subresour...
[ "func", "(", "c", "*", "horizontalPodAutoscalers", ")", "Patch", "(", "name", "string", ",", "pt", "types", ".", "PatchType", ",", "data", "[", "]", "byte", ",", "subresources", "...", "string", ")", "(", "result", "*", "v2beta1", ".", "HorizontalPodAutosc...
// Patch applies the patch and returns the patched horizontalPodAutoscaler.
[ "Patch", "applies", "the", "patch", "and", "returns", "the", "patched", "horizontalPodAutoscaler", "." ]
train
https://github.com/kubernetes/kubernetes/blob/6a8a3682919652ae668c389ed2f60efb770eed03/staging/src/k8s.io/client-go/kubernetes/typed/autoscaling/v2beta1/horizontalpodautoscaler.go#L180-L191
kubernetes/kubernetes
staging/src/k8s.io/legacy-cloud-providers/vsphere/nodemanager.go
GetNodeInfo
func (nm *NodeManager) GetNodeInfo(nodeName k8stypes.NodeName) (NodeInfo, error) { getNodeInfo := func(nodeName k8stypes.NodeName) *NodeInfo { nm.nodeInfoLock.RLock() nodeInfo := nm.nodeInfoMap[convertToString(nodeName)] nm.nodeInfoLock.RUnlock() return nodeInfo } nodeInfo := getNodeInfo(nodeName) var err e...
go
func (nm *NodeManager) GetNodeInfo(nodeName k8stypes.NodeName) (NodeInfo, error) { getNodeInfo := func(nodeName k8stypes.NodeName) *NodeInfo { nm.nodeInfoLock.RLock() nodeInfo := nm.nodeInfoMap[convertToString(nodeName)] nm.nodeInfoLock.RUnlock() return nodeInfo } nodeInfo := getNodeInfo(nodeName) var err e...
[ "func", "(", "nm", "*", "NodeManager", ")", "GetNodeInfo", "(", "nodeName", "k8stypes", ".", "NodeName", ")", "(", "NodeInfo", ",", "error", ")", "{", "getNodeInfo", ":=", "func", "(", "nodeName", "k8stypes", ".", "NodeName", ")", "*", "NodeInfo", "{", "...
// GetNodeInfo returns a NodeInfo which datacenter, vm and vc server ip address. // This method returns an error if it is unable find node VCs and DCs listed in vSphere.conf // NodeInfo returned may not be updated to reflect current VM location. // // This method is a getter but it can cause side-effect of updating Nod...
[ "GetNodeInfo", "returns", "a", "NodeInfo", "which", "datacenter", "vm", "and", "vc", "server", "ip", "address", ".", "This", "method", "returns", "an", "error", "if", "it", "is", "unable", "find", "node", "VCs", "and", "DCs", "listed", "in", "vSphere", "."...
train
https://github.com/kubernetes/kubernetes/blob/6a8a3682919652ae668c389ed2f60efb770eed03/staging/src/k8s.io/legacy-cloud-providers/vsphere/nodemanager.go#L275-L304
kubernetes/kubernetes
staging/src/k8s.io/legacy-cloud-providers/vsphere/nodemanager.go
GetNodeDetails
func (nm *NodeManager) GetNodeDetails() ([]NodeDetails, error) { nm.registeredNodesLock.Lock() defer nm.registeredNodesLock.Unlock() var nodeDetails []NodeDetails for nodeName, nodeObj := range nm.registeredNodes { nodeInfo, err := nm.GetNodeInfoWithNodeObject(nodeObj) if err != nil { return nil, err } ...
go
func (nm *NodeManager) GetNodeDetails() ([]NodeDetails, error) { nm.registeredNodesLock.Lock() defer nm.registeredNodesLock.Unlock() var nodeDetails []NodeDetails for nodeName, nodeObj := range nm.registeredNodes { nodeInfo, err := nm.GetNodeInfoWithNodeObject(nodeObj) if err != nil { return nil, err } ...
[ "func", "(", "nm", "*", "NodeManager", ")", "GetNodeDetails", "(", ")", "(", "[", "]", "NodeDetails", ",", "error", ")", "{", "nm", ".", "registeredNodesLock", ".", "Lock", "(", ")", "\n", "defer", "nm", ".", "registeredNodesLock", ".", "Unlock", "(", ...
// GetNodeDetails returns NodeDetails for all the discovered nodes. // // This method is a getter but it can cause side-effect of updating NodeInfo objects.
[ "GetNodeDetails", "returns", "NodeDetails", "for", "all", "the", "discovered", "nodes", ".", "This", "method", "is", "a", "getter", "but", "it", "can", "cause", "side", "-", "effect", "of", "updating", "NodeInfo", "objects", "." ]
train
https://github.com/kubernetes/kubernetes/blob/6a8a3682919652ae668c389ed2f60efb770eed03/staging/src/k8s.io/legacy-cloud-providers/vsphere/nodemanager.go#L309-L323
kubernetes/kubernetes
staging/src/k8s.io/legacy-cloud-providers/vsphere/nodemanager.go
renewNodeInfo
func (nm *NodeManager) renewNodeInfo(nodeInfo *NodeInfo, reconnect bool) (*NodeInfo, error) { ctx, cancel := context.WithCancel(context.Background()) defer cancel() vsphereInstance := nm.vsphereInstanceMap[nodeInfo.vcServer] if vsphereInstance == nil { err := fmt.Errorf("vSphereInstance for vSphere %q not found ...
go
func (nm *NodeManager) renewNodeInfo(nodeInfo *NodeInfo, reconnect bool) (*NodeInfo, error) { ctx, cancel := context.WithCancel(context.Background()) defer cancel() vsphereInstance := nm.vsphereInstanceMap[nodeInfo.vcServer] if vsphereInstance == nil { err := fmt.Errorf("vSphereInstance for vSphere %q not found ...
[ "func", "(", "nm", "*", "NodeManager", ")", "renewNodeInfo", "(", "nodeInfo", "*", "NodeInfo", ",", "reconnect", "bool", ")", "(", "*", "NodeInfo", ",", "error", ")", "{", "ctx", ",", "cancel", ":=", "context", ".", "WithCancel", "(", "context", ".", "...
// renewNodeInfo renews vSphere connection, VirtualMachine and Datacenter for NodeInfo instance.
[ "renewNodeInfo", "renews", "vSphere", "connection", "VirtualMachine", "and", "Datacenter", "for", "NodeInfo", "instance", "." ]
train
https://github.com/kubernetes/kubernetes/blob/6a8a3682919652ae668c389ed2f60efb770eed03/staging/src/k8s.io/legacy-cloud-providers/vsphere/nodemanager.go#L345-L368
kubernetes/kubernetes
staging/src/k8s.io/legacy-cloud-providers/vsphere/nodemanager.go
vcConnect
func (nm *NodeManager) vcConnect(ctx context.Context, vsphereInstance *VSphereInstance) error { err := vsphereInstance.conn.Connect(ctx) if err == nil { return nil } credentialManager := nm.CredentialManager() if !vclib.IsInvalidCredentialsError(err) || credentialManager == nil { klog.Errorf("Cannot connect t...
go
func (nm *NodeManager) vcConnect(ctx context.Context, vsphereInstance *VSphereInstance) error { err := vsphereInstance.conn.Connect(ctx) if err == nil { return nil } credentialManager := nm.CredentialManager() if !vclib.IsInvalidCredentialsError(err) || credentialManager == nil { klog.Errorf("Cannot connect t...
[ "func", "(", "nm", "*", "NodeManager", ")", "vcConnect", "(", "ctx", "context", ".", "Context", ",", "vsphereInstance", "*", "VSphereInstance", ")", "error", "{", "err", ":=", "vsphereInstance", ".", "conn", ".", "Connect", "(", "ctx", ")", "\n", "if", "...
// vcConnect connects to vCenter with existing credentials // If credentials are invalid: // 1. It will fetch credentials from credentialManager // 2. Update the credentials // 3. Connects again to vCenter with fetched credentials
[ "vcConnect", "connects", "to", "vCenter", "with", "existing", "credentials", "If", "credentials", "are", "invalid", ":", "1", ".", "It", "will", "fetch", "credentials", "from", "credentialManager", "2", ".", "Update", "the", "credentials", "3", ".", "Connects", ...
train
https://github.com/kubernetes/kubernetes/blob/6a8a3682919652ae668c389ed2f60efb770eed03/staging/src/k8s.io/legacy-cloud-providers/vsphere/nodemanager.go#L382-L404
kubernetes/kubernetes
staging/src/k8s.io/legacy-cloud-providers/vsphere/nodemanager.go
GetNodeInfoWithNodeObject
func (nm *NodeManager) GetNodeInfoWithNodeObject(node *v1.Node) (NodeInfo, error) { nodeName := node.Name getNodeInfo := func(nodeName string) *NodeInfo { nm.nodeInfoLock.RLock() nodeInfo := nm.nodeInfoMap[nodeName] nm.nodeInfoLock.RUnlock() return nodeInfo } nodeInfo := getNodeInfo(nodeName) var err error...
go
func (nm *NodeManager) GetNodeInfoWithNodeObject(node *v1.Node) (NodeInfo, error) { nodeName := node.Name getNodeInfo := func(nodeName string) *NodeInfo { nm.nodeInfoLock.RLock() nodeInfo := nm.nodeInfoMap[nodeName] nm.nodeInfoLock.RUnlock() return nodeInfo } nodeInfo := getNodeInfo(nodeName) var err error...
[ "func", "(", "nm", "*", "NodeManager", ")", "GetNodeInfoWithNodeObject", "(", "node", "*", "v1", ".", "Node", ")", "(", "NodeInfo", ",", "error", ")", "{", "nodeName", ":=", "node", ".", "Name", "\n", "getNodeInfo", ":=", "func", "(", "nodeName", "string...
// GetNodeInfoWithNodeObject returns a NodeInfo which datacenter, vm and vc server ip address. // This method returns an error if it is unable find node VCs and DCs listed in vSphere.conf // NodeInfo returned may not be updated to reflect current VM location. // // This method is a getter but it can cause side-effect o...
[ "GetNodeInfoWithNodeObject", "returns", "a", "NodeInfo", "which", "datacenter", "vm", "and", "vc", "server", "ip", "address", ".", "This", "method", "returns", "an", "error", "if", "it", "is", "unable", "find", "node", "VCs", "and", "DCs", "listed", "in", "v...
train
https://github.com/kubernetes/kubernetes/blob/6a8a3682919652ae668c389ed2f60efb770eed03/staging/src/k8s.io/legacy-cloud-providers/vsphere/nodemanager.go#L411-L441
kubernetes/kubernetes
staging/src/k8s.io/cli-runtime/pkg/genericclioptions/config_flags.go
ToRawKubeConfigLoader
func (f *ConfigFlags) ToRawKubeConfigLoader() clientcmd.ClientConfig { if f.usePersistentConfig { return f.toRawKubePersistentConfigLoader() } return f.toRawKubeConfigLoader() }
go
func (f *ConfigFlags) ToRawKubeConfigLoader() clientcmd.ClientConfig { if f.usePersistentConfig { return f.toRawKubePersistentConfigLoader() } return f.toRawKubeConfigLoader() }
[ "func", "(", "f", "*", "ConfigFlags", ")", "ToRawKubeConfigLoader", "(", ")", "clientcmd", ".", "ClientConfig", "{", "if", "f", ".", "usePersistentConfig", "{", "return", "f", ".", "toRawKubePersistentConfigLoader", "(", ")", "\n", "}", "\n", "return", "f", ...
// ToRawKubeConfigLoader binds config flag values to config overrides // Returns an interactive clientConfig if the password flag is enabled, // or a non-interactive clientConfig otherwise.
[ "ToRawKubeConfigLoader", "binds", "config", "flag", "values", "to", "config", "overrides", "Returns", "an", "interactive", "clientConfig", "if", "the", "password", "flag", "is", "enabled", "or", "a", "non", "-", "interactive", "clientConfig", "otherwise", "." ]
train
https://github.com/kubernetes/kubernetes/blob/6a8a3682919652ae668c389ed2f60efb770eed03/staging/src/k8s.io/cli-runtime/pkg/genericclioptions/config_flags.go#L117-L122
kubernetes/kubernetes
staging/src/k8s.io/cli-runtime/pkg/genericclioptions/config_flags.go
toRawKubePersistentConfigLoader
func (f *ConfigFlags) toRawKubePersistentConfigLoader() clientcmd.ClientConfig { f.lock.Lock() defer f.lock.Unlock() if f.clientConfig == nil { f.clientConfig = f.toRawKubeConfigLoader() } return f.clientConfig }
go
func (f *ConfigFlags) toRawKubePersistentConfigLoader() clientcmd.ClientConfig { f.lock.Lock() defer f.lock.Unlock() if f.clientConfig == nil { f.clientConfig = f.toRawKubeConfigLoader() } return f.clientConfig }
[ "func", "(", "f", "*", "ConfigFlags", ")", "toRawKubePersistentConfigLoader", "(", ")", "clientcmd", ".", "ClientConfig", "{", "f", ".", "lock", ".", "Lock", "(", ")", "\n", "defer", "f", ".", "lock", ".", "Unlock", "(", ")", "\n\n", "if", "f", ".", ...
// toRawKubePersistentConfigLoader binds config flag values to config overrides // Returns a persistent clientConfig for propagation.
[ "toRawKubePersistentConfigLoader", "binds", "config", "flag", "values", "to", "config", "overrides", "Returns", "a", "persistent", "clientConfig", "for", "propagation", "." ]
train
https://github.com/kubernetes/kubernetes/blob/6a8a3682919652ae668c389ed2f60efb770eed03/staging/src/k8s.io/cli-runtime/pkg/genericclioptions/config_flags.go#L202-L211
kubernetes/kubernetes
staging/src/k8s.io/cli-runtime/pkg/genericclioptions/config_flags.go
ToDiscoveryClient
func (f *ConfigFlags) ToDiscoveryClient() (discovery.CachedDiscoveryInterface, error) { config, err := f.ToRESTConfig() if err != nil { return nil, err } // The more groups you have, the more discovery requests you need to make. // given 25 groups (our groups + a few custom resources) with one-ish version each,...
go
func (f *ConfigFlags) ToDiscoveryClient() (discovery.CachedDiscoveryInterface, error) { config, err := f.ToRESTConfig() if err != nil { return nil, err } // The more groups you have, the more discovery requests you need to make. // given 25 groups (our groups + a few custom resources) with one-ish version each,...
[ "func", "(", "f", "*", "ConfigFlags", ")", "ToDiscoveryClient", "(", ")", "(", "discovery", ".", "CachedDiscoveryInterface", ",", "error", ")", "{", "config", ",", "err", ":=", "f", ".", "ToRESTConfig", "(", ")", "\n", "if", "err", "!=", "nil", "{", "r...
// ToDiscoveryClient implements RESTClientGetter. // Expects the AddFlags method to have been called. // Returns a CachedDiscoveryInterface using a computed RESTConfig.
[ "ToDiscoveryClient", "implements", "RESTClientGetter", ".", "Expects", "the", "AddFlags", "method", "to", "have", "been", "called", ".", "Returns", "a", "CachedDiscoveryInterface", "using", "a", "computed", "RESTConfig", "." ]
train
https://github.com/kubernetes/kubernetes/blob/6a8a3682919652ae668c389ed2f60efb770eed03/staging/src/k8s.io/cli-runtime/pkg/genericclioptions/config_flags.go#L216-L236