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

[BUG]: Crd AltermanagerConfig field muteTimeIntervals.timeIntervals.months regex pattern |[1-12] isn't correct #6353

Closed
1 task done
dellnoantechnp opened this issue Mar 1, 2024 · 1 comment · Fixed by #6362

Comments

@dellnoantechnp
Copy link

Is there an existing issue for this?

  • I have searched the existing issues

What happened?

Description

apiVersion: monitoring.coreos.com/v1alpha1
kind: AlertmanagerConfig
metadata:
  name: my-prometheusalert
spec:
  muteTimeIntervals:
    - name: holidays
      timeIntervals:
      - months:
        - january
        - may:august
        - "1"       <--- success
        - "2"       <--- success
        - "3"       <---- failed
....
The AlertmanagerConfig "my-prometheusalert" is invalid: spec.muteTimeIntervals.timeIntervals.months: Invalid value: "12": spec.muteTimeIntervals.timeIntervals.months in body should match '^((?i)january|february|march|april|may|june|july|august|september|october|november|december|[1-12])(?:((:((?i)january|february|march|april|may|june|july|august|september|october|november|december|[1-12]))$)|$)'

Steps to Reproduce

Expected Result

two way expect:

  1. only accept month name.
  2. \b([1-9]|1[0-2])\b access 1-12

Actual Result

Invalid value: "12"

Prometheus Operator Version

Name:                   kube-prometheus-stack-operator                                      
Namespace:              monitoring                                                          
CreationTimestamp:      Mon, 29 Jan 2024 06:14:09 +0000                                     
Labels:                 app=kube-prometheus-stack-operator                                  
                        app.kubernetes.io/component=prometheus-operator                     
                        app.kubernetes.io/instance=kube-prometheus-stack                    
                        app.kubernetes.io/managed-by=Helm                                   
                        app.kubernetes.io/name=kube-prometheus-stack-prometheus-operator    
                        app.kubernetes.io/part-of=kube-prometheus-stack                     
                        app.kubernetes.io/version=56.2.1                                    
                        argocd.argoproj.io/instance=kube-prometheus-stack                   
                        chart=kube-prometheus-stack-56.2.1                                  
                        heritage=Helm                                                       
                        release=kube-prometheus-stack                                       
Annotations:            deployment.kubernetes.io/revision: 1                                
Selector:               app=kube-prometheus-stack-operator,release=kube-prometheus-stack    
Replicas:               1 desired | 1 updated | 1 total | 1 available | 0 unavailable       
StrategyType:           RollingUpdate                                                       
MinReadySeconds:        0                                                                   
RollingUpdateStrategy:  25% max unavailable, 25% max surge                                  
Pod Template:                                                                               
  Labels:           app=kube-prometheus-stack-operator                                      
                    app.kubernetes.io/component=prometheus-operator                         
                    app.kubernetes.io/instance=kube-prometheus-stack                        
                    app.kubernetes.io/managed-by=Helm                                       
                    app.kubernetes.io/name=kube-prometheus-stack-prometheus-operator        
                    app.kubernetes.io/part-of=kube-prometheus-stack                         
                    app.kubernetes.io/version=56.2.1                                        
                    chart=kube-prometheus-stack-56.2.1                                      
                    heritage=Helm                                                           
                    release=kube-prometheus-stack

Kubernetes Version

>_ kubectl version -o yaml 
clientVersion:
  buildDate: "2021-08-04T18:03:20Z"
  compiler: gc
  gitCommit: c2b5237ccd9c0f1d600d3072634ca66cefdf272f
  gitTreeState: clean
  gitVersion: v1.22.0
  goVersion: go1.16.6
  major: "1"
  minor: "22"
  platform: linux/amd64
serverVersion:
  buildDate: "2021-08-04T17:57:25Z"
  compiler: gc
  gitCommit: c2b5237ccd9c0f1d600d3072634ca66cefdf272f
  gitTreeState: clean
  gitVersion: v1.22.0
  goVersion: go1.16.6
  major: "1"
  minor: "22"
  platform: linux/amd64

Kubernetes Cluster Type

kubeadm

How did you deploy Prometheus-Operator?

helm chart:prometheus-community/kube-prometheus-stack

Manifests

No response

prometheus-operator log output

None

Anything else?

No response

@dellnoantechnp dellnoantechnp added kind/bug needs-triage Issues that haven't been triaged yet labels Mar 1, 2024
@nicolastakashi nicolastakashi added good first issue and removed needs-triage Issues that haven't been triaged yet labels Mar 1, 2024
@mouad-eh
Copy link
Contributor

mouad-eh commented Mar 3, 2024

This looks like a good issue to start with. I already started working on it, I will follow up with PR once I am done.

simonpasquier added a commit that referenced this issue Mar 28, 2024
fix: Crd AltermanagerConfig field muteTimeIntervals.timeIntervals.months regex pattern |[1-12] isn't correct (#6353)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants