@@ -89,10 +89,10 @@ func NewClient(cacheDir string, quiet bool, policyBundleRepo string, opts ...Opt
89
89
}, nil
90
90
}
91
91
92
- func (c * Client ) populateOCIArtifact () error {
92
+ func (c * Client ) populateOCIArtifact (registryOpts types. RegistryOptions ) error {
93
93
if c .artifact == nil {
94
94
log .Logger .Debugf ("Using URL: %s to load policy bundle" , c .policyBundleRepo )
95
- art , err := oci .NewArtifact (c .policyBundleRepo , c .quiet , types. RegistryOptions {} )
95
+ art , err := oci .NewArtifact (c .policyBundleRepo , c .quiet , registryOpts )
96
96
if err != nil {
97
97
return xerrors .Errorf ("OCI artifact error: %w" , err )
98
98
}
@@ -102,8 +102,8 @@ func (c *Client) populateOCIArtifact() error {
102
102
}
103
103
104
104
// DownloadBuiltinPolicies download default policies from GitHub Pages
105
- func (c * Client ) DownloadBuiltinPolicies (ctx context.Context ) error {
106
- if err := c .populateOCIArtifact (); err != nil {
105
+ func (c * Client ) DownloadBuiltinPolicies (ctx context.Context , registryOpts types. RegistryOptions ) error {
106
+ if err := c .populateOCIArtifact (registryOpts ); err != nil {
107
107
return xerrors .Errorf ("OPA bundle error: %w" , err )
108
108
}
109
109
@@ -154,7 +154,7 @@ func (c *Client) LoadBuiltinPolicies() ([]string, error) {
154
154
}
155
155
156
156
// NeedsUpdate returns if the default policy should be updated
157
- func (c * Client ) NeedsUpdate (ctx context.Context ) (bool , error ) {
157
+ func (c * Client ) NeedsUpdate (ctx context.Context , registryOpts types. RegistryOptions ) (bool , error ) {
158
158
meta , err := c .GetMetadata ()
159
159
if err != nil {
160
160
return true , nil
@@ -165,7 +165,7 @@ func (c *Client) NeedsUpdate(ctx context.Context) (bool, error) {
165
165
return false , nil
166
166
}
167
167
168
- if err = c .populateOCIArtifact (); err != nil {
168
+ if err = c .populateOCIArtifact (registryOpts ); err != nil {
169
169
return false , xerrors .Errorf ("OPA bundle error: %w" , err )
170
170
}
171
171
0 commit comments