Skip to content

Commit

Permalink
Merge pull request #477 from zeeke/improve-operator-logging
Browse files Browse the repository at this point in the history
Improve operator logging
  • Loading branch information
adrianchiris committed Jul 20, 2023
2 parents 52e9d20 + ed9d2db commit 154d2d6
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
1 change: 0 additions & 1 deletion api/v1/helper.go
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,6 @@ func (p *SriovNetworkNodePolicy) Selected(node *corev1.Node) bool {
}
return false
}
log.Info("Selected():", "node", node.Name)
return true
}

Expand Down
4 changes: 2 additions & 2 deletions controllers/sriovnetworknodepolicy_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -576,7 +576,7 @@ func renderDsForCR(path string, data *render.RenderData) ([]*uns.Unstructured, e

func (r *SriovNetworkNodePolicyReconciler) renderDevicePluginConfigData(ctx context.Context, pl *sriovnetworkv1.SriovNetworkNodePolicyList, node *corev1.Node) (dptypes.ResourceConfList, error) {
logger := log.Log.WithName("renderDevicePluginConfigData")
logger.Info("Start to render device plugin config data")
logger.Info("Start to render device plugin config data", "node", node.Name)
rcl := dptypes.ResourceConfList{}
for _, p := range pl.Items {
if p.Name == constants.DefaultPolicyName {
Expand Down Expand Up @@ -608,7 +608,7 @@ func (r *SriovNetworkNodePolicyReconciler) renderDevicePluginConfigData(ctx cont
return rcl, err
}
rcl.ResourceList = append(rcl.ResourceList, *rc)
logger.Info("Add resource", "Resource", *rc, "Resource list", rcl.ResourceList)
logger.Info("Add resource", "Resource", *rc)
}
}
return rcl, nil
Expand Down
2 changes: 2 additions & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import (
netattdefv1 "github.com/k8snetworkplumbingwg/network-attachment-definition-client/pkg/apis/k8s.cni.cncf.io/v1"
openshiftconfigv1 "github.com/openshift/api/config/v1"
mcfgv1 "github.com/openshift/machine-config-operator/pkg/apis/machineconfiguration.openshift.io/v1"
"go.uber.org/zap/zapcore"
"k8s.io/apimachinery/pkg/api/errors"

// Import all Kubernetes client auth plugins (e.g. Azure, GCP, OIDC, etc.)
Expand Down Expand Up @@ -77,6 +78,7 @@ func main() {
"Enabling this will ensure there is only one active controller manager.")
opts := zap.Options{
Development: true,
TimeEncoder: zapcore.RFC3339NanoTimeEncoder,
}
opts.BindFlags(flag.CommandLine)
flag.Parse()
Expand Down

0 comments on commit 154d2d6

Please sign in to comment.