generated from kyma-project/template-repository
-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
21 changed files
with
945 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
package migrateFinalizers | ||
|
||
import "github.com/kyma-project/cloud-manager/api" | ||
|
||
const newFinalizer = api.CommonFinalizerDeletionHook | ||
const oldFinalizer1 = "cloud-control.kyma-project.io/deletion-hook" | ||
const oldFinalizer2 = "cloud-resources.kyma-project.io/deletion-hook" | ||
|
||
type finalizerInfo struct { | ||
AddFinalizers []string | ||
RemoveFinalizers []string | ||
} | ||
|
||
func newFinalizerInfo() *finalizerInfo { | ||
return &finalizerInfo{ | ||
AddFinalizers: []string{newFinalizer}, | ||
RemoveFinalizers: []string{oldFinalizer1, oldFinalizer2}, | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,95 @@ | ||
apiVersion: cloud-control.kyma-project.io/v1beta1 | ||
kind: IpRange | ||
spec: | ||
remoteRef: | ||
name: name | ||
namespace: ns | ||
scope: | ||
name: scope | ||
--- | ||
apiVersion: cloud-control.kyma-project.io/v1beta1 | ||
kind: Network | ||
spec: | ||
network: | ||
reference: | ||
gcp: | ||
gcpProject: project-abcde-1234 | ||
networkName: some-network | ||
scope: | ||
name: scope | ||
--- | ||
apiVersion: cloud-control.kyma-project.io/v1beta1 | ||
kind: NfsInstance | ||
spec: | ||
ipRange: | ||
name: some-ip-range | ||
instance: | ||
aws: | ||
performanceMode: generalPurpose | ||
throughput: bursting | ||
remoteRef: | ||
name: name | ||
namespace: ns | ||
scope: | ||
name: scope | ||
--- | ||
apiVersion: cloud-control.kyma-project.io/v1beta1 | ||
kind: Nuke | ||
spec: | ||
scope: | ||
name: scope | ||
--- | ||
apiVersion: cloud-control.kyma-project.io/v1beta1 | ||
kind: RedisInstance | ||
spec: | ||
instance: | ||
gcp: | ||
memorySizeGb: 10 | ||
tier: BASIC | ||
ipRange: | ||
name: iprange1 | ||
remoteRef: | ||
name: name | ||
namespace: ns | ||
scope: | ||
name: scope | ||
--- | ||
apiVersion: cloud-control.kyma-project.io/v1beta1 | ||
kind: Scope | ||
spec: | ||
kymaName: kyma | ||
provider: gcp | ||
region: us-east1 | ||
scope: | ||
gcp: | ||
project: project-abcde-123 | ||
vpcNetwork: vpcnetwork-123 | ||
shootName: shot123 | ||
--- | ||
apiVersion: cloud-control.kyma-project.io/v1beta1 | ||
kind: SkrStatus | ||
spec: | ||
brokerPlan: plan | ||
globalAccount: gacc | ||
kymaName: kyma | ||
provider: gcp | ||
region: us-east1 | ||
shootName: shoot123 | ||
subAccount: subacc567 | ||
--- | ||
apiVersion: cloud-control.kyma-project.io/v1beta1 | ||
kind: VpcPeering | ||
spec: | ||
remoteRef: | ||
name: name | ||
namespace: ns | ||
scope: | ||
name: scope | ||
details: | ||
localNetwork: | ||
name: local-net | ||
remoteNetwork: | ||
name: remote-net | ||
--- | ||
apiVersion: operator.kyma-project.io/v1beta2 | ||
kind: Kyma |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
package migrateFinalizers | ||
|
||
import ( | ||
"reflect" | ||
"strings" | ||
|
||
"github.com/elliotchance/pie/v2" | ||
"github.com/kyma-project/cloud-manager/pkg/util" | ||
coordinationv1 "k8s.io/api/coordination/v1" | ||
corev1 "k8s.io/api/core/v1" | ||
"sigs.k8s.io/controller-runtime/pkg/client" | ||
|
||
cloudcontrolv1beta1 "github.com/kyma-project/cloud-manager/api/cloud-control/v1beta1" | ||
cloudresourcesv1beta1 "github.com/kyma-project/cloud-manager/api/cloud-resources/v1beta1" | ||
) | ||
|
||
const kcpNamespace = "kcp-system" | ||
|
||
func newKindInfo(list client.ObjectList, title string) KindInfo { | ||
if title == "" { | ||
x := reflect.ValueOf(list).Elem().Type().Name() | ||
title = strings.TrimSuffix(x, "List") | ||
} | ||
return KindInfo{ | ||
Title: title, | ||
List: list, | ||
} | ||
} | ||
|
||
type kindInfoProvider func() []KindInfo | ||
|
||
func newKindsForKcp() []KindInfo { | ||
return pie.Map([]KindInfo{ | ||
newKindInfo(&cloudcontrolv1beta1.IpRangeList{}, "KcpIpRange"), | ||
newKindInfo(&cloudcontrolv1beta1.NetworkList{}, ""), | ||
newKindInfo(&cloudcontrolv1beta1.NfsInstanceList{}, ""), | ||
newKindInfo(&cloudcontrolv1beta1.NukeList{}, ""), | ||
newKindInfo(&cloudcontrolv1beta1.RedisInstanceList{}, ""), | ||
newKindInfo(&cloudcontrolv1beta1.ScopeList{}, ""), | ||
newKindInfo(&cloudcontrolv1beta1.SkrStatusList{}, ""), | ||
newKindInfo(&cloudcontrolv1beta1.VpcPeeringList{}, ""), | ||
{ | ||
Title: "Kyma", | ||
List: util.NewKymaListUnstructured(), | ||
}, | ||
}, func(x KindInfo) KindInfo { | ||
x.Namespace = kcpNamespace | ||
return x | ||
}) | ||
} | ||
|
||
func newKindsForSkr() []KindInfo { | ||
return []KindInfo{ | ||
newKindInfo(&cloudresourcesv1beta1.AwsNfsBackupScheduleList{}, ""), | ||
newKindInfo(&cloudresourcesv1beta1.AwsNfsVolumeList{}, ""), | ||
newKindInfo(&cloudresourcesv1beta1.AwsNfsVolumeBackupList{}, ""), | ||
newKindInfo(&cloudresourcesv1beta1.AwsNfsVolumeRestoreList{}, ""), | ||
newKindInfo(&cloudresourcesv1beta1.AwsRedisInstanceList{}, ""), | ||
newKindInfo(&cloudresourcesv1beta1.AwsVpcPeeringList{}, ""), | ||
newKindInfo(&cloudresourcesv1beta1.AzureRedisInstanceList{}, ""), | ||
newKindInfo(&cloudresourcesv1beta1.AzureVpcPeeringList{}, ""), | ||
newKindInfo(&cloudresourcesv1beta1.CceeNfsVolumeList{}, ""), | ||
newKindInfo(&cloudresourcesv1beta1.CloudResourcesList{}, ""), | ||
newKindInfo(&cloudresourcesv1beta1.GcpNfsBackupScheduleList{}, ""), | ||
newKindInfo(&cloudresourcesv1beta1.GcpNfsVolumeList{}, ""), | ||
newKindInfo(&cloudresourcesv1beta1.GcpNfsVolumeBackupList{}, ""), | ||
newKindInfo(&cloudresourcesv1beta1.GcpNfsVolumeRestoreList{}, ""), | ||
newKindInfo(&cloudresourcesv1beta1.GcpRedisInstanceList{}, ""), | ||
newKindInfo(&cloudresourcesv1beta1.GcpVpcPeeringList{}, ""), | ||
newKindInfo(&cloudresourcesv1beta1.IpRangeList{}, "SkrIpRange"), | ||
newKindInfo(&corev1.ConfigMapList{}, ""), | ||
newKindInfo(&corev1.SecretList{}, ""), | ||
newKindInfo(&corev1.PersistentVolumeList{}, ""), | ||
newKindInfo(&corev1.PersistentVolumeClaimList{}, ""), | ||
newKindInfo(&coordinationv1.LeaseList{}, ""), | ||
} | ||
} |
Oops, something went wrong.