Skip to content

Commit

Permalink
linter
Browse files Browse the repository at this point in the history
  • Loading branch information
alexeykazakov committed Jul 4, 2024
1 parent 7d14a83 commit c0cc5b4
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions controllers/nstemplateset/cluster_resources_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -550,8 +550,8 @@ func TestDeleteClusterResources(t *testing.T) {
withNamespaces("abcde11", "dev", "code"),
withDeletionTs(),
withClusterResources("abcde11"),
withNSTemplateSetFeatureAnnotation("feature-1"))
crq := newClusterResourceQuota(spacename, "advanced", withFeatureAnnotation("feature-1"))
withNSTemplateSetFeatureAnnotation("feature-2"))
crq := newClusterResourceQuota(spacename, "advanced", withFeatureAnnotation("feature-2"), withName("feature-2-for-"+spacename))

manager, cl := prepareClusterResourcesManager(t, nsTmplSet, crq)

Expand Down
8 changes: 4 additions & 4 deletions controllers/nstemplateset/namespaces.go
Original file line number Diff line number Diff line change
Expand Up @@ -196,12 +196,12 @@ func (r *namespacesManager) ensureInnerNamespaceResources(ctx context.Context, n
currentRef, exists := namespace.Labels[toolchainv1alpha1.TemplateRefLabelKey]
if exists {
// Now check if there is any featured object to be deleted in case the feature annotation does not present in the NSTemplateSet anymore
featureStr, _ := nsTmplSet.Annotations[toolchainv1alpha1.FeatureToggleNameAnnotationKey]
features := strings.Split(featureStr, ",")
toDeleteObsoleteFeaturedObjects := false
featureStr := nsTmplSet.Annotations[toolchainv1alpha1.FeatureToggleNameAnnotationKey]
features := strings.Split(featureStr, ",")
for _, obj := range newObjs {
objFeature, found := obj.GetAnnotations()[toolchainv1alpha1.FeatureToggleNameAnnotationKey]
if found && !slices.Contains(features, objFeature) {
objFeature, f := obj.GetAnnotations()[toolchainv1alpha1.FeatureToggleNameAnnotationKey]
if f && !slices.Contains(features, objFeature) {
// This object represents a disabled feature. We need to delete obsolete objects.
toDeleteObsoleteFeaturedObjects = true
break
Expand Down

0 comments on commit c0cc5b4

Please sign in to comment.