Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(v2): fix extensions apply #1799

Conversation

emosbaugh
Copy link
Member

@emosbaugh emosbaugh commented Feb 3, 2025

What this PR does / why we need it:

  • Respects ForceUpgrade
  • Respects order

Which issue(s) this PR fixes:

Does this PR require a test?

Does this PR require a release note?


Does this PR require documentation?

Copy link

github-actions bot commented Feb 3, 2025

This PR has been released (on staging) and is available for download with a embedded-cluster-smoke-test-staging-app license ID.

Online Installer:

curl "https://staging.replicated.app/embedded/embedded-cluster-smoke-test-staging-app/ci/appver-dev-c45f870" -H "Authorization: $EC_SMOKE_TEST_LICENSE_ID" -o embedded-cluster-smoke-test-staging-app-ci.tgz

Airgap Installer (may take a few minutes before the airgap bundle is built):

curl "https://staging.replicated.app/embedded/embedded-cluster-smoke-test-staging-app/ci-airgap/appver-dev-c45f870?airgap=true" -H "Authorization: $EC_SMOKE_TEST_LICENSE_ID" -o embedded-cluster-smoke-test-staging-app-ci.tgz

Happy debugging!

@@ -47,6 +47,8 @@ func Upgrade(ctx context.Context, kcli client.Client, prev *ecv1beta1.Installati
// diff the extensions
diffResult := diffExtensions(prev.Spec.Config.Extensions, in.Spec.Config.Extensions)

// NOTE: this does not respect order and may add extensions prior to upgrading ones with a lower order.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

order is respected in the diffExtensions function per operation though. How should it be respected otherwise?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

im not sure how it should be respected. but what if an extension needed to be upgraded first because it contained a new crd for a cr that was applied from another extension that was added?

@emosbaugh emosbaugh force-pushed the emosbaugh/sc-119635/extensions-helm-values-are-not-being-properly branch from 83f5fd9 to d598b1b Compare February 4, 2025 05:52
@emosbaugh emosbaugh marked this pull request as ready for review February 4, 2025 05:54
@emosbaugh emosbaugh requested a review from sgalsaleh February 4, 2025 05:55

actionIng, _ := formatAction(action)

slog.Info(fmt.Sprintf("%s extension %s", actionIng, ext.Name))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why not keep logging the version like before?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am just trying to make it consistent. Should we go with all structured logging?

Other instances where it is not structured:

			slog.Info(fmt.Sprintf("%s already installed", ext.Name))
		slog.Info(fmt.Sprintf("%s is ready!", ext.Name))

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we should go with structured logging, but slog doesn't provide wrapping out of the box. this is how i had it before:

slog.Info(fmt.Sprintf("%s extension", actionIng), "name", ext.Name, "version", ext.Version)

@emosbaugh emosbaugh merged commit f6e198e into v2-upgrades-without-manager Feb 4, 2025
61 of 66 checks passed
@emosbaugh emosbaugh deleted the emosbaugh/sc-119635/extensions-helm-values-are-not-being-properly branch February 4, 2025 15:26
@emosbaugh emosbaugh restored the emosbaugh/sc-119635/extensions-helm-values-are-not-being-properly branch February 4, 2025 17:21
@emosbaugh emosbaugh deleted the emosbaugh/sc-119635/extensions-helm-values-are-not-being-properly branch February 4, 2025 17:22
laverya added a commit that referenced this pull request Feb 4, 2025
* V2 upgrades without manager

* overrides for ha migration

* fix build

* clean error message when upgrading addons and extensions

* include logs in support bundle

* record upgrade failures

* run all v1 install tests in v2 (#1775)

* remove TestInstallWithoutEmbed

* use new install

* check postupgrade override labels

* fix extension upgrade messages

* further improve wording

* fix nil map issue when upgrading operator

* f

* Update pkg/extensions/upgrade.go

* Update pkg/extensions/upgrade.go

---------

Co-authored-by: Salah Al Saleh <[email protected]>

* yaml v3

* handle panics

* use slog

* replace join with join2 (#1780)

* fix build

* fix ha join

* fix lint (#1781)

* add comments to ignore deprecated BuiltinConfigs field

* fix linting

* mount charts dir

* feat(v2): enable v2 restore (#1776)

* fix upgrades

* fix TestLocalArtifactMirror and TestCommandsRequireSudo (#1782)

* chore: no spinner if no terminal (#1778)

* fix panic in TestHostPreflightCustomSpec

* fix compile

* require license for install2

* f

* f

* use single-node-install.sh in LAM e2e test

* improve sudo test logging

* ???

* see if it's just one thing failing in sudo test

* use join2 command in 'node join'. Hide 'node' commands

* improve how we are requiring the license flag for installation

---------

Co-authored-by: Ethan Mosbaugh <[email protected]>

* chore(ci): fix TestGetInstallation migrate data dirs (#1786)

* feat(v2): fix e2e TestVersion (#1784)

* feat(v2): fix e2e TestVersion

* f

* f

* fix operator upgrade in airgap

* fix velero airgap upgrades

* fix airgap upgrades

* chore(v2): e2e test multiple upgrades (#1783)

* chore(v2): e2e test multiple upgrades

* f

* f

* f

* f

* f

* f

* f

* remove use of ecUpgrade2TargetVersion

* f

* f

* f

* f

* f

* f

* f

* f

* f

* f

* f

* f

* f

* f

* f

* f

* f

---------

Co-authored-by: Andrew Lavery <[email protected]>

* fix TestHostPreflightCustomSpec and TestUnsupportedOverrides (#1787)

* create an app release to test unsupported overrides with

* f

* simplify unsupported overrides test

* update TestHostPreflightCustomSpec to use real releases

* f

* disable old installations

* better logging

* remove operator/pkg/charts as it is now unused (#1795)

* remove operator/pkg/charts as it is now unused

* run the operator even when the version does not match

* add unit tests

* feat(v2): support for restore (#1794)

* feat(v2): support for restore

* feat(v2): support for restore

* feat(v2): support for restore

* f

* f

* f

* check chart contents directly instead of using k0s chart object (#1798)

* check chart contents directly instead of using k0s chart object

* simplify by no longer checking chart values, just results

* feat(v2): restore ha (#1797)

* feat(v2): restore ha

* f

* f

* f

* Fix dryrun tests (#1800)

* disable TestOldVersionUpgrade test

* feat(v2): fix extensions apply (#1799)

* fix validate-success

---------

Co-authored-by: Andrew Lavery <[email protected]>
Co-authored-by: Ethan Mosbaugh <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants