Skip to content

Commit e6a4e27

Browse files
committed
containerapi: add deprecation notices
Signed-off-by: Hank Donnay <[email protected]>
1 parent c585ec2 commit e6a4e27

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

rhel/internal/containerapi/containerapi.go

+13
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
// Package containerapi is a minimal client around the Red Hat Container API.
2+
//
3+
// Deprecated: This package's functionality should only be required for
4+
// container images that are long-since out of support.
25
package containerapi
36

47
import (
@@ -10,6 +13,7 @@ import (
1013
"net/url"
1114
"path"
1215
"strings"
16+
"sync"
1317

1418
"github.com/quay/zlog"
1519
)
@@ -38,6 +42,13 @@ type ContainerAPI struct {
3842

3943
// GetCPEs fetches CPE information for given build from Red Hat Container API.
4044
func (c *ContainerAPI) GetCPEs(ctx context.Context, nvr, arch string) ([]string, error) {
45+
deprecationWarning.Do(func() {
46+
zlog.Warn(ctx).
47+
Bool("deprecation", true).
48+
Msg("support for the Red Hat Container API will be removed in a future release")
49+
zlog.Warn(ctx).
50+
Msg("container images using this code are extremely old!")
51+
})
4152
uri, err := c.Root.Parse(path.Join("v1/images/nvr/", nvr))
4253
if err != nil {
4354
return nil, err
@@ -80,3 +91,5 @@ func (c *ContainerAPI) GetCPEs(ctx context.Context, nvr, arch string) ([]string,
8091
}
8192
return nil, nil
8293
}
94+
95+
var deprecationWarning sync.Once

0 commit comments

Comments
 (0)