Remove CLI and API deprecations (#2508)

* remove api deprecations

Signed-off-by: Alex Goodman <wagoodman@users.noreply.github.com>

* remove deprecated NAME cli flag

Signed-off-by: Alex Goodman <wagoodman@users.noreply.github.com>

---------

Signed-off-by: Alex Goodman <wagoodman@users.noreply.github.com>
This commit is contained in:
Alex Goodman 2024-01-22 12:55:30 -05:00 committed by GitHub
parent 03b7938fbf
commit c5d15d1d6c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 0 additions and 144 deletions

View File

@ -46,7 +46,6 @@ type Catalog struct {
// configuration for the source (the subject being analyzed)
Registry registryConfig `yaml:"registry" json:"registry" mapstructure:"registry"`
Platform string `yaml:"platform" json:"platform" mapstructure:"platform"`
Name string `yaml:"name" json:"name" mapstructure:"name"` // deprecated
Source sourceConfig `yaml:"source" json:"source" mapstructure:"source"`
Exclusions []string `yaml:"exclude" json:"exclude" mapstructure:"exclude"`
}
@ -175,14 +174,6 @@ func (cfg *Catalog) AddFlags(flags clio.FlagSet) {
flags.StringArrayVarP(&cfg.SelectCatalogers, "select-catalogers", "",
"add, remove, and filter the catalogers to be used")
flags.StringVarP(&cfg.Source.Name, "name", "",
"set the name of the target being analyzed")
if pfp, ok := flags.(fangs.PFlagSetProvider); ok {
flagSet := pfp.PFlagSet()
flagSet.Lookup("name").Deprecated = "use: source-name"
}
flags.StringVarP(&cfg.Source.Name, "source-name", "",
"set the name of the target being analyzed")
@ -198,13 +189,6 @@ func (cfg *Catalog) DescribeFields(descriptions fangs.FieldDescriptionSet) {
}
func (cfg *Catalog) PostLoad() error {
if cfg.Name != "" {
log.Warnf("name parameter is deprecated. please use: source-name. name will be removed in a future version")
if cfg.Source.Name == "" {
cfg.Source.Name = cfg.Name
}
}
usingLegacyCatalogers := len(cfg.Catalogers) > 0
usingNewCatalogers := len(cfg.DefaultCatalogers) > 0 || len(cfg.SelectCatalogers) > 0

View File

@ -1,9 +0,0 @@
package pkg
// Deprecated: use Collection instead
type Catalog = Collection
// Deprecated: use NewCollection() instead
func NewCatalog(pkgs ...Package) *Catalog {
return NewCollection(pkgs...)
}

View File

@ -1,119 +0,0 @@
package source
import (
"io"
stereoscopeFile "github.com/anchore/stereoscope/pkg/file"
"github.com/anchore/stereoscope/pkg/image"
"github.com/anchore/syft/syft/file"
)
// Deprecated: use file.Metadata instead
type FileMetadata = file.Metadata
type (
// Deprecated: use file.Coordinates instead
Coordinates = file.Coordinates
// Deprecated: use file.CoordinateSet instead
CoordinateSet = file.CoordinateSet
// Deprecated: use file.Resolver instead
FileResolver = file.Resolver
// Deprecated: use file.ContentResolver instead
FileContentResolver = file.ContentResolver
// Deprecated: use file.PathResolver instead
FilePathResolver = file.PathResolver
// Deprecated: use file.LocationResolver instead
FileLocationResolver = file.LocationResolver
// Deprecated: use file.MetadataResolver instead
FileMetadataResolver = file.MetadataResolver
// Deprecated: use file.WritableResolver instead
WritableFileResolver = file.WritableResolver
// Deprecated: use file.MockResolver instead
MockResolver = file.MockResolver
// Deprecated: use file.Location instead
Location = file.Location
// Deprecated: use file.LocationData instead
LocationData = file.LocationData
// Deprecated: use file.LocationMetadata instead
LocationMetadata = file.LocationMetadata
// Deprecated: use file.LocationSet instead
LocationSet = file.LocationSet
// Deprecated: use file.Locations instead
Locations = file.Locations
// Deprecated: use file.LocationReadCloser instead
LocationReadCloser = file.LocationReadCloser
)
// Deprecated: use file.NewCoordinateSet instead
func NewCoordinateSet(coordinates ...file.Coordinates) file.CoordinateSet {
return file.NewCoordinateSet(coordinates...)
}
// Deprecated: use file.NewLocationSet instead
func NewLocationSet(locations ...file.Location) file.LocationSet {
return file.NewLocationSet(locations...)
}
// Deprecated: use file.NewLocation instead
func NewLocation(realPath string) file.Location {
return file.NewLocation(realPath)
}
// Deprecated: use file.NewVirtualLocation instead
func NewVirtualLocation(realPath, virtualPath string) file.Location {
return file.NewVirtualLocation(realPath, virtualPath)
}
// Deprecated: use file.NewLocationFromCoordinates instead
func NewLocationFromCoordinates(coordinates file.Coordinates) file.Location {
return file.NewLocationFromCoordinates(coordinates)
}
// Deprecated: use file.NewVirtualLocationFromCoordinates instead
func NewVirtualLocationFromCoordinates(coordinates file.Coordinates, virtualPath string) file.Location {
return file.NewVirtualLocationFromCoordinates(coordinates, virtualPath)
}
// Deprecated: use file.NewLocationFromImage instead
func NewLocationFromImage(virtualPath string, ref stereoscopeFile.Reference, img *image.Image) file.Location {
return file.NewLocationFromImage(virtualPath, ref, img)
}
// Deprecated: use file.NewLocationFromDirectory instead
func NewLocationFromDirectory(responsePath string, ref stereoscopeFile.Reference) file.Location {
return file.NewLocationFromDirectory(responsePath, ref)
}
// Deprecated: use file.NewVirtualLocationFromDirectory instead
func NewVirtualLocationFromDirectory(responsePath, virtualResponsePath string, ref stereoscopeFile.Reference) file.Location {
return file.NewVirtualLocationFromDirectory(responsePath, virtualResponsePath, ref)
}
// Deprecated: use file.NewLocationReadCloser instead
func NewLocationReadCloser(location file.Location, reader io.ReadCloser) file.LocationReadCloser {
return file.NewLocationReadCloser(location, reader)
}
// Deprecated: use file.NewMockResolverForPaths instead
func NewMockResolverForPaths(paths ...string) *file.MockResolver {
return file.NewMockResolverForPaths(paths...)
}
// Deprecated: use file.NewMockResolverForPathsWithMetadata instead
func NewMockResolverForPathsWithMetadata(metadata map[file.Coordinates]file.Metadata) *file.MockResolver {
return file.NewMockResolverForPathsWithMetadata(metadata)
}