Skip to content

Commit

Permalink
feat(ec): migration from v1 to v2 - fixes (#1718)
Browse files Browse the repository at this point in the history
* feat(ec): migration from v1 to v2 - fixes

* f

* f

* f

* f

* f

* f

* f

* f

* use new runner

* use new runner
  • Loading branch information
emosbaugh authored Jan 21, 2025
1 parent 0e973cc commit f386880
Show file tree
Hide file tree
Showing 24 changed files with 1,171 additions and 531 deletions.
28 changes: 14 additions & 14 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ jobs:

build-current:
name: Build current
runs-on: embedded-cluster
runs-on: embedded-cluster-2
needs:
- git-sha
outputs:
Expand Down Expand Up @@ -206,7 +206,7 @@ jobs:
build-legacydr:
name: Build legacy DR
runs-on: embedded-cluster
runs-on: embedded-cluster-2
needs:
- git-sha
outputs:
Expand Down Expand Up @@ -275,7 +275,7 @@ jobs:
build-previous-k0s:
name: Build previous k0s
runs-on: embedded-cluster
runs-on: embedded-cluster-2
needs:
- git-sha
outputs:
Expand Down Expand Up @@ -380,7 +380,7 @@ jobs:
build-upgrade:
name: Build upgrade
runs-on: embedded-cluster
runs-on: embedded-cluster-2
needs:
- git-sha
outputs:
Expand Down Expand Up @@ -777,19 +777,19 @@ jobs:
- TestInstallWithMITMProxy
include:
- test: TestMultiNodeAirgapUpgrade
runner: embedded-cluster
runner: embedded-cluster-2
- test: TestMultiNodeAirgapUpgradeSameK0s
runner: embedded-cluster
runner: embedded-cluster-2
- test: TestMultiNodeAirgapUpgradePreviousStable
runner: embedded-cluster
runner: embedded-cluster-2
- test: TestAirgapUpgradeFromEC18
runner: embedded-cluster
runner: embedded-cluster-2
- test: TestSingleNodeAirgapDisasterRecovery
runner: embedded-cluster
runner: embedded-cluster-2
- test: TestMultiNodeAirgapHAInstallation
runner: embedded-cluster
runner: embedded-cluster-2
- test: TestMultiNodeAirgapHADisasterRecovery
runner: embedded-cluster
runner: embedded-cluster-2
steps:
- name: Checkout
uses: actions/checkout@v4
Expand All @@ -802,7 +802,7 @@ jobs:
- uses: ./.github/actions/e2e
with:
test-name: '${{ matrix.test }}'
is-large-runner: ${{ matrix.runner == 'embedded-cluster' }}
is-large-runner: ${{ matrix.runner == 'embedded-cluster-2' }}
airgap-license-id: ${{ secrets.STAGING_EMBEDDED_CLUSTER_AIRGAP_LICENSE_ID }}
snapshot-license-id: ${{ secrets.STAGING_EMBEDDED_CLUSTER_SNAPSHOT_LICENSE_ID }}
snapshot-license: ${{ secrets.STAGING_EMBEDDED_CLUSTER_SNAPSHOT_LICENSE }}
Expand Down Expand Up @@ -833,7 +833,7 @@ jobs:
matrix:
include:
- test: TestFiveNodesAirgapUpgrade
runner: embedded-cluster
runner: embedded-cluster-2
steps:
- name: Checkout
uses: actions/checkout@v4
Expand All @@ -846,7 +846,7 @@ jobs:
- uses: ./.github/actions/e2e
with:
test-name: '${{ matrix.test }}'
is-large-runner: ${{ matrix.runner == 'embedded-cluster' }}
is-large-runner: ${{ matrix.runner == 'embedded-cluster-2' }}
airgap-license-id: ${{ secrets.STAGING_EMBEDDED_CLUSTER_AIRGAP_LICENSE_ID }}
snapshot-license-id: ${{ secrets.STAGING_EMBEDDED_CLUSTER_SNAPSHOT_LICENSE_ID }}
snapshot-license: ${{ secrets.STAGING_EMBEDDED_CLUSTER_SNAPSHOT_LICENSE }}
Expand Down
18 changes: 9 additions & 9 deletions .github/workflows/release-prod.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -545,21 +545,21 @@ jobs:
- TestInstallWithMITMProxy
include:
- test: TestMultiNodeAirgapUpgrade
runner: embedded-cluster
runner: embedded-cluster-2
- test: TestMultiNodeAirgapUpgradeSameK0s
runner: embedded-cluster
runner: embedded-cluster-2
- test: TestMultiNodeAirgapUpgradePreviousStable
runner: embedded-cluster
runner: embedded-cluster-2
- test: TestAirgapUpgradeFromEC18
runner: embedded-cluster
runner: embedded-cluster-2
- test: TestSingleNodeAirgapDisasterRecovery
runner: embedded-cluster
runner: embedded-cluster-2
- test: TestMultiNodeAirgapHAInstallation
runner: embedded-cluster
runner: embedded-cluster-2
- test: TestMultiNodeAirgapHADisasterRecovery
runner: embedded-cluster
runner: embedded-cluster-2
- test: TestFiveNodesAirgapUpgrade
runner: embedded-cluster
runner: embedded-cluster-2
steps:
- name: Checkout
uses: actions/checkout@v4
Expand All @@ -572,7 +572,7 @@ jobs:
- uses: ./.github/actions/e2e
with:
test-name: '${{ matrix.test }}'
is-large-runner: ${{ matrix.runner == 'embedded-cluster' }}
is-large-runner: ${{ matrix.runner == 'embedded-cluster-2' }}
airgap-license-id: ${{ secrets.STAGING_EMBEDDED_CLUSTER_AIRGAP_LICENSE_ID }}
snapshot-license-id: ${{ secrets.STAGING_EMBEDDED_CLUSTER_SNAPSHOT_LICENSE_ID }}
snapshot-license: ${{ secrets.STAGING_EMBEDDED_CLUSTER_SNAPSHOT_LICENSE }}
Expand Down
4 changes: 4 additions & 0 deletions kinds/apis/v1beta1/installation_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,10 @@ const (
InstallationSourceTypeConfigMap string = "ConfigMap"
)

const (
DisableReconcileConditionType = "DisableReconcile"
)

// ConfigSecretEntryName holds the entry name we are looking for in the secret
// that holds the embedded cluster configuration.
const ConfigSecretEntryName = "config.yaml"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ rules:
resources:
- persistentvolumes
- persistentvolumeclaims
- pods
verbs:
- delete
- get
Expand All @@ -50,7 +49,9 @@ rules:
- ""
resources:
- configmaps
- pods
verbs:
- create
- get
- list
- watch
Expand Down
7 changes: 6 additions & 1 deletion operator/controllers/installation_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -557,7 +557,7 @@ func (r *InstallationReconciler) Reconcile(ctx context.Context, req ctrl.Request
// are going to operate only on the newest one (sorting by installation
// name).
log := ctrl.LoggerFrom(ctx)
installs, err := kubeutils.ListInstallations(ctx, r.Client)
installs, err := kubeutils.ListCRDInstallations(ctx, r.Client)
if err != nil {
return ctrl.Result{}, fmt.Errorf("failed to list installations: %w", err)
}
Expand Down Expand Up @@ -590,6 +590,11 @@ func (r *InstallationReconciler) Reconcile(ctx context.Context, req ctrl.Request
return ctrl.Result{}, nil
}

if k8sutil.CheckConditionStatus(in.Status, v1beta1.DisableReconcileConditionType) == metav1.ConditionTrue {
log.Info("Installation reconciliation is disabled, reconciliation ended")
return ctrl.Result{}, nil
}

// if this installation points to a cluster configuration living on
// a secret we need to fetch this configuration before moving on.
// at this stage we bail out with an error if we can't fetch or
Expand Down
1 change: 0 additions & 1 deletion operator/pkg/cli/migrate_v2.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ func MigrateV2Cmd() *cobra.Command {

return nil
},
// NOTE: the top level command is unused in the product but can be used for testing.
RunE: func(cmd *cobra.Command, args []string) error {
ctx := cmd.Context()

Expand Down
Loading

0 comments on commit f386880

Please sign in to comment.