armory / spinnaker-operator

Open Source Spinnaker Kubernetes Operator source code
Apache License 2.0
186 stars 71 forks source link

Changes the yaml for crd creation to remove deprecation warning on v1.22 #250

Open seanrclayton opened 2 years ago

seanrclayton commented 2 years ago

I ran into the same problem described in this issue I updated the yaml to comply with the changes described in the migration document here And Deploying the service seems to work just fine.

nasirhm commented 2 years ago

It fails to apply the CRDs due to OpenAPI Validation Errors as follows:

Spinnaker Accounts:

The CustomResourceDefinition "spinnakeraccounts.spinnaker.io" is invalid:
* spec.validation.openAPIV3Schema.properties[spec].properties[settings].type: Required value: must not be empty for specified object fields
* spec.validation.openAPIV3Schema.properties[spec].properties[validation].properties[frequencySeconds].anyOf[0].type: Forbidden: must be empty to be structural
* spec.validation.openAPIV3Schema.properties[spec].properties[validation].properties[frequencySeconds].anyOf[1].type: Forbidden: must be empty to be structural
* spec.validation.openAPIV3Schema.properties[spec].properties[validation].properties[frequencySeconds].type: Required value: must not be empty for specified object fields

for SpinnakerService CRD:

The CustomResourceDefinition "spinnakerservices.spinnaker.io" is invalid:
* spec.validation.openAPIV3Schema.properties[spec].properties[spinnakerConfig].properties[config].type: Required value: must not be empty for specified object fields
* spec.validation.openAPIV3Schema.properties[spec].properties[spinnakerConfig].properties[profiles].additionalProperties.type: Required value: must not be empty for specified object fields
* spec.validation.openAPIV3Schema.properties[spec].properties[spinnakerConfig].properties[service-settings].additionalProperties.type: Required value: must not be empty for specified object fields
* spec.validation.openAPIV3Schema.properties[spec].properties[validation].properties[canary].additionalProperties.properties[frequencySeconds].anyOf[0].type: Forbidden: must be empty to be structural
* spec.validation.openAPIV3Schema.properties[spec].properties[validation].properties[canary].additionalProperties.properties[frequencySeconds].anyOf[1].type: Forbidden: must be empty to be structural
* spec.validation.openAPIV3Schema.properties[spec].properties[validation].properties[canary].additionalProperties.properties[frequencySeconds].type: Required value: must not be empty for specified object fields
* spec.validation.openAPIV3Schema.properties[spec].properties[validation].properties[ci].additionalProperties.properties[frequencySeconds].anyOf[0].type: Forbidden: must be empty to be structural
* spec.validation.openAPIV3Schema.properties[spec].properties[validation].properties[ci].additionalProperties.properties[frequencySeconds].anyOf[1].type: Forbidden: must be empty to be structural
* spec.validation.openAPIV3Schema.properties[spec].properties[validation].properties[ci].additionalProperties.properties[frequencySeconds].type: Required value: must not be empty for specified object fields
* spec.validation.openAPIV3Schema.properties[spec].properties[validation].properties[frequencySeconds].anyOf[0].type: Forbidden: must be empty to be structural
* spec.validation.openAPIV3Schema.properties[spec].properties[validation].properties[frequencySeconds].anyOf[1].type: Forbidden: must be empty to be structural
* spec.validation.openAPIV3Schema.properties[spec].properties[validation].properties[frequencySeconds].type: Required value: must not be empty for specified object fields
* spec.validation.openAPIV3Schema.properties[spec].properties[validation].properties[metricStores].additionalProperties.properties[frequencySeconds].anyOf[0].type: Forbidden: must be empty to be structural
* spec.validation.openAPIV3Schema.properties[spec].properties[validation].properties[metricStores].additionalProperties.properties[frequencySeconds].anyOf[1].type: Forbidden: must be empty to be structural
* spec.validation.openAPIV3Schema.properties[spec].properties[validation].properties[metricStores].additionalProperties.properties[frequencySeconds].type: Required value: must not be empty for specified object fields
* spec.validation.openAPIV3Schema.properties[spec].properties[validation].properties[notifications].additionalProperties.properties[frequencySeconds].anyOf[0].type: Forbidden: must be empty to be structural
* spec.validation.openAPIV3Schema.properties[spec].properties[validation].properties[notifications].additionalProperties.properties[frequencySeconds].anyOf[1].type: Forbidden: must be empty to be structural
* spec.validation.openAPIV3Schema.properties[spec].properties[validation].properties[notifications].additionalProperties.properties[frequencySeconds].type: Required value: must not be empty for specified object fields
* spec.validation.openAPIV3Schema.properties[spec].properties[validation].properties[persistentStorage].additionalProperties.properties[frequencySeconds].anyOf[0].type: Forbidden: must be empty to be structural
* spec.validation.openAPIV3Schema.properties[spec].properties[validation].properties[persistentStorage].additionalProperties.properties[frequencySeconds].anyOf[1].type: Forbidden: must be empty to be structural
* spec.validation.openAPIV3Schema.properties[spec].properties[validation].properties[persistentStorage].additionalProperties.properties[frequencySeconds].type: Required value: must not be empty for specified object fields
* spec.validation.openAPIV3Schema.properties[spec].properties[validation].properties[providers].additionalProperties.properties[frequencySeconds].anyOf[0].type: Forbidden: must be empty to be structural
* spec.validation.openAPIV3Schema.properties[spec].properties[validation].properties[providers].additionalProperties.properties[frequencySeconds].anyOf[1].type: Forbidden: must be empty to be structural
* spec.validation.openAPIV3Schema.properties[spec].properties[validation].properties[providers].additionalProperties.properties[frequencySeconds].type: Required value: must not be empty for specified object fields
* spec.validation.openAPIV3Schema.properties[spec].properties[validation].properties[pubsub].additionalProperties.properties[frequencySeconds].anyOf[0].type: Forbidden: must be empty to be structural
* spec.validation.openAPIV3Schema.properties[spec].properties[validation].properties[pubsub].additionalProperties.properties[frequencySeconds].anyOf[1].type: Forbidden: must be empty to be structural
* spec.validation.openAPIV3Schema.properties[spec].properties[validation].properties[pubsub].additionalProperties.properties[frequencySeconds].type: Required value: must not be empty for specified object fields

How did you get it to work on your local setup ?

seanrclayton commented 2 years ago

Apologies - I didn't realize i hadn't merged the feature branch with master in my repo. I actually changed my original way of fixing and issue with the depreciation of anyOf to use x-kubernetes-int-or-string The CRD applies now. I tried testing it on my local machine rather than a cluster - but got an error, so further testing on spinnaker's end would be needed.

villasenor commented 2 years ago

@seanrclayton Thanks for jumping in to help solve this issue! Not sure if this is due to an error on my end or the changes in this branch, but while I was able to get the operator to install with this branch, I can't actually get the operator to deploy anything. See the issue I opened here: https://github.com/armory/spinnaker-operator/issues/251

ArtemChekunov commented 2 years ago

Hi guys,

Many thanks for all your work. Any chance to release it before GKE will upgrade to kube_ver: 1.22?

ArtemChekunov commented 2 years ago

hmm

extra keys not allowed @ pull_request_rules → item 0 → actions → merge → strict

looks like the field is not appropriate https://github.com/armory/spinnaker-operator/blob/master/.mergify.yml#L10

Eugst commented 2 years ago

https://blog.mergify.com/strict-mode-deprecation/ strict was deprecated. and it is no more in merge options: https://docs.mergify.com/actions/merge/#options

@seanrclayton could you, please, check the comment from @abannachZen

Eugst commented 2 years ago

@abannachZen How I can speed up the delivery of this PR?

evin-bz commented 1 year ago

I can confirm this fixes the issue I was having as well (with k3d), would be a +1 to merging