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

fix: Return an error when receiving no provider or providerRef #201

Merged

Conversation

jonathan-innis
Copy link
Member

@jonathan-innis jonathan-innis commented Feb 2, 2023

Fixes aws/karpenter-provider-aws#3343

Description

  • Return an error when receiving no provider or providerRef

Tried using x-kubernetes-validations but this doesn't work for customers that have not enabled the feature flag and are using older versions of K8s

error: error validating "pkg/apis/crds/karpenter.sh_provisioners.yaml": error validating data: ValidationError(CustomResourceDefinition.spec.versions[0].schema.openAPIV3Schema.properties.spec): unknown field "x-kubernetes-validations" in io.k8s.apiextensions-apiserver.pkg.apis.apiextensions.v1.JSONSchemaProps; if you choose to ignore these errors, turn validation off with --validate=false

How was this change tested?

make presubmit

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@jonathan-innis jonathan-innis marked this pull request as ready for review February 2, 2023 23:46
@jonathan-innis jonathan-innis requested a review from a team as a code owner February 2, 2023 23:46
@jonathan-innis jonathan-innis enabled auto-merge (squash) February 2, 2023 23:50
@coveralls
Copy link

coveralls commented Feb 2, 2023

Pull Request Test Coverage Report for Build 4079684809

  • 3 of 3 (100.0%) changed or added relevant lines in 1 file are covered.
  • 12 unchanged lines in 2 files lost coverage.
  • Overall coverage decreased (-0.02%) to 78.338%

Files with Coverage Reduction New Missed Lines %
pkg/controllers/deprovisioning/controller.go 3 76.54%
pkg/controllers/deprovisioning/events/events.go 9 80.0%
Totals Coverage Status
Change from base Build 4069455737: -0.02%
Covered Lines: 6220
Relevant Lines: 7940

💛 - Coveralls

@jonathan-innis jonathan-innis merged commit 586061d into kubernetes-sigs:main Feb 3, 2023
@jonathan-innis jonathan-innis deleted the error-on-no-provider branch February 3, 2023 19:35
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.

A more detailed error message for a Provisioner without providerRef?
3 participants