func (f Filter) match(agent HasVersion) bool {
	if f.Number != version.Zero && agent.AgentVersion() != f.Number {
		return false
	}
	tools, ok := agent.(*Tools)
	if !ok {
		return true
	}
	// TODO(juju4) - remove this logic
	// Older tools were based on series. So if the filter is
	// using a os type, we need to convert the tools to the
	// corresponding os type before matching.
	if f.OSType != "" {
		release := tools.Version.Release
		if tools.Version.Major == 2 && tools.Version.Minor <= 8 {
			if !coreos.IsValidOSTypeName(release) {
				release = coreseries.DefaultOSTypeNameFromSeries(release)
			}
		}
		if release != f.OSType {
			return false
		}
	}
	if f.Arch != "" && tools.Version.Arch != f.Arch {
		return false
	}
	return true
}
// match returns true if the supplied tools match f.
match returns true if the supplied tools match f.
// match returns true if the supplied tools match f .
func (f Filter) match(agent HasVersion) bool {
	if f.Number != version.Zero && agent.AgentVersion() != f.Number {
		return false
	}
	tools, ok := agent.(*Tools)
	if !ok {
		return true
	}
	if f.OSType != "" {
		release := tools.Version.Release
		if tools.Version.Major == 2 && tools.Version.Minor <= 8 {
			if !coreos.IsValidOSTypeName(release) {
				release = coreseries.DefaultOSTypeNameFromSeries(release)
			}
		}
		if release != f.OSType {
			return false
		}
	}
	if f.Arch != "" && tools.Version.Arch != f.Arch {
		return false
	}
	return true
}
func ( f Filter ) match ( agent HasVersion ) bool { if f . Number != version . Zero && agent . AgentVersion ( ) != f . Number { return false } tools , ok := agent . ( * Tools ) if ! ok { return true } if f . OSType != " " { release := tools . Version . Release if tools . Version . Major == 2 && tools . Version . Minor <= 8 { if ! coreos . IsValidOSTypeName ( release ) { release = coreseries . DefaultOSTypeNameFromSeries ( release ) } } if release != f . OSType { return false } } if f . Arch != " " && tools . Version . Arch != f . Arch { return false } return true }
match returns true if the supplied tools match f.
match returns true if the supplied tools match f .
// TODO(juju4) - remove this logic // Older tools were based on series. So if the filter is // using a os type, we need to convert the tools to the // corresponding os type before matching.