-
Notifications
You must be signed in to change notification settings - Fork 151
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Cleanup kustomize manifests rendering action (#1353)
This commit is meant to cleanup the kustomize manifest redering by: - removing a useless parameter related to the caching mechanism - moving the code to the kustomize package to accomodate other rendering engines - introduce metrics tro track how many resources have been rendered and to perform blackbox testing against the action
- Loading branch information
1 parent
4906ffe
commit f941791
Showing
8 changed files
with
92 additions
and
64 deletions.
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
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
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
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
2 changes: 1 addition & 1 deletion
2
...render/action_render_manifests_support.go → ...tomize/action_render_manifests_support.go
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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
package render | ||
package kustomize | ||
|
||
import ( | ||
"context" | ||
|
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
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 |
---|---|---|
@@ -0,0 +1,32 @@ | ||
package render | ||
|
||
import ( | ||
"github.com/prometheus/client_golang/prometheus" | ||
"sigs.k8s.io/controller-runtime/pkg/metrics" | ||
) | ||
|
||
var ( | ||
// RenderedResourcesTotal is a prometheus counter metrics which holds the total | ||
// number of resource rendered by the action per controller and rendering type. | ||
// It has two labels. | ||
// controller label refers to the controller name. | ||
// engine label refers to the rendering engine. | ||
RenderedResourcesTotal = prometheus.NewCounterVec( | ||
prometheus.CounterOpts{ | ||
Name: "action_renderer_manifests_total", | ||
Help: "Number of rendered resources", | ||
}, | ||
[]string{ | ||
"controller", | ||
"engine", | ||
}, | ||
) | ||
) | ||
|
||
// init register metrics to the global registry from controller-runtime/pkg/metrics. | ||
// see https://book.kubebuilder.io/reference/metrics#publishing-additional-metrics | ||
// | ||
//nolint:gochecknoinits | ||
func init() { | ||
metrics.Registry.MustRegister(RenderedResourcesTotal) | ||
} |
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