mirror of
https://github.com/projectcapsule/capsule.git
synced 2026-08-25 16:07:24 +00:00
* chore(deps): update dependency golangci/golangci-lint to v2 * chore(golint): bump v2 and satisfy linters Signed-off-by: Oliver Bähler <oliverbaehler@hotmail.com> --------- Signed-off-by: Oliver Bähler <oliverbaehler@hotmail.com> Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Oliver Bähler <oliverbaehler@hotmail.com>
24 lines
563 B
Go
24 lines
563 B
Go
// Copyright 2020-2023 Project Capsule Authors.
|
|
// SPDX-License-Identifier: Apache-2.0
|
|
|
|
package tenant
|
|
|
|
import (
|
|
"context"
|
|
|
|
capsulev1beta2 "github.com/projectcapsule/capsule/api/v1beta2"
|
|
capsuleapi "github.com/projectcapsule/capsule/pkg/api"
|
|
)
|
|
|
|
// Sets a label on the Tenant object with it's name.
|
|
func (r *Manager) ensureMetadata(ctx context.Context, tnt *capsulev1beta2.Tenant) (err error) {
|
|
// Assign Labels
|
|
if tnt.Labels == nil {
|
|
tnt.Labels = make(map[string]string)
|
|
}
|
|
|
|
tnt.Labels[capsuleapi.TenantNameLabel] = tnt.Name
|
|
|
|
return r.Update(ctx, tnt)
|
|
}
|