forked from Mirantis/hmc
-
Notifications
You must be signed in to change notification settings - Fork 0
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 Mirantis#287 from eromanova/templates
Split Templates in multiple types
- Loading branch information
Showing
127 changed files
with
1,445 additions
and
369 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
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,62 @@ | ||
// Copyright 2024 | ||
// | ||
// 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 v1alpha1 | ||
|
||
import ( | ||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" | ||
) | ||
|
||
// +kubebuilder:object:root=true | ||
// +kubebuilder:subresource:status | ||
// +kubebuilder:resource:shortName=clustertmpl | ||
// +kubebuilder:printcolumn:name="valid",type="boolean",JSONPath=".status.valid",description="Valid",priority=0 | ||
// +kubebuilder:printcolumn:name="validationError",type="string",JSONPath=".status.validationError",description="Validation Error",priority=1 | ||
// +kubebuilder:printcolumn:name="description",type="string",JSONPath=".status.description",description="Description",priority=1 | ||
|
||
// ClusterTemplate is the Schema for the cluster templates API | ||
type ClusterTemplate struct { | ||
metav1.TypeMeta `json:",inline"` | ||
metav1.ObjectMeta `json:"metadata,omitempty"` | ||
|
||
Spec ClusterTemplateSpec `json:"spec,omitempty"` | ||
Status ClusterTemplateStatus `json:"status,omitempty"` | ||
} | ||
|
||
// +kubebuilder:object:root=true | ||
|
||
// ClusterTemplateList contains a list of ClusterTemplate | ||
type ClusterTemplateList struct { | ||
metav1.TypeMeta `json:",inline"` | ||
metav1.ListMeta `json:"metadata,omitempty"` | ||
Items []ClusterTemplate `json:"items"` | ||
} | ||
|
||
// ClusterTemplateSpec defines the desired state of ClusterTemplate | ||
type ClusterTemplateSpec struct { | ||
TemplateSpecMixin `json:",inline"` | ||
} | ||
|
||
// ClusterTemplateStatus defines the observed state of ClusterTemplate | ||
type ClusterTemplateStatus struct { | ||
TemplateStatusMixin `json:",inline"` | ||
} | ||
|
||
func (t *ClusterTemplate) GetSpec() *TemplateSpecMixin { | ||
return &t.Spec.TemplateSpecMixin | ||
} | ||
|
||
func (t *ClusterTemplate) GetStatus() *TemplateStatusMixin { | ||
return &t.Status.TemplateStatusMixin | ||
} |
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,62 @@ | ||
// Copyright 2024 | ||
// | ||
// 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 v1alpha1 | ||
|
||
import ( | ||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" | ||
) | ||
|
||
// +kubebuilder:object:root=true | ||
// +kubebuilder:subresource:status | ||
// +kubebuilder:resource:shortName=providertmpl,scope=Cluster | ||
// +kubebuilder:printcolumn:name="valid",type="boolean",JSONPath=".status.valid",description="Valid",priority=0 | ||
// +kubebuilder:printcolumn:name="validationError",type="string",JSONPath=".status.validationError",description="Validation Error",priority=1 | ||
// +kubebuilder:printcolumn:name="description",type="string",JSONPath=".status.description",description="Description",priority=1 | ||
|
||
// ProviderTemplate is the Schema for the provider templates API | ||
type ProviderTemplate struct { | ||
metav1.TypeMeta `json:",inline"` | ||
metav1.ObjectMeta `json:"metadata,omitempty"` | ||
|
||
Spec ProviderTemplateSpec `json:"spec,omitempty"` | ||
Status ProviderTemplateStatus `json:"status,omitempty"` | ||
} | ||
|
||
// +kubebuilder:object:root=true | ||
|
||
// ProviderTemplateList contains a list of ProviderTemplate | ||
type ProviderTemplateList struct { | ||
metav1.TypeMeta `json:",inline"` | ||
metav1.ListMeta `json:"metadata,omitempty"` | ||
Items []ProviderTemplate `json:"items"` | ||
} | ||
|
||
// ProviderTemplateSpec defines the desired state of ProviderTemplate | ||
type ProviderTemplateSpec struct { | ||
TemplateSpecMixin `json:",inline"` | ||
} | ||
|
||
// ProviderTemplateStatus defines the observed state of ProviderTemplate | ||
type ProviderTemplateStatus struct { | ||
TemplateStatusMixin `json:",inline"` | ||
} | ||
|
||
func (t *ProviderTemplate) GetSpec() *TemplateSpecMixin { | ||
return &t.Spec.TemplateSpecMixin | ||
} | ||
|
||
func (t *ProviderTemplate) GetStatus() *TemplateStatusMixin { | ||
return &t.Status.TemplateStatusMixin | ||
} |
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,62 @@ | ||
// Copyright 2024 | ||
// | ||
// 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 v1alpha1 | ||
|
||
import ( | ||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" | ||
) | ||
|
||
// +kubebuilder:object:root=true | ||
// +kubebuilder:subresource:status | ||
// +kubebuilder:resource:shortName=svctmpl | ||
// +kubebuilder:printcolumn:name="valid",type="boolean",JSONPath=".status.valid",description="Valid",priority=0 | ||
// +kubebuilder:printcolumn:name="validationError",type="string",JSONPath=".status.validationError",description="Validation Error",priority=1 | ||
// +kubebuilder:printcolumn:name="description",type="string",JSONPath=".status.description",description="Description",priority=1 | ||
|
||
// ServiceTemplate is the Schema for the service templates API | ||
type ServiceTemplate struct { | ||
metav1.TypeMeta `json:",inline"` | ||
metav1.ObjectMeta `json:"metadata,omitempty"` | ||
|
||
Spec ServiceTemplateSpec `json:"spec,omitempty"` | ||
Status ServiceTemplateStatus `json:"status,omitempty"` | ||
} | ||
|
||
// +kubebuilder:object:root=true | ||
|
||
// ServiceTemplateList contains a list of ServiceTemplate | ||
type ServiceTemplateList struct { | ||
metav1.TypeMeta `json:",inline"` | ||
metav1.ListMeta `json:"metadata,omitempty"` | ||
Items []ServiceTemplate `json:"items"` | ||
} | ||
|
||
// ServiceTemplateSpec defines the desired state of ServiceTemplate | ||
type ServiceTemplateSpec struct { | ||
TemplateSpecMixin `json:",inline"` | ||
} | ||
|
||
// ServiceTemplateStatus defines the observed state of ServiceTemplate | ||
type ServiceTemplateStatus struct { | ||
TemplateStatusMixin `json:",inline"` | ||
} | ||
|
||
func (t *ServiceTemplate) GetSpec() *TemplateSpecMixin { | ||
return &t.Spec.TemplateSpecMixin | ||
} | ||
|
||
func (t *ServiceTemplate) GetStatus() *TemplateStatusMixin { | ||
return &t.Status.TemplateStatusMixin | ||
} |
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.