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

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

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

seanrclayton
Copy link

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
Copy link

nasirhm commented Feb 13, 2022

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
Copy link
Author

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
Copy link

@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: #251

Comment on lines +414 to +416
frequencySeconds:
x-kubernetes-int-or-string: true
description: Number of seconds between each validation

Choose a reason for hiding this comment

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

I found that you can still use the anyOf syntax, but the order of the types matters.
In the old version it was

anyOf:
  - type: string
  - type: integer

but

anyOf:
  - type: integer
  - type: string

avoids the need to use x-kubernetes-int-or-string. My interpretation of x-kubernetes-int-or-string was a workaround, but that may be misguided.

Suggested change
frequencySeconds:
x-kubernetes-int-or-string: true
description: Number of seconds between each validation
frequencySeconds:
type: object
anyOf:
- type: integer
- type: string
description: Number of seconds between each validation

Choose a reason for hiding this comment

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

The above suggestion can be applied to all int-or-string lines.

Choose a reason for hiding this comment

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

Reading more of the documentation looks like x-kubernetes-int-or-string is just shorthand, not necessarily a workaround. Carry on!

@ArtemChekunov
Copy link

Hi guys,

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

@ArtemChekunov
Copy link

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
Copy link

Eugst commented Apr 13, 2022

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
Copy link

Eugst commented Apr 15, 2022

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

@evin-bz
Copy link

evin-bz commented Nov 14, 2022

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

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.

7 participants