...
1 package container
2
3 import (
4 "fmt"
5
6 "github.com/bazelbuild/bazel-gazelle/rule"
7 )
8
9 const (
10 ContainerPushRuleName = "container_push"
11 ThirdPartyContainerDepRuleName = "third_party_container_dep"
12 rulesPackage = "hack/build/rules/container"
13 garRegistry = "us-east1-docker.pkg.dev"
14 edgeInfraRepoPrefix = "ret-edge-pltf-infra/thirdparty"
15 pushTag = "dev"
16 )
17
18 var kinds = map[string]rule.KindInfo{
19 ContainerPushRuleName: {
20 MatchAny: false,
21 MergeableAttrs: map[string]bool{
22 "name": true,
23 "digest": true,
24 "image_name": true,
25 "image": true,
26 "registry": true,
27 "repository_file": true,
28 "rules_docker": true,
29 "tag": true,
30 },
31 },
32 ThirdPartyContainerDepRuleName: {
33 MatchAny: true,
34 NonEmptyAttrs: map[string]bool{
35 "digest": true,
36 "image_name": true,
37 "registry": true,
38 "repository": true,
39 "tag": false,
40 "destination_repo": false,
41 },
42 ResolveAttrs: map[string]bool{
43 "digest": true,
44 "image_name": true,
45 "registry": true,
46 "repository": true,
47 "tag": false,
48 "destination_repo": false,
49 },
50 MergeableAttrs: map[string]bool{
51 "digest": true,
52 "image_name": true,
53 "registry": true,
54 "repository": true,
55 "tag": false,
56 "destination_repo": false,
57 },
58 },
59 "oci_repo": {
60 MatchAny: true,
61 NonEmptyAttrs: map[string]bool{
62 "name": true,
63 "build_setting_default": true,
64 },
65 },
66 }
67
68 func (c *Container) Kinds() map[string]rule.KindInfo {
69 return kinds
70 }
71
72 func (c *Container) ApparentLoads(_ func(string) string) []rule.LoadInfo {
73 return []rule.LoadInfo{
74 {
75 Name: fmt.Sprintf("//%s:index.bzl", rulesPackage),
76 Symbols: []string{
77 ContainerPushRuleName,
78 },
79 },
80 }
81 }
82
View as plain text