-
Notifications
You must be signed in to change notification settings - Fork 78
Add conditions array to OperatorCondition's spec #119
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
Merged
openshift-merge-robot
merged 2 commits into
operator-framework:master
from
dinhxuanvu:opcon-crd
May 26, 2021
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
// +groupName=operators.coreos.com | ||
|
||
// Package v2 contains resources types for version v2 of the operators.coreos.com API group. | ||
package v2 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
// +kubebuilder:object:generate=true | ||
|
||
// Package v2 contains API Schema definitions for the operator v2 API group. | ||
package v2 | ||
|
||
import ( | ||
"k8s.io/apimachinery/pkg/runtime/schema" | ||
"sigs.k8s.io/controller-runtime/pkg/scheme" | ||
) | ||
|
||
var ( | ||
// GroupVersion is group version used to register these objects. | ||
GroupVersion = schema.GroupVersion{Group: "operators.coreos.com", Version: "v2"} | ||
|
||
// SchemeGroupVersion is required for compatibility with client generation. | ||
SchemeGroupVersion = GroupVersion | ||
|
||
// SchemeBuilder is used to add go types to the GroupVersionKind scheme. | ||
SchemeBuilder = &scheme.Builder{GroupVersion: GroupVersion} | ||
|
||
// AddToScheme adds the types in this group-version to the given scheme. | ||
AddToScheme = SchemeBuilder.AddToScheme | ||
) | ||
|
||
// Resource takes an unqualified resource and returns a Group qualified GroupResource | ||
func Resource(resource string) schema.GroupResource { | ||
return GroupVersion.WithResource(resource).GroupResource() | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
package v2 | ||
|
||
import ( | ||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" | ||
) | ||
|
||
const ( | ||
// Upgradeable indicates that the operator is upgradeable | ||
Upgradeable string = "Upgradeable" | ||
) | ||
|
||
// OperatorConditionSpec allows an operator to report state to OLM and provides | ||
// cluster admin with the ability to manually override state reported by the operator. | ||
type OperatorConditionSpec struct { | ||
ServiceAccounts []string `json:"serviceAccounts,omitempty"` | ||
Deployments []string `json:"deployments,omitempty"` | ||
Overrides []metav1.Condition `json:"overrides,omitempty"` | ||
Conditions []metav1.Condition `json:"conditions,omitempty"` | ||
} | ||
|
||
// OperatorConditionStatus allows OLM to convey which conditions have been observed. | ||
type OperatorConditionStatus struct { | ||
Conditions []metav1.Condition `json:"conditions,omitempty"` | ||
} | ||
|
||
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object | ||
// +genclient | ||
// +kubebuilder:storageversion | ||
dinhxuanvu marked this conversation as resolved.
Show resolved
Hide resolved
|
||
// +kubebuilder:resource:shortName=condition,categories=olm | ||
// +kubebuilder:subresource:status | ||
// OperatorCondition is a Custom Resource of type `OperatorCondition` which is used to convey information to OLM about the state of an operator. | ||
type OperatorCondition struct { | ||
metav1.TypeMeta `json:",inline"` | ||
metav1.ObjectMeta `json:"metadata"` | ||
|
||
Spec OperatorConditionSpec `json:"spec,omitempty"` | ||
Status OperatorConditionStatus `json:"status,omitempty"` | ||
} | ||
|
||
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object | ||
// OperatorConditionList represents a list of Conditions. | ||
type OperatorConditionList struct { | ||
metav1.TypeMeta `json:",inline"` | ||
metav1.ListMeta `json:"metadata"` | ||
|
||
Items []OperatorCondition `json:"items"` | ||
} | ||
|
||
func init() { | ||
SchemeBuilder.Register(&OperatorCondition{}, &OperatorConditionList{}) | ||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.