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

Support for empty Limtador CR #30

Merged
merged 2 commits into from
Jul 11, 2022
Merged

Conversation

eguzki
Copy link
Contributor

@eguzki eguzki commented Jul 11, 2022

what

  • Fix config file of limitador when limits are not set
  • Fix support for empty spec.listeners optional field

verification steps

  • deploy limitador locally
make local-setup
  • deploy empty limitador CR
k apply -f - <<EOF
apiVersion: limitador.kuadrant.io/v1alpha1         
kind: Limitador                                    
metadata:                                          
  name: limitador-sample                           
spec:  {}
EOF
  • Limitador operator does not generate any error log
$ k logs -n limitador-operator-system limitador-operator-controller-manager-749c4fdc44-tnsrx -c manager
{"level":"info","ts":1657529026.7756279,"msg":"go version: go1.16.15"}
{"level":"info","ts":1657529026.7756512,"msg":"go os/arch: linux/amd64"}
{"level":"info","ts":1657529026.7756562,"msg":"base logger","log level":"info","log mode":"production"}
{"level":"info","ts":1657529027.3821933,"logger":"controller-runtime.metrics","msg":"metrics server is starting to listen","addr":"127.0.0.1:8080"}
{"level":"info","ts":1657529027.3836012,"msg":"starting manager"}
{"level":"info","ts":1657529027.3845196,"msg":"starting metrics server","path":"/metrics"}
{"level":"info","ts":1657529027.3846383,"msg":"attempting to acquire leader lease limitador-operator-system/3745a16e.kuadrant.io...\n"}
{"level":"info","ts":1657529027.5713243,"msg":"successfully acquired lease limitador-operator-system/3745a16e.kuadrant.io\n"}
{"level":"info","ts":1657529027.572534,"logger":"controller.limitador","msg":"Starting EventSource","reconciler group":"limitador.kuadrant.io","reconciler kind":"Limitador","source":"kind source: /, Kind="}
{"level":"info","ts":1657529027.670073,"logger":"controller.limitador","msg":"Starting Controller","reconciler group":"limitador.kuadrant.io","reconciler kind":"Limitador"}
{"level":"info","ts":1657529027.8804502,"logger":"controller.limitador","msg":"Starting workers","reconciler group":"limitador.kuadrant.io","reconciler kind":"Limitador","worker count":1}
{"level":"info","ts":1657529104.7214217,"logger":"limitador","msg":"create object","limitador":"default/limitador-sample","GKV":"/v1, Kind=Service","name":"limitador-sample","namespace":"default"}
{"level":"info","ts":1657529104.8410294,"logger":"limitador","msg":"create object","limitador":"default/limitador-sample","GKV":"apps/v1, Kind=Deployment","name":"limitador-sample","namespace":"default"}
{"level":"info","ts":1657529105.07508,"logger":"limitador","msg":"create object","limitador":"default/limitador-sample","GKV":"/, Kind=","name":"limits-config-limitador-sample","namespace":"default"}
{"level":"info","ts":1657529105.0891075,"logger":"limitador","msg":"update object","limitador":"default/limitador-sample","GKV":"apps/v1, Kind=Deployment","name":"limitador-sample","namespace":"default"}
  • limitador-config.yaml file's content is []
k get cm limits-config-limitador-sample -o yaml
apiVersion: v1
data:
  hash: 58e0494c51d30eb3494f7c9198986bb9
  limitador-config.yaml: |
    []
kind: ConfigMap
metadata:
  creationTimestamp: "2022-07-11T08:45:05Z"
  labels:
    app: limitador
  name: limits-config-limitador-sample
  namespace: default
  resourceVersion: "876"
  uid: 5ef83916-12f4-4da0-82ae-166e12b8aa31

@eguzki eguzki changed the title Fix when limits not set Support for empty Limtador CR Jul 11, 2022
@eguzki eguzki requested a review from didierofrivia July 11, 2022 08:56
Copy link
Member

@didierofrivia didierofrivia left a comment

Choose a reason for hiding this comment

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

👍🏼

@@ -61,6 +66,34 @@ type Limitador struct {
Status LimitadorStatus `json:"status,omitempty"`
}

func (l *Limitador) GRPCPort() int32 {
Copy link
Member

Choose a reason for hiding this comment

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

I see, so instead of defining default values in the "code" we'll get them defined in "types"

@didierofrivia didierofrivia merged commit a73f233 into main Jul 11, 2022
@didierofrivia didierofrivia deleted the fix-when-limits-not-set branch July 11, 2022 13:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants