diff --git a/hack/api-reference/api.md b/hack/api-reference/api.md index c583a824c..93a75cb21 100644 --- a/hack/api-reference/api.md +++ b/hack/api-reference/api.md @@ -682,7 +682,7 @@ map[string]string -items
+managedItems
[]AzureResource @@ -691,7 +691,7 @@ map[string]string (Optional) -

Items is a list of resources that were created during the infrastructure reconciliation.

+

ManagedItems is a list of resources that were created during the infrastructure reconciliation.

diff --git a/pkg/apis/azure/helper/scheme.go b/pkg/apis/azure/helper/scheme.go index e31b1a241..063bfa374 100644 --- a/pkg/apis/azure/helper/scheme.go +++ b/pkg/apis/azure/helper/scheme.go @@ -107,8 +107,8 @@ func InfrastructureStateFromRaw(raw *runtime.RawExtension) (*api.InfrastructureS if state.Data == nil { state.Data = make(map[string]string) } - if state.Items == nil { - state.Items = make([]api.AzureResource, 0) + if state.ManagedItems == nil { + state.ManagedItems = make([]api.AzureResource, 0) } return state, nil diff --git a/pkg/apis/azure/types_infrastructure.go b/pkg/apis/azure/types_infrastructure.go index 642942b42..2823bf1f8 100644 --- a/pkg/apis/azure/types_infrastructure.go +++ b/pkg/apis/azure/types_infrastructure.go @@ -248,9 +248,9 @@ type InfrastructureState struct { // Data is map to store things. // +optional Data map[string]string - // Items is a list of resources that were created during the infrastructure reconciliation. + // ManagedItems is a list of resources that were created during the infrastructure reconciliation. // +optional - Items []AzureResource + ManagedItems []AzureResource } // AzureResource represents metadata information about created infrastructure resources. diff --git a/pkg/apis/azure/v1alpha1/types_infrastructure.go b/pkg/apis/azure/v1alpha1/types_infrastructure.go index b9a99e065..3cc5dd6d7 100644 --- a/pkg/apis/azure/v1alpha1/types_infrastructure.go +++ b/pkg/apis/azure/v1alpha1/types_infrastructure.go @@ -275,9 +275,9 @@ type InfrastructureState struct { // Data is map to store things. // +optional Data map[string]string `json:"data,omitempty"` - // Items is a list of resources that were created during the infrastructure reconciliation. + // ManagedItems is a list of resources that were created during the infrastructure reconciliation. // +optional - Items []AzureResource `json:"items,omitempty"` + ManagedItems []AzureResource `json:"managedItems,omitempty"` } // AzureResource represents metadata information about created infrastructure resources. diff --git a/pkg/apis/azure/v1alpha1/zz_generated.conversion.go b/pkg/apis/azure/v1alpha1/zz_generated.conversion.go index 6d761fd21..dcdc3f4a3 100644 --- a/pkg/apis/azure/v1alpha1/zz_generated.conversion.go +++ b/pkg/apis/azure/v1alpha1/zz_generated.conversion.go @@ -580,7 +580,7 @@ func Convert_azure_InfrastructureConfig_To_v1alpha1_InfrastructureConfig(in *azu func autoConvert_v1alpha1_InfrastructureState_To_azure_InfrastructureState(in *InfrastructureState, out *azure.InfrastructureState, s conversion.Scope) error { out.Data = *(*map[string]string)(unsafe.Pointer(&in.Data)) - out.Items = *(*[]azure.AzureResource)(unsafe.Pointer(&in.Items)) + out.ManagedItems = *(*[]azure.AzureResource)(unsafe.Pointer(&in.ManagedItems)) return nil } @@ -591,7 +591,7 @@ func Convert_v1alpha1_InfrastructureState_To_azure_InfrastructureState(in *Infra func autoConvert_azure_InfrastructureState_To_v1alpha1_InfrastructureState(in *azure.InfrastructureState, out *InfrastructureState, s conversion.Scope) error { out.Data = *(*map[string]string)(unsafe.Pointer(&in.Data)) - out.Items = *(*[]AzureResource)(unsafe.Pointer(&in.Items)) + out.ManagedItems = *(*[]AzureResource)(unsafe.Pointer(&in.ManagedItems)) return nil } diff --git a/pkg/apis/azure/v1alpha1/zz_generated.deepcopy.go b/pkg/apis/azure/v1alpha1/zz_generated.deepcopy.go index dc0e11ac0..c1b7d93fa 100644 --- a/pkg/apis/azure/v1alpha1/zz_generated.deepcopy.go +++ b/pkg/apis/azure/v1alpha1/zz_generated.deepcopy.go @@ -275,8 +275,8 @@ func (in *InfrastructureState) DeepCopyInto(out *InfrastructureState) { (*out)[key] = val } } - if in.Items != nil { - in, out := &in.Items, &out.Items + if in.ManagedItems != nil { + in, out := &in.ManagedItems, &out.ManagedItems *out = make([]AzureResource, len(*in)) copy(*out, *in) } diff --git a/pkg/apis/azure/zz_generated.deepcopy.go b/pkg/apis/azure/zz_generated.deepcopy.go index bd2557c0d..2e9db7da8 100644 --- a/pkg/apis/azure/zz_generated.deepcopy.go +++ b/pkg/apis/azure/zz_generated.deepcopy.go @@ -275,8 +275,8 @@ func (in *InfrastructureState) DeepCopyInto(out *InfrastructureState) { (*out)[key] = val } } - if in.Items != nil { - in, out := &in.Items, &out.Items + if in.ManagedItems != nil { + in, out := &in.ManagedItems, &out.ManagedItems *out = make([]AzureResource, len(*in)) copy(*out, *in) } diff --git a/pkg/controller/infrastructure/infraflow/ensurer.go b/pkg/controller/infrastructure/infraflow/ensurer.go index a7ffcc109..9305e8665 100644 --- a/pkg/controller/infrastructure/infraflow/ensurer.go +++ b/pkg/controller/infrastructure/infraflow/ensurer.go @@ -739,8 +739,8 @@ func (f *FlowContext) GetInfrastructureStatus(_ context.Context) (*v1alpha1.Infr // GetInfrastructureState returns tha shoot's infrastructure state. func (f *FlowContext) GetInfrastructureState() (*runtime.RawExtension, error) { state := &v1alpha1.InfrastructureState{ - TypeMeta: helper.InfrastructureStateTypeMeta, - Items: f.inventory.ToList(), + TypeMeta: helper.InfrastructureStateTypeMeta, + ManagedItems: f.inventory.ToList(), } return &runtime.RawExtension{ diff --git a/pkg/controller/infrastructure/infraflow/flow_context.go b/pkg/controller/infrastructure/infraflow/flow_context.go index dd6dc23c8..f7ddc7c5d 100644 --- a/pkg/controller/infrastructure/infraflow/flow_context.go +++ b/pkg/controller/infrastructure/infraflow/flow_context.go @@ -83,7 +83,7 @@ func NewFlowContext(factory client.Factory, } inv := NewSimpleInventory(wb) - for _, r := range state.Items { + for _, r := range state.ManagedItems { if err := inv.Insert(r.ID); err != nil { return nil, err } @@ -179,7 +179,7 @@ func (f *FlowContext) buildReconcileGraph() *flow.Graph { // Delete deletes all resources managed by the reconciler func (f *FlowContext) Delete(ctx context.Context) error { - if len(f.state.Items) == 0 { + if len(f.state.ManagedItems) == 0 { // special case where the credentials were invalid from the beginning if _, ok := f.state.Data[CreatedResourcesExistKey]; !ok { return nil