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

SKR Status #977

Merged
merged 6 commits into from
Jan 21, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions PROJECT
Original file line number Diff line number Diff line change
Expand Up @@ -203,4 +203,12 @@ resources:
kind: AwsNfsVolumeRestore
path: github.com/kyma-project/cloud-manager/api/cloud-resources/v1beta1
version: v1beta1
- api:
crdVersion: v1
namespaced: true
domain: kyma-project.io
group: cloud-control
kind: SkrStatus
path: github.com/kyma-project/cloud-manager/api/cloud-control/v1beta1
version: v1beta1
version: "3"
93 changes: 93 additions & 0 deletions api/cloud-control/v1beta1/skrstatus_types.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
/*
Copyright 2023.

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 v1beta1

import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)

type SkrStatusCondition struct {
Title string `json:"title"`
ObjKindGroup string `json:"objKindGroup"`
CrdKindGroup string `json:"crdKindGroup"`
BusolaKindGroup string `json:"busolaKindGroup"`
Feature string `json:"feature"`
ObjName string `json:"objName"`
ObjNamespace string `json:"objNamespace"`
Filename string `json:"filename"`
Ok bool `json:"ok"`
Outcomes []string `json:"outcomes"`
}

// SkrStatusSpec defines the desired state of SkrStatus.
type SkrStatusSpec struct {
KymaName string `json:"kymaName"`
Provider string `json:"provider"`
BrokerPlan string `json:"brokerPlan"`
GlobalAccount string `json:"globalAccount"`
SubAccount string `json:"subAccount"`
Region string `json:"region"`
ShootName string `json:"shootName"`

PastConnections []metav1.Time `json:"pastConnections,omitempty"`
AverageIntervalSeconds int `json:"averageIntervalSeconds,omitempty"`

Conditions []SkrStatusCondition `json:"conditions"`
}

// SkrStatusStatus defines the observed state of SkrStatus.
type SkrStatusStatus struct {
// INSERT ADDITIONAL STATUS FIELD - define observed state of cluster
// Important: Run "make" to regenerate code after modifying this file
}

// +kubebuilder:object:root=true
// +kubebuilder:subresource:status

// SkrStatus is the Schema for the skrstatuses API.
type SkrStatus struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`

Spec SkrStatusSpec `json:"spec,omitempty"`
Status SkrStatusStatus `json:"status,omitempty"`
}

func (in *SkrStatus) CloneForPatch() *SkrStatus {
result := &SkrStatus{
TypeMeta: in.TypeMeta,
ObjectMeta: metav1.ObjectMeta{
Namespace: in.Namespace,
Name: in.Name,
},
Spec: in.Spec,
}
return result
}

// +kubebuilder:object:root=true

// SkrStatusList contains a list of SkrStatus.
type SkrStatusList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata,omitempty"`
Items []SkrStatus `json:"items"`
}

func init() {
SchemeBuilder.Register(&SkrStatus{}, &SkrStatusList{})
}
123 changes: 123 additions & 0 deletions api/cloud-control/v1beta1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

118 changes: 118 additions & 0 deletions config/crd/bases/cloud-control.kyma-project.io_skrstatuses.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@
---
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.16.5
name: skrstatuses.cloud-control.kyma-project.io
spec:
group: cloud-control.kyma-project.io
names:
kind: SkrStatus
listKind: SkrStatusList
plural: skrstatuses
singular: skrstatus
scope: Namespaced
versions:
- name: v1beta1
schema:
openAPIV3Schema:
description: SkrStatus is the Schema for the skrstatuses API.
properties:
apiVersion:
description: |-
APIVersion defines the versioned schema of this representation of an object.
Servers should convert recognized schemas to the latest internal value, and
may reject unrecognized values.
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources
type: string
kind:
description: |-
Kind is a string value representing the REST resource this object represents.
Servers may infer this from the endpoint the client submits requests to.
Cannot be updated.
In CamelCase.
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
type: string
metadata:
type: object
spec:
description: SkrStatusSpec defines the desired state of SkrStatus.
properties:
averageIntervalSeconds:
type: integer
brokerPlan:
type: string
conditions:
items:
properties:
busolaKindGroup:
type: string
crdKindGroup:
type: string
feature:
type: string
filename:
type: string
objKindGroup:
type: string
objName:
type: string
objNamespace:
type: string
ok:
type: boolean
outcomes:
items:
type: string
type: array
title:
type: string
required:
- busolaKindGroup
- crdKindGroup
- feature
- filename
- objKindGroup
- objName
- objNamespace
- ok
- outcomes
- title
type: object
type: array
globalAccount:
type: string
kymaName:
type: string
pastConnections:
items:
format: date-time
type: string
type: array
provider:
type: string
region:
type: string
shootName:
type: string
subAccount:
type: string
required:
- brokerPlan
- conditions
- globalAccount
- kymaName
- provider
- region
- shootName
- subAccount
type: object
status:
description: SkrStatusStatus defines the observed state of SkrStatus.
type: object
type: object
served: true
storage: true
subresources:
status: {}
1 change: 1 addition & 0 deletions config/crd/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ resources:
- bases/cloud-resources.kyma-project.io_awsnfsbackupschedules.yaml
- bases/cloud-control.kyma-project.io_nukes.yaml
- bases/cloud-resources.kyma-project.io_awsnfsvolumerestores.yaml
- bases/cloud-control.kyma-project.io_skrstatuses.yaml
#+kubebuilder:scaffold:crdkustomizeresource

patches:
Expand Down
Loading
Loading