Skip to content

Commit

Permalink
feat: Deletion mode (#1844)
Browse files Browse the repository at this point in the history
* feat: Re-add `.spec.modules[].managed` to KymaCR (#1661)

feat: Re-add '.spec.modules[].managed' to KymaCR

* feat: Add AssociatedResources field to Manifest Spec (#1656)

* Add managedResources to ManifestSpec

* Add managedResources to ManifestSpec

* Fix docs deadlink

* Adjust docs

* Code review comments

* TWS review

* Renaming ManagedResources to AssociatedResources

* Update manifest-cr.md

Co-authored-by: Małgorzata Świeca <malgorzata.swieca@sap.com>

* Update manifest-cr.md

Co-authored-by: Małgorzata Świeca <malgorzata.swieca@sap.com>

* Update manifest_types.go

Co-authored-by: Małgorzata Świeca <malgorzata.swieca@sap.com>

---------

Co-authored-by: Małgorzata Świeca <malgorzata.swieca@sap.com>

* chore: Create ModuleTemplate with new ocm format for e2e (#1660)

* create module-template with new ocm format and managed resource

* chore(dependabot): bump golang from 1.22.4-alpine to 1.22.5-alpine (#1664)

Bumps golang from 1.22.4-alpine to 1.22.5-alpine.

---
updated-dependencies:
- dependency-name: golang
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* chore: Bump k8s version for e2e to 1.29.6 (#1665)

* chore: Bump k8s version for e2e to 1.29.6

* add wait for main build and bump smoke test version

* feat: Avoid Redundant SSA for Manifest Patching (#1620)

* feat: avoid redundant ssa for manifest patching

* refactor: linting issue

* test: add unit test

* fix: integration tests

* refactor: unwrapped error

* fix: state flickering

* chore: add linter exception

* chore: remove linter exception

* fix: null pointer ref in case of mandatory module

* chore: Add helpful comment

Co-authored-by: Christoph Schwägerl <acc.pius@mailbox.org>

* feat: add additional diff check in NeedToUpdate()

* test: diff check in unit test

* refactor: lint

* refactor: remove manifest diff check

* fix: module template integration test

* test: add unit test

* Revert "test: add unit test"

This reverts commit a5a9102.

* Revert "fix: module template integration test"

This reverts commit 9ed7e26.

* fix integration test

* chore: retrigger

* refactor: gofunmpt

* docs: Apply suggestions from code review

Co-authored-by: Małgorzata Świeca <malgorzata.swieca@sap.com>

---------

Co-authored-by: Christoph Schwägerl <acc.pius@mailbox.org>
Co-authored-by: Christoph Schwägerl <c.schwaegerl@sap.com>
Co-authored-by: Małgorzata Świeca <malgorzata.swieca@sap.com>

* rename

* Revert "Merge branch 'main' into intro-test-managed-resources"

This reverts commit 854b8b4, reversing
changes made to be4f556.

* update module template

* update module template

* retrigger jobs

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Raj <54686422+LeelaChacha@users.noreply.github.com>
Co-authored-by: Christoph Schwägerl <acc.pius@mailbox.org>
Co-authored-by: Christoph Schwägerl <c.schwaegerl@sap.com>
Co-authored-by: Małgorzata Świeca <malgorzata.swieca@sap.com>

* chore: Merge main into deletion modes feature (#1678)

* chore(dependabot): bump golang from 1.22.4-alpine to 1.22.5-alpine (#1664)

Bumps golang from 1.22.4-alpine to 1.22.5-alpine.

---
updated-dependencies:
- dependency-name: golang
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* chore: Bump k8s version for e2e to 1.29.6 (#1665)

* chore: Bump k8s version for e2e to 1.29.6

* add wait for main build and bump smoke test version

* feat: Avoid Redundant SSA for Manifest Patching (#1620)

* feat: avoid redundant ssa for manifest patching

* refactor: linting issue

* test: add unit test

* fix: integration tests

* refactor: unwrapped error

* fix: state flickering

* chore: add linter exception

* chore: remove linter exception

* fix: null pointer ref in case of mandatory module

* chore: Add helpful comment

Co-authored-by: Christoph Schwägerl <acc.pius@mailbox.org>

* feat: add additional diff check in NeedToUpdate()

* test: diff check in unit test

* refactor: lint

* refactor: remove manifest diff check

* fix: module template integration test

* test: add unit test

* Revert "test: add unit test"

This reverts commit a5a9102.

* Revert "fix: module template integration test"

This reverts commit 9ed7e26.

* fix integration test

* chore: retrigger

* refactor: gofunmpt

* docs: Apply suggestions from code review

Co-authored-by: Małgorzata Świeca <malgorzata.swieca@sap.com>

---------

Co-authored-by: Christoph Schwägerl <acc.pius@mailbox.org>
Co-authored-by: Christoph Schwägerl <c.schwaegerl@sap.com>
Co-authored-by: Małgorzata Świeca <malgorzata.swieca@sap.com>

* chore(dependabot): bump github.com/google/go-containerregistry from 0.19.2 to 0.20.0 (#1670)

chore(dependabot): bump github.com/google/go-containerregistry

Bumps [github.com/google/go-containerregistry](https://github.com/google/go-containerregistry) from 0.19.2 to 0.20.0.
- [Release notes](https://github.com/google/go-containerregistry/releases)
- [Changelog](https://github.com/google/go-containerregistry/blob/main/.goreleaser.yml)
- [Commits](google/go-containerregistry@v0.19.2...v0.20.0)

---
updated-dependencies:
- dependency-name: github.com/google/go-containerregistry
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* chore(dependabot): bump google.golang.org/grpc from 1.64.0 to 1.64.1 in the go_modules group (#1671)

chore(dependabot): bump google.golang.org/grpc in the go_modules group

Bumps the go_modules group with 1 update: [google.golang.org/grpc](https://github.com/grpc/grpc-go).


Updates `google.golang.org/grpc` from 1.64.0 to 1.64.1
- [Release notes](https://github.com/grpc/grpc-go/releases)
- [Commits](grpc/grpc-go@v1.64.0...v1.64.1)

---
updated-dependencies:
- dependency-name: google.golang.org/grpc
  dependency-type: indirect
  dependency-group: go_modules
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* chore: Remove diff manifest diff checker (#1674)

* chore: Remove diff manifest diff checker

* retrigger jobs

* refactor: Simplify declarative reconciler (#1676)

* extract default finalizer from opts

* extract field owner and namespace

* extract skip label funx

* replace obj with manifest for manifest reconcile loop

* add skip reconcile check as method. internalize cr deletion check

* simplify SpecResolver

* fix integration test setup

* linting

* linting

* remove generace cache key

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Benjamin Lindner <50365642+lindnerby@users.noreply.github.com>
Co-authored-by: Raj <54686422+LeelaChacha@users.noreply.github.com>
Co-authored-by: Christoph Schwägerl <acc.pius@mailbox.org>
Co-authored-by: Christoph Schwägerl <c.schwaegerl@sap.com>
Co-authored-by: Małgorzata Świeca <malgorzata.swieca@sap.com>

* chore: Remove associatedResources field from Manifest CR (#1689)

Revert "feat: Add AssociatedResources field to Manifest Spec (#1656)"

This reverts commit 2e620d7.

* chore: Sync deletion mode feature branch (#1720)

* chore(dependabot): bump golang from 1.22.4-alpine to 1.22.5-alpine (#1664)

Bumps golang from 1.22.4-alpine to 1.22.5-alpine.

---
updated-dependencies:
- dependency-name: golang
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* chore: Bump k8s version for e2e to 1.29.6 (#1665)

* chore: Bump k8s version for e2e to 1.29.6

* add wait for main build and bump smoke test version

* feat: Avoid Redundant SSA for Manifest Patching (#1620)

* feat: avoid redundant ssa for manifest patching

* refactor: linting issue

* test: add unit test

* fix: integration tests

* refactor: unwrapped error

* fix: state flickering

* chore: add linter exception

* chore: remove linter exception

* fix: null pointer ref in case of mandatory module

* chore: Add helpful comment

Co-authored-by: Christoph Schwägerl <acc.pius@mailbox.org>

* feat: add additional diff check in NeedToUpdate()

* test: diff check in unit test

* refactor: lint

* refactor: remove manifest diff check

* fix: module template integration test

* test: add unit test

* Revert "test: add unit test"

This reverts commit a5a9102.

* Revert "fix: module template integration test"

This reverts commit 9ed7e26.

* fix integration test

* chore: retrigger

* refactor: gofunmpt

* docs: Apply suggestions from code review

Co-authored-by: Małgorzata Świeca <malgorzata.swieca@sap.com>

---------

Co-authored-by: Christoph Schwägerl <acc.pius@mailbox.org>
Co-authored-by: Christoph Schwägerl <c.schwaegerl@sap.com>
Co-authored-by: Małgorzata Świeca <malgorzata.swieca@sap.com>

* chore(dependabot): bump github.com/google/go-containerregistry from 0.19.2 to 0.20.0 (#1670)

chore(dependabot): bump github.com/google/go-containerregistry

Bumps [github.com/google/go-containerregistry](https://github.com/google/go-containerregistry) from 0.19.2 to 0.20.0.
- [Release notes](https://github.com/google/go-containerregistry/releases)
- [Changelog](https://github.com/google/go-containerregistry/blob/main/.goreleaser.yml)
- [Commits](google/go-containerregistry@v0.19.2...v0.20.0)

---
updated-dependencies:
- dependency-name: github.com/google/go-containerregistry
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* chore(dependabot): bump google.golang.org/grpc from 1.64.0 to 1.64.1 in the go_modules group (#1671)

chore(dependabot): bump google.golang.org/grpc in the go_modules group

Bumps the go_modules group with 1 update: [google.golang.org/grpc](https://github.com/grpc/grpc-go).


Updates `google.golang.org/grpc` from 1.64.0 to 1.64.1
- [Release notes](https://github.com/grpc/grpc-go/releases)
- [Commits](grpc/grpc-go@v1.64.0...v1.64.1)

---
updated-dependencies:
- dependency-name: google.golang.org/grpc
  dependency-type: indirect
  dependency-group: go_modules
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* chore: Remove diff manifest diff checker (#1674)

* chore: Remove diff manifest diff checker

* retrigger jobs

* refactor: Simplify declarative reconciler (#1676)

* extract default finalizer from opts

* extract field owner and namespace

* extract skip label funx

* replace obj with manifest for manifest reconcile loop

* add skip reconcile check as method. internalize cr deletion check

* simplify SpecResolver

* fix integration test setup

* linting

* linting

* remove generace cache key

* chore: Update Protecode (#1683)

update protecode

* chore: Refactor NewCachedDescriptorProvider (#1695)

* remove parameter for NewCachedDescriptorProvider

* fix dead link

* adjust unit test coverage

* fix flaky test

* docs: Update KLM Local Test Setup Guide (#1680)

fix errors in local test setup documentation
add version info

* feat: Drop multiple ways to reference modules in Kyma CR (#1672)

* remove module reference by namespace/name

* remove module reference by objectmeta name

* remove module reference by FQDN

* add initial test structure

* add test cases for different module reference scenarios

* fix tests

* update documentation

* address review comments

* address more review comments

* fix linting issues

* rearrange imports

* adjust documentation

* chore: Configure different requeue intervals for Manifest reconciliation (#1690)

* Add different requeue intervals for Manifest reconciliation

* Empty-Commit

* code review comments

* chore: Bump k8s deps (#1703)

* chore: Bump k8s deps

* retrigger jobs

* bump api folder as well

---------

Co-authored-by: Nesma Badr <Nesma.badr@sap.com>

* fix: Manifest CR should update by moduletemplate generation changes (#1702)

* when moduletemplate generation updated, then manifest CR should also updated.

* refactor regular_test.go

---------

Co-authored-by: Benjamin Lindner <50365642+lindnerby@users.noreply.github.com>

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Benjamin Lindner <50365642+lindnerby@users.noreply.github.com>
Co-authored-by: Raj <54686422+LeelaChacha@users.noreply.github.com>
Co-authored-by: Christoph Schwägerl <acc.pius@mailbox.org>
Co-authored-by: Christoph Schwägerl <c.schwaegerl@sap.com>
Co-authored-by: Małgorzata Świeca <malgorzata.swieca@sap.com>
Co-authored-by: Amritanshu Sikdar <amritanshu.sikdar@sap.com>
Co-authored-by: Amritanshu Sikdar <amritanshu.sikdar@gmail.com>
Co-authored-by: Nesma Badr <Nesma.badr@sap.com>

* chore: Sync main into deletion mode feature (#1736)

* chore(dependabot): bump golang from 1.22.4-alpine to 1.22.5-alpine (#1664)

Bumps golang from 1.22.4-alpine to 1.22.5-alpine.

---
updated-dependencies:
- dependency-name: golang
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* chore: Bump k8s version for e2e to 1.29.6 (#1665)

* chore: Bump k8s version for e2e to 1.29.6

* add wait for main build and bump smoke test version

* feat: Avoid Redundant SSA for Manifest Patching (#1620)

* feat: avoid redundant ssa for manifest patching

* refactor: linting issue

* test: add unit test

* fix: integration tests

* refactor: unwrapped error

* fix: state flickering

* chore: add linter exception

* chore: remove linter exception

* fix: null pointer ref in case of mandatory module

* chore: Add helpful comment

Co-authored-by: Christoph Schwägerl <acc.pius@mailbox.org>

* feat: add additional diff check in NeedToUpdate()

* test: diff check in unit test

* refactor: lint

* refactor: remove manifest diff check

* fix: module template integration test

* test: add unit test

* Revert "test: add unit test"

This reverts commit a5a9102.

* Revert "fix: module template integration test"

This reverts commit 9ed7e26.

* fix integration test

* chore: retrigger

* refactor: gofunmpt

* docs: Apply suggestions from code review

Co-authored-by: Małgorzata Świeca <malgorzata.swieca@sap.com>

---------

Co-authored-by: Christoph Schwägerl <acc.pius@mailbox.org>
Co-authored-by: Christoph Schwägerl <c.schwaegerl@sap.com>
Co-authored-by: Małgorzata Świeca <malgorzata.swieca@sap.com>

* chore(dependabot): bump github.com/google/go-containerregistry from 0.19.2 to 0.20.0 (#1670)

chore(dependabot): bump github.com/google/go-containerregistry

Bumps [github.com/google/go-containerregistry](https://github.com/google/go-containerregistry) from 0.19.2 to 0.20.0.
- [Release notes](https://github.com/google/go-containerregistry/releases)
- [Changelog](https://github.com/google/go-containerregistry/blob/main/.goreleaser.yml)
- [Commits](google/go-containerregistry@v0.19.2...v0.20.0)

---
updated-dependencies:
- dependency-name: github.com/google/go-containerregistry
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* chore(dependabot): bump google.golang.org/grpc from 1.64.0 to 1.64.1 in the go_modules group (#1671)

chore(dependabot): bump google.golang.org/grpc in the go_modules group

Bumps the go_modules group with 1 update: [google.golang.org/grpc](https://github.com/grpc/grpc-go).


Updates `google.golang.org/grpc` from 1.64.0 to 1.64.1
- [Release notes](https://github.com/grpc/grpc-go/releases)
- [Commits](grpc/grpc-go@v1.64.0...v1.64.1)

---
updated-dependencies:
- dependency-name: google.golang.org/grpc
  dependency-type: indirect
  dependency-group: go_modules
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* chore: Remove diff manifest diff checker (#1674)

* chore: Remove diff manifest diff checker

* retrigger jobs

* refactor: Simplify declarative reconciler (#1676)

* extract default finalizer from opts

* extract field owner and namespace

* extract skip label funx

* replace obj with manifest for manifest reconcile loop

* add skip reconcile check as method. internalize cr deletion check

* simplify SpecResolver

* fix integration test setup

* linting

* linting

* remove generace cache key

* chore: Update Protecode (#1683)

update protecode

* chore: Refactor NewCachedDescriptorProvider (#1695)

* remove parameter for NewCachedDescriptorProvider

* fix dead link

* adjust unit test coverage

* fix flaky test

* docs: Update KLM Local Test Setup Guide (#1680)

fix errors in local test setup documentation
add version info

* feat: Drop multiple ways to reference modules in Kyma CR (#1672)

* remove module reference by namespace/name

* remove module reference by objectmeta name

* remove module reference by FQDN

* add initial test structure

* add test cases for different module reference scenarios

* fix tests

* update documentation

* address review comments

* address more review comments

* fix linting issues

* rearrange imports

* adjust documentation

* chore: Configure different requeue intervals for Manifest reconciliation (#1690)

* Add different requeue intervals for Manifest reconciliation

* Empty-Commit

* code review comments

* chore: Bump k8s deps (#1703)

* chore: Bump k8s deps

* retrigger jobs

* bump api folder as well

---------

Co-authored-by: Nesma Badr <Nesma.badr@sap.com>

* fix: Manifest CR should update by moduletemplate generation changes (#1702)

* when moduletemplate generation updated, then manifest CR should also updated.

* refactor regular_test.go

---------

Co-authored-by: Benjamin Lindner <50365642+lindnerby@users.noreply.github.com>

* feat: Support StatefulSet Module Resource in Ready Check (#1713)

* Add implementation to support stateful set

* Add unit tests

* Start writing E2E test

* Adjust Github Actions for E2E test

* E2E test implementation

* chore(dependabot): bump github.com/onsi/gomega from 1.33.1 to 1.34.0 (#1723)

Bumps [github.com/onsi/gomega](https://github.com/onsi/gomega) from 1.33.1 to 1.34.0.
- [Release notes](https://github.com/onsi/gomega/releases)
- [Changelog](https://github.com/onsi/gomega/blob/master/CHANGELOG.md)
- [Commits](onsi/gomega@v1.33.1...v1.34.0)

---
updated-dependencies:
- dependency-name: github.com/onsi/gomega
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* deps: Use latest watcher img 1.1.1 (#1726)

* deps: Bump sec-scanners-config KLM img tag to 1.1.1 (#1728)

* chore: Add deprecation notes to customStateCheck (#1708)

* Add deprecation notes

* Update docs/technical-reference/api/moduleTemplate-cr.md

Co-authored-by: Małgorzata Świeca <malgorzata.swieca@sap.com>

* Configure API version exclusion

* Update docs/technical-reference/api/moduleTemplate-cr.md

Co-authored-by: Małgorzata Świeca <malgorzata.swieca@sap.com>

* review fix

---------

Co-authored-by: Małgorzata Świeca <malgorzata.swieca@sap.com>

* chore(dependabot): bump github.com/onsi/gomega from 1.34.0 to 1.34.1 (#1729)

Bumps [github.com/onsi/gomega](https://github.com/onsi/gomega) from 1.34.0 to 1.34.1.
- [Release notes](https://github.com/onsi/gomega/releases)
- [Changelog](https://github.com/onsi/gomega/blob/master/CHANGELOG.md)
- [Commits](onsi/gomega@v1.34.0...v1.34.1)

---
updated-dependencies:
- dependency-name: github.com/onsi/gomega
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* chore(dependabot): bump github.com/onsi/ginkgo/v2 from 2.19.0 to 2.19.1 (#1727)

Bumps [github.com/onsi/ginkgo/v2](https://github.com/onsi/ginkgo) from 2.19.0 to 2.19.1.
- [Release notes](https://github.com/onsi/ginkgo/releases)
- [Changelog](https://github.com/onsi/ginkgo/blob/master/CHANGELOG.md)
- [Commits](onsi/ginkgo@v2.19.0...v2.19.1)

---
updated-dependencies:
- dependency-name: github.com/onsi/ginkgo/v2
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* chore(dependabot): bump github.com/docker/docker from 26.1.3+incompatible to 26.1.4+incompatible in the go_modules group (#1731)

chore(dependabot): bump github.com/docker/docker in the go_modules group

Bumps the go_modules group with 1 update: [github.com/docker/docker](https://github.com/docker/docker).


Updates `github.com/docker/docker` from 26.1.3+incompatible to 26.1.4+incompatible
- [Release notes](https://github.com/docker/docker/releases)
- [Commits](moby/moby@v26.1.3...v26.1.4)

---
updated-dependencies:
- dependency-name: github.com/docker/docker
  dependency-type: indirect
  dependency-group: go_modules
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* chore(dependabot): bump github.com/cert-manager/cert-manager from 1.15.1 to 1.15.2 (#1730)

chore(dependabot): bump github.com/cert-manager/cert-manager

Bumps [github.com/cert-manager/cert-manager](https://github.com/cert-manager/cert-manager) from 1.15.1 to 1.15.2.
- [Release notes](https://github.com/cert-manager/cert-manager/releases)
- [Changelog](https://github.com/cert-manager/cert-manager/blob/master/RELEASE.md)
- [Commits](cert-manager/cert-manager@v1.15.1...v1.15.2)

---
updated-dependencies:
- dependency-name: github.com/cert-manager/cert-manager
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Tomasz Smelcerz <tomasz.smelcerz@sap.com>

* chore: Limit access for remote and istio namespaces (#1722)

* Limit access for remote and istio namespaces

* Adjust E2E test

* Empty-Commit

* Change ClusterRole to Role

* Review comments

* chore(dependabot): bump github.com/docker/docker from 26.1.3+incompatible to 26.1.4+incompatible in /api in the go_modules group (#1732)

chore(dependabot): bump github.com/docker/docker

Bumps the go_modules group in /api with 1 update: [github.com/docker/docker](https://github.com/docker/docker).


Updates `github.com/docker/docker` from 26.1.3+incompatible to 26.1.4+incompatible
- [Release notes](https://github.com/docker/docker/releases)
- [Commits](moby/moby@v26.1.3...v26.1.4)

---
updated-dependencies:
- dependency-name: github.com/docker/docker
  dependency-type: indirect
  dependency-group: go_modules
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Tomasz Smelcerz <tomasz.smelcerz@sap.com>

* chore(dependabot): bump github.com/open-component-model/ocm from 0.11.0 to 0.12.0 in /api (#1705)

* chore(dependabot): bump github.com/open-component-model/ocm in /api

Bumps [github.com/open-component-model/ocm](https://github.com/open-component-model/ocm) from 0.11.0 to 0.12.0.
- [Release notes](https://github.com/open-component-model/ocm/releases)
- [Changelog](https://github.com/open-component-model/ocm/blob/main/.goreleaser.yaml)
- [Commits](open-component-model/ocm@v0.11.0...v0.12.0)

---
updated-dependencies:
- dependency-name: github.com/open-component-model/ocm
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

* bump ocm in lifecycle-manager

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Tomasz Smelcerz <tomasz.smelcerz@sap.com>

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Benjamin Lindner <50365642+lindnerby@users.noreply.github.com>
Co-authored-by: Christoph Schwägerl <acc.pius@mailbox.org>
Co-authored-by: Christoph Schwägerl <c.schwaegerl@sap.com>
Co-authored-by: Małgorzata Świeca <malgorzata.swieca@sap.com>
Co-authored-by: Xin Ruan <xin.ruan@sap.com>
Co-authored-by: Amritanshu Sikdar <amritanshu.sikdar@sap.com>
Co-authored-by: Amritanshu Sikdar <amritanshu.sikdar@gmail.com>
Co-authored-by: Nesma Badr <Nesma.badr@sap.com>
Co-authored-by: Tomasz Smelcerz <tomasz.smelcerz@sap.com>

* feat: Support "application/x-tar" media type in the module template (#1698)

* feat: support x-tar media type

* chore: adjust after rebase

* fix: oci repo subpath parsing

* refactor: lint

* refactor: lint perfsprint

* fix: default cr parsing from template

* fix: moduletemplate layer name

* test: add integration test

* refactor: after code review

* make lint happy

* refactoring test

* refactoring ExtractLayer

* keep default cr in moduletemplate

* update dead link

* test layer parser

* test layer parser

* adjust e2e test

* code refactoring

---------

Co-authored-by: Xin Ruan <xin.ruan@sap.com>

* feat: Unmanage module (#1717)

* add annotation probably should be replaced with finalizer

* add finalizer if unmanaged

* delete manifest and finalizers when unmanaged finalizer found

* set unmanaged from spec

* fix compile error

* start testcase

* delete

* all module test instances have managed enabled by default

* fix enable label value

* revert integration test

* revert integration test

* add unmanage e2e

* add unamage module to e2e matrix

* remove helper func

* sort

* fix resource name

* renaming

* add unmanaged annotation

* unmanage with deletion in manifest-controller

* move deletion of manifest to kyma control loop

* fix e2e

* lint fixes

* fmt

* resolve lint issues

* revert loglevel

* clean-up and more testcases

* adapt e2e

* adapt e2e

* adapt e2e

* add Managed = true to all used v1beta2.Module in code...

* extend e2e

* adapt some review comments

* revert FDescribe

* return err on invalid kyma and watcher state

* adapt runner test

* chore: Remove requeue on invalid cr state (#1829)

remove requeue on invalid cr state

* fix merge

* fix merge

* fix merge

* fix merge

* fix IsUnmanaged detection

* delete unmanaged manifest in manifest controller

* fix NeedToUpdate

* refactor removefinalizer

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: Christoph Schwägerl <c.schwaegerl@sap.com>
Co-authored-by: Nesma Badr <Nesma.badr@sap.com>
Co-authored-by: Małgorzata Świeca <malgorzata.swieca@sap.com>
Co-authored-by: Benjamin Lindner <50365642+lindnerby@users.noreply.github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Raj <54686422+LeelaChacha@users.noreply.github.com>
Co-authored-by: Christoph Schwägerl <acc.pius@mailbox.org>
Co-authored-by: Amritanshu Sikdar <amritanshu.sikdar@sap.com>
Co-authored-by: Amritanshu Sikdar <amritanshu.sikdar@gmail.com>
Co-authored-by: Tomasz Smelcerz <tomasz.smelcerz@sap.com>
  • Loading branch information
11 people authored Sep 9, 2024
1 parent 88dbd1e commit 2342670
Show file tree
Hide file tree
Showing 84 changed files with 1,888 additions and 580 deletions.
9 changes: 8 additions & 1 deletion .github/actions/deploy-template-operator/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ runs:
matrix.e2e-test == 'kyma-deprovision-with-background-propagation' ||
matrix.e2e-test == 'module-consistency' ||
matrix.e2e-test == 'skip-manifest-reconciliation' ||
matrix.e2e-test == 'misconfigured-kyma-secret'
matrix.e2e-test == 'misconfigured-kyma-secret' ||
matrix.e2e-test == 'unmanage-module'
}}
shell: bash
run: |
Expand Down Expand Up @@ -159,4 +160,10 @@ runs:
sed -i 's/localhost:5111/k3d-kcp-registry.localhost:5000/g' ./template.yaml
kubectl get crds
kubectl apply -f template.yaml
- name: Apply Template Operator Module in OCM format
working-directory: ./lifecycle-manager
if: ${{ matrix.e2e-test == 'ocm-compatible-module-template' }}
shell: bash
run: |
kubectl apply -f tests/moduletemplates/moduletemplate_template_operator_regular_new_ocm.yaml
2 changes: 2 additions & 0 deletions .github/workflows/test-e2e.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,15 @@ jobs:
- purge-metrics
- module-upgrade-channel-switch
- module-upgrade-new-version
- unmanage-module
- skip-manifest-reconciliation
- ca-certificate-rotation
- self-signed-certificate-rotation
- mandatory-module
- mandatory-module-metrics
- misconfigured-kyma-secret
- rbac-privileges
- ocm-compatible-module-template
runs-on: ubuntu-latest
timeout-minutes: 20
steps:
Expand Down
1 change: 1 addition & 0 deletions api/shared/operator_annotations.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,5 @@ const (
IsClusterScopedAnnotation = OperatorGroup + Separator + "is-cluster-scoped"
CustomStateCheckAnnotation = OperatorGroup + Separator + "custom-state-check"
ModuleVersionAnnotation = OperatorGroup + Separator + "module-version"
UnmanagedAnnotation = OperatorGroup + Separator + "is-unmanaged"
)
6 changes: 6 additions & 0 deletions api/shared/operator_labels.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package shared

import "strings"

const (
OperatorGroup = "operator.kyma-project.io"
Separator = "/"
Expand Down Expand Up @@ -41,3 +43,7 @@ const (
EnableLabelValue = "true"
DisableLabelValue = "false"
)

func IsEnabled(value string) bool {
return strings.ToLower(value) == EnableLabelValue
}
4 changes: 3 additions & 1 deletion api/shared/state.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package shared

// +kubebuilder:validation:Enum=Processing;Deleting;Ready;Error;"";Warning
// +kubebuilder:validation:Enum=Processing;Deleting;Ready;Error;"";Warning;Unmanaged
type State string

// Valid States.
Expand All @@ -21,6 +21,8 @@ const (
// StateWarning signifies specified resource has been deployed, but cannot be used due to misconfiguration,
// usually it means that user interaction is required.
StateWarning State = "Warning"

StateUnmanaged State = "Unmanaged"
)

// IsSupportedState These states will be used by module CR.
Expand Down
23 changes: 14 additions & 9 deletions api/v1beta2/kyma_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@ limitations under the License.
package v1beta2

import (
"strings"

"k8s.io/apimachinery/pkg/api/meta"
apimetav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/types"
Expand Down Expand Up @@ -82,6 +80,11 @@ type Module struct {

// +kubebuilder:default:=CreateAndDelete
CustomResourcePolicy `json:"customResourcePolicy,omitempty"`

// Managed is determining whether the module is managed or not. If the module is unmanaged, the user is responsible
// for the lifecycle of the module.
// +kubebuilder:default:=true
Managed bool `json:"managed"`
}

// CustomResourcePolicy determines how a ModuleTemplate should be parsed. When CustomResourcePolicy is set to
Expand Down Expand Up @@ -356,7 +359,7 @@ func (kyma *Kyma) DetermineState() shared.State {
func (kyma *Kyma) AllModulesReady() bool {
for i := range kyma.Status.Modules {
moduleStatus := &kyma.Status.Modules[i]
if moduleStatus.State != shared.StateReady {
if moduleStatus.State != shared.StateReady && moduleStatus.State != shared.StateUnmanaged {
return false
}
}
Expand All @@ -365,37 +368,39 @@ func (kyma *Kyma) AllModulesReady() bool {

func (kyma *Kyma) HasSyncLabelEnabled() bool {
if sync, found := kyma.Labels[shared.SyncLabel]; found {
return strings.ToLower(sync) == shared.EnableLabelValue
return shared.IsEnabled(sync)
}

return true // missing label defaults to enabled sync
}

func (kyma *Kyma) SkipReconciliation() bool {
skip, found := kyma.Labels[shared.SkipReconcileLabel]
return found && strings.ToLower(skip) == shared.EnableLabelValue
return found && shared.IsEnabled(skip)
}

func (kyma *Kyma) IsInternal() bool {
internal, found := kyma.Labels[shared.InternalLabel]
return found && strings.ToLower(internal) == shared.EnableLabelValue
return found && shared.IsEnabled(internal)
}

func (kyma *Kyma) IsBeta() bool {
beta, found := kyma.Labels[shared.BetaLabel]
return found && strings.ToLower(beta) == shared.EnableLabelValue
return found && shared.IsEnabled(beta)
}

type AvailableModule struct {
Module
Enabled bool
Enabled bool
Unmanaged bool
}

func (kyma *Kyma) GetAvailableModules() []AvailableModule {
moduleMap := make(map[string]bool)
modules := make([]AvailableModule, 0)
for _, module := range kyma.Spec.Modules {
moduleMap[module.Name] = true
modules = append(modules, AvailableModule{Module: module, Enabled: true})
modules = append(modules, AvailableModule{Module: module, Enabled: true, Unmanaged: !module.Managed})
}

for _, module := range kyma.Status.Modules {
Expand Down
23 changes: 15 additions & 8 deletions api/v1beta2/manifest_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,19 @@ limitations under the License.
package v1beta2

import (
"strconv"

apimetav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
machineryruntime "k8s.io/apimachinery/pkg/runtime"

"github.com/kyma-project/lifecycle-manager/api/shared"
)

type LayerName string

const (
RawManifestLayerName = "raw-manifest"
ConfigLayer LayerName = "config"
DefaultCRLayer LayerName = "default-cr"
RawManifestLayer LayerName = "raw-manifest"
)

// InstallInfo defines installation information.
Expand Down Expand Up @@ -94,6 +96,7 @@ type RefTypeMetadata string

const (
OciRefType RefTypeMetadata = "oci-ref"
OciDirType RefTypeMetadata = "oci-dir"
)

// +kubebuilder:object:root=true
Expand All @@ -119,6 +122,14 @@ func (manifest *Manifest) SetStatus(status shared.Status) {
manifest.Status = status
}

func (manifest *Manifest) IsUnmanaged() bool {
return manifest.GetAnnotations() != nil && manifest.GetAnnotations()[shared.UnmanagedAnnotation] == shared.EnableLabelValue
}

func (manifest *Manifest) IsMandatoryModule() bool {
return manifest.GetLabels() != nil && manifest.GetLabels()[shared.IsMandatoryModule] == shared.EnableLabelValue
}

// +kubebuilder:object:root=true

// ManifestList contains a list of Manifest.
Expand All @@ -134,11 +145,7 @@ func init() {
}

func (manifest *Manifest) SkipReconciliation() bool {
return manifest.GetLabels() != nil && manifest.GetLabels()[shared.SkipReconcileLabel] == strconv.FormatBool(true)
}

func (manifest *Manifest) IsMandatoryModule() bool {
return manifest.GetLabels() != nil && manifest.GetLabels()[shared.IsMandatoryModule] == strconv.FormatBool(true)
return manifest.GetLabels() != nil && manifest.GetLabels()[shared.SkipReconcileLabel] == shared.EnableLabelValue
}

func (manifest *Manifest) GetChannel() (string, bool) {
Expand Down
18 changes: 18 additions & 0 deletions config/crd/bases/operator.kyma-project.io_kymas.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,12 @@ spec:
- CreateAndDelete
- Ignore
type: string
managed:
default: true
description: |-
Managed is determining whether the module is managed or not. If the module is unmanaged, the user is responsible
for the lifecycle of the module.
type: boolean
name:
description: |-
Name is a unique identifier of the module.
Expand All @@ -98,6 +104,7 @@ spec:
It will be removed in the upcoming API version.
type: string
required:
- managed
- name
type: object
type: array
Expand Down Expand Up @@ -368,6 +375,7 @@ spec:
- Error
- ""
- Warning
- Unmanaged
type: string
template:
description: |-
Expand Down Expand Up @@ -442,6 +450,7 @@ spec:
- Error
- ""
- Warning
- Unmanaged
type: string
type: object
type: object
Expand Down Expand Up @@ -517,6 +526,12 @@ spec:
- CreateAndDelete
- Ignore
type: string
managed:
default: true
description: |-
Managed is determining whether the module is managed or not. If the module is unmanaged, the user is responsible
for the lifecycle of the module.
type: boolean
name:
description: |-
Name is a unique identifier of the module.
Expand All @@ -531,6 +546,7 @@ spec:
It will be removed in the upcoming API version.
type: string
required:
- managed
- name
type: object
type: array
Expand Down Expand Up @@ -771,6 +787,7 @@ spec:
- Error
- ""
- Warning
- Unmanaged
type: string
template:
description: |-
Expand Down Expand Up @@ -845,6 +862,7 @@ spec:
- Error
- ""
- Warning
- Unmanaged
type: string
type: object
type: object
Expand Down
2 changes: 2 additions & 0 deletions config/crd/bases/operator.kyma-project.io_manifests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,7 @@ spec:
- Error
- ""
- Warning
- Unmanaged
type: string
synced:
description: |-
Expand Down Expand Up @@ -524,6 +525,7 @@ spec:
- Error
- ""
- Warning
- Unmanaged
type: string
synced:
description: |-
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ spec:
- Error
- ""
- Warning
- Unmanaged
type: string
value:
description: Value is the value at the JSONPath for which the
Expand Down Expand Up @@ -179,6 +180,7 @@ spec:
- Error
- ""
- Warning
- Unmanaged
type: string
value:
description: Value is the value at the JSONPath for which the
Expand Down
2 changes: 2 additions & 0 deletions config/crd/bases/operator.kyma-project.io_watchers.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,7 @@ spec:
- Error
- ""
- Warning
- Unmanaged
type: string
required:
- state
Expand Down Expand Up @@ -486,6 +487,7 @@ spec:
- Error
- ""
- Warning
- Unmanaged
type: string
required:
- state
Expand Down
34 changes: 34 additions & 0 deletions config/rbac/namespace_bindings/istio_namespace_role.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
---
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
name: manager-role-istio-namespace
namespace: istio-system
rules:
- apiGroups:
- ""
resources:
- secrets
verbs:
- list
- watch
- create
- delete
- apiGroups:
- cert-manager.io
resources:
- certificates
verbs:
- patch
- list
- watch
- get
- create
- delete
- apiGroups:
- cert-manager.io
resources:
- issuers
verbs:
- list
- watch
12 changes: 12 additions & 0 deletions config/rbac/namespace_bindings/istio_namespace_role_binding.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
name: manager-rolebinding-istio-namespace
namespace: istio-system
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: Role
name: manager-role-istio-namespace
subjects:
- kind: ServiceAccount
name: controller-manager
Loading

0 comments on commit 2342670

Please sign in to comment.