Skip to content

Commit

Permalink
fix(logging): Remove verbose/unnecessary logging (#3497)
Browse files Browse the repository at this point in the history
* fix(logging): Remove verbose/unnecessary logging

* fix(logs): a few more allow anonymous calls

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
  • Loading branch information
marchello2000 and mergify[bot] committed Mar 6, 2020
1 parent ee48b26 commit 0d716fc
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -201,18 +201,20 @@ protected void tick() {

public List<PinnedServerGroupTag> fetchPinnedServerGroupTags() {
List<EntityTags> allEntityTags =
retrySupport.retry(
AuthenticatedRequest.allowAnonymous(
() ->
objectMapper.convertValue(
oortService.getEntityTags(
ImmutableMap.<String, String>builder()
.put("tag:" + PINNED_CAPACITY_TAG, "*")
.put("entityType", "servergroup")
.build()),
new TypeReference<List<EntityTags>>() {}),
15,
2000,
false);
retrySupport.retry(
() ->
objectMapper.convertValue(
oortService.getEntityTags(
ImmutableMap.<String, String>builder()
.put("tag:" + PINNED_CAPACITY_TAG, "*")
.put("entityType", "servergroup")
.build()),
new TypeReference<List<EntityTags>>() {}),
15,
2000,
false));

return allEntityTags.stream()
.map(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,9 @@ class EchoNotifyingExecutionListener implements ExecutionListener {
front50Service.getApplicationNotifications(pipeline.application)
}, user.get()).call()
} else {
notifications = front50Service.getApplicationNotifications(pipeline.application)
notifications = AuthenticatedRequest.allowAnonymous({
front50Service.getApplicationNotifications(pipeline.application)
})
}

if (notifications) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@

package com.netflix.spinnaker.orca.mine.tasks

import com.netflix.spinnaker.security.AuthenticatedRequest

import java.util.concurrent.TimeUnit
import com.netflix.spinnaker.orca.ExecutionStatus
import com.netflix.spinnaker.orca.OverridableTimeoutRetryableTask
Expand Down Expand Up @@ -45,8 +47,9 @@ class MonitorAcaTaskTask extends AbstractCloudProviderAwareTask implements Overr
]

try {
def canary = AuthenticatedRequest.allowAnonymous({ mineService.getCanary(context.canary.id) })
outputs << [
canary : mineService.getCanary(context.canary.id)
canary: canary
]
} catch (RetrofitError e) {
log.error("Exception occurred while getting canary with id ${context.canary.id} from mine service", e)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,6 @@ class PipelineTemplatePreprocessor
return pipeline
}

log.debug("Starting handler chain")

val chain = DefaultHandlerChain()
val context = GlobalPipelineTemplateContext(chain, request)

Expand Down Expand Up @@ -101,7 +99,6 @@ class PipelineTemplatePreprocessor

recordRequest(context, !context.getErrors().hasErrors(false))

log.debug("Handler chain complete")
return context.getProcessedOutput()
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
import com.netflix.spinnaker.kork.artifacts.model.Artifact;
import com.netflix.spinnaker.orca.clouddriver.OortService;
import com.netflix.spinnaker.orca.pipelinetemplate.v2schema.model.V2PipelineTemplate;
import com.netflix.spinnaker.security.AuthenticatedRequest;
import java.io.IOException;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
Expand All @@ -39,7 +40,9 @@ public V2TemplateLoader(OortService oortService, ObjectMapper objectMapper) {
}

public V2PipelineTemplate load(Artifact template) {
Response templateContent = oortService.fetchArtifact(template);
Response templateContent =
AuthenticatedRequest.allowAnonymous(() -> oortService.fetchArtifact(template));

try {
return objectMapper.readValue(templateContent.getBody().in(), V2PipelineTemplate.class);
} catch (IOException ioe) {
Expand Down

0 comments on commit 0d716fc

Please sign in to comment.