From 195560b8330711ebe60fa71a9a4385edbd24b613 Mon Sep 17 00:00:00 2001 From: achimweigel Date: Tue, 30 Jan 2024 11:13:20 +0100 Subject: [PATCH] Further improvements (#956) * further performance improvements (run-int-tests) --- apis/.schemes/core-v1alpha1-Blueprint.json | 2 + apis/core/types_execution.go | 12 --- apis/core/types_shared.go | 2 + apis/core/v1alpha1/types_execution.go | 13 --- apis/core/v1alpha1/types_shared.go | 2 + apis/core/v1alpha1/zz_generated.conversion.go | 34 -------- apis/core/v1alpha1/zz_generated.deepcopy.go | 21 ----- apis/core/zz_generated.deepcopy.go | 21 ----- apis/openapi/openapi_generated.go | 57 ++----------- .../landscaper/apis/core/types_execution.go | 12 --- .../landscaper/apis/core/types_shared.go | 2 + .../apis/core/v1alpha1/types_execution.go | 13 --- .../apis/core/v1alpha1/types_shared.go | 2 + .../core/v1alpha1/zz_generated.conversion.go | 34 -------- .../core/v1alpha1/zz_generated.deepcopy.go | 21 ----- .../apis/core/zz_generated.deepcopy.go | 21 ----- docs/api-reference/core.md | 80 +++---------------- docs/technical/performance.md | 5 -- .../controllers/execution/reconcile_test.go | 10 ++- .../installations/reconcile_delete.go | 2 +- .../landscaper.gardener.cloud_executions.yaml | 22 ----- ...ndscaper.gardener.cloud_installations.yaml | 4 + pkg/landscaper/execution/execution.go | 14 +--- pkg/landscaper/execution/gc.go | 11 --- pkg/landscaper/execution/reconcile.go | 33 +------- .../installations/executions/operation.go | 4 + .../subinstallations/subinstallations.go | 4 + test/integration/executions/generations.go | 2 - .../landscaper/apis/core/types_execution.go | 12 --- .../landscaper/apis/core/types_shared.go | 2 + .../apis/core/v1alpha1/types_execution.go | 13 --- .../apis/core/v1alpha1/types_shared.go | 2 + .../core/v1alpha1/zz_generated.conversion.go | 34 -------- .../core/v1alpha1/zz_generated.deepcopy.go | 21 ----- .../apis/core/zz_generated.deepcopy.go | 21 ----- 35 files changed, 58 insertions(+), 507 deletions(-) diff --git a/apis/.schemes/core-v1alpha1-Blueprint.json b/apis/.schemes/core-v1alpha1-Blueprint.json index df04f7927..a7554d5b6 100755 --- a/apis/.schemes/core-v1alpha1-Blueprint.json +++ b/apis/.schemes/core-v1alpha1-Blueprint.json @@ -247,9 +247,11 @@ "type": "object", "properties": { "hasNoSiblingExports": { + "description": "set this on true if the installation does not export data to its siblings or has no siblings at all", "type": "boolean" }, "hasNoSiblingImports": { + "description": "set this on true if the installation does not import data from its siblings or has no siblings at all", "type": "boolean" } } diff --git a/apis/core/types_execution.go b/apis/core/types_execution.go index f36b88f96..8956579ff 100644 --- a/apis/core/types_execution.go +++ b/apis/core/types_execution.go @@ -86,10 +86,6 @@ type ExecutionStatus struct { // +optional DeployItemCache *DeployItemCache `json:"deployItemCache,omitempty"` - // ExecutionGenerations stores which generation the execution had when it last applied a specific deployitem. - // So in this case, the observedGeneration refers to the executions generation. - ExecutionGenerations []ExecutionGeneration `json:"execGenerations,omitempty"` - // JobID is the ID of the current working request. JobID string `json:"jobID,omitempty"` @@ -108,14 +104,6 @@ type ExecutionStatus struct { TransitionTimes *TransitionTimes `json:"transitionTimes,omitempty"` } -// ExecutionGeneration links a deployitem to the generation of the execution when it was applied. -type ExecutionGeneration struct { - // Name is the name of the deployitem this generation refers to. - Name string `json:"name"` - // ObservedGeneration stores the generation which the execution had when it last applied the referenced deployitem. - ObservedGeneration int64 `json:"observedGeneration"` -} - // DeployItemTemplateList is a list of deploy item templates type DeployItemTemplateList []DeployItemTemplate diff --git a/apis/core/types_shared.go b/apis/core/types_shared.go index d6dd4f81e..37570c3f5 100644 --- a/apis/core/types_shared.go +++ b/apis/core/types_shared.go @@ -364,6 +364,8 @@ type DiNamePair struct { // Optimization contains settings to improve execution preformance type Optimization struct { + // set this on true if the installation does not import data from its siblings or has no siblings at all HasNoSiblingImports bool `json:"hasNoSiblingImports,omitempty"` + // set this on true if the installation does not export data to its siblings or has no siblings at all HasNoSiblingExports bool `json:"hasNoSiblingExports,omitempty"` } diff --git a/apis/core/v1alpha1/types_execution.go b/apis/core/v1alpha1/types_execution.go index 10d0ae71a..c0ee04d03 100644 --- a/apis/core/v1alpha1/types_execution.go +++ b/apis/core/v1alpha1/types_execution.go @@ -190,11 +190,6 @@ type ExecutionStatus struct { // +optional DeployItemCache *DeployItemCache `json:"deployItemCache,omitempty"` - // ExecutionGenerations stores which generation the execution had when it last applied a specific deployitem. - // So in this case, the observedGeneration refers to the executions generation. - // +optional - ExecutionGenerations []ExecutionGeneration `json:"execGenerations,omitempty"` - // JobID is the ID of the current working request. JobID string `json:"jobID,omitempty"` @@ -213,14 +208,6 @@ type ExecutionStatus struct { TransitionTimes *TransitionTimes `json:"transitionTimes,omitempty"` } -// ExecutionGeneration links a deployitem to the generation of the execution when it was applied. -type ExecutionGeneration struct { - // Name is the name of the deployitem this generation refers to. - Name string `json:"name"` - // ObservedGeneration stores the generation which the execution had when it last applied the referenced deployitem. - ObservedGeneration int64 `json:"observedGeneration"` -} - // DeployItemTemplateList is a list of deploy item templates type DeployItemTemplateList []DeployItemTemplate diff --git a/apis/core/v1alpha1/types_shared.go b/apis/core/v1alpha1/types_shared.go index 574d5e110..04f1ce5fb 100644 --- a/apis/core/v1alpha1/types_shared.go +++ b/apis/core/v1alpha1/types_shared.go @@ -380,6 +380,8 @@ type DiNamePair struct { // Optimization contains settings to improve execution preformance type Optimization struct { + // set this on true if the installation does not import data from its siblings or has no siblings at all HasNoSiblingImports bool `json:"hasNoSiblingImports,omitempty"` + // set this on true if the installation does not export data to its siblings or has no siblings at all HasNoSiblingExports bool `json:"hasNoSiblingExports,omitempty"` } diff --git a/apis/core/v1alpha1/zz_generated.conversion.go b/apis/core/v1alpha1/zz_generated.conversion.go index c162ea0b0..aebefe36f 100644 --- a/apis/core/v1alpha1/zz_generated.conversion.go +++ b/apis/core/v1alpha1/zz_generated.conversion.go @@ -472,16 +472,6 @@ func RegisterConversions(s *runtime.Scheme) error { }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*ExecutionGeneration)(nil), (*core.ExecutionGeneration)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha1_ExecutionGeneration_To_core_ExecutionGeneration(a.(*ExecutionGeneration), b.(*core.ExecutionGeneration), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*core.ExecutionGeneration)(nil), (*ExecutionGeneration)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_core_ExecutionGeneration_To_v1alpha1_ExecutionGeneration(a.(*core.ExecutionGeneration), b.(*ExecutionGeneration), scope) - }); err != nil { - return err - } if err := s.AddGeneratedConversionFunc((*ExecutionList)(nil), (*core.ExecutionList)(nil), func(a, b interface{}, scope conversion.Scope) error { return Convert_v1alpha1_ExecutionList_To_core_ExecutionList(a.(*ExecutionList), b.(*core.ExecutionList), scope) }); err != nil { @@ -2277,28 +2267,6 @@ func Convert_core_Execution_To_v1alpha1_Execution(in *core.Execution, out *Execu return autoConvert_core_Execution_To_v1alpha1_Execution(in, out, s) } -func autoConvert_v1alpha1_ExecutionGeneration_To_core_ExecutionGeneration(in *ExecutionGeneration, out *core.ExecutionGeneration, s conversion.Scope) error { - out.Name = in.Name - out.ObservedGeneration = in.ObservedGeneration - return nil -} - -// Convert_v1alpha1_ExecutionGeneration_To_core_ExecutionGeneration is an autogenerated conversion function. -func Convert_v1alpha1_ExecutionGeneration_To_core_ExecutionGeneration(in *ExecutionGeneration, out *core.ExecutionGeneration, s conversion.Scope) error { - return autoConvert_v1alpha1_ExecutionGeneration_To_core_ExecutionGeneration(in, out, s) -} - -func autoConvert_core_ExecutionGeneration_To_v1alpha1_ExecutionGeneration(in *core.ExecutionGeneration, out *ExecutionGeneration, s conversion.Scope) error { - out.Name = in.Name - out.ObservedGeneration = in.ObservedGeneration - return nil -} - -// Convert_core_ExecutionGeneration_To_v1alpha1_ExecutionGeneration is an autogenerated conversion function. -func Convert_core_ExecutionGeneration_To_v1alpha1_ExecutionGeneration(in *core.ExecutionGeneration, out *ExecutionGeneration, s conversion.Scope) error { - return autoConvert_core_ExecutionGeneration_To_v1alpha1_ExecutionGeneration(in, out, s) -} - func autoConvert_v1alpha1_ExecutionList_To_core_ExecutionList(in *ExecutionList, out *core.ExecutionList, s conversion.Scope) error { out.ListMeta = in.ListMeta if in.Items != nil { @@ -2361,7 +2329,6 @@ func autoConvert_v1alpha1_ExecutionStatus_To_core_ExecutionStatus(in *ExecutionS out.LastError = (*core.Error)(unsafe.Pointer(in.LastError)) out.ExportReference = (*core.ObjectReference)(unsafe.Pointer(in.ExportReference)) out.DeployItemCache = (*core.DeployItemCache)(unsafe.Pointer(in.DeployItemCache)) - out.ExecutionGenerations = *(*[]core.ExecutionGeneration)(unsafe.Pointer(&in.ExecutionGenerations)) out.JobID = in.JobID out.JobIDFinished = in.JobIDFinished out.ExecutionPhase = core.ExecutionPhase(in.ExecutionPhase) @@ -2381,7 +2348,6 @@ func autoConvert_core_ExecutionStatus_To_v1alpha1_ExecutionStatus(in *core.Execu out.LastError = (*Error)(unsafe.Pointer(in.LastError)) out.ExportReference = (*ObjectReference)(unsafe.Pointer(in.ExportReference)) out.DeployItemCache = (*DeployItemCache)(unsafe.Pointer(in.DeployItemCache)) - out.ExecutionGenerations = *(*[]ExecutionGeneration)(unsafe.Pointer(&in.ExecutionGenerations)) out.JobID = in.JobID out.JobIDFinished = in.JobIDFinished out.ExecutionPhase = ExecutionPhase(in.ExecutionPhase) diff --git a/apis/core/v1alpha1/zz_generated.deepcopy.go b/apis/core/v1alpha1/zz_generated.deepcopy.go index 5f02d1801..10c295617 100644 --- a/apis/core/v1alpha1/zz_generated.deepcopy.go +++ b/apis/core/v1alpha1/zz_generated.deepcopy.go @@ -1274,22 +1274,6 @@ func (in *Execution) DeepCopyObject() runtime.Object { return nil } -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ExecutionGeneration) DeepCopyInto(out *ExecutionGeneration) { - *out = *in - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ExecutionGeneration. -func (in *ExecutionGeneration) DeepCopy() *ExecutionGeneration { - if in == nil { - return nil - } - out := new(ExecutionGeneration) - in.DeepCopyInto(out) - return out -} - // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *ExecutionList) DeepCopyInto(out *ExecutionList) { *out = *in @@ -1376,11 +1360,6 @@ func (in *ExecutionStatus) DeepCopyInto(out *ExecutionStatus) { *out = new(DeployItemCache) (*in).DeepCopyInto(*out) } - if in.ExecutionGenerations != nil { - in, out := &in.ExecutionGenerations, &out.ExecutionGenerations - *out = make([]ExecutionGeneration, len(*in)) - copy(*out, *in) - } if in.PhaseTransitionTime != nil { in, out := &in.PhaseTransitionTime, &out.PhaseTransitionTime *out = (*in).DeepCopy() diff --git a/apis/core/zz_generated.deepcopy.go b/apis/core/zz_generated.deepcopy.go index 4ada9a70b..398ccb3b8 100644 --- a/apis/core/zz_generated.deepcopy.go +++ b/apis/core/zz_generated.deepcopy.go @@ -1274,22 +1274,6 @@ func (in *Execution) DeepCopyObject() runtime.Object { return nil } -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ExecutionGeneration) DeepCopyInto(out *ExecutionGeneration) { - *out = *in - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ExecutionGeneration. -func (in *ExecutionGeneration) DeepCopy() *ExecutionGeneration { - if in == nil { - return nil - } - out := new(ExecutionGeneration) - in.DeepCopyInto(out) - return out -} - // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *ExecutionList) DeepCopyInto(out *ExecutionList) { *out = *in @@ -1376,11 +1360,6 @@ func (in *ExecutionStatus) DeepCopyInto(out *ExecutionStatus) { *out = new(DeployItemCache) (*in).DeepCopyInto(*out) } - if in.ExecutionGenerations != nil { - in, out := &in.ExecutionGenerations, &out.ExecutionGenerations - *out = make([]ExecutionGeneration, len(*in)) - copy(*out, *in) - } if in.PhaseTransitionTime != nil { in, out := &in.PhaseTransitionTime, &out.PhaseTransitionTime *out = (*in).DeepCopy() diff --git a/apis/openapi/openapi_generated.go b/apis/openapi/openapi_generated.go index 0864b6f33..39d68246b 100644 --- a/apis/openapi/openapi_generated.go +++ b/apis/openapi/openapi_generated.go @@ -129,7 +129,6 @@ func GetOpenAPIDefinitions(ref common.ReferenceCallback) map[string]common.OpenA "github.com/gardener/landscaper/apis/core/v1alpha1.EnvironmentSpec": schema_landscaper_apis_core_v1alpha1_EnvironmentSpec(ref), "github.com/gardener/landscaper/apis/core/v1alpha1.Error": schema_landscaper_apis_core_v1alpha1_Error(ref), "github.com/gardener/landscaper/apis/core/v1alpha1.Execution": schema_landscaper_apis_core_v1alpha1_Execution(ref), - "github.com/gardener/landscaper/apis/core/v1alpha1.ExecutionGeneration": schema_landscaper_apis_core_v1alpha1_ExecutionGeneration(ref), "github.com/gardener/landscaper/apis/core/v1alpha1.ExecutionList": schema_landscaper_apis_core_v1alpha1_ExecutionList(ref), "github.com/gardener/landscaper/apis/core/v1alpha1.ExecutionSpec": schema_landscaper_apis_core_v1alpha1_ExecutionSpec(ref), "github.com/gardener/landscaper/apis/core/v1alpha1.ExecutionStatus": schema_landscaper_apis_core_v1alpha1_ExecutionStatus(ref), @@ -5221,36 +5220,6 @@ func schema_landscaper_apis_core_v1alpha1_Execution(ref common.ReferenceCallback } } -func schema_landscaper_apis_core_v1alpha1_ExecutionGeneration(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "ExecutionGeneration links a deployitem to the generation of the execution when it was applied.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "name": { - SchemaProps: spec.SchemaProps{ - Description: "Name is the name of the deployitem this generation refers to.", - Default: "", - Type: []string{"string"}, - Format: "", - }, - }, - "observedGeneration": { - SchemaProps: spec.SchemaProps{ - Description: "ObservedGeneration stores the generation which the execution had when it last applied the referenced deployitem.", - Default: 0, - Type: []string{"integer"}, - Format: "int64", - }, - }, - }, - Required: []string{"name", "observedGeneration"}, - }, - }, - } -} - func schema_landscaper_apis_core_v1alpha1_ExecutionList(ref common.ReferenceCallback) common.OpenAPIDefinition { return common.OpenAPIDefinition{ Schema: spec.Schema{ @@ -5390,20 +5359,6 @@ func schema_landscaper_apis_core_v1alpha1_ExecutionStatus(ref common.ReferenceCa Ref: ref("github.com/gardener/landscaper/apis/core/v1alpha1.DeployItemCache"), }, }, - "execGenerations": { - SchemaProps: spec.SchemaProps{ - Description: "ExecutionGenerations stores which generation the execution had when it last applied a specific deployitem. So in this case, the observedGeneration refers to the executions generation.", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref("github.com/gardener/landscaper/apis/core/v1alpha1.ExecutionGeneration"), - }, - }, - }, - }, - }, "jobID": { SchemaProps: spec.SchemaProps{ Description: "JobID is the ID of the current working request.", @@ -5441,7 +5396,7 @@ func schema_landscaper_apis_core_v1alpha1_ExecutionStatus(ref common.ReferenceCa }, }, Dependencies: []string{ - "github.com/gardener/landscaper/apis/core/v1alpha1.Condition", "github.com/gardener/landscaper/apis/core/v1alpha1.DeployItemCache", "github.com/gardener/landscaper/apis/core/v1alpha1.Error", "github.com/gardener/landscaper/apis/core/v1alpha1.ExecutionGeneration", "github.com/gardener/landscaper/apis/core/v1alpha1.ObjectReference", "github.com/gardener/landscaper/apis/core/v1alpha1.TransitionTimes", "k8s.io/apimachinery/pkg/apis/meta/v1.Time"}, + "github.com/gardener/landscaper/apis/core/v1alpha1.Condition", "github.com/gardener/landscaper/apis/core/v1alpha1.DeployItemCache", "github.com/gardener/landscaper/apis/core/v1alpha1.Error", "github.com/gardener/landscaper/apis/core/v1alpha1.ObjectReference", "github.com/gardener/landscaper/apis/core/v1alpha1.TransitionTimes", "k8s.io/apimachinery/pkg/apis/meta/v1.Time"}, } } @@ -6539,14 +6494,16 @@ func schema_landscaper_apis_core_v1alpha1_Optimization(ref common.ReferenceCallb Properties: map[string]spec.Schema{ "hasNoSiblingImports": { SchemaProps: spec.SchemaProps{ - Type: []string{"boolean"}, - Format: "", + Description: "set this on true if the installation does not import data from its siblings or has no siblings at all", + Type: []string{"boolean"}, + Format: "", }, }, "hasNoSiblingExports": { SchemaProps: spec.SchemaProps{ - Type: []string{"boolean"}, - Format: "", + Description: "set this on true if the installation does not export data to its siblings or has no siblings at all", + Type: []string{"boolean"}, + Format: "", }, }, }, diff --git a/controller-utils/vendor/github.com/gardener/landscaper/apis/core/types_execution.go b/controller-utils/vendor/github.com/gardener/landscaper/apis/core/types_execution.go index f36b88f96..8956579ff 100644 --- a/controller-utils/vendor/github.com/gardener/landscaper/apis/core/types_execution.go +++ b/controller-utils/vendor/github.com/gardener/landscaper/apis/core/types_execution.go @@ -86,10 +86,6 @@ type ExecutionStatus struct { // +optional DeployItemCache *DeployItemCache `json:"deployItemCache,omitempty"` - // ExecutionGenerations stores which generation the execution had when it last applied a specific deployitem. - // So in this case, the observedGeneration refers to the executions generation. - ExecutionGenerations []ExecutionGeneration `json:"execGenerations,omitempty"` - // JobID is the ID of the current working request. JobID string `json:"jobID,omitempty"` @@ -108,14 +104,6 @@ type ExecutionStatus struct { TransitionTimes *TransitionTimes `json:"transitionTimes,omitempty"` } -// ExecutionGeneration links a deployitem to the generation of the execution when it was applied. -type ExecutionGeneration struct { - // Name is the name of the deployitem this generation refers to. - Name string `json:"name"` - // ObservedGeneration stores the generation which the execution had when it last applied the referenced deployitem. - ObservedGeneration int64 `json:"observedGeneration"` -} - // DeployItemTemplateList is a list of deploy item templates type DeployItemTemplateList []DeployItemTemplate diff --git a/controller-utils/vendor/github.com/gardener/landscaper/apis/core/types_shared.go b/controller-utils/vendor/github.com/gardener/landscaper/apis/core/types_shared.go index d6dd4f81e..37570c3f5 100644 --- a/controller-utils/vendor/github.com/gardener/landscaper/apis/core/types_shared.go +++ b/controller-utils/vendor/github.com/gardener/landscaper/apis/core/types_shared.go @@ -364,6 +364,8 @@ type DiNamePair struct { // Optimization contains settings to improve execution preformance type Optimization struct { + // set this on true if the installation does not import data from its siblings or has no siblings at all HasNoSiblingImports bool `json:"hasNoSiblingImports,omitempty"` + // set this on true if the installation does not export data to its siblings or has no siblings at all HasNoSiblingExports bool `json:"hasNoSiblingExports,omitempty"` } diff --git a/controller-utils/vendor/github.com/gardener/landscaper/apis/core/v1alpha1/types_execution.go b/controller-utils/vendor/github.com/gardener/landscaper/apis/core/v1alpha1/types_execution.go index 10d0ae71a..c0ee04d03 100644 --- a/controller-utils/vendor/github.com/gardener/landscaper/apis/core/v1alpha1/types_execution.go +++ b/controller-utils/vendor/github.com/gardener/landscaper/apis/core/v1alpha1/types_execution.go @@ -190,11 +190,6 @@ type ExecutionStatus struct { // +optional DeployItemCache *DeployItemCache `json:"deployItemCache,omitempty"` - // ExecutionGenerations stores which generation the execution had when it last applied a specific deployitem. - // So in this case, the observedGeneration refers to the executions generation. - // +optional - ExecutionGenerations []ExecutionGeneration `json:"execGenerations,omitempty"` - // JobID is the ID of the current working request. JobID string `json:"jobID,omitempty"` @@ -213,14 +208,6 @@ type ExecutionStatus struct { TransitionTimes *TransitionTimes `json:"transitionTimes,omitempty"` } -// ExecutionGeneration links a deployitem to the generation of the execution when it was applied. -type ExecutionGeneration struct { - // Name is the name of the deployitem this generation refers to. - Name string `json:"name"` - // ObservedGeneration stores the generation which the execution had when it last applied the referenced deployitem. - ObservedGeneration int64 `json:"observedGeneration"` -} - // DeployItemTemplateList is a list of deploy item templates type DeployItemTemplateList []DeployItemTemplate diff --git a/controller-utils/vendor/github.com/gardener/landscaper/apis/core/v1alpha1/types_shared.go b/controller-utils/vendor/github.com/gardener/landscaper/apis/core/v1alpha1/types_shared.go index 574d5e110..04f1ce5fb 100644 --- a/controller-utils/vendor/github.com/gardener/landscaper/apis/core/v1alpha1/types_shared.go +++ b/controller-utils/vendor/github.com/gardener/landscaper/apis/core/v1alpha1/types_shared.go @@ -380,6 +380,8 @@ type DiNamePair struct { // Optimization contains settings to improve execution preformance type Optimization struct { + // set this on true if the installation does not import data from its siblings or has no siblings at all HasNoSiblingImports bool `json:"hasNoSiblingImports,omitempty"` + // set this on true if the installation does not export data to its siblings or has no siblings at all HasNoSiblingExports bool `json:"hasNoSiblingExports,omitempty"` } diff --git a/controller-utils/vendor/github.com/gardener/landscaper/apis/core/v1alpha1/zz_generated.conversion.go b/controller-utils/vendor/github.com/gardener/landscaper/apis/core/v1alpha1/zz_generated.conversion.go index c162ea0b0..aebefe36f 100644 --- a/controller-utils/vendor/github.com/gardener/landscaper/apis/core/v1alpha1/zz_generated.conversion.go +++ b/controller-utils/vendor/github.com/gardener/landscaper/apis/core/v1alpha1/zz_generated.conversion.go @@ -472,16 +472,6 @@ func RegisterConversions(s *runtime.Scheme) error { }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*ExecutionGeneration)(nil), (*core.ExecutionGeneration)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha1_ExecutionGeneration_To_core_ExecutionGeneration(a.(*ExecutionGeneration), b.(*core.ExecutionGeneration), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*core.ExecutionGeneration)(nil), (*ExecutionGeneration)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_core_ExecutionGeneration_To_v1alpha1_ExecutionGeneration(a.(*core.ExecutionGeneration), b.(*ExecutionGeneration), scope) - }); err != nil { - return err - } if err := s.AddGeneratedConversionFunc((*ExecutionList)(nil), (*core.ExecutionList)(nil), func(a, b interface{}, scope conversion.Scope) error { return Convert_v1alpha1_ExecutionList_To_core_ExecutionList(a.(*ExecutionList), b.(*core.ExecutionList), scope) }); err != nil { @@ -2277,28 +2267,6 @@ func Convert_core_Execution_To_v1alpha1_Execution(in *core.Execution, out *Execu return autoConvert_core_Execution_To_v1alpha1_Execution(in, out, s) } -func autoConvert_v1alpha1_ExecutionGeneration_To_core_ExecutionGeneration(in *ExecutionGeneration, out *core.ExecutionGeneration, s conversion.Scope) error { - out.Name = in.Name - out.ObservedGeneration = in.ObservedGeneration - return nil -} - -// Convert_v1alpha1_ExecutionGeneration_To_core_ExecutionGeneration is an autogenerated conversion function. -func Convert_v1alpha1_ExecutionGeneration_To_core_ExecutionGeneration(in *ExecutionGeneration, out *core.ExecutionGeneration, s conversion.Scope) error { - return autoConvert_v1alpha1_ExecutionGeneration_To_core_ExecutionGeneration(in, out, s) -} - -func autoConvert_core_ExecutionGeneration_To_v1alpha1_ExecutionGeneration(in *core.ExecutionGeneration, out *ExecutionGeneration, s conversion.Scope) error { - out.Name = in.Name - out.ObservedGeneration = in.ObservedGeneration - return nil -} - -// Convert_core_ExecutionGeneration_To_v1alpha1_ExecutionGeneration is an autogenerated conversion function. -func Convert_core_ExecutionGeneration_To_v1alpha1_ExecutionGeneration(in *core.ExecutionGeneration, out *ExecutionGeneration, s conversion.Scope) error { - return autoConvert_core_ExecutionGeneration_To_v1alpha1_ExecutionGeneration(in, out, s) -} - func autoConvert_v1alpha1_ExecutionList_To_core_ExecutionList(in *ExecutionList, out *core.ExecutionList, s conversion.Scope) error { out.ListMeta = in.ListMeta if in.Items != nil { @@ -2361,7 +2329,6 @@ func autoConvert_v1alpha1_ExecutionStatus_To_core_ExecutionStatus(in *ExecutionS out.LastError = (*core.Error)(unsafe.Pointer(in.LastError)) out.ExportReference = (*core.ObjectReference)(unsafe.Pointer(in.ExportReference)) out.DeployItemCache = (*core.DeployItemCache)(unsafe.Pointer(in.DeployItemCache)) - out.ExecutionGenerations = *(*[]core.ExecutionGeneration)(unsafe.Pointer(&in.ExecutionGenerations)) out.JobID = in.JobID out.JobIDFinished = in.JobIDFinished out.ExecutionPhase = core.ExecutionPhase(in.ExecutionPhase) @@ -2381,7 +2348,6 @@ func autoConvert_core_ExecutionStatus_To_v1alpha1_ExecutionStatus(in *core.Execu out.LastError = (*Error)(unsafe.Pointer(in.LastError)) out.ExportReference = (*ObjectReference)(unsafe.Pointer(in.ExportReference)) out.DeployItemCache = (*DeployItemCache)(unsafe.Pointer(in.DeployItemCache)) - out.ExecutionGenerations = *(*[]ExecutionGeneration)(unsafe.Pointer(&in.ExecutionGenerations)) out.JobID = in.JobID out.JobIDFinished = in.JobIDFinished out.ExecutionPhase = ExecutionPhase(in.ExecutionPhase) diff --git a/controller-utils/vendor/github.com/gardener/landscaper/apis/core/v1alpha1/zz_generated.deepcopy.go b/controller-utils/vendor/github.com/gardener/landscaper/apis/core/v1alpha1/zz_generated.deepcopy.go index 5f02d1801..10c295617 100644 --- a/controller-utils/vendor/github.com/gardener/landscaper/apis/core/v1alpha1/zz_generated.deepcopy.go +++ b/controller-utils/vendor/github.com/gardener/landscaper/apis/core/v1alpha1/zz_generated.deepcopy.go @@ -1274,22 +1274,6 @@ func (in *Execution) DeepCopyObject() runtime.Object { return nil } -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ExecutionGeneration) DeepCopyInto(out *ExecutionGeneration) { - *out = *in - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ExecutionGeneration. -func (in *ExecutionGeneration) DeepCopy() *ExecutionGeneration { - if in == nil { - return nil - } - out := new(ExecutionGeneration) - in.DeepCopyInto(out) - return out -} - // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *ExecutionList) DeepCopyInto(out *ExecutionList) { *out = *in @@ -1376,11 +1360,6 @@ func (in *ExecutionStatus) DeepCopyInto(out *ExecutionStatus) { *out = new(DeployItemCache) (*in).DeepCopyInto(*out) } - if in.ExecutionGenerations != nil { - in, out := &in.ExecutionGenerations, &out.ExecutionGenerations - *out = make([]ExecutionGeneration, len(*in)) - copy(*out, *in) - } if in.PhaseTransitionTime != nil { in, out := &in.PhaseTransitionTime, &out.PhaseTransitionTime *out = (*in).DeepCopy() diff --git a/controller-utils/vendor/github.com/gardener/landscaper/apis/core/zz_generated.deepcopy.go b/controller-utils/vendor/github.com/gardener/landscaper/apis/core/zz_generated.deepcopy.go index 4ada9a70b..398ccb3b8 100644 --- a/controller-utils/vendor/github.com/gardener/landscaper/apis/core/zz_generated.deepcopy.go +++ b/controller-utils/vendor/github.com/gardener/landscaper/apis/core/zz_generated.deepcopy.go @@ -1274,22 +1274,6 @@ func (in *Execution) DeepCopyObject() runtime.Object { return nil } -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ExecutionGeneration) DeepCopyInto(out *ExecutionGeneration) { - *out = *in - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ExecutionGeneration. -func (in *ExecutionGeneration) DeepCopy() *ExecutionGeneration { - if in == nil { - return nil - } - out := new(ExecutionGeneration) - in.DeepCopyInto(out) - return out -} - // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *ExecutionList) DeepCopyInto(out *ExecutionList) { *out = *in @@ -1376,11 +1360,6 @@ func (in *ExecutionStatus) DeepCopyInto(out *ExecutionStatus) { *out = new(DeployItemCache) (*in).DeepCopyInto(*out) } - if in.ExecutionGenerations != nil { - in, out := &in.ExecutionGenerations, &out.ExecutionGenerations - *out = make([]ExecutionGeneration, len(*in)) - copy(*out, *in) - } if in.PhaseTransitionTime != nil { in, out := &in.PhaseTransitionTime, &out.PhaseTransitionTime *out = (*in).DeepCopy() diff --git a/docs/api-reference/core.md b/docs/api-reference/core.md index 8c2a2413c..61fbc6ad6 100644 --- a/docs/api-reference/core.md +++ b/docs/api-reference/core.md @@ -99,7 +99,7 @@ e.g. “https:/ localTypes
-map[string]..JSONSchemaDefinition +map[string]github.com/gardener/landscaper/apis/core/v1alpha1.JSONSchemaDefinition @@ -1012,7 +1012,7 @@ InstallationImports importDataMappings
-map[string]..AnyJSON +map[string]github.com/gardener/landscaper/apis/core/v1alpha1.AnyJSON @@ -1043,7 +1043,7 @@ InstallationExports exportDataMappings
-map[string]..AnyJSON +map[string]github.com/gardener/landscaper/apis/core/v1alpha1.AnyJSON @@ -1180,7 +1180,7 @@ InstallationImports importDataMappings
-map[string]..AnyJSON +map[string]github.com/gardener/landscaper/apis/core/v1alpha1.AnyJSON @@ -1211,7 +1211,7 @@ InstallationExports exportDataMappings
-map[string]..AnyJSON +map[string]github.com/gardener/landscaper/apis/core/v1alpha1.AnyJSON @@ -2522,7 +2522,7 @@ Note that the type information is used to determine the secret key and the type configurations
-map[string]..AnyJSON +map[string]github.com/gardener/landscaper/apis/core/v1alpha1.AnyJSON @@ -2978,8 +2978,8 @@ Error lastErrors
- -[]*..Error + +[]*github.com/gardener/landscaper/apis/core/v1alpha1.Error @@ -3375,7 +3375,7 @@ InstallationImports importDataMappings
-map[string]..AnyJSON +map[string]github.com/gardener/landscaper/apis/core/v1alpha1.AnyJSON @@ -3719,47 +3719,6 @@ string

ErrorCode is a string alias.

-

ExecutionGeneration -

-

-(Appears on: -ExecutionStatus) -

-

-

ExecutionGeneration links a deployitem to the generation of the execution when it was applied.

-

- - - - - - - - - - - - - - - - - -
FieldDescription
-name
- -string - -
-

Name is the name of the deployitem this generation refers to.

-
-observedGeneration
- -int64 - -
-

ObservedGeneration stores the generation which the execution had when it last applied the referenced deployitem.

-

ExecutionPhase (string alias)

@@ -3912,21 +3871,6 @@ DeployItemCache -execGenerations
- - -[]ExecutionGeneration - - - - -(Optional) -

ExecutionGenerations stores which generation the execution had when it last applied a specific deployitem. -So in this case, the observedGeneration refers to the executions generation.

- - - - jobID
string @@ -4600,7 +4544,7 @@ InstallationImports importDataMappings
-map[string]..AnyJSON +map[string]github.com/gardener/landscaper/apis/core/v1alpha1.AnyJSON @@ -4631,7 +4575,7 @@ InstallationExports exportDataMappings
-map[string]..AnyJSON +map[string]github.com/gardener/landscaper/apis/core/v1alpha1.AnyJSON @@ -5216,6 +5160,7 @@ bool
+

set this on true if the installation does not import data from its siblings or has no siblings at all

@@ -5226,6 +5171,7 @@ bool +

set this on true if the installation does not export data to its siblings or has no siblings at all

diff --git a/docs/technical/performance.md b/docs/technical/performance.md index 4c78773b9..f2d162775 100644 --- a/docs/technical/performance.md +++ b/docs/technical/performance.md @@ -147,8 +147,3 @@ such load peaks could be handled withing less than one minute for about 20.000 o - - - - - diff --git a/pkg/landscaper/controllers/execution/reconcile_test.go b/pkg/landscaper/controllers/execution/reconcile_test.go index 86179ad23..b7cfece14 100644 --- a/pkg/landscaper/controllers/execution/reconcile_test.go +++ b/pkg/landscaper/controllers/execution/reconcile_test.go @@ -7,16 +7,17 @@ package execution_test import ( "context" - "github.com/gardener/landscaper/pkg/utils/read_write_layer" - . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" apierrors "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/runtime" "k8s.io/client-go/tools/record" "sigs.k8s.io/controller-runtime/pkg/client" + "sigs.k8s.io/controller-runtime/pkg/controller/controllerutil" "sigs.k8s.io/controller-runtime/pkg/reconcile" + "github.com/gardener/landscaper/pkg/utils/read_write_layer" + lsv1alpha1 "github.com/gardener/landscaper/apis/core/v1alpha1" kutil "github.com/gardener/landscaper/controller-utils/pkg/kubernetes" "github.com/gardener/landscaper/controller-utils/pkg/logging" @@ -93,9 +94,13 @@ var _ = Describe("Reconcile", func() { testutils.ExpectNoError(testenv.Client.Delete(ctx, exec)) // reconcile execution and check that objects are gone + Expect(testenv.Client.Get(ctx, kutil.ObjectKeyFromObject(di), di)).To(Succeed()) + controllerutil.RemoveFinalizer(di, lsv1alpha1.LandscaperFinalizer) + Expect(testenv.Client.Update(ctx, di)).To(Succeed()) Expect(state.Client.Get(ctx, kutil.ObjectKeyFromObject(exec), exec)).To(Succeed()) Expect(testutils.UpdateJobIdForExecution(ctx, testenv, exec)).To(Succeed()) testutils.ShouldReconcile(ctx, ctrl, testutils.RequestFromObject(exec)) + Expect(apierrors.IsNotFound(testenv.Client.Get(ctx, kutil.ObjectKeyFromObject(di), di))).To(BeTrue(), "expect the deploy item to be deleted") Expect(apierrors.IsNotFound(testenv.Client.Get(ctx, kutil.ObjectKeyFromObject(exec), exec))).To(BeTrue(), "expect the execution to be deleted") }) @@ -272,7 +277,6 @@ var _ = Describe("Reconcile", func() { deployItems, err := read_write_layer.ListManagedDeployItems(ctx, testenv.Client, client.ObjectKeyFromObject(exec), read_write_layer.R000000) Expect(err).To(BeNil()) Expect(deployItems.Items).To(HaveLen(3)) - Expect(exec.Status.ExecutionGenerations).To(HaveLen(1)) // Check that the first deploy item di-a is not deleted di := state.DeployItems[state.Namespace+"/di-a"] diff --git a/pkg/landscaper/controllers/installations/reconcile_delete.go b/pkg/landscaper/controllers/installations/reconcile_delete.go index 43c539c6d..27a9e6214 100644 --- a/pkg/landscaper/controllers/installations/reconcile_delete.go +++ b/pkg/landscaper/controllers/installations/reconcile_delete.go @@ -146,7 +146,7 @@ func (c *Controller) handleDeletionPhaseDeleting(ctx context.Context, inst *lsv1 return false, false, lserrors.NewWrappedError(err, op, "UpdateInstallation", err.Error()) } - if inst.Spec.Optimization == nil || inst.Spec.Optimization.HasNoSiblingImports { + if inst.Spec.Optimization == nil || !inst.Spec.Optimization.HasNoSiblingImports { // touch siblings to speed up processing // a potential improvement is to only touch siblings exporting data for the current installation but this would // result in more complex coding and should only be done if the current approach results in performance problems diff --git a/pkg/landscaper/crdmanager/crdresources/landscaper.gardener.cloud_executions.yaml b/pkg/landscaper/crdmanager/crdresources/landscaper.gardener.cloud_executions.yaml index 042fb91b5..930ba8e71 100755 --- a/pkg/landscaper/crdmanager/crdresources/landscaper.gardener.cloud_executions.yaml +++ b/pkg/landscaper/crdmanager/crdresources/landscaper.gardener.cloud_executions.yaml @@ -180,28 +180,6 @@ spec: type: string type: array type: object - execGenerations: - description: ExecutionGenerations stores which generation the execution - had when it last applied a specific deployitem. So in this case, - the observedGeneration refers to the executions generation. - items: - description: ExecutionGeneration links a deployitem to the generation - of the execution when it was applied. - properties: - name: - description: Name is the name of the deployitem this generation - refers to. - type: string - observedGeneration: - description: ObservedGeneration stores the generation which - the execution had when it last applied the referenced deployitem. - format: int64 - type: integer - required: - - name - - observedGeneration - type: object - type: array exportRef: description: ExportReference references the object that contains the exported values. only used for operation purpose. diff --git a/pkg/landscaper/crdmanager/crdresources/landscaper.gardener.cloud_installations.yaml b/pkg/landscaper/crdmanager/crdresources/landscaper.gardener.cloud_installations.yaml index a87465d8f..4f380f632 100755 --- a/pkg/landscaper/crdmanager/crdresources/landscaper.gardener.cloud_installations.yaml +++ b/pkg/landscaper/crdmanager/crdresources/landscaper.gardener.cloud_installations.yaml @@ -619,8 +619,12 @@ spec: description: Optimization contains settings to improve execution performance. properties: hasNoSiblingExports: + description: set this on true if the installation does not export + data to its siblings or has no siblings at all type: boolean hasNoSiblingImports: + description: set this on true if the installation does not import + data from its siblings or has no siblings at all type: boolean type: object required: diff --git a/pkg/landscaper/execution/execution.go b/pkg/landscaper/execution/execution.go index 29d63cc23..272824d0e 100644 --- a/pkg/landscaper/execution/execution.go +++ b/pkg/landscaper/execution/execution.go @@ -281,18 +281,6 @@ func (o *Operation) getDeployItems(ctx context.Context, return executionItems, orphaned, nil } -// UpdateStatus updates the status of a execution -func (o *Operation) UpdateStatus(ctx context.Context, updatedConditions ...lsv1alpha1.Condition) error { - logger, ctx := logging.FromContextOrNew(ctx, nil) - - o.exec.Status.Conditions = lsv1alpha1helper.MergeConditions(o.exec.Status.Conditions, updatedConditions...) - if err := o.WriterToLsUncachedClient().UpdateExecutionStatus(ctx, read_write_layer.W000032, o.exec); err != nil { - logger.Error(err, "unable to set installation status") - return err - } - return nil -} - // CreateOrUpdateExportReference creates or updates a dataobject from a object reference func (o *Operation) CreateOrUpdateExportReference(ctx context.Context, values interface{}) error { do := dataobjects.New(). @@ -319,5 +307,5 @@ func (o *Operation) CreateOrUpdateExportReference(ctx context.Context, values in Name: raw.Name, Namespace: raw.Namespace, } - return o.UpdateStatus(ctx) + return nil } diff --git a/pkg/landscaper/execution/gc.go b/pkg/landscaper/execution/gc.go index d953fc081..b0ff9d500 100644 --- a/pkg/landscaper/execution/gc.go +++ b/pkg/landscaper/execution/gc.go @@ -8,8 +8,6 @@ import ( "context" "fmt" - lserrors "github.com/gardener/landscaper/apis/errors" - "github.com/gardener/landscaper/pkg/utils/read_write_layer" apierrors "k8s.io/apimachinery/pkg/api/errors" @@ -24,15 +22,6 @@ func (o *Operation) cleanupOrphanedDeployItemsForNewReconcile(ctx context.Contex } for i := range orphaned { item := orphaned[i] - itemName, ok := item.Labels[lsv1alpha1.ExecutionManagedNameLabel] - if ok { - o.exec.Status.ExecutionGenerations = removeExecutionGeneration(o.exec.Status.ExecutionGenerations, itemName) - if err := o.WriterToLsUncachedClient().UpdateExecutionStatus(ctx, read_write_layer.W000146, o.exec); err != nil { - msg := fmt.Sprintf("unable to patch execution status %s", o.exec.Name) - return lserrors.NewWrappedError(err, "cleanupOrphanedDeployItemsForNewReconcile", msg, err.Error()) - } - } - if item.DeletionTimestamp.IsZero() { if err := o.WriterToLsUncachedClient().DeleteDeployItem(ctx, read_write_layer.W000064, item); err != nil { if !apierrors.IsNotFound(err) { diff --git a/pkg/landscaper/execution/reconcile.go b/pkg/landscaper/execution/reconcile.go index 94bec676a..c8192b349 100644 --- a/pkg/landscaper/execution/reconcile.go +++ b/pkg/landscaper/execution/reconcile.go @@ -48,6 +48,9 @@ func (o *Operation) updateDeployItem(ctx context.Context, item executionItem) (* } if _, err := o.WriterToLsUncachedClient().CreateOrUpdateDeployItem(ctx, read_write_layer.W000036, item.DeployItem, func() error { + if item.DeployItem.CreationTimestamp.IsZero() && item.DeployItem.DeletionTimestamp.IsZero() { + controllerutil.AddFinalizer(item.DeployItem, lsv1alpha1.LandscaperFinalizer) + } ApplyDeployItemTemplate(item.DeployItem, item.Info) kutil.SetMetaDataLabel(&item.DeployItem.ObjectMeta, lsv1alpha1.ExecutionManagedByLabel, o.exec.Name) item.DeployItem.Spec.Context = o.exec.Spec.Context @@ -64,17 +67,6 @@ func (o *Operation) updateDeployItem(ctx context.Context, item executionItem) (* return nil, lserrors.NewWrappedError(err, op, msg, err.Error()) } - ref := lsv1alpha1.VersionedNamedObjectReference{} - ref.Name = item.Info.Name - ref.Reference.Name = item.DeployItem.Name - ref.Reference.Namespace = item.DeployItem.Namespace - ref.Reference.ObservedGeneration = item.DeployItem.Generation - - o.exec.Status.ExecutionGenerations = setExecutionGeneration(o.exec.Status.ExecutionGenerations, item.Info.Name, o.exec.Generation) - if err := o.WriterToLsUncachedClient().UpdateExecutionStatus(ctx, read_write_layer.W000034, o.exec); err != nil { - msg := fmt.Sprintf("unable to patch execution status %s", o.exec.Name) - return nil, lserrors.NewWrappedError(err, op, msg, err.Error()) - } return &lsv1alpha1.DiNamePair{ SpecName: item.Info.Name, ObjectName: item.DeployItem.Name, @@ -161,22 +153,3 @@ func (o *Operation) addExports(ctx context.Context, item *lsv1alpha1.DeployItem) } return data, nil } - -func setExecutionGeneration(objects []lsv1alpha1.ExecutionGeneration, name string, gen int64) []lsv1alpha1.ExecutionGeneration { - for i, ref := range objects { - if ref.Name == name { - objects[i].ObservedGeneration = gen - return objects - } - } - return append(objects, lsv1alpha1.ExecutionGeneration{Name: name, ObservedGeneration: gen}) -} - -func removeExecutionGeneration(objects []lsv1alpha1.ExecutionGeneration, name string) []lsv1alpha1.ExecutionGeneration { - for i, ref := range objects { - if ref.Name == name { - return append(objects[:i], objects[i+1:]...) - } - } - return objects -} diff --git a/pkg/landscaper/installations/executions/operation.go b/pkg/landscaper/installations/executions/operation.go index 679fc9f3c..b553322ab 100644 --- a/pkg/landscaper/installations/executions/operation.go +++ b/pkg/landscaper/installations/executions/operation.go @@ -176,6 +176,10 @@ func (o *ExecutionOperation) Ensure(ctx context.Context, inst *installations.Ins metav1.SetMetaDataAnnotation(&exec.ObjectMeta, lsv1alpha1.OperationAnnotation, string(lsv1alpha1.ReconcileOperation)) } + if exec.CreationTimestamp.IsZero() && exec.DeletionTimestamp.IsZero() { + controllerutil.AddFinalizer(exec, lsv1alpha1.LandscaperFinalizer) + } + if err := controllerutil.SetControllerReference(inst.GetInstallation(), exec, api.LandscaperScheme); err != nil { return err } diff --git a/pkg/landscaper/installations/subinstallations/subinstallations.go b/pkg/landscaper/installations/subinstallations/subinstallations.go index 105e2a091..d326d52e1 100644 --- a/pkg/landscaper/installations/subinstallations/subinstallations.go +++ b/pkg/landscaper/installations/subinstallations/subinstallations.go @@ -281,6 +281,10 @@ func (o *Operation) createOrUpdateNewInstallation(ctx context.Context, } _, err = o.WriterToLsUncachedClient().CreateOrUpdateInstallation(ctx, read_write_layer.W000001, subInst, func() error { + if subInst.CreationTimestamp.IsZero() && subInst.DeletionTimestamp.IsZero() { + controllerutil.AddFinalizer(subInst, lsv1alpha1.LandscaperFinalizer) + } + subInst.Labels = map[string]string{ lsv1alpha1.EncompassedByLabel: inst.Name, } diff --git a/test/integration/executions/generations.go b/test/integration/executions/generations.go index 73e16199a..d5a51a9ac 100644 --- a/test/integration/executions/generations.go +++ b/test/integration/executions/generations.go @@ -97,7 +97,6 @@ func GenerationHandlingTestsForNewReconcile(f *framework.Framework) { oldExGen := exec.Generation oldDIGen := di.Generation - Expect(exec.Status.ExecutionGenerations[0].ObservedGeneration).To(Equal(oldExGen)) mockConfig := &mockv1alpha1.ProviderConfiguration{} utils.ExpectNoError(json.Unmarshal(di.Spec.Configuration.Raw, mockConfig)) @@ -150,7 +149,6 @@ func GenerationHandlingTestsForNewReconcile(f *framework.Framework) { By("verify that generations and observed generations behave as expected") Expect(exec.Generation).To(BeNumerically(">", oldExGen)) Expect(di.Generation).To(BeNumerically(">", oldDIGen)) - Expect(exec.Status.ExecutionGenerations[0].ObservedGeneration).To(Equal(exec.Generation)) By("delete execution") utils.ExpectNoError(utils.DeleteExecutionForNewReconcile(ctx, f.Client, exec, 2*time.Minute)) diff --git a/vendor/github.com/gardener/landscaper/apis/core/types_execution.go b/vendor/github.com/gardener/landscaper/apis/core/types_execution.go index f36b88f96..8956579ff 100644 --- a/vendor/github.com/gardener/landscaper/apis/core/types_execution.go +++ b/vendor/github.com/gardener/landscaper/apis/core/types_execution.go @@ -86,10 +86,6 @@ type ExecutionStatus struct { // +optional DeployItemCache *DeployItemCache `json:"deployItemCache,omitempty"` - // ExecutionGenerations stores which generation the execution had when it last applied a specific deployitem. - // So in this case, the observedGeneration refers to the executions generation. - ExecutionGenerations []ExecutionGeneration `json:"execGenerations,omitempty"` - // JobID is the ID of the current working request. JobID string `json:"jobID,omitempty"` @@ -108,14 +104,6 @@ type ExecutionStatus struct { TransitionTimes *TransitionTimes `json:"transitionTimes,omitempty"` } -// ExecutionGeneration links a deployitem to the generation of the execution when it was applied. -type ExecutionGeneration struct { - // Name is the name of the deployitem this generation refers to. - Name string `json:"name"` - // ObservedGeneration stores the generation which the execution had when it last applied the referenced deployitem. - ObservedGeneration int64 `json:"observedGeneration"` -} - // DeployItemTemplateList is a list of deploy item templates type DeployItemTemplateList []DeployItemTemplate diff --git a/vendor/github.com/gardener/landscaper/apis/core/types_shared.go b/vendor/github.com/gardener/landscaper/apis/core/types_shared.go index d6dd4f81e..37570c3f5 100644 --- a/vendor/github.com/gardener/landscaper/apis/core/types_shared.go +++ b/vendor/github.com/gardener/landscaper/apis/core/types_shared.go @@ -364,6 +364,8 @@ type DiNamePair struct { // Optimization contains settings to improve execution preformance type Optimization struct { + // set this on true if the installation does not import data from its siblings or has no siblings at all HasNoSiblingImports bool `json:"hasNoSiblingImports,omitempty"` + // set this on true if the installation does not export data to its siblings or has no siblings at all HasNoSiblingExports bool `json:"hasNoSiblingExports,omitempty"` } diff --git a/vendor/github.com/gardener/landscaper/apis/core/v1alpha1/types_execution.go b/vendor/github.com/gardener/landscaper/apis/core/v1alpha1/types_execution.go index 10d0ae71a..c0ee04d03 100644 --- a/vendor/github.com/gardener/landscaper/apis/core/v1alpha1/types_execution.go +++ b/vendor/github.com/gardener/landscaper/apis/core/v1alpha1/types_execution.go @@ -190,11 +190,6 @@ type ExecutionStatus struct { // +optional DeployItemCache *DeployItemCache `json:"deployItemCache,omitempty"` - // ExecutionGenerations stores which generation the execution had when it last applied a specific deployitem. - // So in this case, the observedGeneration refers to the executions generation. - // +optional - ExecutionGenerations []ExecutionGeneration `json:"execGenerations,omitempty"` - // JobID is the ID of the current working request. JobID string `json:"jobID,omitempty"` @@ -213,14 +208,6 @@ type ExecutionStatus struct { TransitionTimes *TransitionTimes `json:"transitionTimes,omitempty"` } -// ExecutionGeneration links a deployitem to the generation of the execution when it was applied. -type ExecutionGeneration struct { - // Name is the name of the deployitem this generation refers to. - Name string `json:"name"` - // ObservedGeneration stores the generation which the execution had when it last applied the referenced deployitem. - ObservedGeneration int64 `json:"observedGeneration"` -} - // DeployItemTemplateList is a list of deploy item templates type DeployItemTemplateList []DeployItemTemplate diff --git a/vendor/github.com/gardener/landscaper/apis/core/v1alpha1/types_shared.go b/vendor/github.com/gardener/landscaper/apis/core/v1alpha1/types_shared.go index 574d5e110..04f1ce5fb 100644 --- a/vendor/github.com/gardener/landscaper/apis/core/v1alpha1/types_shared.go +++ b/vendor/github.com/gardener/landscaper/apis/core/v1alpha1/types_shared.go @@ -380,6 +380,8 @@ type DiNamePair struct { // Optimization contains settings to improve execution preformance type Optimization struct { + // set this on true if the installation does not import data from its siblings or has no siblings at all HasNoSiblingImports bool `json:"hasNoSiblingImports,omitempty"` + // set this on true if the installation does not export data to its siblings or has no siblings at all HasNoSiblingExports bool `json:"hasNoSiblingExports,omitempty"` } diff --git a/vendor/github.com/gardener/landscaper/apis/core/v1alpha1/zz_generated.conversion.go b/vendor/github.com/gardener/landscaper/apis/core/v1alpha1/zz_generated.conversion.go index c162ea0b0..aebefe36f 100644 --- a/vendor/github.com/gardener/landscaper/apis/core/v1alpha1/zz_generated.conversion.go +++ b/vendor/github.com/gardener/landscaper/apis/core/v1alpha1/zz_generated.conversion.go @@ -472,16 +472,6 @@ func RegisterConversions(s *runtime.Scheme) error { }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*ExecutionGeneration)(nil), (*core.ExecutionGeneration)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha1_ExecutionGeneration_To_core_ExecutionGeneration(a.(*ExecutionGeneration), b.(*core.ExecutionGeneration), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*core.ExecutionGeneration)(nil), (*ExecutionGeneration)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_core_ExecutionGeneration_To_v1alpha1_ExecutionGeneration(a.(*core.ExecutionGeneration), b.(*ExecutionGeneration), scope) - }); err != nil { - return err - } if err := s.AddGeneratedConversionFunc((*ExecutionList)(nil), (*core.ExecutionList)(nil), func(a, b interface{}, scope conversion.Scope) error { return Convert_v1alpha1_ExecutionList_To_core_ExecutionList(a.(*ExecutionList), b.(*core.ExecutionList), scope) }); err != nil { @@ -2277,28 +2267,6 @@ func Convert_core_Execution_To_v1alpha1_Execution(in *core.Execution, out *Execu return autoConvert_core_Execution_To_v1alpha1_Execution(in, out, s) } -func autoConvert_v1alpha1_ExecutionGeneration_To_core_ExecutionGeneration(in *ExecutionGeneration, out *core.ExecutionGeneration, s conversion.Scope) error { - out.Name = in.Name - out.ObservedGeneration = in.ObservedGeneration - return nil -} - -// Convert_v1alpha1_ExecutionGeneration_To_core_ExecutionGeneration is an autogenerated conversion function. -func Convert_v1alpha1_ExecutionGeneration_To_core_ExecutionGeneration(in *ExecutionGeneration, out *core.ExecutionGeneration, s conversion.Scope) error { - return autoConvert_v1alpha1_ExecutionGeneration_To_core_ExecutionGeneration(in, out, s) -} - -func autoConvert_core_ExecutionGeneration_To_v1alpha1_ExecutionGeneration(in *core.ExecutionGeneration, out *ExecutionGeneration, s conversion.Scope) error { - out.Name = in.Name - out.ObservedGeneration = in.ObservedGeneration - return nil -} - -// Convert_core_ExecutionGeneration_To_v1alpha1_ExecutionGeneration is an autogenerated conversion function. -func Convert_core_ExecutionGeneration_To_v1alpha1_ExecutionGeneration(in *core.ExecutionGeneration, out *ExecutionGeneration, s conversion.Scope) error { - return autoConvert_core_ExecutionGeneration_To_v1alpha1_ExecutionGeneration(in, out, s) -} - func autoConvert_v1alpha1_ExecutionList_To_core_ExecutionList(in *ExecutionList, out *core.ExecutionList, s conversion.Scope) error { out.ListMeta = in.ListMeta if in.Items != nil { @@ -2361,7 +2329,6 @@ func autoConvert_v1alpha1_ExecutionStatus_To_core_ExecutionStatus(in *ExecutionS out.LastError = (*core.Error)(unsafe.Pointer(in.LastError)) out.ExportReference = (*core.ObjectReference)(unsafe.Pointer(in.ExportReference)) out.DeployItemCache = (*core.DeployItemCache)(unsafe.Pointer(in.DeployItemCache)) - out.ExecutionGenerations = *(*[]core.ExecutionGeneration)(unsafe.Pointer(&in.ExecutionGenerations)) out.JobID = in.JobID out.JobIDFinished = in.JobIDFinished out.ExecutionPhase = core.ExecutionPhase(in.ExecutionPhase) @@ -2381,7 +2348,6 @@ func autoConvert_core_ExecutionStatus_To_v1alpha1_ExecutionStatus(in *core.Execu out.LastError = (*Error)(unsafe.Pointer(in.LastError)) out.ExportReference = (*ObjectReference)(unsafe.Pointer(in.ExportReference)) out.DeployItemCache = (*DeployItemCache)(unsafe.Pointer(in.DeployItemCache)) - out.ExecutionGenerations = *(*[]ExecutionGeneration)(unsafe.Pointer(&in.ExecutionGenerations)) out.JobID = in.JobID out.JobIDFinished = in.JobIDFinished out.ExecutionPhase = ExecutionPhase(in.ExecutionPhase) diff --git a/vendor/github.com/gardener/landscaper/apis/core/v1alpha1/zz_generated.deepcopy.go b/vendor/github.com/gardener/landscaper/apis/core/v1alpha1/zz_generated.deepcopy.go index 5f02d1801..10c295617 100644 --- a/vendor/github.com/gardener/landscaper/apis/core/v1alpha1/zz_generated.deepcopy.go +++ b/vendor/github.com/gardener/landscaper/apis/core/v1alpha1/zz_generated.deepcopy.go @@ -1274,22 +1274,6 @@ func (in *Execution) DeepCopyObject() runtime.Object { return nil } -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ExecutionGeneration) DeepCopyInto(out *ExecutionGeneration) { - *out = *in - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ExecutionGeneration. -func (in *ExecutionGeneration) DeepCopy() *ExecutionGeneration { - if in == nil { - return nil - } - out := new(ExecutionGeneration) - in.DeepCopyInto(out) - return out -} - // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *ExecutionList) DeepCopyInto(out *ExecutionList) { *out = *in @@ -1376,11 +1360,6 @@ func (in *ExecutionStatus) DeepCopyInto(out *ExecutionStatus) { *out = new(DeployItemCache) (*in).DeepCopyInto(*out) } - if in.ExecutionGenerations != nil { - in, out := &in.ExecutionGenerations, &out.ExecutionGenerations - *out = make([]ExecutionGeneration, len(*in)) - copy(*out, *in) - } if in.PhaseTransitionTime != nil { in, out := &in.PhaseTransitionTime, &out.PhaseTransitionTime *out = (*in).DeepCopy() diff --git a/vendor/github.com/gardener/landscaper/apis/core/zz_generated.deepcopy.go b/vendor/github.com/gardener/landscaper/apis/core/zz_generated.deepcopy.go index 4ada9a70b..398ccb3b8 100644 --- a/vendor/github.com/gardener/landscaper/apis/core/zz_generated.deepcopy.go +++ b/vendor/github.com/gardener/landscaper/apis/core/zz_generated.deepcopy.go @@ -1274,22 +1274,6 @@ func (in *Execution) DeepCopyObject() runtime.Object { return nil } -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ExecutionGeneration) DeepCopyInto(out *ExecutionGeneration) { - *out = *in - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ExecutionGeneration. -func (in *ExecutionGeneration) DeepCopy() *ExecutionGeneration { - if in == nil { - return nil - } - out := new(ExecutionGeneration) - in.DeepCopyInto(out) - return out -} - // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *ExecutionList) DeepCopyInto(out *ExecutionList) { *out = *in @@ -1376,11 +1360,6 @@ func (in *ExecutionStatus) DeepCopyInto(out *ExecutionStatus) { *out = new(DeployItemCache) (*in).DeepCopyInto(*out) } - if in.ExecutionGenerations != nil { - in, out := &in.ExecutionGenerations, &out.ExecutionGenerations - *out = make([]ExecutionGeneration, len(*in)) - copy(*out, *in) - } if in.PhaseTransitionTime != nil { in, out := &in.PhaseTransitionTime, &out.PhaseTransitionTime *out = (*in).DeepCopy()