// IsErrUnknownNomadVersion returns whether the error is due to Nomad being
// unable to determine the version of a node.
8745
func IsErrUnknownNomadVersion(err error) bool {
	return err != nil && strings.Contains(err.Error(), errUnknownNomadVersion)
}
237720
func BucketVersioningEnabled(awsSession *session.Session,
	S3Bucket string,
	logger *logrus.Logger) (bool, error) {

	s3Svc := s3.New(awsSession)
	params := &s3.GetBucketVersioningInput{
		Bucket: aws.String(S3Bucket), // Required
	}
	versioningEnabled := false
	resp, err := s3Svc.GetBucketVersioning(params)
	if err == nil && resp != nil && resp.Status != nil {
		// What's the versioning policy?
		logger.WithFields(logrus.Fields{
			"VersionPolicy": *resp,
			"BucketName":    S3Bucket,
		}).Debug("Bucket version policy")
		versioningEnabled = (strings.ToLower(*resp.Status) == "enabled")
	}
	return versioningEnabled, err
}
388932
func IsStoredVersion(crd *CustomResourceDefinition, version string) bool {
	for _, v := range crd.Status.StoredVersions {
		if version == v {
			return true
		}
	}
	return false
}
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
}
1355149
func (m *KopsModelContext) KubernetesVersion() semver.Version {
	// TODO: Remove copy-pasting c.f. https://github.com/kubernetes/kops/blob/master/pkg/model/components/context.go#L32

	kubernetesVersion := m.Cluster.Spec.KubernetesVersion

	if kubernetesVersion == "" {
		glog.Fatalf("KubernetesVersion is required")
	}

	sv, err := util.ParseKubernetesVersion(kubernetesVersion)
	if err != nil {
		glog.Fatalf("unable to determine kubernetes version from %q", kubernetesVersion)
	}

	return *sv
}
640842
func (s *DetectModerationLabelsOutput) SetModerationModelVersion(v string) *DetectModerationLabelsOutput {
	s.ModerationModelVersion = &v
	return s
}
373321
func (c *Adb) ServerVersion() (int, error) {
	resp, err := roundTripSingleResponse(c.server, "host:version")
	if err != nil {
		return 0, wrapClientError(err, c, "GetServerVersion")
	}

	version, err := c.parseServerVersion(resp)
	if err != nil {
		return 0, wrapClientError(err, c, "GetServerVersion")
	}
	return version, nil
}
1279858
func (st *State) MongoVersion() (string, error) {
	binfo, err := st.session.BuildInfo()
	if err != nil {
		return "", errors.Annotate(err, "cannot obtain mongo build info")
	}
	return binfo.Version, nil
}
865452
func (c *CLI) IsVersion() bool {
	c.once.Do(c.init)
	return c.isVersion
}
1076420
func IsAllowedVersion(v unversioned.GroupVersion) bool {
	if len(envRequestedVersions) == 0 {
		return true
	}
	_, found := envRequestedVersions[v]
	return found
}
457751
func GetVersion(uuid []byte) Version {
	ver := uuid[6] >> 4
	if ver > 0 && ver < 6 {
		return Version(ver)
	}

	return VersionUnknown
}
154560
func IsEnabledVersion(v unversioned.GroupVersion) bool {
	_, found := enabledVersions[v]
	return found
}
987867
func newVersion(s *session) *version {
	id := atomic.AddInt64(&s.ntVersionId, 1)
	nv := &version{s: s, id: id - 1}
	return nv
}
28270
func (p *Peer) VersionKnown() bool {
	p.flagsMtx.Lock()
	versionKnown := p.versionKnown
	p.flagsMtx.Unlock()

	return versionKnown
}
776430
func lastSemanticVersionWithoutModifiers(version string) string {
	parts := strings.Split(version, "-")
	return strings.Split(parts[0], "+")[0]
}
524807
func (n *managedNode) GetSoftwareVersion() (string, error) {
	n.RLock()
	defer n.RUnlock()
	ctx, _ := context.WithTimeout(context.Background(), DEFAULT_CTX_TIMEOUT)
	version, err := n.client.SoftwareVersion(ctx, &cc.EmptyMsg{})
	return version.Version, err
}
1167778
func (s *PublishSchemaInput) SetMinorVersion(v string) *PublishSchemaInput {
	s.MinorVersion = &v
	return s
}