Skip to content

Commit

Permalink
chore(dependencies): kork 5.4.8 (#457)
Browse files Browse the repository at this point in the history
Updates JenkinsClient to use helper method to construct proxy instances.
Adds allowAnonymous around some calls to eliminate logging noise.
  • Loading branch information
cfieber committed Jun 7, 2019
1 parent 2dc1dc9 commit 80d6720
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 21 deletions.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#Wed Jun 05 20:01:11 UTC 2019
fiatVersion=1.0.4
enablePublishing=false
korkVersion=5.4.6
korkVersion=5.4.8
spinnakerGradleVersion=6.5.0
org.gradle.parallel=true
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@

package com.netflix.spinnaker.igor.config


import com.fasterxml.jackson.databind.DeserializationFeature
import com.fasterxml.jackson.databind.ObjectMapper
import com.fasterxml.jackson.dataformat.xml.XmlMapper
Expand Down Expand Up @@ -51,7 +50,6 @@ import javax.net.ssl.TrustManager
import javax.net.ssl.TrustManagerFactory
import javax.net.ssl.X509TrustManager
import javax.validation.Valid
import java.lang.reflect.Proxy
import java.security.KeyStore
import java.security.cert.CertificateException
import java.security.cert.X509Certificate
Expand Down Expand Up @@ -91,21 +89,16 @@ class JenkinsConfig {
log.info "bootstrapping ${host.address} as ${host.name}"
[(host.name): jenkinsService(
host.name,
(JenkinsClient) Proxy.newProxyInstance(
JenkinsClient.getClassLoader(),
[JenkinsClient] as Class[],
new InstrumentedProxy(
registry,
jenkinsClient(
host,
jenkinsOkHttpClientProvider.provide(host),
jenkinsRetrofitRequestInterceptorProvider.provide(host),
igorConfigurationProperties.client.timeout
),
"jenkinsClient",
[master: host.name]
)
),
(JenkinsClient) InstrumentedProxy.proxy(
registry,
jenkinsClient(
host,
jenkinsOkHttpClientProvider.provide(host),
jenkinsRetrofitRequestInterceptorProvider.provide(host),
igorConfigurationProperties.client.timeout
),
"jenkinsClient",
[master: host.name]),
host.csrf,
host.permissions.build()
)]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ class DockerMonitor extends CommonPollingMonitor<ImageDelta, DockerPollingDelta>
Set<String> cachedImages = cache.getImages(account)

long startTime = System.currentTimeMillis()
List<TaggedImage> images = dockerRegistryAccounts.service.getImagesByAccount(account)
List<TaggedImage> images = AuthenticatedRequest.allowAnonymous { dockerRegistryAccounts.service.getImagesByAccount(account) }
registry.timer("pollingMonitor.docker.retrieveImagesByAccount", [new BasicTag("account", account)])
.record(System.currentTimeMillis() - startTime, TimeUnit.MILLISECONDS)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
package com.netflix.spinnaker.igor.docker.model

import com.netflix.spinnaker.igor.docker.service.ClouddriverService
import com.netflix.spinnaker.security.AuthenticatedRequest
import groovy.util.logging.Slf4j
import org.springframework.beans.factory.annotation.Autowired
import retrofit.RetrofitError
Expand All @@ -34,8 +35,10 @@ class DockerRegistryAccounts {

void updateAccounts() {
try {
this.accounts = service.allAccounts.findAll{ it.cloudProvider == 'dockerRegistry' }*.name.collect{
service.getAccountDetails(it)
AuthenticatedRequest.allowAnonymous {
this.accounts = service.allAccounts.findAll { it.cloudProvider == 'dockerRegistry' }*.name.collect {
service.getAccountDetails(it)
}
}
} catch (RetrofitError e) {
log.error "Failed to get list of docker accounts", e
Expand Down

0 comments on commit 80d6720

Please sign in to comment.