Skip to content

Commit

Permalink
Merge branch 'main' into checkmarx-one
Browse files Browse the repository at this point in the history
  • Loading branch information
bru-jer-work authored Jan 27, 2025
2 parents 27181da + 701378b commit 99eac3e
Show file tree
Hide file tree
Showing 69 changed files with 2,437 additions and 327 deletions.
10 changes: 10 additions & 0 deletions .github/workflows/.grenrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"dataSource": "milestones",
"prefix": "",
"groupBy": {
":fire: Enhancements:": ["kind/feature"],
":bug: Bug fixes:": ["kind/bug"]
},
"milestoneMatch": "{{tag_name}}",
"changelogFilename": "CHANGELOG.md"
}
26 changes: 26 additions & 0 deletions .github/workflows/create-release-notes.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Generate Release Notes

on:
push:
tags:
- "*" # Triggers on any tag creation

jobs:
generate-release-notes:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Set up Node.js
uses: actions/setup-node@v4

- name: Install github-release-notes
run: npm install -g github-release-notes

- name: Generate release notes
env:
GREN_GITHUB_TOKEN: ${{ github.token }}
run: |
gren release --data-source=milestones --override
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"
5 changes: 4 additions & 1 deletion api/cloud-control/v1beta1/redisinstance_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,10 @@ type RedisInstanceAws struct {

// +optional
// +kubebuilder:default="7.0"
// +kubebuilder:validation:XValidation:rule=(self == oldSelf), message="EngineVersion is immutable."
// +kubebuilder:validation:Enum="7.1";"7.0";"6.x"
// +kubebuilder:validation:XValidation:rule=(self != "7.0" || oldSelf == "7.0" || oldSelf == "6.x"), message="engineVersion cannot be downgraded."
// +kubebuilder:validation:XValidation:rule=(self != "7.1" || oldSelf == "7.1" || oldSelf == "7.0" || oldSelf == "6.x"), message="engineVersion cannot be downgraded."
// +kubebuilder:validation:XValidation:rule=(self != "6.x" || oldSelf == "6.x"), message="engineVersion cannot be downgraded."
EngineVersion string `json:"engineVersion"`

// +optional
Expand Down
100 changes: 100 additions & 0 deletions api/cloud-control/v1beta1/skrstatus_types.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
/*
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"`

// +optional
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,
}
if len(in.Labels) > 0 {
result.Labels = in.Labels
}
if len(in.Annotations) > 0 {
result.Annotations = in.Annotations
}
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.

5 changes: 4 additions & 1 deletion api/cloud-resources/v1beta1/awsredisinstance_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,10 @@ type AwsRedisInstanceSpec struct {

// +optional
// +kubebuilder:default="7.0"
// +kubebuilder:validation:XValidation:rule=(self == oldSelf), message="EngineVersion is immutable."
// +kubebuilder:validation:Enum="7.1";"7.0";"6.x"
// +kubebuilder:validation:XValidation:rule=(self != "7.0" || oldSelf == "7.0" || oldSelf == "6.x"), message="engineVersion cannot be downgraded."
// +kubebuilder:validation:XValidation:rule=(self != "7.1" || oldSelf == "7.1" || oldSelf == "7.0" || oldSelf == "6.x"), message="engineVersion cannot be downgraded."
// +kubebuilder:validation:XValidation:rule=(self != "6.x" || oldSelf == "6.x"), message="engineVersion cannot be downgraded."
EngineVersion string `json:"engineVersion"`

// +optional
Expand Down
1 change: 1 addition & 0 deletions cmd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@ func main() {
}

rootLogger := zap.New(zap.UseFlagOptions(&opts))
rootLogger = rootLogger.WithSink(util.NewLogFilterSink(rootLogger.GetSink()))
ctrl.SetLogger(rootLogger)

setupLog.WithValues(
Expand Down
13 changes: 11 additions & 2 deletions config/crd/bases/cloud-control.kyma-project.io_redisinstances.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,19 @@ spec:
type: string
engineVersion:
default: "7.0"
enum:
- "7.1"
- "7.0"
- 6.x
type: string
x-kubernetes-validations:
- message: EngineVersion is immutable.
rule: (self == oldSelf)
- message: engineVersion cannot be downgraded.
rule: (self != "7.0" || oldSelf == "7.0" || oldSelf == "6.x")
- message: engineVersion cannot be downgraded.
rule: (self != "7.1" || oldSelf == "7.1" || oldSelf == "7.0"
|| oldSelf == "6.x")
- message: engineVersion cannot be downgraded.
rule: (self != "6.x" || oldSelf == "6.x")
parameters:
additionalProperties:
type: string
Expand Down
Loading

0 comments on commit 99eac3e

Please sign in to comment.