generated from kubernetes/kubernetes-template-project
-
Notifications
You must be signed in to change notification settings - Fork 82
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #492 from Danil-Grigorev/runtime-extension-provider
✨ Add RuntimeExtension provider
- Loading branch information
Showing
18 changed files
with
3,465 additions
and
34 deletions.
There are no files selected for viewing
This file contains 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,61 @@ | ||
/* | ||
Copyright 2024 The Kubernetes Authors. | ||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. | ||
You may obtain a copy of the License at | ||
http://www.apache.org/licenses/LICENSE-2.0 | ||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. | ||
*/ | ||
|
||
package v1alpha2 | ||
|
||
import ( | ||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" | ||
) | ||
|
||
// RuntimeExtensionProviderSpec defines the desired state of RuntimeExtensionProvider. | ||
type RuntimeExtensionProviderSpec struct { | ||
ProviderSpec `json:",inline"` | ||
} | ||
|
||
// RuntimeExtensionProviderStatus defines the observed state of RuntimeExtensionProvider. | ||
type RuntimeExtensionProviderStatus struct { | ||
ProviderStatus `json:",inline"` | ||
} | ||
|
||
// +kubebuilder:object:root=true | ||
// +kubebuilder:resource:path=runtimeextensionproviders,shortName=carep,scope=Namespaced | ||
// +kubebuilder:subresource:status | ||
// +kubebuilder:printcolumn:name="InstalledVersion",type="string",JSONPath=".status.installedVersion" | ||
// +kubebuilder:printcolumn:name="Ready",type="string",JSONPath=".status.conditions[?(@.type=='Ready')].status" | ||
// +kubebuilder:storageversion | ||
|
||
// RuntimeExtensionProvider is the Schema for the RuntimeExtensionProviders API. | ||
type RuntimeExtensionProvider struct { | ||
metav1.TypeMeta `json:",inline"` | ||
metav1.ObjectMeta `json:"metadata,omitempty"` | ||
|
||
Spec RuntimeExtensionProviderSpec `json:"spec,omitempty"` | ||
Status RuntimeExtensionProviderStatus `json:"status,omitempty"` | ||
} | ||
|
||
// +kubebuilder:object:root=true | ||
|
||
// RuntimeExtensionProviderList contains a list of RuntimeExtensionProviders. | ||
type RuntimeExtensionProviderList struct { | ||
metav1.TypeMeta `json:",inline"` | ||
metav1.ListMeta `json:"metadata,omitempty"` | ||
Items []RuntimeExtensionProvider `json:"items"` | ||
} | ||
|
||
func init() { | ||
ProviderLists = append(ProviderLists, &RuntimeExtensionProviderList{}) | ||
Providers = append(Providers, &RuntimeExtensionProvider{}) | ||
} |
This file contains 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,61 @@ | ||
/* | ||
Copyright 2024 The Kubernetes Authors. | ||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. | ||
You may obtain a copy of the License at | ||
http://www.apache.org/licenses/LICENSE-2.0 | ||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. | ||
*/ | ||
|
||
package v1alpha2 | ||
|
||
import ( | ||
clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" | ||
) | ||
|
||
var _ GenericProvider = &RuntimeExtensionProvider{} | ||
|
||
func (p *RuntimeExtensionProvider) GetConditions() clusterv1.Conditions { | ||
return p.Status.Conditions | ||
} | ||
|
||
func (p *RuntimeExtensionProvider) SetConditions(conditions clusterv1.Conditions) { | ||
p.Status.Conditions = conditions | ||
} | ||
|
||
func (p *RuntimeExtensionProvider) GetSpec() ProviderSpec { | ||
return p.Spec.ProviderSpec | ||
} | ||
|
||
func (p *RuntimeExtensionProvider) SetSpec(in ProviderSpec) { | ||
p.Spec.ProviderSpec = in | ||
} | ||
|
||
func (p *RuntimeExtensionProvider) GetStatus() ProviderStatus { | ||
return p.Status.ProviderStatus | ||
} | ||
|
||
func (p *RuntimeExtensionProvider) SetStatus(in ProviderStatus) { | ||
p.Status.ProviderStatus = in | ||
} | ||
|
||
func (p *RuntimeExtensionProvider) GetType() string { | ||
return "runtimeextension" | ||
} | ||
|
||
func (p *RuntimeExtensionProviderList) GetItems() []GenericProvider { | ||
providers := []GenericProvider{} | ||
|
||
for index := range p.Items { | ||
providers = append(providers, &p.Items[index]) | ||
} | ||
|
||
return providers | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains 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 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 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 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 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
Oops, something went wrong.