koki / short

Manageable Kubernetes manifests through a composable, reusable syntax
https://docs.koki.io/short
Apache License 2.0
122 stars 14 forks source link

Issue 176 : #220

Closed hitchhiker-vogon closed 6 years ago

hitchhiker-vogon commented 6 years ago

Support for MutatingWebhookConfiguration and ValidatingWebhookConfiguration Corresponding converter/types added

wlan0 commented 6 years ago

Need to add a line in tests/functional_tests.go like this

func TestValidatingWebhooks(t *testing.T) {
   err := testResource("validating_webhooks", testFuncGenerator(t))
   if err != nil {
     t.Fatal(err)
   }
}

func TestMutatingWebhooks(t *testing.T) {
   err := testResource("mutating_webhooks", testFuncGenerator(t))
   if err != nil {
     t.Fatal(err)
   }
}

This will run the CI tests with the resources present in testdata

wlan0 commented 6 years ago

@hitchhiker-vogon Here's the code to convert Koki selector labels/expressions to Kube expressions

https://github.com/koki/short/blob/master/converter/converters/koki_replicaset_to_kube_replicaset.go#L176

Here's the code to convert Kube selector labels/expressions to Koki expressions

https://github.com/koki/short/blob/master/converter/converters/kube_replicaset_to_koki_replicaset.go#L153

Here's an example of how this code is reused in converting deployement object from Kube to Koki https://github.com/koki/short/blob/master/converter/converters/kube_deployment_to_koki_deployment.go#L66. (Notice the statements following the conversion of selectors)

We also talked about using the pipe separated Operation expressions today, like so

CREATE|UPDATE|DELETE|CONNECT|*

Note that if '*' is present, then the other expressions should be omitted. Similarly, if all Operations are specified, then that expression should be substituted to '*'

wlan0 commented 6 years ago

:+1:

LGTM