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: user-configurable labels (in ServiceConfig type) for Docker containers and k8s pods #1604

Merged
merged 22 commits into from
Oct 25, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
dda1617
Adding labels to kurtosis service config and startosis service config
leoporoli Oct 19, 2023
e921956
adding custom user labels in docker attributes provider
leoporoli Oct 19, 2023
c73cfbd
adding custom user labels in Kubernetes attributes provider
leoporoli Oct 20, 2023
806fb15
TestMaxAllowedLabel added
leoporoli Oct 20, 2023
6c0d09e
ValidateUserCustomLabelKey func added
leoporoli Oct 20, 2023
b1ea355
validate service config labels
leoporoli Oct 20, 2023
ee04d7c
Adding service config labels validation in startosis type
leoporoli Oct 20, 2023
8dccf17
new test example added in docker and kubernetes label keys tests
leoporoli Oct 20, 2023
7255197
Adding test for service config labels validators
leoporoli Oct 23, 2023
d383dcd
docs
leoporoli Oct 23, 2023
c1fb4eb
docs updated
leoporoli Oct 23, 2023
e531e1a
Merge branch 'main' into lporoli/ticket-1585
leoporoli Oct 23, 2023
cc2ca66
Merge branch 'main' into lporoli/ticket-1585
leoporoli Oct 23, 2023
9c1da3b
fix formatting of the code example
leeederek Oct 23, 2023
adb0594
Update container-engine-lib/lib/backend_impls/docker/object_attribute…
leoporoli Oct 24, 2023
9279fcf
PR review changes
leoporoli Oct 24, 2023
3c30f59
Merge branch 'main' into lporoli/ticket-1585
leoporoli Oct 24, 2023
6668482
Merge branch 'main' into lporoli/ticket-1585
leoporoli Oct 24, 2023
47f36f8
Merge branch 'main' into lporoli/ticket-1585
leoporoli Oct 24, 2023
b2fb8a9
Merge branch 'main' into lporoli/ticket-1585
leoporoli Oct 24, 2023
dc24048
Merge branch 'main' into lporoli/ticket-1585
leeederek Oct 25, 2023
e2d55df
Merge branch 'main' into lporoli/ticket-1585
leoporoli Oct 25, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions cli/cli/kurtosis_gateway/connection/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@ package connection

import (
"context"
"github.com/kurtosis-tech/kurtosis/container-engine-lib/lib/backend_impls/kubernetes/object_attributes_provider/kubernetes_label_key"
"net/url"

"github.com/kurtosis-tech/kurtosis/api/golang/engine/kurtosis_engine_rpc_api_bindings"
"github.com/kurtosis-tech/kurtosis/api/golang/engine/lib/kurtosis_context"
"github.com/kurtosis-tech/kurtosis/container-engine-lib/lib/backend_impls/kubernetes/kubernetes_manager"
"github.com/kurtosis-tech/kurtosis/container-engine-lib/lib/backend_impls/kubernetes/object_attributes_provider/label_key_consts"
"github.com/kurtosis-tech/kurtosis/container-engine-lib/lib/backend_impls/kubernetes/object_attributes_provider/label_value_consts"
"github.com/kurtosis-tech/kurtosis/container-engine-lib/lib/backend_interface/objects/engine"
"github.com/kurtosis-tech/kurtosis/container-engine-lib/lib/backend_interface/objects/port_spec"
Expand Down Expand Up @@ -111,9 +111,9 @@ func (provider *GatewayConnectionProvider) ForUserServiceIfRunning(enclaveId str

func (provider *GatewayConnectionProvider) getEnginePodPortforwardEndpoint(engineGuid engine.EngineGUID) (*url.URL, error) {
engineLabels := map[string]string{
label_key_consts.IDKubernetesLabelKey.GetString(): string(engineGuid),
label_key_consts.KurtosisResourceTypeKubernetesLabelKey.GetString(): label_value_consts.EngineKurtosisResourceTypeKubernetesLabelValue.GetString(),
label_key_consts.AppIDKubernetesLabelKey.GetString(): label_value_consts.AppIDKubernetesLabelValue.GetString(),
kubernetes_label_key.IDKubernetesLabelKey.GetString(): string(engineGuid),
kubernetes_label_key.KurtosisResourceTypeKubernetesLabelKey.GetString(): label_value_consts.EngineKurtosisResourceTypeKubernetesLabelValue.GetString(),
kubernetes_label_key.AppIDKubernetesLabelKey.GetString(): label_value_consts.AppIDKubernetesLabelValue.GetString(),
}
// Call k8s to find our engine namespace
engineNamespaceList, err := provider.kubernetesManager.GetNamespacesByLabels(provider.providerContext, engineLabels)
Expand Down Expand Up @@ -146,8 +146,8 @@ func (provider *GatewayConnectionProvider) getApiContainerPodPortforwardEndpoint

// Get running API Container pods from Kubernetes
apiContainerPodLabels := map[string]string{
label_key_consts.KurtosisResourceTypeKubernetesLabelKey.GetString(): label_value_consts.APIContainerKurtosisResourceTypeKubernetesLabelValue.GetString(),
label_key_consts.AppIDKubernetesLabelKey.GetString(): label_value_consts.AppIDKubernetesLabelValue.GetString(),
kubernetes_label_key.KurtosisResourceTypeKubernetesLabelKey.GetString(): label_value_consts.APIContainerKurtosisResourceTypeKubernetesLabelValue.GetString(),
kubernetes_label_key.AppIDKubernetesLabelKey.GetString(): label_value_consts.AppIDKubernetesLabelValue.GetString(),
}
runningApiContainerPodNames, err := provider.getRunningPodNamesByLabels(enclaveNamespaceName, apiContainerPodLabels)
if err != nil {
Expand Down Expand Up @@ -191,9 +191,9 @@ func (provider *GatewayConnectionProvider) getEnclaveNamespaceNameForEnclaveId(e
}

enclaveLabels := map[string]string{
label_key_consts.EnclaveUUIDKubernetesLabelKey.GetString(): enclaveId,
label_key_consts.KurtosisResourceTypeKubernetesLabelKey.GetString(): label_value_consts.EnclaveKurtosisResourceTypeKubernetesLabelValue.GetString(),
label_key_consts.AppIDKubernetesLabelKey.GetString(): label_value_consts.AppIDKubernetesLabelValue.GetString(),
kubernetes_label_key.EnclaveUUIDKubernetesLabelKey.GetString(): enclaveId,
kubernetes_label_key.KurtosisResourceTypeKubernetesLabelKey.GetString(): label_value_consts.EnclaveKurtosisResourceTypeKubernetesLabelValue.GetString(),
kubernetes_label_key.AppIDKubernetesLabelKey.GetString(): label_value_consts.AppIDKubernetesLabelValue.GetString(),
}
enclaveNamespaceList, err := provider.kubernetesManager.GetNamespacesByLabels(provider.providerContext, enclaveLabels)
if err != nil {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"github.com/kurtosis-tech/kurtosis/container-engine-lib/lib/backend_impls/docker/docker_kurtosis_backend"
"github.com/kurtosis-tech/kurtosis/container-engine-lib/lib/backend_impls/docker/docker_kurtosis_backend/logs_collector_functions"
"github.com/kurtosis-tech/kurtosis/container-engine-lib/lib/backend_impls/docker/docker_manager"
"github.com/kurtosis-tech/kurtosis/container-engine-lib/lib/backend_impls/docker/object_attributes_provider/label_key_consts"
"github.com/kurtosis-tech/kurtosis/container-engine-lib/lib/backend_impls/docker/object_attributes_provider/docker_label_key"
"github.com/kurtosis-tech/kurtosis/container-engine-lib/lib/backend_impls/docker/object_attributes_provider/label_value_consts"
"github.com/kurtosis-tech/kurtosis/container-engine-lib/lib/backend_impls/metrics_reporting"
"github.com/kurtosis-tech/kurtosis/container-engine-lib/lib/backend_interface"
Expand Down Expand Up @@ -211,8 +211,8 @@ func getDockerKurtosisBackend(
enclaveUuid := optionalApiContainerModeArgs.EnclaveID

enclaveNetworkSearchLabels := map[string]string{
label_key_consts.AppIDDockerLabelKey.GetString(): label_value_consts.AppIDDockerLabelValue.GetString(),
label_key_consts.IDDockerLabelKey.GetString(): string(enclaveUuid),
docker_label_key.AppIDDockerLabelKey.GetString(): label_value_consts.AppIDDockerLabelValue.GetString(),
docker_label_key.IDDockerLabelKey.GetString(): string(enclaveUuid),
}
matchingNetworks, err := dockerManager.GetNetworksByLabels(ctx, enclaveNetworkSearchLabels)
if err != nil {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package docker_kurtosis_backend

import (
"context"
"github.com/kurtosis-tech/kurtosis/container-engine-lib/lib/backend_impls/docker/object_attributes_provider/docker_label_key"
"github.com/sirupsen/logrus"
"io"
"sync"
Expand All @@ -16,7 +17,6 @@ import (
"github.com/kurtosis-tech/kurtosis/container-engine-lib/lib/backend_impls/docker/docker_manager/types"
"github.com/kurtosis-tech/kurtosis/container-engine-lib/lib/backend_impls/docker/docker_network_allocator"
"github.com/kurtosis-tech/kurtosis/container-engine-lib/lib/backend_impls/docker/object_attributes_provider"
"github.com/kurtosis-tech/kurtosis/container-engine-lib/lib/backend_impls/docker/object_attributes_provider/label_key_consts"
"github.com/kurtosis-tech/kurtosis/container-engine-lib/lib/backend_impls/docker/object_attributes_provider/label_value_consts"
"github.com/kurtosis-tech/kurtosis/container-engine-lib/lib/backend_interface/objects/compute_resources"
"github.com/kurtosis-tech/kurtosis/container-engine-lib/lib/backend_interface/objects/container"
Expand Down Expand Up @@ -488,8 +488,8 @@ func (backend *DockerKurtosisBackend) GetAvailableCPUAndMemory(ctx context.Conte
// ====================================================================================================
func (backend *DockerKurtosisBackend) getEnclaveNetworkByEnclaveUuid(ctx context.Context, enclaveUuid enclave.EnclaveUUID) (*types.Network, error) {
networkSearchLabels := map[string]string{
label_key_consts.AppIDDockerLabelKey.GetString(): label_value_consts.AppIDDockerLabelValue.GetString(),
label_key_consts.EnclaveUUIDDockerLabelKey.GetString(): string(enclaveUuid),
docker_label_key.AppIDDockerLabelKey.GetString(): label_value_consts.AppIDDockerLabelValue.GetString(),
docker_label_key.EnclaveUUIDDockerLabelKey.GetString(): string(enclaveUuid),
}

enclaveNetworksFound, err := backend.dockerManager.GetNetworksByLabels(ctx, networkSearchLabels)
Expand All @@ -513,9 +513,9 @@ func (backend *DockerKurtosisBackend) getEnclaveNetworkByEnclaveUuid(ctx context
// Guaranteed to either return an enclave data volume name or throw an error
func (backend *DockerKurtosisBackend) getEnclaveDataVolumeByEnclaveUuid(ctx context.Context, enclaveUuid enclave.EnclaveUUID) (string, error) {
volumeSearchLabels := map[string]string{
label_key_consts.AppIDDockerLabelKey.GetString(): label_value_consts.AppIDDockerLabelValue.GetString(),
label_key_consts.EnclaveUUIDDockerLabelKey.GetString(): string(enclaveUuid),
label_key_consts.VolumeTypeDockerLabelKey.GetString(): label_value_consts.EnclaveDataVolumeTypeDockerLabelValue.GetString(),
docker_label_key.AppIDDockerLabelKey.GetString(): label_value_consts.AppIDDockerLabelValue.GetString(),
docker_label_key.EnclaveUUIDDockerLabelKey.GetString(): string(enclaveUuid),
docker_label_key.VolumeTypeDockerLabelKey.GetString(): label_value_consts.EnclaveDataVolumeTypeDockerLabelValue.GetString(),
}
foundVolumes, err := backend.dockerManager.GetVolumesByLabels(ctx, volumeSearchLabels)
if err != nil {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package docker_kurtosis_backend

import (
"context"
"github.com/kurtosis-tech/kurtosis/container-engine-lib/lib/backend_impls/docker/object_attributes_provider/docker_label_key"
"net"
"time"

Expand All @@ -12,7 +13,6 @@ import (
"github.com/kurtosis-tech/kurtosis/container-engine-lib/lib/backend_impls/docker/docker_manager/types"
"github.com/kurtosis-tech/kurtosis/container-engine-lib/lib/backend_impls/docker/docker_operation_parallelizer"
"github.com/kurtosis-tech/kurtosis/container-engine-lib/lib/backend_impls/docker/object_attributes_provider/docker_port_spec_serializer"
"github.com/kurtosis-tech/kurtosis/container-engine-lib/lib/backend_impls/docker/object_attributes_provider/label_key_consts"
"github.com/kurtosis-tech/kurtosis/container-engine-lib/lib/backend_impls/docker/object_attributes_provider/label_value_consts"
"github.com/kurtosis-tech/kurtosis/container-engine-lib/lib/backend_interface/objects/api_container"
"github.com/kurtosis-tech/kurtosis/container-engine-lib/lib/backend_interface/objects/container"
Expand Down Expand Up @@ -337,8 +337,8 @@ func (backend *DockerKurtosisBackend) DestroyAPIContainers(ctx context.Context,
func (backend *DockerKurtosisBackend) getMatchingApiContainers(ctx context.Context, filters *api_container.APIContainerFilters) (map[string]*api_container.APIContainer, error) {

apiContainerSearchLabels := map[string]string{
label_key_consts.AppIDDockerLabelKey.GetString(): label_value_consts.AppIDDockerLabelValue.GetString(),
label_key_consts.ContainerTypeDockerLabelKey.GetString(): label_value_consts.APIContainerContainerTypeDockerLabelValue.GetString(),
docker_label_key.AppIDDockerLabelKey.GetString(): label_value_consts.AppIDDockerLabelValue.GetString(),
docker_label_key.ContainerTypeDockerLabelKey.GetString(): label_value_consts.APIContainerContainerTypeDockerLabelValue.GetString(),
// NOTE: we do NOT use the enclave UUID label here, and instead do postfiltering, because Docker has no way to do disjunctive search!
}
allApiContainers, err := backend.dockerManager.GetContainersByLabels(ctx, apiContainerSearchLabels, consts.ShouldFetchAllContainersWhenRetrievingContainers)
Expand Down Expand Up @@ -392,16 +392,16 @@ func getApiContainerObjectFromContainerInfo(
allHostMachinePortBindings map[nat.Port]*nat.PortBinding,
bridgeNetworkIpAddress string,
) (*api_container.APIContainer, error) {
enclaveId, found := labels[label_key_consts.EnclaveUUIDDockerLabelKey.GetString()]
enclaveId, found := labels[docker_label_key.EnclaveUUIDDockerLabelKey.GetString()]
if !found {
return nil, stacktrace.NewError("Expected the API container's enclave UUID to be found under label '%v' but the label wasn't present", label_key_consts.EnclaveUUIDDockerLabelKey.GetString())
return nil, stacktrace.NewError("Expected the API container's enclave UUID to be found under label '%v' but the label wasn't present", docker_label_key.EnclaveUUIDDockerLabelKey.GetString())
}

privateIpAddrStr, found := labels[label_key_consts.PrivateIPDockerLabelKey.GetString()]
privateIpAddrStr, found := labels[docker_label_key.PrivateIPDockerLabelKey.GetString()]
if !found {
return nil, stacktrace.NewError(
"Couldn't find the API container's private IP using label '%v'",
label_key_consts.PrivateIPDockerLabelKey.GetString(),
docker_label_key.PrivateIPDockerLabelKey.GetString(),
)
}
privateIpAddr := net.ParseIP(privateIpAddrStr)
Expand Down Expand Up @@ -459,9 +459,9 @@ func getPrivateApiContainerPorts(containerLabels map[string]string) (
resultGrpcPortSpec *port_spec.PortSpec,
resultErr error,
) {
serializedPortSpecs, found := containerLabels[label_key_consts.PortSpecsDockerLabelKey.GetString()]
serializedPortSpecs, found := containerLabels[docker_label_key.PortSpecsDockerLabelKey.GetString()]
if !found {
return nil, stacktrace.NewError("Expected to find port specs label '%v' but none was found", label_key_consts.PortSpecsDockerLabelKey.GetString())
return nil, stacktrace.NewError("Expected to find port specs label '%v' but none was found", docker_label_key.PortSpecsDockerLabelKey.GetString())
}

portSpecs, err := docker_port_spec_serializer.DeserializePortSpecs(serializedPortSpecs)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
"github.com/kurtosis-tech/kurtosis/container-engine-lib/lib/backend_impls/docker/docker_manager"
"github.com/kurtosis-tech/kurtosis/container-engine-lib/lib/backend_impls/docker/docker_manager/types"
"github.com/kurtosis-tech/kurtosis/container-engine-lib/lib/backend_impls/docker/docker_operation_parallelizer"
"github.com/kurtosis-tech/kurtosis/container-engine-lib/lib/backend_impls/docker/object_attributes_provider/label_key_consts"
"github.com/kurtosis-tech/kurtosis/container-engine-lib/lib/backend_impls/docker/object_attributes_provider/docker_label_key"
"github.com/kurtosis-tech/kurtosis/container-engine-lib/lib/backend_impls/docker/object_attributes_provider/label_value_consts"
"github.com/kurtosis-tech/kurtosis/container-engine-lib/lib/backend_interface/objects/enclave"
"github.com/kurtosis-tech/stacktrace"
Expand Down Expand Up @@ -42,8 +42,8 @@ func (backend *DockerKurtosisBackend) CreateEnclave(ctx context.Context, enclave
teardownCtx := context.Background() // Separate context for tearing stuff down in case the input context is cancelled

searchNetworkLabels := map[string]string{
label_key_consts.AppIDDockerLabelKey.GetString(): label_value_consts.AppIDDockerLabelValue.GetString(),
label_key_consts.EnclaveUUIDDockerLabelKey.GetString(): string(enclaveUuid),
docker_label_key.AppIDDockerLabelKey.GetString(): label_value_consts.AppIDDockerLabelValue.GetString(),
docker_label_key.EnclaveUUIDDockerLabelKey.GetString(): string(enclaveUuid),
}

networks, err := backend.dockerManager.GetNetworksByLabels(ctx, searchNetworkLabels)
Expand All @@ -55,9 +55,9 @@ func (backend *DockerKurtosisBackend) CreateEnclave(ctx context.Context, enclave
}

volumeSearchLabels := map[string]string{
label_key_consts.AppIDDockerLabelKey.GetString(): label_value_consts.AppIDDockerLabelValue.GetString(),
label_key_consts.EnclaveUUIDDockerLabelKey.GetString(): string(enclaveUuid),
label_key_consts.VolumeTypeDockerLabelKey.GetString(): label_value_consts.EnclaveDataVolumeTypeDockerLabelValue.GetString(),
docker_label_key.AppIDDockerLabelKey.GetString(): label_value_consts.AppIDDockerLabelValue.GetString(),
docker_label_key.EnclaveUUIDDockerLabelKey.GetString(): string(enclaveUuid),
docker_label_key.VolumeTypeDockerLabelKey.GetString(): label_value_consts.EnclaveDataVolumeTypeDockerLabelValue.GetString(),
}
foundVolumes, err := backend.dockerManager.GetVolumesByLabels(ctx, volumeSearchLabels)
if err != nil {
Expand Down Expand Up @@ -196,7 +196,7 @@ func (backend *DockerKurtosisBackend) GetEnclaves(
// and extracts out whether enclave is running on production mode
for _, container := range matchingNetworkInfo.containers {
labels := container.GetLabels()
containerType, ok := labels[label_key_consts.ContainerTypeDockerLabelKey.GetString()]
containerType, ok := labels[docker_label_key.ContainerTypeDockerLabelKey.GetString()]
if !ok {
continue
}
Expand Down Expand Up @@ -308,8 +308,8 @@ func (backend *DockerKurtosisBackend) DumpEnclave(
outputDirpath string,
) error {
enclaveContainerSearchLabels := map[string]string{
label_key_consts.AppIDDockerLabelKey.GetString(): label_value_consts.AppIDDockerLabelValue.GetString(),
label_key_consts.EnclaveUUIDDockerLabelKey.GetString(): string(enclaveUuid),
docker_label_key.AppIDDockerLabelKey.GetString(): label_value_consts.AppIDDockerLabelValue.GetString(),
docker_label_key.EnclaveUUIDDockerLabelKey.GetString(): string(enclaveUuid),
}

enclaveContainers, err := backend.dockerManager.GetContainersByLabels(ctx, enclaveContainerSearchLabels, shouldFetchStoppedContainersWhenDumpingEnclave)
Expand Down Expand Up @@ -417,7 +417,7 @@ func (backend *DockerKurtosisBackend) getMatchingEnclaveNetworkInfo(
error,
) {
kurtosisNetworkLabels := map[string]string{
label_key_consts.AppIDDockerLabelKey.GetString(): label_value_consts.AppIDDockerLabelValue.GetString(),
docker_label_key.AppIDDockerLabelKey.GetString(): label_value_consts.AppIDDockerLabelValue.GetString(),
// NOTE: we don't search by enclave ID here because Docker has no way to do disjunctive search
}

Expand Down Expand Up @@ -511,8 +511,8 @@ func (backend *DockerKurtosisBackend) getAllEnclaveContainers(
var containers []*types.Container

searchLabels := map[string]string{
label_key_consts.AppIDDockerLabelKey.GetString(): label_value_consts.AppIDDockerLabelValue.GetString(),
label_key_consts.EnclaveUUIDDockerLabelKey.GetString(): string(enclaveUuid),
docker_label_key.AppIDDockerLabelKey.GetString(): label_value_consts.AppIDDockerLabelValue.GetString(),
docker_label_key.EnclaveUUIDDockerLabelKey.GetString(): string(enclaveUuid),
}
containers, err := backend.dockerManager.GetContainersByLabels(ctx, searchLabels, shouldFetchStoppedContainersWhenGettingEnclaveStatus)
if err != nil {
Expand All @@ -530,8 +530,8 @@ func getAllEnclaveVolumes(
var volumes []*volume.Volume

searchLabels := map[string]string{
label_key_consts.AppIDDockerLabelKey.GetString(): label_value_consts.AppIDDockerLabelValue.GetString(),
label_key_consts.EnclaveUUIDDockerLabelKey.GetString(): string(enclaveUuid),
docker_label_key.AppIDDockerLabelKey.GetString(): label_value_consts.AppIDDockerLabelValue.GetString(),
docker_label_key.EnclaveUUIDDockerLabelKey.GetString(): string(enclaveUuid),
}

volumes, err := dockerManager.GetVolumesByLabels(ctx, searchLabels)
Expand Down Expand Up @@ -736,9 +736,9 @@ func destroyEnclaveNetworks(

func getEnclaveUuidFromNetwork(network *types.Network) (enclave.EnclaveUUID, error) {
labels := network.GetLabels()
enclaveUuidLabelValue, found := labels[label_key_consts.EnclaveUUIDDockerLabelKey.GetString()]
enclaveUuidLabelValue, found := labels[docker_label_key.EnclaveUUIDDockerLabelKey.GetString()]
if !found {
return "", stacktrace.NewError("Expected to find network's label with key '%v' but none was found", label_key_consts.EnclaveUUIDDockerLabelKey.GetString())
return "", stacktrace.NewError("Expected to find network's label with key '%v' but none was found", docker_label_key.EnclaveUUIDDockerLabelKey.GetString())
}
enclaveUuid := enclave.EnclaveUUID(enclaveUuidLabelValue)
return enclaveUuid, nil
Expand All @@ -747,7 +747,7 @@ func getEnclaveUuidFromNetwork(network *types.Network) (enclave.EnclaveUUID, err
func getEnclaveCreationTimeFromNetwork(network *types.Network) (*time.Time, error) {

labels := network.GetLabels()
enclaveCreationTimeStr, found := labels[label_key_consts.EnclaveCreationTimeLabelKey.GetString()]
enclaveCreationTimeStr, found := labels[docker_label_key.EnclaveCreationTimeLabelKey.GetString()]
if !found {
//Handling retro-compatibility, enclaves that did not track enclave's creation time
return nil, nil //TODO remove this return after 2023-01-01
Expand All @@ -766,7 +766,7 @@ func getEnclaveCreationTimeFromNetwork(network *types.Network) (*time.Time, erro
func getEnclaveNameFromNetwork(network *types.Network) string {

labels := network.GetLabels()
enclaveNameStr, found := labels[label_key_consts.EnclaveNameDockerLabelKey.GetString()]
enclaveNameStr, found := labels[docker_label_key.EnclaveNameDockerLabelKey.GetString()]
if !found {
//Handling retro-compatibility, enclaves that did not track enclave's name
return ""
Expand Down
Loading