This repository has been archived by the owner on Oct 9, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 63
Downgrade info logs in clusterresource controller #89
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -239,14 +239,14 @@ func (c *controller) syncNamespace(ctx context.Context, namespace NamespaceName, | |
templateFileName := templateFile.Name() | ||
if filepath.Ext(templateFileName) != ".yaml" { | ||
// nothing to do. | ||
logger.Infof(ctx, "syncing namespace [%s]: ignoring unrecognized filetype [%s]", | ||
logger.Debugf(ctx, "syncing namespace [%s]: ignoring unrecognized filetype [%s]", | ||
namespace, templateFile.Name()) | ||
continue | ||
} | ||
|
||
if c.templateAlreadyApplied(namespace, templateFile) { | ||
// nothing to do. | ||
logger.Infof(ctx, "syncing namespace [%s]: templateFile [%s] already applied, nothing to do.", namespace, templateFile.Name()) | ||
logger.Debugf(ctx, "syncing namespace [%s]: templateFile [%s] already applied, nothing to do.", namespace, templateFile.Name()) | ||
continue | ||
} | ||
|
||
|
@@ -315,7 +315,7 @@ func (c *controller) syncNamespace(ctx context.Context, namespace NamespaceName, | |
|
||
if err != nil { | ||
c.metrics.TemplateUpdateErrors.Inc() | ||
logger.Infof(ctx, "Failed to update resource [%+v] in namespace [%s] with err :%v", | ||
logger.Warningf(ctx, "Failed to update resource [%+v] in namespace [%s] with err :%v", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. how so? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. we are dumping out the entire object, is that want you intend to do? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. we're only dumping out the Kind |
||
k8sObj.GetObjectKind().GroupVersionKind().Kind, namespace, err) | ||
collectedErrs = append(collectedErrs, err) | ||
} else { | ||
|
@@ -333,7 +333,7 @@ func (c *controller) syncNamespace(ctx context.Context, namespace NamespaceName, | |
collectedErrs = append(collectedErrs, err) | ||
} | ||
} else { | ||
logger.Infof(ctx, "Created resource [%+v] for namespace [%s] in kubernetes", | ||
logger.Debugf(ctx, "Created resource [%+v] for namespace [%s] in kubernetes", | ||
k8sObj.GetObjectKind().GroupVersionKind().Kind, namespace) | ||
c.metrics.KubernetesResourcesCreated.Inc() | ||
c.appliedTemplates[namespace][templateFile.Name()] = templateFile.ModTime() | ||
|
@@ -354,7 +354,7 @@ func (c *controller) Sync(ctx context.Context) error { | |
} | ||
}() | ||
c.metrics.SyncStarted.Inc() | ||
logger.Info(ctx, "Running an invocation of ClusterResource Sync") | ||
logger.Debugf(ctx, "Running an invocation of ClusterResource Sync") | ||
|
||
// Prefer to sync projects most newly created to ensure their resources get created first when other resources exist. | ||
projects, err := c.db.ProjectRepo().ListAll(ctx, descCreatedAtSortParam) | ||
|
@@ -389,9 +389,8 @@ func (c *controller) Sync(ctx context.Context) error { | |
c.metrics.ResourceAddErrors.Inc() | ||
errs = append(errs, err) | ||
} else { | ||
logger.Infof(ctx, "Created cluster resources for namespace [%s] in kubernetes", namespace) | ||
c.metrics.ResourcesAdded.Inc() | ||
logger.Debugf(ctx, "Successfully created kubernetes resources for [%s-%s]", project.Identifier, domain.ID) | ||
logger.Debugf(ctx, "Successfully created kubernetes resources for [%s]", namespace) | ||
} | ||
} | ||
} | ||
|
@@ -403,7 +402,7 @@ func (c *controller) Sync(ctx context.Context) error { | |
|
||
func (c *controller) Run() { | ||
ctx := context.Background() | ||
logger.Infof(ctx, "Running ClusterResourceController") | ||
logger.Debugf(ctx, "Running ClusterResourceController") | ||
interval := c.config.ClusterResourceConfiguration().GetRefreshInterval() | ||
wait.Forever(func() { | ||
err := c.Sync(ctx) | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is this not a warning? We are ignoring something?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not necessarily, we only look at yaml files (because of how kubernetes mounts configmaps with symlinks this was causing problems in the sandbox mode)