-
Notifications
You must be signed in to change notification settings - Fork 544
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
Verify Native APIs Present for ClusterServiceVersion #541
Conversation
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: If they are not already assigned, you can assign the PR to them by writing The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
// that can manage apps for given version and AppType. | ||
// NativeAPI describes the GVK of a Kubernetes resource that is required by an | ||
// Operator, but must be provided by the underlying cluster and not an extension. | ||
type NativeAPI struct { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There might be an existing struct that can be used here that is JSON-serializable.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great :) just need an e2e test and we can merge |
d927772
to
0814f13
Compare
@@ -180,7 +180,25 @@ spec: | |||
values: | |||
type: array | |||
description: set of values for the expression | |||
|
|||
nativeAPIs: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can't enforce this as a required field, but it should be.
276c901
to
2cacdfb
Compare
@@ -238,7 +260,7 @@ func (a *Operator) requirementAndPermissionStatus(csv *v1alpha1.ClusterServiceVe | |||
return false, nil, fmt.Errorf("could not cast install strategy as type %T", strategyDetailsDeployment) | |||
} | |||
|
|||
reqMet, reqStatuses := a.requirementStatus(strategyDetailsDeployment, csv.GetAllCRDDescriptions(), csv.GetOwnedAPIServiceDescriptions(), csv.GetRequiredAPIServiceDescriptions()) | |||
reqMet, reqStatuses := a.requirementStatus(strategyDetailsDeployment, csv.GetAllCRDDescriptions(), csv.GetOwnedAPIServiceDescriptions(), csv.GetRequiredAPIServiceDescriptions(), csv.Spec.NativeAPIs) | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does the GUI ever make use of the previous getter methods? I'm just wondering if it's worth making one for the Native APIs to return an alphabetical listing (or deduplication) like the others.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't understand how the frontend app would call into the Operator Go source...?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn't mean call directly. But based on your response there's zero coupling.
Verify Native APIs Present for ClusterServiceVersion
Description
Adds the ability to enforce that certain "native" APIs exist in a Kubernetes cluster in order to install an Operator using a
ClusterServiceVersion
. This is a more complete solution than depending on some "version" of Kubernetes, because there are so many flavors and distributions that may or may not contain the APIs consumed by the Operator.Changes
spec.nativeAPIs
field toClusterServiceVersion
(array ofGroupVersionKinds
)requirementStatus
just like CRDs and apiservicesAddresses https://jira.coreos.com/browse/ALM-666