diff --git a/CHANGELOG.md b/CHANGELOG.md index d3ad7c03a..64058cc22 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -36,6 +36,7 @@ - (Feature) (Scheduler) Create Integration Profile - (Feature) (Scheduler) Additional types - (Feature) Alternative Upgrade Order Feature +- (Feature) (Scheduler) SchedV1 Integration ## [1.2.42](https://github.com/arangodb/kube-arangodb/tree/1.2.42) (2024-07-23) - (Maintenance) Go 1.22.4 & Kubernetes 1.29.6 libraries diff --git a/pkg/debug_package/generators/kubernetes/arango_scheduler.go b/pkg/debug_package/generators/kubernetes/arango_scheduler.go index cf6dd16e9..dead1a268 100644 --- a/pkg/debug_package/generators/kubernetes/arango_scheduler.go +++ b/pkg/debug_package/generators/kubernetes/arango_scheduler.go @@ -43,5 +43,25 @@ func scheduler(logger zerolog.Logger, files chan<- shared.File) error { return err } + if err := schedulerPods(logger, files, k); err != nil { + logger.Err(err).Msgf("Error while collecting arango scheduler extension") + return err + } + + if err := schedulerDeployments(logger, files, k); err != nil { + logger.Err(err).Msgf("Error while collecting arango scheduler extension") + return err + } + + if err := schedulerBatchJobs(logger, files, k); err != nil { + logger.Err(err).Msgf("Error while collecting arango scheduler extension") + return err + } + + if err := schedulerCronJobs(logger, files, k); err != nil { + logger.Err(err).Msgf("Error while collecting arango scheduler extension") + return err + } + return nil } diff --git a/pkg/debug_package/generators/kubernetes/arango_scheduler_batchjobs.go b/pkg/debug_package/generators/kubernetes/arango_scheduler_batchjobs.go new file mode 100644 index 000000000..a12a9b70c --- /dev/null +++ b/pkg/debug_package/generators/kubernetes/arango_scheduler_batchjobs.go @@ -0,0 +1,73 @@ +// +// DISCLAIMER +// +// Copyright 2024 ArangoDB GmbH, Cologne, Germany +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Copyright holder is ArangoDB GmbH, Cologne, Germany +// + +package kubernetes + +import ( + "context" + "fmt" + + "github.com/rs/zerolog" + + schedulerApi "github.com/arangodb/kube-arangodb/pkg/apis/scheduler/v1beta1" + "github.com/arangodb/kube-arangodb/pkg/debug_package/cli" + "github.com/arangodb/kube-arangodb/pkg/debug_package/shared" + "github.com/arangodb/kube-arangodb/pkg/util/errors" + "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/kerrors" + "github.com/arangodb/kube-arangodb/pkg/util/kclient" +) + +func schedulerBatchJobs(logger zerolog.Logger, files chan<- shared.File, client kclient.Client) error { + batchjobs, err := listSchedulerBatchJobs(client) + if err != nil { + if kerrors.IsForbiddenOrNotFound(err) { + return nil + } + + return err + } + + if err := errors.ExecuteWithErrorArrayP2(schedulerBatchJob, client, files, batchjobs...); err != nil { + logger.Err(err).Msgf("Error while collecting arango scheduler batchjobs") + return err + } + + return nil +} + +func schedulerBatchJob(client kclient.Client, files chan<- shared.File, ext *schedulerApi.ArangoSchedulerBatchJob) error { + files <- shared.NewYAMLFile(fmt.Sprintf("kubernetes/arango/scheduler/arangoschedulerbatchjobs/%s.yaml", ext.GetName()), func() ([]interface{}, error) { + return []interface{}{ext}, nil + }) + + return nil +} + +func listSchedulerBatchJobs(client kclient.Client) ([]*schedulerApi.ArangoSchedulerBatchJob, error) { + return ListObjects[*schedulerApi.ArangoSchedulerBatchJobList, *schedulerApi.ArangoSchedulerBatchJob](context.Background(), client.Arango().SchedulerV1beta1().ArangoSchedulerBatchJobs(cli.GetInput().Namespace), func(result *schedulerApi.ArangoSchedulerBatchJobList) []*schedulerApi.ArangoSchedulerBatchJob { + q := make([]*schedulerApi.ArangoSchedulerBatchJob, len(result.Items)) + + for id, e := range result.Items { + q[id] = e.DeepCopy() + } + + return q + }) +} diff --git a/pkg/debug_package/generators/kubernetes/arango_scheduler_cronjobs.go b/pkg/debug_package/generators/kubernetes/arango_scheduler_cronjobs.go new file mode 100644 index 000000000..566548feb --- /dev/null +++ b/pkg/debug_package/generators/kubernetes/arango_scheduler_cronjobs.go @@ -0,0 +1,73 @@ +// +// DISCLAIMER +// +// Copyright 2024 ArangoDB GmbH, Cologne, Germany +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Copyright holder is ArangoDB GmbH, Cologne, Germany +// + +package kubernetes + +import ( + "context" + "fmt" + + "github.com/rs/zerolog" + + schedulerApi "github.com/arangodb/kube-arangodb/pkg/apis/scheduler/v1beta1" + "github.com/arangodb/kube-arangodb/pkg/debug_package/cli" + "github.com/arangodb/kube-arangodb/pkg/debug_package/shared" + "github.com/arangodb/kube-arangodb/pkg/util/errors" + "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/kerrors" + "github.com/arangodb/kube-arangodb/pkg/util/kclient" +) + +func schedulerCronJobs(logger zerolog.Logger, files chan<- shared.File, client kclient.Client) error { + cronjobs, err := listSchedulerCronJobs(client) + if err != nil { + if kerrors.IsForbiddenOrNotFound(err) { + return nil + } + + return err + } + + if err := errors.ExecuteWithErrorArrayP2(schedulerCronJob, client, files, cronjobs...); err != nil { + logger.Err(err).Msgf("Error while collecting arango scheduler cronjobs") + return err + } + + return nil +} + +func schedulerCronJob(client kclient.Client, files chan<- shared.File, ext *schedulerApi.ArangoSchedulerCronJob) error { + files <- shared.NewYAMLFile(fmt.Sprintf("kubernetes/arango/scheduler/arangoschedulercronjobs/%s.yaml", ext.GetName()), func() ([]interface{}, error) { + return []interface{}{ext}, nil + }) + + return nil +} + +func listSchedulerCronJobs(client kclient.Client) ([]*schedulerApi.ArangoSchedulerCronJob, error) { + return ListObjects[*schedulerApi.ArangoSchedulerCronJobList, *schedulerApi.ArangoSchedulerCronJob](context.Background(), client.Arango().SchedulerV1beta1().ArangoSchedulerCronJobs(cli.GetInput().Namespace), func(result *schedulerApi.ArangoSchedulerCronJobList) []*schedulerApi.ArangoSchedulerCronJob { + q := make([]*schedulerApi.ArangoSchedulerCronJob, len(result.Items)) + + for id, e := range result.Items { + q[id] = e.DeepCopy() + } + + return q + }) +} diff --git a/pkg/debug_package/generators/kubernetes/arango_scheduler_deployment.go b/pkg/debug_package/generators/kubernetes/arango_scheduler_deployment.go new file mode 100644 index 000000000..eec21376e --- /dev/null +++ b/pkg/debug_package/generators/kubernetes/arango_scheduler_deployment.go @@ -0,0 +1,73 @@ +// +// DISCLAIMER +// +// Copyright 2024 ArangoDB GmbH, Cologne, Germany +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Copyright holder is ArangoDB GmbH, Cologne, Germany +// + +package kubernetes + +import ( + "context" + "fmt" + + "github.com/rs/zerolog" + + schedulerApi "github.com/arangodb/kube-arangodb/pkg/apis/scheduler/v1beta1" + "github.com/arangodb/kube-arangodb/pkg/debug_package/cli" + "github.com/arangodb/kube-arangodb/pkg/debug_package/shared" + "github.com/arangodb/kube-arangodb/pkg/util/errors" + "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/kerrors" + "github.com/arangodb/kube-arangodb/pkg/util/kclient" +) + +func schedulerDeployments(logger zerolog.Logger, files chan<- shared.File, client kclient.Client) error { + deployments, err := listSchedulerDeployments(client) + if err != nil { + if kerrors.IsForbiddenOrNotFound(err) { + return nil + } + + return err + } + + if err := errors.ExecuteWithErrorArrayP2(schedulerDeployment, client, files, deployments...); err != nil { + logger.Err(err).Msgf("Error while collecting arango scheduler deployments") + return err + } + + return nil +} + +func schedulerDeployment(client kclient.Client, files chan<- shared.File, ext *schedulerApi.ArangoSchedulerDeployment) error { + files <- shared.NewYAMLFile(fmt.Sprintf("kubernetes/arango/scheduler/arangoschedulerdeployments/%s.yaml", ext.GetName()), func() ([]interface{}, error) { + return []interface{}{ext}, nil + }) + + return nil +} + +func listSchedulerDeployments(client kclient.Client) ([]*schedulerApi.ArangoSchedulerDeployment, error) { + return ListObjects[*schedulerApi.ArangoSchedulerDeploymentList, *schedulerApi.ArangoSchedulerDeployment](context.Background(), client.Arango().SchedulerV1beta1().ArangoSchedulerDeployments(cli.GetInput().Namespace), func(result *schedulerApi.ArangoSchedulerDeploymentList) []*schedulerApi.ArangoSchedulerDeployment { + q := make([]*schedulerApi.ArangoSchedulerDeployment, len(result.Items)) + + for id, e := range result.Items { + q[id] = e.DeepCopy() + } + + return q + }) +} diff --git a/pkg/debug_package/generators/kubernetes/arango_scheduler_pod.go b/pkg/debug_package/generators/kubernetes/arango_scheduler_pod.go new file mode 100644 index 000000000..b3bbe7c80 --- /dev/null +++ b/pkg/debug_package/generators/kubernetes/arango_scheduler_pod.go @@ -0,0 +1,73 @@ +// +// DISCLAIMER +// +// Copyright 2024 ArangoDB GmbH, Cologne, Germany +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Copyright holder is ArangoDB GmbH, Cologne, Germany +// + +package kubernetes + +import ( + "context" + "fmt" + + "github.com/rs/zerolog" + + schedulerApi "github.com/arangodb/kube-arangodb/pkg/apis/scheduler/v1beta1" + "github.com/arangodb/kube-arangodb/pkg/debug_package/cli" + "github.com/arangodb/kube-arangodb/pkg/debug_package/shared" + "github.com/arangodb/kube-arangodb/pkg/util/errors" + "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/kerrors" + "github.com/arangodb/kube-arangodb/pkg/util/kclient" +) + +func schedulerPods(logger zerolog.Logger, files chan<- shared.File, client kclient.Client) error { + pods, err := listSchedulerPods(client) + if err != nil { + if kerrors.IsForbiddenOrNotFound(err) { + return nil + } + + return err + } + + if err := errors.ExecuteWithErrorArrayP2(schedulerPod, client, files, pods...); err != nil { + logger.Err(err).Msgf("Error while collecting arango scheduler pods") + return err + } + + return nil +} + +func schedulerPod(client kclient.Client, files chan<- shared.File, ext *schedulerApi.ArangoSchedulerPod) error { + files <- shared.NewYAMLFile(fmt.Sprintf("kubernetes/arango/scheduler/arangoschedulerpods/%s.yaml", ext.GetName()), func() ([]interface{}, error) { + return []interface{}{ext}, nil + }) + + return nil +} + +func listSchedulerPods(client kclient.Client) ([]*schedulerApi.ArangoSchedulerPod, error) { + return ListObjects[*schedulerApi.ArangoSchedulerPodList, *schedulerApi.ArangoSchedulerPod](context.Background(), client.Arango().SchedulerV1beta1().ArangoSchedulerPods(cli.GetInput().Namespace), func(result *schedulerApi.ArangoSchedulerPodList) []*schedulerApi.ArangoSchedulerPod { + q := make([]*schedulerApi.ArangoSchedulerPod, len(result.Items)) + + for id, e := range result.Items { + q[id] = e.DeepCopy() + } + + return q + }) +} diff --git a/pkg/deployment/resources/arango_profiles.go b/pkg/deployment/resources/arango_profiles.go index cfa12fdc0..56da23346 100644 --- a/pkg/deployment/resources/arango_profiles.go +++ b/pkg/deployment/resources/arango_profiles.go @@ -81,6 +81,8 @@ func (r *Resources) EnsureArangoProfiles(ctx context.Context, cachedStatus inspe return "", nil, err } + key, v := constants.NewProfileIntegration(name, version) + return fullName, &schedulerApi.ArangoProfile{ ObjectMeta: meta.ObjectMeta{ Name: fullName, @@ -91,8 +93,8 @@ func (r *Resources) EnsureArangoProfiles(ctx context.Context, cachedStatus inspe }, Spec: schedulerApi.ProfileSpec{ Selectors: matchArangoProfilesLabels(map[string]string{ - constants.ProfilesDeployment: deploymentName, - fmt.Sprintf("%s/%s", constants.ProfilesIntegrationPrefix, name): version, + constants.ProfilesDeployment: deploymentName, + key: v, }), Template: integration, }, @@ -128,8 +130,9 @@ func (r *Resources) EnsureArangoProfiles(ctx context.Context, cachedStatus inspe }, }, nil }, - gen("authz", "v0", sidecar.IntegrationAuthorizationV0{}), - gen("authn", "v1", sidecar.IntegrationAuthenticationV1{Spec: spec, DeploymentName: apiObject.GetName()}), + gen(constants.ProfilesIntegrationAuthz, constants.ProfilesIntegrationV0, sidecar.IntegrationAuthorizationV0{}), + gen(constants.ProfilesIntegrationAuthn, constants.ProfilesIntegrationV1, sidecar.IntegrationAuthenticationV1{Spec: spec, DeploymentName: apiObject.GetName()}), + gen(constants.ProfilesIntegrationSched, constants.ProfilesIntegrationV1, sidecar.IntegrationSchedulerV1{}), ); err != nil { return err } else if changed { diff --git a/pkg/handlers/scheduler/batchjob/handler.go b/pkg/handlers/scheduler/batchjob/handler.go index 57b1b42c1..9f87e3d08 100644 --- a/pkg/handlers/scheduler/batchjob/handler.go +++ b/pkg/handlers/scheduler/batchjob/handler.go @@ -109,6 +109,14 @@ func (h *handler) HandleObject(ctx context.Context, item operation.Item, extensi return false, err } + // Try to fetch status + if profileNames := util.FormatList(calculatedProfiles, func(a util.KV[string, schedulerApi.ProfileAcceptedTemplate]) string { + return a.K + }); !equality.Semantic.DeepEqual(status.Profiles, profileNames) { + status.Profiles = profileNames + return true, operator.Reconcile("Status Changed") + } + var batchJobTemplate batch.Job batchJobTemplate.ObjectMeta = meta.ObjectMeta{ Name: extension.ObjectMeta.Name, @@ -168,16 +176,6 @@ func (h *handler) HandleObject(ctx context.Context, item operation.Item, extensi return false, err } - profileNames := util.FormatList(calculatedProfiles, func(a util.KV[string, schedulerApi.ProfileAcceptedTemplate]) string { - return a.K - }) - - // Try to fetch status - if !equality.Semantic.DeepEqual(status.Profiles, profileNames) { - status.Profiles = profileNames - return true, operator.Reconcile("Status Changed") - } - // Try to fetch status if !equality.Semantic.DeepEqual(status.JobStatus, obj.Status) { obj.Status.DeepCopyInto(&status.JobStatus) diff --git a/pkg/handlers/scheduler/cronjob/handler.go b/pkg/handlers/scheduler/cronjob/handler.go index 9666bf9d7..c65d8791f 100644 --- a/pkg/handlers/scheduler/cronjob/handler.go +++ b/pkg/handlers/scheduler/cronjob/handler.go @@ -109,6 +109,14 @@ func (h *handler) HandleObject(ctx context.Context, item operation.Item, extensi return false, err } + // Try to fetch status + if profileNames := util.FormatList(calculatedProfiles, func(a util.KV[string, schedulerApi.ProfileAcceptedTemplate]) string { + return a.K + }); !equality.Semantic.DeepEqual(status.Profiles, profileNames) { + status.Profiles = profileNames + return true, operator.Reconcile("Status Changed") + } + var cronJobTemplate batch.CronJob cronJobTemplate.ObjectMeta = meta.ObjectMeta{ Name: extension.ObjectMeta.Name, @@ -168,16 +176,6 @@ func (h *handler) HandleObject(ctx context.Context, item operation.Item, extensi return false, err } - profileNames := util.FormatList(calculatedProfiles, func(a util.KV[string, schedulerApi.ProfileAcceptedTemplate]) string { - return a.K - }) - - // Try to fetch status - if !equality.Semantic.DeepEqual(status.Profiles, profileNames) { - status.Profiles = profileNames - return true, operator.Reconcile("Status Changed") - } - // Try to fetch status if !equality.Semantic.DeepEqual(status.CronJobStatus, obj.Status) { obj.Status.DeepCopyInto(&status.CronJobStatus) diff --git a/pkg/handlers/scheduler/deployment/handler.go b/pkg/handlers/scheduler/deployment/handler.go index 05828f1df..9ccd75159 100644 --- a/pkg/handlers/scheduler/deployment/handler.go +++ b/pkg/handlers/scheduler/deployment/handler.go @@ -109,6 +109,14 @@ func (h *handler) HandleObject(ctx context.Context, item operation.Item, extensi return false, err } + // Try to fetch status + if profileNames := util.FormatList(calculatedProfiles, func(a util.KV[string, schedulerApi.ProfileAcceptedTemplate]) string { + return a.K + }); !equality.Semantic.DeepEqual(status.Profiles, profileNames) { + status.Profiles = profileNames + return true, operator.Reconcile("Status Changed") + } + var deploymentTemplate apps.Deployment deploymentTemplate.ObjectMeta = meta.ObjectMeta{ Name: extension.ObjectMeta.Name, @@ -169,16 +177,6 @@ func (h *handler) HandleObject(ctx context.Context, item operation.Item, extensi return false, err } - profileNames := util.FormatList(calculatedProfiles, func(a util.KV[string, schedulerApi.ProfileAcceptedTemplate]) string { - return a.K - }) - - // Try to fetch status - if !equality.Semantic.DeepEqual(status.Profiles, profileNames) { - status.Profiles = profileNames - return true, operator.Reconcile("Status Changed") - } - // Try to fetch status if !equality.Semantic.DeepEqual(status.DeploymentStatus, obj.Status) { obj.Status.DeepCopyInto(&status.DeploymentStatus) diff --git a/pkg/handlers/scheduler/pod/handler.go b/pkg/handlers/scheduler/pod/handler.go index bcd471a38..292642d62 100644 --- a/pkg/handlers/scheduler/pod/handler.go +++ b/pkg/handlers/scheduler/pod/handler.go @@ -109,6 +109,14 @@ func (h *handler) HandleObject(ctx context.Context, item operation.Item, extensi return false, err } + // Try to fetch status + if profileNames := util.FormatList(calculatedProfiles, func(a util.KV[string, schedulerApi.ProfileAcceptedTemplate]) string { + return a.K + }); !equality.Semantic.DeepEqual(status.Profiles, profileNames) { + status.Profiles = profileNames + return true, operator.Reconcile("Status Changed") + } + var podSpecTemplate core.PodTemplateSpec podSpecTemplate.ObjectMeta = meta.ObjectMeta{ @@ -164,16 +172,6 @@ func (h *handler) HandleObject(ctx context.Context, item operation.Item, extensi return false, err } - profileNames := util.FormatList(calculatedProfiles, func(a util.KV[string, schedulerApi.ProfileAcceptedTemplate]) string { - return a.K - }) - - // Try to fetch status - if !equality.Semantic.DeepEqual(status.Profiles, profileNames) { - status.Profiles = profileNames - return true, operator.Reconcile("Status Changed") - } - // Try to fetch status if !equality.Semantic.DeepEqual(status.PodStatus, obj.Status) { obj.Status.DeepCopyInto(&status.PodStatus) diff --git a/pkg/integrations/sidecar/integration.scheduler.v1.go b/pkg/integrations/sidecar/integration.scheduler.v1.go new file mode 100644 index 000000000..9913e6274 --- /dev/null +++ b/pkg/integrations/sidecar/integration.scheduler.v1.go @@ -0,0 +1,73 @@ +// +// DISCLAIMER +// +// Copyright 2024 ArangoDB GmbH, Cologne, Germany +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Copyright holder is ArangoDB GmbH, Cologne, Germany +// + +package sidecar + +import ( + core "k8s.io/api/core/v1" + + api "github.com/arangodb/kube-arangodb/pkg/apis/deployment/v1" +) + +type IntegrationSchedulerV1 struct { + Core *Core + + DeploymentName string + Spec api.DeploymentSpec +} + +func (i IntegrationSchedulerV1) Name() []string { + return []string{"SCHEDULER", "V1"} +} + +func (i IntegrationSchedulerV1) Validate() error { + return nil +} + +func (i IntegrationSchedulerV1) Envs() ([]core.EnvVar, error) { + var envs = []core.EnvVar{ + { + Name: "INTEGRATION_SCHEDULER_V1", + Value: "true", + }, + { + Name: "INTEGRATION_SCHEDULER_V1_VERIFY_ACCESS", + Value: "true", + }, + { + Name: "INTEGRATION_SCHEDULER_V1_NAMESPACE", + ValueFrom: &core.EnvVarSource{ + FieldRef: &core.ObjectFieldSelector{ + FieldPath: "metadata.namespace", + }, + }, + }, + } + + return i.Core.Envs(i, envs...), nil +} + +func (i IntegrationSchedulerV1) GlobalEnvs() ([]core.EnvVar, error) { + return nil, nil +} + +func (i IntegrationSchedulerV1) Volumes() ([]core.Volume, []core.VolumeMount, error) { + return nil, nil, nil +} diff --git a/pkg/util/constants/profiles.go b/pkg/util/constants/profiles.go index b603fca0a..bc4778a0c 100644 --- a/pkg/util/constants/profiles.go +++ b/pkg/util/constants/profiles.go @@ -20,7 +20,24 @@ package constants +import "fmt" + const ProfileGroup = "profiles.arangodb.com" const ProfilesDeployment = ProfileGroup + "/deployment" const ProfilesIntegrationPrefix = "integration." + ProfileGroup + +const ( + ProfilesIntegrationAuthn = "authn" + ProfilesIntegrationAuthz = "authz" + ProfilesIntegrationSched = "sched" +) + +const ( + ProfilesIntegrationV0 = "v0" + ProfilesIntegrationV1 = "v1" +) + +func NewProfileIntegration(name, version string) (string, string) { + return fmt.Sprintf("%s/%s", ProfilesIntegrationPrefix, name), version +}