keptn-sandbox / keptn-gitops-operator

7 stars 7 forks source link

GSoC: Implement SLI Custom Resource Definition and Controller #41

Open eysk-io opened 2 years ago

eysk-io commented 2 years ago

Initialize the default Custom Resource Definition with a default controller. Specifically using the operator-sdk cli (i.e. operator-sdk create api --version v1 --kind KeptnServiceLevelIndicator --resource --controller).

API Definition

type KeptnServiceLevelIndicator struct {
    metav1.TypeMeta   `json:",inline"`
    metav1.ObjectMeta `json:"metadata,omitempty"`

    Spec    KeptnServiceLevelIndicatorSpec       `json:"spec,omitempty"`
}

type KeptnServiceLevelIndicatorSpec struct {
    Provider    string            `json:"provider"`
    Indicators  map[string]string `json:"indicators"`
}

type KeptnServiceLevelIndicatorList struct {
    metav1.TypeMeta   `json:",inline"`
    metav1.ObjectMeta `json:"metadata,omitempty"`

    Items   []KeptnServiceLevelIndicator `json:"items"`
}