//GetNodeSoftwareVersion asks a managed node for its running software version
968468
func (s *Server) GetNodeSoftwareVersion(c context.Context, n *pb.Node) (*pb.NodeSoftwareVersion, error) {
	s.RLock()
	defer s.RUnlock()
	if _, ok := s.managedNodes[n.Id]; ok {
		version, err := s.managedNodes[n.Id].GetSoftwareVersion()
		return &pb.NodeSoftwareVersion{Version: version}, err
	}
	return &pb.NodeSoftwareVersion{}, fmt.Errorf("Node %d not found or not managed node", n.Id)
}
640063
func (c *FakeDiscovery) ServerVersion() (*version.Info, error) {
	action := testing.ActionImpl{}
	action.Verb = "get"
	action.Resource = schema.GroupVersionResource{Resource: "version"}
	c.Invokes(action, nil)

	if c.FakedServerVersion != nil {
		return c.FakedServerVersion, nil
	}

	versionInfo := kubeversion.Get()
	return &versionInfo, nil
}
140775
func (s *DeviceData) SetSoftwareVersion(v string) *DeviceData {
	s.SoftwareVersion = &v
	return s
}
902299
func (s *Gateway) SetSoftwareVersion(v string) *Gateway {
	s.SoftwareVersion = &v
	return s
}
566041
func GetVersions(property *Property) (*Versions, error) {
	versions := NewVersions()
	if err := versions.GetVersions(property); err != nil {
		return nil, err
	}

	return versions, nil
}
36745
func GetServerVersion(clientConn *grpc.ClientConn) (*Version, error) {
	return NewAPIClient(clientConn).GetVersion(
		context.Background(),
		&empty.Empty{},
	)
}
1110741
func (s *Device) SetSoftwareVersion(v string) *Device {
	s.SoftwareVersion = &v
	return s
}
401748
func (tree *MutableTree) GetVersionedWithProof(key []byte, version int64) ([]byte, *RangeProof, error) {
	if tree.versions[version] {
		t, err := tree.GetImmutable(version)
		if err != nil {
			return nil, nil, err
		}

		return t.GetWithProof(key)
	}
	return nil, nil, cmn.ErrorWrap(ErrVersionDoesNotExist, "")
}
162377
func (runner *runner) GetVersion() (string, error) {
	return getIPTablesVersionString(runner.exec, runner.protocol)
}
835849
func (mtt *mttNode) GetVersions(ns []string) ([]*metricType, error) {
	var nodes []*mttNode
	var mts []*metricType

	if len(ns) == 0 {
		return nil, errorEmptyNamespace()
	}

	nodes = mtt.search(nodes, ns)

	for _, node := range nodes {
		// concatenates metric types in ALL versions into a single slice
		for _, mt := range node.mts {
			mts = append(mts, mt)
		}
	}
	if len(mts) == 0 {
		return nil, errorMetricNotFound("/" + strings.Join(ns, "/"))
	}
	return mts, nil
}
446014
func getVersion(lastSeenBinaryVersion *string) error {
	// Create the get request for the etcd version endpoint.
	req, err := http.NewRequest("GET", etcdVersionScrapeURI, nil)
	if err != nil {
		return fmt.Errorf("failed to create GET request for etcd version: %v", err)
	}

	// Send the get request and receive a response.
	client := &http.Client{}
	resp, err := client.Do(req)
	if err != nil {
		return fmt.Errorf("failed to receive GET response for etcd version: %v", err)
	}
	defer resp.Body.Close()

	// Obtain EtcdVersion from the JSON response.
	var version EtcdVersion
	if err := json.NewDecoder(resp.Body).Decode(&version); err != nil {
		return fmt.Errorf("failed to decode etcd version JSON: %v", err)
	}

	// Return without updating the version if it stayed the same since last time.
	if *lastSeenBinaryVersion == version.BinaryVersion {
		return nil
	}

	// Delete the metric for the previous version.
	if *lastSeenBinaryVersion != "" {
		deleted := etcdVersion.Delete(prometheus.Labels{"binary_version": *lastSeenBinaryVersion})
		if !deleted {
			return errors.New("failed to delete previous version's metric")
		}
	}

	// Record the new version in a metric.
	etcdVersion.With(prometheus.Labels{
		"binary_version": version.BinaryVersion,
	}).Set(0)
	*lastSeenBinaryVersion = version.BinaryVersion
	return nil
}
504559
func GetPluginVersion(name string) (*ver.Version, error) {
	route, found, err := ReadPluginRoute(name)
	if err != nil {
		return nil, err
	}

	if !found {
		return nil, fmt.Errorf("plugin not installed with name (%s)", name)
	}

	if route.Version == "" {
		return nil, nil
	}

	pluginVersion, err := ver.NewVersion(route.Version)
	if err != nil {
		return nil, err
	}
	if pluginVersion == nil {
		return nil, fmt.Errorf("failed to parse version (%s)", route.Version)
	}

	return pluginVersion, nil
}
804480
func GetSemverVersion() (semver.Version, error) {
	return semver.Make(strings.TrimPrefix(GetVersion(), VersionPrefix))
}
1266138
func (cs *ConfigurationService) GetVersion(ctx context.Context) (v *Version, resp *APIResponse, err error) {
	v = &Version{}
	_, resp, err = cs.client.getAction(ctx, &APIClientRequest{
		Path:         "version",
		ResponseBody: v,
		APIVersion:   apiV1,
	})
	return
}
399876
func getKernelVersion() (string, error) {
	// Get CurrentBuildNumber.
	buildNumber, err := getCurrentVersionVal("CurrentBuildNumber")
	if err != nil {
		return "", err
	}

	// Get CurrentMajorVersionNumber.
	majorVersionNumberString, err := getCurrentVersionVal("CurrentMajorVersionNumber")
	if err != nil {
		return "", err
	}
	majorVersionNumber, err := windows.UTF16FromString(majorVersionNumberString)
	if err != nil {
		return "", err
	}

	// Get CurrentMinorVersionNumber.
	minorVersionNumberString, err := getCurrentVersionVal("CurrentMinorVersionNumber")
	if err != nil {
		return "", err
	}
	minorVersionNumber, err := windows.UTF16FromString(minorVersionNumberString)
	if err != nil {
		return "", err
	}

	// Get UBR.
	revision, err := getVersionRevision()
	if err != nil {
		return "", err
	}

	return fmt.Sprintf("%d.%d.%s.%d", majorVersionNumber[0], minorVersionNumber[0], buildNumber, revision), nil
}
1169961
func (g *GistCommit) GetVersion() string {
	if g == nil || g.Version == nil {
		return ""
	}
	return *g.Version
}
638910
func (ds *dockerService) getDockerVersion() (*dockertypes.Version, error) {
	v, err := ds.client.Version()
	if err != nil {
		return nil, fmt.Errorf("failed to get docker version: %v", err)
	}
	// Docker API version (e.g., 1.23) is not semver compatible. Add a ".0"
	// suffix to remedy this.
	v.APIVersion = fmt.Sprintf("%s.0", v.APIVersion)
	return v, nil
}