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

(bug) when deploymentType is Local, validate namespace #829

Merged
merged 1 commit into from
Nov 18, 2024

Conversation

gianlucam76
Copy link
Member

@gianlucam76 gianlucam76 commented Nov 17, 2024

A Profile using deploymentType: Local, can only deploy resources in the same namespace.

Fixes #828

Previously, Sveltos used the following format for the OwnerReferences name for resources it deployed due to a Profile:

Profile.namespace/Profile.name

However, a Profile with this exact name doesn't exist within the management cluster. As a result, the Kubernetes controller would immediately remove the deployed resource.

This behavior occurred because:

A namespaced owner must exist in the same namespace as the dependent.
If it does not, the owner reference is treated as absent, and the
dependent is subject to deletion once all owners are verified absent

Given this PR ensures that a Profile only creates resources in the management cluster in the same namespace, now only Profile.name is set in the OwnerReference.name

@gianlucam76
Copy link
Member Author

Add a note to documentation: Profile should not be used to match the management cluster.

A Profile using deploymentType: Local, can only deploy resources
in the same namespace.

Previously, Sveltos used the following format for the OwnerReferences
name for resources it deployed due to a Profile:

```
Profile.namespace/Profile.name
```

However, a Profile with this exact name doesn't exist within the
management cluster. As a result, the Kubernetes controller would
immediately remove the deployed resource.

This behavior occurred because:

```
A namespaced owner must exist in the same namespace as the dependent.
If it does not, the owner reference is treated as absent, and the
dependent is subject to deletion once all owners are verified absent
```

Given this PR ensures that a Profile only creates resources in the management
cluster in the same namespace, now only Profile.name is set in the
OwnerReference.name
@gianlucam76 gianlucam76 merged commit 4aefcc3 into projectsveltos:main Nov 18, 2024
5 checks passed
@gianlucam76 gianlucam76 deleted the profile-resources branch November 18, 2024 09:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

BUG: deploymentType: Local does not work with Profile
1 participant