Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fixed kustomize docs #1074

Merged
merged 4 commits into from
Aug 19, 2024
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions docs/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ aliases:
- /operator/changelog/index.html
---

- fixed Prometheus scrape config metricsPath conversion. See [this issue](https://github.com/VictoriaMetrics/operator/issues/1073)

## [v0.47.0](https://github.com/VictoriaMetrics/operator/releases/tag/v0.47.0) - 15 Aug 2024

### Breaking changes
Expand Down
5 changes: 3 additions & 2 deletions docs/setup.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ For installing VictoriaMetrics operator with helm-chart follow the instructions
([this](https://github.com/VictoriaMetrics/helm-charts/blob/master/charts/victoria-metrics-operator/README.md)
or [this](https://github.com/VictoriaMetrics/helm-charts/blob/master/charts/victoria-metrics-k8s-stack/README.md)).

in addition, you can use [quickstart guide](https://docs.victoriametrics.com/operator/quick-start) for
in addition, you can use [quickstart guide](https://docs.victoriametrics.com/operator/quick-start) for
installing VictoriaMetrics operator with helm-chart.

## Installing by Manifest
Expand Down Expand Up @@ -76,7 +76,8 @@ resources:
namespace: ${NAMESPACE}

images:
- name: victoriametrics/operator
- name: manager
newName: victoriametrics/operator
newTag: ${VM_VERSION}
EOF
```
Expand Down
1 change: 1 addition & 0 deletions internal/controller/operator/converter/v1alpha1/apis.go
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,7 @@ func ConvertScrapeConfig(promscrapeConfig *promv1alpha1.ScrapeConfig, conf *conf
cs.Annotations = converter.FilterPrefixes(promscrapeConfig.Annotations, conf.FilterPrometheusConverterAnnotationPrefixes)
cs.Spec.RelabelConfigs = converter.ConvertRelabelConfig(promscrapeConfig.Spec.RelabelConfigs)
cs.Spec.MetricRelabelConfigs = converter.ConvertRelabelConfig(promscrapeConfig.Spec.MetricRelabelConfigs)
cs.Spec.Path = *promscrapeConfig.Spec.MetricsPath
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think, it's better to use ptr.Deref, otherwise operator will crash with panic at null metricsPath

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See failed tests

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updated


if promscrapeConfig.Spec.EnableCompression != nil {
cs.Spec.VMScrapeParams = &vmv1beta1.VMScrapeParams{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ func TestConvertScrapeConfig(t *testing.T) {
Username: corev1.SecretKeySelector{Key: "username"},
Password: corev1.SecretKeySelector{Key: "password"},
},
MetricsPath: ptr.To("/test"),
ProxyConfig: promv1.ProxyConfig{
ProxyURL: ptr.To("http://proxy.com"),
},
Expand All @@ -108,6 +109,7 @@ func TestConvertScrapeConfig(t *testing.T) {
ProxyURL: ptr.To("http://proxy.com"),
HonorTimestamps: ptr.To(true),
VMScrapeParams: &vmv1beta1.VMScrapeParams{DisableCompression: ptr.To(false)},
Path: "/test",
},
StaticConfigs: []vmv1beta1.StaticConfig{
{
Expand Down
Loading