From 3748b7eff31a4e38a7639be0571230674e4cfe46 Mon Sep 17 00:00:00 2001 From: Nicolae Nicora Date: Sat, 11 Oct 2025 23:01:02 +0200 Subject: [PATCH 01/14] fix: incorporate all modules into one module --- charts/{ => cmk}/.helmignore | 0 charts/{ => cmk}/Chart.yaml | 0 charts/{ => cmk}/README.md | 0 charts/{ => cmk}/templates/NOTES.txt | 0 charts/{ => cmk}/templates/_helpers.tpl | 0 charts/cmk/templates/configmap.yaml | 23 +++ .../templates}/deployment.yaml | 6 +- .../api-server => cmk/templates}/hpa.yaml | 2 +- .../api-server => cmk/templates}/pdb.yaml | 2 +- .../api-server => cmk/templates}/service.yaml | 4 +- .../templates}/serviceaccount.yaml | 3 +- charts/{ => cmk}/values.yaml | 143 ++------------ charts/templates/api-server/configmap.yaml | 71 ------- .../templates/task-scheduler/configmap.yaml | 42 ----- .../templates/task-scheduler/deployment.yaml | 112 ----------- .../task-scheduler/serviceaccount.yaml | 13 -- charts/templates/task-worker/configmap.yaml | 49 ----- charts/templates/task-worker/deployment.yaml | 112 ----------- .../templates/task-worker/serviceaccount.yaml | 13 -- .../tenant-manager-cli/configmap.yaml | 37 ---- .../tenant-manager-cli/deployment.yaml | 105 ----------- .../tenant-manager-cli/serviceaccount.yaml | 14 -- .../templates/tenant-manager/configmap.yaml | 42 ----- .../templates/tenant-manager/deployment.yaml | 105 ----------- charts/templates/tenant-manager/hpa.yaml | 36 ---- charts/templates/tenant-manager/pdb.yaml | 23 --- .../tenant-manager/serviceaccount.yaml | 13 -- charts/templates/tests/test-connection.yaml | 15 -- cmd/api-server/export_test.go | 7 - cmd/api-server/main_test.go | 168 ----------------- .../main.go => apiserver/command.go} | 94 ++++------ cmd/apiserver/command_test.go | 70 +++++++ cmd/apiserver/export_test.go | 6 + cmd/cmk/main.go | 84 +++++++++ cmd/task-scheduler/main.go | 78 -------- cmd/task-worker/main.go | 78 -------- cmd/taskscheduler/command.go | 75 ++++++++ cmd/taskworker/command.go | 77 ++++++++ cmd/tenant-manager-cli/export_test.go | 7 - cmd/tenant-manager/export_test.go | 8 - cmd/tenant-manager/main.go | 174 ------------------ cmd/tenantmanager/command.go | 143 ++++++++++++++ .../command_test.go} | 34 +--- cmd/tenantmanager/export_test.go | 6 + .../main.go => tenantmanagercli/command.go} | 73 +++----- .../command_test.go} | 61 +----- cmd/tenantmanagercli/export_test.go | 6 + go.mod | 3 +- go.sum | 2 + 49 files changed, 583 insertions(+), 1656 deletions(-) rename charts/{ => cmk}/.helmignore (100%) rename charts/{ => cmk}/Chart.yaml (100%) rename charts/{ => cmk}/README.md (100%) rename charts/{ => cmk}/templates/NOTES.txt (100%) rename charts/{ => cmk}/templates/_helpers.tpl (100%) create mode 100644 charts/cmk/templates/configmap.yaml rename charts/{templates/api-server => cmk/templates}/deployment.yaml (96%) rename charts/{templates/api-server => cmk/templates}/hpa.yaml (94%) rename charts/{templates/api-server => cmk/templates}/pdb.yaml (91%) rename charts/{templates/api-server => cmk/templates}/service.yaml (82%) rename charts/{templates/api-server => cmk/templates}/serviceaccount.yaml (80%) rename charts/{ => cmk}/values.yaml (85%) delete mode 100644 charts/templates/api-server/configmap.yaml delete mode 100644 charts/templates/task-scheduler/configmap.yaml delete mode 100644 charts/templates/task-scheduler/deployment.yaml delete mode 100644 charts/templates/task-scheduler/serviceaccount.yaml delete mode 100644 charts/templates/task-worker/configmap.yaml delete mode 100644 charts/templates/task-worker/deployment.yaml delete mode 100644 charts/templates/task-worker/serviceaccount.yaml delete mode 100644 charts/templates/tenant-manager-cli/configmap.yaml delete mode 100644 charts/templates/tenant-manager-cli/deployment.yaml delete mode 100644 charts/templates/tenant-manager-cli/serviceaccount.yaml delete mode 100644 charts/templates/tenant-manager/configmap.yaml delete mode 100644 charts/templates/tenant-manager/deployment.yaml delete mode 100644 charts/templates/tenant-manager/hpa.yaml delete mode 100644 charts/templates/tenant-manager/pdb.yaml delete mode 100644 charts/templates/tenant-manager/serviceaccount.yaml delete mode 100644 charts/templates/tests/test-connection.yaml delete mode 100644 cmd/api-server/export_test.go delete mode 100644 cmd/api-server/main_test.go rename cmd/{api-server/main.go => apiserver/command.go} (72%) create mode 100644 cmd/apiserver/command_test.go create mode 100644 cmd/apiserver/export_test.go create mode 100644 cmd/cmk/main.go delete mode 100644 cmd/task-scheduler/main.go delete mode 100644 cmd/task-worker/main.go create mode 100644 cmd/taskscheduler/command.go create mode 100644 cmd/taskworker/command.go delete mode 100644 cmd/tenant-manager-cli/export_test.go delete mode 100644 cmd/tenant-manager/export_test.go delete mode 100644 cmd/tenant-manager/main.go create mode 100644 cmd/tenantmanager/command.go rename cmd/{tenant-manager/main_test.go => tenantmanager/command_test.go} (63%) create mode 100644 cmd/tenantmanager/export_test.go rename cmd/{tenant-manager-cli/main.go => tenantmanagercli/command.go} (75%) rename cmd/{tenant-manager-cli/main_test.go => tenantmanagercli/command_test.go} (58%) create mode 100644 cmd/tenantmanagercli/export_test.go diff --git a/charts/.helmignore b/charts/cmk/.helmignore similarity index 100% rename from charts/.helmignore rename to charts/cmk/.helmignore diff --git a/charts/Chart.yaml b/charts/cmk/Chart.yaml similarity index 100% rename from charts/Chart.yaml rename to charts/cmk/Chart.yaml diff --git a/charts/README.md b/charts/cmk/README.md similarity index 100% rename from charts/README.md rename to charts/cmk/README.md diff --git a/charts/templates/NOTES.txt b/charts/cmk/templates/NOTES.txt similarity index 100% rename from charts/templates/NOTES.txt rename to charts/cmk/templates/NOTES.txt diff --git a/charts/templates/_helpers.tpl b/charts/cmk/templates/_helpers.tpl similarity index 100% rename from charts/templates/_helpers.tpl rename to charts/cmk/templates/_helpers.tpl diff --git a/charts/cmk/templates/configmap.yaml b/charts/cmk/templates/configmap.yaml new file mode 100644 index 00000000..d8339fe6 --- /dev/null +++ b/charts/cmk/templates/configmap.yaml @@ -0,0 +1,23 @@ +--- +apiVersion: v1 +kind: ConfigMap +metadata: + name: {{ include "cmk.name" . }}-config + labels: + {{- include "cmk.labels" . | nindent 4 }} +immutable: {{ .Values.application.isImmutable | default false }} +data: + config.yaml: |- + application: + name: {{ .Chart.Name }} + {{- with .Values.application }} + environment: {{ .environment }} + {{- with .labels }} + labels: + {{- toYaml . | nindent 8 }} + {{- end}} + {{- end}} + + {{- with .Values.config }} + {{- toYaml . | nindent 4 }} + {{- end}} \ No newline at end of file diff --git a/charts/templates/api-server/deployment.yaml b/charts/cmk/templates/deployment.yaml similarity index 96% rename from charts/templates/api-server/deployment.yaml rename to charts/cmk/templates/deployment.yaml index bb70e142..ad1527b4 100644 --- a/charts/templates/api-server/deployment.yaml +++ b/charts/cmk/templates/deployment.yaml @@ -1,4 +1,3 @@ -{{- if .Values.apiServer.deploy }} --- apiVersion: apps/v1 kind: Deployment @@ -49,10 +48,10 @@ spec: {{- end }} image: "{{ template "cmk.image" (tuple .Values.image $.Chart.AppVersion) }}" imagePullPolicy: {{ .Values.image.pullPolicy }} - {{- with .Values.apiServer.image.command }} + {{- with .Values.image.command }} command: [ "{{- toYaml . }}" ] {{- end }} - {{- with .Values.apiServer.image.args }} + {{- with .Values.image.args }} args: {{- toYaml . | nindent 12 }} {{- end }} @@ -121,4 +120,3 @@ spec: tolerations: {{- toYaml . | nindent 8 }} {{- end }} -{{- end }} diff --git a/charts/templates/api-server/hpa.yaml b/charts/cmk/templates/hpa.yaml similarity index 94% rename from charts/templates/api-server/hpa.yaml rename to charts/cmk/templates/hpa.yaml index 0161e9e0..3e6941c0 100644 --- a/charts/templates/api-server/hpa.yaml +++ b/charts/cmk/templates/hpa.yaml @@ -1,4 +1,4 @@ -{{- if and .Values.apiServer.deploy .Values.autoscaling.enabled }} +{{- if .Values.autoscaling.enabled }} apiVersion: autoscaling/v2 kind: HorizontalPodAutoscaler metadata: diff --git a/charts/templates/api-server/pdb.yaml b/charts/cmk/templates/pdb.yaml similarity index 91% rename from charts/templates/api-server/pdb.yaml rename to charts/cmk/templates/pdb.yaml index 57732a3e..48eaa680 100644 --- a/charts/templates/api-server/pdb.yaml +++ b/charts/cmk/templates/pdb.yaml @@ -1,4 +1,4 @@ -{{- if and .Values.apiServer.deploy .Values.podDisruptionBudget.enabled }} +{{- if .Values.podDisruptionBudget.enabled }} --- apiVersion: policy/v1 kind: PodDisruptionBudget diff --git a/charts/templates/api-server/service.yaml b/charts/cmk/templates/service.yaml similarity index 82% rename from charts/templates/api-server/service.yaml rename to charts/cmk/templates/service.yaml index a146d0b0..c07683df 100644 --- a/charts/templates/api-server/service.yaml +++ b/charts/cmk/templates/service.yaml @@ -1,4 +1,3 @@ -{{- if .Values.apiServer.deploy }} --- apiVersion: v1 kind: Service @@ -20,5 +19,4 @@ spec: {{- toYaml . | nindent 4 }} {{- end }} selector: - {{- include "cmk.selectorLabels" . | nindent 4 }} -{{- end }} \ No newline at end of file + {{- include "cmk.selectorLabels" . | nindent 4 }} \ No newline at end of file diff --git a/charts/templates/api-server/serviceaccount.yaml b/charts/cmk/templates/serviceaccount.yaml similarity index 80% rename from charts/templates/api-server/serviceaccount.yaml rename to charts/cmk/templates/serviceaccount.yaml index 18b5ade4..75c08732 100644 --- a/charts/templates/api-server/serviceaccount.yaml +++ b/charts/cmk/templates/serviceaccount.yaml @@ -1,4 +1,4 @@ -{{- if and .Values.apiServer.deploy .Values.serviceAccount.create -}} +{{- if .Values.serviceAccount.create -}} apiVersion: v1 kind: ServiceAccount metadata: @@ -10,4 +10,3 @@ metadata: {{- toYaml . | nindent 4 }} {{- end }} automountServiceAccountToken: {{ .Values.serviceAccount.automount }} -{{- end }} diff --git a/charts/values.yaml b/charts/cmk/values.yaml similarity index 85% rename from charts/values.yaml rename to charts/cmk/values.yaml index 6e8ec725..d9a46ae3 100644 --- a/charts/values.yaml +++ b/charts/cmk/values.yaml @@ -2,118 +2,6 @@ # This is a YAML-formatted file. # Declare variables to be passed into your templates. -# Component-specific values - -# api-server configuration -apiServer: - # This sets the container image more information can be found here: https://kubernetes.io/docs/concepts/containers/images/ - image: - # Setting the command - # +docs:property - command: "" - - # Setting the arguments for the container - # +docs:property - args: [] - # - --graceful-shutdown=2 - # - --graceful-shutdown-message="Graceful shutdown in %d seconds" - - # Enable the API-server deployment. - deploy: true - -# tenant-manager configuration -tenantManager: - # This sets the container image more information can be found here: https://kubernetes.io/docs/concepts/containers/images/ - image: - # Setting the command - # +docs:property - command: "" - - # Setting the arguments for the container - # +docs:property - args: [] - # - --graceful-shutdown=2 - # - --graceful-shutdown-message="Graceful shutdown in %d seconds" - - # Enable the tenant-manager deployment. - deploy: true - - # tenant-manager service configuration - service: - # Enable the tenant-manager service - enabled: false - - # This sets the service type more information can be found here: https://kubernetes.io/docs/concepts/services-networking/service/#publishing-services-service-types - type: ClusterIP - # This sets the ports more information can be found here: https://kubernetes.io/docs/concepts/services-networking/service/#field-spec-ports - ports: - - port: 5672 # must match .Values.cmk.port - protocol: TCP - targetPort: http - name: http - -# tenant-manager-cli configuration -tenantManagerCLI: - # This sets the container image more information can be found here: https://kubernetes.io/docs/concepts/containers/images/ - image: - # Setting the command - # +docs:property - command: "" - - # Setting the arguments for the container - # +docs:property - args: [] - # - --graceful-shutdown=2 - # - --graceful-shutdown-message="Graceful shutdown in %d seconds" - - # Enable the tenant-manager-cli deployment. - deploy: false - - # tenant-manager-cli service configuration - service: - # Enable the tenant-manager-cli service - enabled: false - - # Additional containers on the output Deployment definition. - extraContainers: [] - - # Additional init containers on the output Deployment definition. - extraInitContainers: [] - -# task scheduler configuration -taskScheduler: - # This sets the container image more information can be found here: https://kubernetes.io/docs/concepts/containers/images/ - image: - # Setting the command - # +docs:property - command: "" - - # Setting the arguments for the container - # +docs:property - args: [] - # - --graceful-shutdown=2 - # - --graceful-shutdown-message="Graceful shutdown in %d seconds" - - # Enable the task scheduler deployment. - deploy: false - -# task worker configuration -taskWorker: - # This sets the container image more information can be found here: https://kubernetes.io/docs/concepts/containers/images/ - image: - # Setting the command - # +docs:property - command: "" - - # Setting the arguments for the container - # +docs:property - args: [] - # - --graceful-shutdown=2 - # - --graceful-shutdown-message="Graceful shutdown in %d seconds" - - # Enable the task worker deployment. - deploy: false - # Override the "name" value, which is used to annotate some of # the resources that are created by this Chart (using "app.kubernetes.io/name"). # +docs:property @@ -136,19 +24,19 @@ replicaCount: 1 image: # The container registry to pull the image from. # For example: - # registry: kms.common.repositories.cloud.sap - # repository: cmk + # registry: ghcr.io/openkcm + # repository: images/checker # +docs:property - registry: "" + registry: ghcr.io/openkcm # The container image # +docs:property - repository: cmk-api-server-dev + repository: images/cmk # Override the image tag to deploy by setting this variable. # If no value is set, the chart's appVersion is used. # +docs:property - tag: "latest" + tag: "" # Setting a digest will override any tag. # +docs:property @@ -157,11 +45,16 @@ image: # Kubernetes imagePullPolicy. pullPolicy: IfNotPresent - # Setting the arguments for the container - # +docs:property - #args: - # - --graceful-shutdown=2 - # - --graceful-shutdown-message="Graceful shutdown in %d seconds" + # # Setting the arguments for the container + # # +docs:property + args: + - api-server +# - task-scheduler +# - task-worker +# - task-manager +# - task-manager-cli + # - --graceful-shutdown 2 + # - --graceful-message 'Graceful shutdown in %d seconds' # Setting the command # +docs:property @@ -306,14 +199,14 @@ ports: affinity: {} -config: +application: isImmutable: false - # Environment where the application is running environment: local # Labels associated to metrics, traces and logs - labels: {} + labels: { } +config: # Feature gates featureGates: enrich-header-with-client-type: true diff --git a/charts/templates/api-server/configmap.yaml b/charts/templates/api-server/configmap.yaml deleted file mode 100644 index 6b1efcb9..00000000 --- a/charts/templates/api-server/configmap.yaml +++ /dev/null @@ -1,71 +0,0 @@ -{{- if .Values.apiServer.deploy }} ---- -apiVersion: v1 -kind: ConfigMap -metadata: - name: {{ include "cmk.name" . }}-config - labels: - {{- include "cmk.labels" . | nindent 4 }} -immutable: {{ .Values.config.isImmutable | default false }} -data: - config.yaml: |- - application: - name: {{ .Chart.Name }} - {{- with .Values.config }} - environment: {{ .environment }} - {{- with .labels }} - labels: - {{- toYaml . | nindent 8 }} - {{- end}} - - featureGates: - {{- toYaml .featureGates | nindent 6 }} - - http: - address: :{{ .http.port }} - - logger: - {{- toYaml .logger | nindent 6 }} - - status: - {{- toYaml .status | nindent 6 }} - - certificates: - {{- toYaml .certificates | nindent 6 }} - - cryptoLayer: - {{- toYaml .cryptoLayer | nindent 6 }} - - # Telemetry configuration - telemetry: - {{- toYaml .telemetry | nindent 6 }} - - # Scheduler configuration - scheduler: - {{- toYaml .scheduler | nindent 6 }} - - # Database configuration - database: - {{- toYaml .database | nindent 6 }} - - # Services configuration - services: - {{- toYaml .services | nindent 6 }} - - # Plugins configuration - plugins: - {{ include "cmk.plugins" . | nindent 6 }} - - eventProcessor: - {{- toYaml .eventProcessor | nindent 6 }} - system: - {{- toYaml .system | nindent 6 }} - - provisioning: - {{- toYaml .provisioning | nindent 6 }} - - audit: - {{- toYaml .audit | nindent 6 }} - - {{- end }} -{{- end }} diff --git a/charts/templates/task-scheduler/configmap.yaml b/charts/templates/task-scheduler/configmap.yaml deleted file mode 100644 index dddeafac..00000000 --- a/charts/templates/task-scheduler/configmap.yaml +++ /dev/null @@ -1,42 +0,0 @@ -{{- if .Values.taskScheduler.deploy }} ---- -apiVersion: v1 -kind: ConfigMap -metadata: - name: {{ include "cmk.name" . }}-task-scheduler-config - labels: - {{- include "cmk.task-scheduler.labels" . | nindent 4 }} -immutable: {{ .Values.config.isImmutable | default false }} -data: - config.yaml: |- - application: - name: task-scheduler - {{- with .Values.config }} - environment: {{ .environment }} - {{- with .labels }} - labels: - {{- toYaml . | nindent 8 }} - {{- end }} - - status: - {{- toYaml .status | nindent 6 }} - - logger: - {{- toYaml .logger | nindent 6 }} - - telemetry: - {{- toYaml .telemetry | nindent 6 }} - - # Database configuration - database: - {{- toYaml .database | nindent 6 }} - - # Scheduler configuration - scheduler: - {{- toYaml .scheduler | nindent 6 }} - - certificates: - {{- toYaml .certificates | nindent 6 }} - - {{- end }} -{{- end }} diff --git a/charts/templates/task-scheduler/deployment.yaml b/charts/templates/task-scheduler/deployment.yaml deleted file mode 100644 index 4f2390f9..00000000 --- a/charts/templates/task-scheduler/deployment.yaml +++ /dev/null @@ -1,112 +0,0 @@ -{{- if .Values.taskScheduler.deploy }} ---- -apiVersion: apps/v1 -kind: Deployment -metadata: - name: {{ include "cmk.fullname" . }}-task-scheduler - labels: - {{- include "cmk.task-scheduler.labels" . | nindent 4 }} -spec: - {{- if not .Values.autoscaling.enabled }} - replicas: {{ .Values.replicaCount }} - {{- end }} - selector: - matchLabels: - {{- include "cmk.task-scheduler.selectorLabels" . | nindent 6 }} - template: - metadata: - {{- with .Values.podAnnotations }} - annotations: - {{- toYaml . | nindent 8 }} - {{- end }} - labels: - {{- include "cmk.task-scheduler.labels" . | nindent 8 }} - {{- with .Values.podLabels }} - {{- toYaml . | nindent 8 }} - {{- end }} - spec: - {{- with .Values.imagePullSecrets }} - imagePullSecrets: - {{- toYaml . | nindent 8 }} - {{- end }} - serviceAccountName: {{ include "cmk.serviceAccountName" . }}-task-scheduler - {{- with .Values.podSecurityContext }} - securityContext: - {{- toYaml . | nindent 8 }} - {{- end }} - {{- with .Values.extraInitContainers }} - initContainers: - {{- toYaml . | nindent 8 }} - {{- end }} - containers: - {{- with .Values.extraContainers }} - {{- toYaml . | nindent 8 }} - {{- end }} - - name: {{ include "cmk.name" . }}-task-scheduler - {{- with .Values.securityContext }} - securityContext: - {{- toYaml . | nindent 12 }} - {{- end }} - image: "{{ template "cmk.image" (tuple .Values.image $.Chart.AppVersion) }}" - imagePullPolicy: {{ .Values.image.pullPolicy }} - {{- with .Values.taskScheduler.image.command }} - command: [ "{{- toYaml . }}" ] - {{- end }} - {{- with .Values.taskScheduler.image.args }} - args: - {{- toYaml . | nindent 12 }} - {{- end }} - {{- with .Values.ports }} - ports: - {{- toYaml . | nindent 12 }} - {{- end }} - env: - - name: MY_POD_IP - valueFrom: - fieldRef: - apiVersion: v1 - fieldPath: status.podIP - - name: K8S_NODE_NAME - valueFrom: - fieldRef: - fieldPath: spec.nodeName - - name: K8S_NODE_IP - valueFrom: - fieldRef: - fieldPath: status.hostIP - {{- with .Values.extraEnvs }} - {{- toYaml . | nindent 12 }} - {{- end }} - {{- with .Values.extraEnvsFrom }} - envFrom: - {{- . | toYaml | nindent 12 }} - {{- end}} - volumeMounts: - - name: {{ include "cmk.name" . }}-task-scheduler-config-volume - mountPath: /etc/cmk - readOnly: true - {{- with .Values.extraVolumeMounts }} - {{- toYaml . | nindent 12 }} - {{- end }} - volumes: - - name: {{ include "cmk.name" . }}-task-scheduler-config-volume - projected: - sources: - - configMap: - name: {{ include "cmk.name" . }}-task-scheduler-config - {{- with .Values.extraVolumes }} - {{- toYaml . | nindent 8 }} - {{- end }} - {{- with .Values.nodeSelector }} - nodeSelector: - {{- toYaml . | nindent 8 }} - {{- end }} - {{- with .Values.affinity }} - affinity: - {{- toYaml . | nindent 8 }} - {{- end }} - {{- with .Values.tolerations }} - tolerations: - {{- toYaml . | nindent 8 }} - {{- end }} -{{- end }} diff --git a/charts/templates/task-scheduler/serviceaccount.yaml b/charts/templates/task-scheduler/serviceaccount.yaml deleted file mode 100644 index bd0eed75..00000000 --- a/charts/templates/task-scheduler/serviceaccount.yaml +++ /dev/null @@ -1,13 +0,0 @@ -{{- if and .Values.taskScheduler.deploy .Values.serviceAccount.create -}} -apiVersion: v1 -kind: ServiceAccount -metadata: - name: {{ include "cmk.serviceAccountName" . }}-task-scheduler - labels: - {{- include "cmk.task-scheduler.labels" . | nindent 4 }} - {{- with .Values.serviceAccount.annotations }} - annotations: - {{- toYaml . | nindent 4 }} - {{- end }} -automountServiceAccountToken: {{ .Values.serviceAccount.automount }} -{{- end }} diff --git a/charts/templates/task-worker/configmap.yaml b/charts/templates/task-worker/configmap.yaml deleted file mode 100644 index 5e52da65..00000000 --- a/charts/templates/task-worker/configmap.yaml +++ /dev/null @@ -1,49 +0,0 @@ -{{- if .Values.taskWorker.deploy }} ---- -apiVersion: v1 -kind: ConfigMap -metadata: - name: {{ include "cmk.name" . }}-task-worker-config - labels: - {{- include "cmk.task-worker.labels" . | nindent 4 }} -immutable: {{ .Values.config.isImmutable | default false }} -data: - config.yaml: |- - application: - name: task-worker - {{- with .Values.config }} - environment: {{ .environment }} - {{- with .labels }} - labels: - {{- toYaml . | nindent 8 }} - {{- end}} - - status: - {{- toYaml .status | nindent 6 }} - - logger: - {{- toYaml .logger | nindent 6 }} - - telemetry: - {{- toYaml .telemetry | nindent 6 }} - - # Database configuration - database: - {{- toYaml .database | nindent 6 }} - - # Scheduler configuration - scheduler: - {{- toYaml .scheduler | nindent 6 }} - - certificates: - {{- toYaml .certificates | nindent 6 }} - - # Plugins configuration - plugins: - {{- include "cmk.plugins" . | nindent 6 }} - - # Keystore pool configuration - keystorePool: - {{- toYaml .keystorePool | nindent 6 }} - {{- end }} -{{- end }} diff --git a/charts/templates/task-worker/deployment.yaml b/charts/templates/task-worker/deployment.yaml deleted file mode 100644 index 66309100..00000000 --- a/charts/templates/task-worker/deployment.yaml +++ /dev/null @@ -1,112 +0,0 @@ -{{- if .Values.taskWorker.deploy }} ---- -apiVersion: apps/v1 -kind: Deployment -metadata: - name: {{ include "cmk.fullname" . }}-task-worker - labels: - {{- include "cmk.task-worker.labels" . | nindent 4 }} -spec: - {{- if not .Values.autoscaling.enabled }} - replicas: {{ .Values.replicaCount }} - {{- end }} - selector: - matchLabels: - {{- include "cmk.task-worker.selectorLabels" . | nindent 6 }} - template: - metadata: - {{- with .Values.podAnnotations }} - annotations: - {{- toYaml . | nindent 8 }} - {{- end }} - labels: - {{- include "cmk.task-worker.labels" . | nindent 8 }} - {{- with .Values.podLabels }} - {{- toYaml . | nindent 8 }} - {{- end }} - spec: - {{- with .Values.imagePullSecrets }} - imagePullSecrets: - {{- toYaml . | nindent 8 }} - {{- end }} - serviceAccountName: {{ include "cmk.serviceAccountName" . }}-task-worker - {{- with .Values.podSecurityContext }} - securityContext: - {{- toYaml . | nindent 8 }} - {{- end }} - {{- with .Values.extraInitContainers }} - initContainers: - {{- toYaml . | nindent 8 }} - {{- end }} - containers: - {{- with .Values.extraContainers }} - {{- toYaml . | nindent 8 }} - {{- end }} - - name: {{ include "cmk.name" . }}-task-worker - {{- with .Values.securityContext }} - securityContext: - {{- toYaml . | nindent 12 }} - {{- end }} - image: "{{ template "cmk.image" (tuple .Values.image $.Chart.AppVersion) }}" - imagePullPolicy: {{ .Values.image.pullPolicy }} - {{- with .Values.taskWorker.image.command }} - command: [ "{{- toYaml . }}" ] - {{- end }} - {{- with .Values.taskWorker.image.args }} - args: - {{- toYaml . | nindent 12 }} - {{- end }} - {{- with .Values.ports }} - ports: - {{- toYaml . | nindent 12 }} - {{- end }} - env: - - name: MY_POD_IP - valueFrom: - fieldRef: - apiVersion: v1 - fieldPath: status.podIP - - name: K8S_NODE_NAME - valueFrom: - fieldRef: - fieldPath: spec.nodeName - - name: K8S_NODE_IP - valueFrom: - fieldRef: - fieldPath: status.hostIP - {{- with .Values.extraEnvs }} - {{- toYaml . | nindent 12 }} - {{- end }} - {{- with .Values.extraEnvsFrom }} - envFrom: - {{- . | toYaml | nindent 12 }} - {{- end }} - volumeMounts: - - name: {{ include "cmk.name" . }}-task-worker-config-volume - mountPath: /etc/cmk - readOnly: true - {{- with .Values.extraVolumeMounts }} - {{- toYaml . | nindent 12 }} - {{- end }} - volumes: - - name: {{ include "cmk.name" . }}-task-worker-config-volume - projected: - sources: - - configMap: - name: {{ include "cmk.name" . }}-task-worker-config - {{- with .Values.extraVolumes }} - {{- toYaml . | nindent 8 }} - {{- end }} - {{- with .Values.nodeSelector }} - nodeSelector: - {{- toYaml . | nindent 8 }} - {{- end }} - {{- with .Values.affinity }} - affinity: - {{- toYaml . | nindent 8 }} - {{- end }} - {{- with .Values.tolerations }} - tolerations: - {{- toYaml . | nindent 8 }} - {{- end }} -{{- end}} diff --git a/charts/templates/task-worker/serviceaccount.yaml b/charts/templates/task-worker/serviceaccount.yaml deleted file mode 100644 index afd9cbba..00000000 --- a/charts/templates/task-worker/serviceaccount.yaml +++ /dev/null @@ -1,13 +0,0 @@ -{{- if and .Values.taskWorker.deploy .Values.serviceAccount.create -}} -apiVersion: v1 -kind: ServiceAccount -metadata: - name: {{ include "cmk.serviceAccountName" . }}-task-worker - labels: - {{- include "cmk.task-worker.labels" . | nindent 4 }} - {{- with .Values.serviceAccount.annotations }} - annotations: - {{- toYaml . | nindent 4 }} - {{- end }} -automountServiceAccountToken: {{ .Values.serviceAccount.automount }} -{{- end }} diff --git a/charts/templates/tenant-manager-cli/configmap.yaml b/charts/templates/tenant-manager-cli/configmap.yaml deleted file mode 100644 index e8273733..00000000 --- a/charts/templates/tenant-manager-cli/configmap.yaml +++ /dev/null @@ -1,37 +0,0 @@ -{{- if .Values.tenantManagerCLI.deploy }} ---- -apiVersion: v1 -kind: ConfigMap -metadata: - name: {{ include "cmk.name" . }}-tenant-manager-cli-config - labels: - {{- include "cmk.tenant-manager-cli.labels" . | nindent 4 }} -immutable: {{ .Values.config.isImmutable | default false }} -data: - config.yaml: |- - application: - name: tenant-manager-cli - {{- with .Values.config }} - environment: {{ .environment }} - {{- with .labels }} - labels: - {{- toYaml . | nindent 8 }} - {{- end}} - - status: - {{- toYaml .status | nindent 6 }} - - logger: - {{- toYaml .logger | nindent 6 }} - - telemetry: - {{- toYaml .telemetry | nindent 6 }} - - database: - {{- toYaml .database | nindent 6 }} - - tenantManager: - {{- toYaml .tenantManager | nindent 6 }} - - {{- end }} -{{- end }} diff --git a/charts/templates/tenant-manager-cli/deployment.yaml b/charts/templates/tenant-manager-cli/deployment.yaml deleted file mode 100644 index abad9d36..00000000 --- a/charts/templates/tenant-manager-cli/deployment.yaml +++ /dev/null @@ -1,105 +0,0 @@ -{{- if .Values.tenantManagerCLI.deploy }} ---- -apiVersion: apps/v1 -kind: Deployment -metadata: - name: {{ include "cmk.fullname" . }}-tenant-manager-cli - labels: - {{- include "cmk.tenant-manager-cli.labels" . | nindent 4 }} -spec: - {{- if not .Values.autoscaling.enabled }} - replicas: {{ .Values.replicaCount }} - {{- end }} - selector: - matchLabels: - {{- include "cmk.tenant-manager-cli.selectorLabels" . | nindent 6 }} - template: - metadata: - {{- with .Values.podAnnotations }} - annotations: - {{- toYaml . | nindent 8 }} - {{- end }} - labels: - {{- include "cmk.tenant-manager-cli.labels" . | nindent 8 }} - {{- with .Values.podLabels }} - {{- toYaml . | nindent 8 }} - {{- end }} - spec: - {{- with .Values.imagePullSecrets }} - imagePullSecrets: - {{- toYaml . | nindent 8 }} - {{- end }} - serviceAccountName: {{ include "cmk.serviceAccountName" . }}-tenant-manager-cli - {{- with .Values.podSecurityContext }} - securityContext: - {{- toYaml . | nindent 8 }} - {{- end }} - {{- with .Values.tenantManagerCLI.extraInitContainers }} - initContainers: - {{- toYaml . | nindent 8 }} - {{- end }} - containers: - {{- with .Values.tenantManagerCLI.extraContainers }} - {{- toYaml . | nindent 8 }} - {{- end }} - - name: {{ include "cmk.name" . }}-tenant-manager-cli - {{- with .Values.securityContext }} - securityContext: - {{- toYaml . | nindent 12 }} - {{- end }} - image: "{{ template "cmk.image" (tuple .Values.image $.Chart.AppVersion) }}" - imagePullPolicy: {{ .Values.image.pullPolicy }} - {{- with .Values.tenantManagerCLI.image.command }} - command: [ "{{- toYaml . }}" ] - {{- end }} - {{- with .Values.tenantManagerCLI.image.args }} - args: - {{- toYaml . | nindent 12 }} - {{- end }} - {{- with .Values.ports }} - ports: - {{- toYaml . | nindent 12 }} - {{- end }} - env: - - name: MY_POD_IP - valueFrom: - fieldRef: - apiVersion: v1 - fieldPath: status.podIP - - name: K8S_NODE_NAME - valueFrom: - fieldRef: - fieldPath: spec.nodeName - - name: K8S_NODE_IP - valueFrom: - fieldRef: - fieldPath: status.hostIP - volumeMounts: - - name: {{ include "cmk.name" . }}-tenant-manager-cli-config-volume - mountPath: /etc/tenant-manager-cli - readOnly: true - {{- with .Values.extraVolumeMounts }} - {{- toYaml . | nindent 12 }} - {{- end }} - volumes: - - name: {{ include "cmk.name" . }}-tenant-manager-cli-config-volume - projected: - sources: - - configMap: - name: {{ include "cmk.name" . }}-tenant-manager-cli-config - {{- with .Values.extraVolumes }} - {{- toYaml . | nindent 8 }} - {{- end }} - {{- with .Values.nodeSelector }} - nodeSelector: - {{- toYaml . | nindent 8 }} - {{- end }} - {{- with .Values.affinity }} - affinity: - {{- toYaml . | nindent 8 }} - {{- end }} - {{- with .Values.tolerations }} - tolerations: - {{- toYaml . | nindent 8 }} - {{- end }} -{{- end}} diff --git a/charts/templates/tenant-manager-cli/serviceaccount.yaml b/charts/templates/tenant-manager-cli/serviceaccount.yaml deleted file mode 100644 index 3e767469..00000000 --- a/charts/templates/tenant-manager-cli/serviceaccount.yaml +++ /dev/null @@ -1,14 +0,0 @@ -{{- if and .Values.tenantManagerCLI.deploy .Values.serviceAccount.create -}} ---- -apiVersion: v1 -kind: ServiceAccount -metadata: - name: {{ include "cmk.serviceAccountName" . }}-tenant-manager-cli - labels: - {{- include "cmk.tenant-manager-cli.labels" . | nindent 4 }} - {{- with .Values.serviceAccount.annotations }} - annotations: - {{- toYaml . | nindent 4 }} - {{- end }} -automountServiceAccountToken: {{ .Values.serviceAccount.automount }} -{{- end }} diff --git a/charts/templates/tenant-manager/configmap.yaml b/charts/templates/tenant-manager/configmap.yaml deleted file mode 100644 index fa6203f0..00000000 --- a/charts/templates/tenant-manager/configmap.yaml +++ /dev/null @@ -1,42 +0,0 @@ -{{- if .Values.tenantManager.deploy }} ---- -apiVersion: v1 -kind: ConfigMap -metadata: - name: {{ include "cmk.name" . }}-tenant-manager-config - labels: - {{- include "cmk.tenant-manager.labels" . | nindent 4 }} -immutable: {{ .Values.config.isImmutable | default false }} -data: - config.yaml: |- - application: - name: tenant-manager - {{- with .Values.config }} - environment: {{ .environment }} - {{- with .labels }} - labels: - {{- toYaml . | nindent 8 }} - {{- end}} - - status: - {{- toYaml .status | nindent 6 }} - - logger: - {{- toYaml .logger | nindent 6 }} - - telemetry: - {{- toYaml .telemetry | nindent 6 }} - - # Database configuration - database: - {{- toYaml .database | nindent 6 }} - - # Services configuration - services: - {{- toYaml .services | nindent 6 }} - - tenantManager: - {{- toYaml .tenantManager | nindent 6 }} - - {{- end }} -{{- end }} diff --git a/charts/templates/tenant-manager/deployment.yaml b/charts/templates/tenant-manager/deployment.yaml deleted file mode 100644 index f7097a72..00000000 --- a/charts/templates/tenant-manager/deployment.yaml +++ /dev/null @@ -1,105 +0,0 @@ -{{- if .Values.tenantManager.deploy }} ---- -apiVersion: apps/v1 -kind: Deployment -metadata: - name: {{ include "cmk.fullname" . }}-tenant-manager - labels: - {{- include "cmk.tenant-manager.labels" . | nindent 4 }} -spec: - {{- if not .Values.autoscaling.enabled }} - replicas: {{ .Values.replicaCount }} - {{- end }} - selector: - matchLabels: - {{- include "cmk.tenant-manager.selectorLabels" . | nindent 6 }} - template: - metadata: - {{- with .Values.podAnnotations }} - annotations: - {{- toYaml . | nindent 8 }} - {{- end }} - labels: - {{- include "cmk.tenant-manager.labels" . | nindent 8 }} - {{- with .Values.podLabels }} - {{- toYaml . | nindent 8 }} - {{- end }} - spec: - {{- with .Values.imagePullSecrets }} - imagePullSecrets: - {{- toYaml . | nindent 8 }} - {{- end }} - serviceAccountName: {{ include "cmk.serviceAccountName" . }}-tenant-manager - {{- with .Values.podSecurityContext }} - securityContext: - {{- toYaml . | nindent 8 }} - {{- end }} - {{- with .Values.extraInitContainers }} - initContainers: - {{- toYaml . | nindent 8 }} - {{- end }} - containers: - {{- with .Values.extraContainers }} - {{- toYaml . | nindent 8 }} - {{- end }} - - name: {{ include "cmk.name" . }}-tenant-manager - {{- with .Values.securityContext }} - securityContext: - {{- toYaml . | nindent 12 }} - {{- end }} - image: "{{ template "cmk.image" (tuple .Values.image $.Chart.AppVersion) }}" - imagePullPolicy: {{ .Values.image.pullPolicy }} - {{- with .Values.tenantManager.image.command }} - command: [ "{{- toYaml . }}" ] - {{- end }} - {{- with .Values.tenantManager.image.args }} - args: - {{- toYaml . | nindent 12 }} - {{- end }} - {{- with .Values.ports }} - ports: - {{- toYaml . | nindent 12 }} - {{- end }} - env: - - name: MY_POD_IP - valueFrom: - fieldRef: - apiVersion: v1 - fieldPath: status.podIP - - name: K8S_NODE_NAME - valueFrom: - fieldRef: - fieldPath: spec.nodeName - - name: K8S_NODE_IP - valueFrom: - fieldRef: - fieldPath: status.hostIP - volumeMounts: - - name: {{ include "cmk.name" . }}-tenant-manager-config-volume - mountPath: /etc/tenant-manager - readOnly: true - {{- with .Values.extraVolumeMounts }} - {{- toYaml . | nindent 12 }} - {{- end }} - volumes: - - name: {{ include "cmk.name" . }}-tenant-manager-config-volume - projected: - sources: - - configMap: - name: {{ include "cmk.name" . }}-tenant-manager-config - {{- with .Values.extraVolumes }} - {{- toYaml . | nindent 8 }} - {{- end }} - {{- with .Values.nodeSelector }} - nodeSelector: - {{- toYaml . | nindent 8 }} - {{- end }} - {{- with .Values.affinity }} - affinity: - {{- toYaml . | nindent 8 }} - {{- end }} - {{- with .Values.tolerations }} - tolerations: - {{- toYaml . | nindent 8 }} - {{- end }} -{{- end}} diff --git a/charts/templates/tenant-manager/hpa.yaml b/charts/templates/tenant-manager/hpa.yaml deleted file mode 100644 index 402aead2..00000000 --- a/charts/templates/tenant-manager/hpa.yaml +++ /dev/null @@ -1,36 +0,0 @@ -{{- if and .Values.tenantManager.deploy .Values.autoscaling.enabled }} -apiVersion: autoscaling/v2 -kind: HorizontalPodAutoscaler -metadata: - name: {{ include "cmk.fullname" . }} - labels: - {{- include "cmk.labels" . | nindent 4 }} -spec: - scaleTargetRef: - apiVersion: apps/v1 - kind: Deployment - name: {{ include "cmk.fullname" . }} - minReplicas: {{ .Values.autoscaling.minReplicas }} - maxReplicas: {{ .Values.autoscaling.maxReplicas }} - metrics: - {{- if or .Values.autoscaling.targetCPUUtilizationPercentage .Values.autoscaling.targetMemoryUtilizationPercentage }} - {{- if .Values.autoscaling.targetCPUUtilizationPercentage }} - - type: Resource - resource: - name: cpu - target: - type: Utilization - averageUtilization: {{ .Values.autoscaling.targetCPUUtilizationPercentage }} - {{- end }} - {{- if .Values.autoscaling.targetMemoryUtilizationPercentage }} - - type: Resource - resource: - name: memory - target: - type: Utilization - averageUtilization: {{ .Values.autoscaling.targetMemoryUtilizationPercentage }} - {{- end }} - {{- else }} - [] - {{- end }} -{{- end }} diff --git a/charts/templates/tenant-manager/pdb.yaml b/charts/templates/tenant-manager/pdb.yaml deleted file mode 100644 index 479265d8..00000000 --- a/charts/templates/tenant-manager/pdb.yaml +++ /dev/null @@ -1,23 +0,0 @@ -{{- if and .Values.tenantManager.deploy .Values.podDisruptionBudget.enabled }} ---- -apiVersion: policy/v1 -kind: PodDisruptionBudget -metadata: - name: {{ include "cmk.fullname" . }} - namespace: {{ include "cmk.namespace" . }} - labels: - {{- include "cmk.labels" . | nindent 4 }} -spec: - selector: - matchLabels: - {{- include "cmk.selectorLabels" . | nindent 6 }} - {{- if not (or (hasKey .Values.podDisruptionBudget "minAvailable") (hasKey .Values.podDisruptionBudget "maxUnavailable")) }} - minAvailable: 1 # Default value because minAvailable and maxUnavailable are not set - {{- end }} - {{- if hasKey .Values.podDisruptionBudget "minAvailable" }} - minAvailable: {{ .Values.podDisruptionBudget.minAvailable }} - {{- end }} - {{- if hasKey .Values.podDisruptionBudget "maxUnavailable" }} - maxUnavailable: {{ .Values.podDisruptionBudget.maxUnavailable }} - {{- end }} -{{- end }} diff --git a/charts/templates/tenant-manager/serviceaccount.yaml b/charts/templates/tenant-manager/serviceaccount.yaml deleted file mode 100644 index 040dd4cf..00000000 --- a/charts/templates/tenant-manager/serviceaccount.yaml +++ /dev/null @@ -1,13 +0,0 @@ -{{- if and .Values.tenantManager.deploy .Values.serviceAccount.create -}} -apiVersion: v1 -kind: ServiceAccount -metadata: - name: {{ include "cmk.serviceAccountName" . }}-tenant-manager - labels: - {{- include "cmk.tenant-manager.labels" . | nindent 4 }} - {{- with .Values.serviceAccount.annotations }} - annotations: - {{- toYaml . | nindent 4 }} - {{- end }} -automountServiceAccountToken: {{ .Values.serviceAccount.automount }} -{{- end }} diff --git a/charts/templates/tests/test-connection.yaml b/charts/templates/tests/test-connection.yaml deleted file mode 100644 index 24a69407..00000000 --- a/charts/templates/tests/test-connection.yaml +++ /dev/null @@ -1,15 +0,0 @@ -apiVersion: v1 -kind: Pod -metadata: - name: "{{ include "cmk.fullname" . }}-test-connection" - labels: - {{- include "cmk.labels" . | nindent 4 }} - annotations: - "helm.sh/hook": test -spec: - containers: - - name: wget - image: busybox - command: ['wget'] - args: ['{{ include "cmk.fullname" . }}:{{ "8081" }}'] - restartPolicy: Never diff --git a/cmd/api-server/export_test.go b/cmd/api-server/export_test.go deleted file mode 100644 index 3684a700..00000000 --- a/cmd/api-server/export_test.go +++ /dev/null @@ -1,7 +0,0 @@ -package main - -var ( - Run = run - RunFunctionWithSigHandling = runFuncWithSignalHandling - MonitorKeystorePoolSize = monitorKeystorePoolSize -) diff --git a/cmd/api-server/main_test.go b/cmd/api-server/main_test.go deleted file mode 100644 index c196ffaa..00000000 --- a/cmd/api-server/main_test.go +++ /dev/null @@ -1,168 +0,0 @@ -package main_test - -import ( - "context" - "net/http" - "os" - "testing" - "time" - - "github.com/openkcm/common-sdk/pkg/commoncfg" - "github.com/stretchr/testify/require" - - apiServer "github.com/openkcm/cmk/cmd/api-server" - "github.com/openkcm/cmk/internal/config" - "github.com/openkcm/cmk/internal/testutils" -) - -func TestServerRunningAndShutdown(t *testing.T) { - _, _ = testutils.NewTestDB(t, testutils.TestDBConfig{}) - - cfg := &config.Config{ - HTTP: config.HTTPServer{ - Address: "localhost:8082", - }, - - Database: config.Database{ - Host: commoncfg.SourceRef{ - Source: commoncfg.EmbeddedSourceValue, - Value: "localhost", - }, - User: commoncfg.SourceRef{ - Source: commoncfg.EmbeddedSourceValue, - Value: "postgres", - }, - Secret: commoncfg.SourceRef{ - Source: commoncfg.EmbeddedSourceValue, - Value: "secret", - }, - Name: "cmk", - Port: "5433", - }, - BaseConfig: commoncfg.BaseConfig{ - Logger: commoncfg.Logger{ - Format: "json", - Level: "info", - }, - }, - } - - ctx := t.Context() - - go func() { - err := apiServer.Run(ctx, cfg) - //nolint:testifylint - require.NoError(t, err) - }() - - url := "http://" + cfg.HTTP.Address + "/keys" - - // Wait until server has started - for { - req, _ := http.NewRequestWithContext(t.Context(), http.MethodGet, url, nil) - - r, err := http.DefaultClient.Do(req) - if err == nil { - defer r.Body.Close() - break - } - - time.Sleep(100 * time.Millisecond) - } - - // Send shutdown to the server - ctx.Done() - - // Wait until cant connect to the server - for { - req, _ := http.NewRequestWithContext(t.Context(), http.MethodGet, url, nil) - - r, err := http.DefaultClient.Do(req) - if err == nil { - defer r.Body.Close() - break - } - - time.Sleep(100 * time.Millisecond) - } -} - -func TestRun(t *testing.T) { - t.Run("Should error on not possible database connection", func(t *testing.T) { - err := apiServer.Run(t.Context(), &config.Config{ - HTTP: config.HTTPServer{ - Address: "localhost:8082", - }, - Database: config.Database{ - Host: commoncfg.SourceRef{ - Value: "error", - }, - User: commoncfg.SourceRef{ - Value: "error", - }, - Secret: commoncfg.SourceRef{ - Value: "error", - }, - Name: "error", - Port: "5433", - }, - BaseConfig: commoncfg.BaseConfig{ - Logger: commoncfg.Logger{ - Format: "json", - Level: "info", - }, - }, - }) - require.Error(t, err) - }) -} - -func TestRunFunctionWithSigHandling(t *testing.T) { - t.Run("Should exitCode 1 on config not found", func(t *testing.T) { - exitCode := apiServer.RunFunctionWithSigHandling(func(_ context.Context, _ *config.Config) error { - return nil - }) - require.Equal(t, 1, exitCode) - }) - - t.Run("Should exitCode 0 on run", func(t *testing.T) { - filename := "config.yaml" - f, err := os.Create(filename) - require.NoError(t, err) - - defer f.Close() - defer os.Remove(filename) - - exitCode := apiServer.RunFunctionWithSigHandling(func(_ context.Context, _ *config.Config) error { - return nil - }) - require.Equal(t, 0, exitCode) - }) -} - -func TestMonitorKeystorePoolSize(t *testing.T) { - ctx, cancel := context.WithTimeout(context.Background(), 500*time.Millisecond) - defer cancel() - - cfg := config.Config{ - KeystorePool: config.KeystorePool{ - Interval: 100 * time.Millisecond, - }, - Database: config.Database{ - Host: commoncfg.SourceRef{Source: "embedded", Value: "localhost"}, - User: commoncfg.SourceRef{Source: "embedded", Value: "postgres"}, - Secret: commoncfg.SourceRef{Source: "embedded", Value: "secret"}, - Name: "cmk", - Port: "5433", - }, - } - - // Run in goroutine, should exit after context timeout - go func() { - apiServer.MonitorKeystorePoolSize(ctx, cfg) - }() - - <-ctx.Done() - // Check if the error is due to context deadline exceeded, not due to other reasons - require.Error(t, ctx.Err(), &context.DeadlineExceeded) -} diff --git a/cmd/api-server/main.go b/cmd/apiserver/command.go similarity index 72% rename from cmd/api-server/main.go rename to cmd/apiserver/command.go index 8b3f7ec6..2997de37 100644 --- a/cmd/api-server/main.go +++ b/cmd/apiserver/command.go @@ -1,12 +1,8 @@ -package main +package apiserver import ( "context" - "flag" - "fmt" "log/slog" - "os" - "os/signal" "syscall" "time" @@ -17,6 +13,7 @@ import ( "github.com/openkcm/common-sdk/pkg/status" "github.com/prometheus/client_golang/prometheus" "github.com/samber/oops" + "github.com/spf13/cobra" "github.com/openkcm/cmk/internal/config" "github.com/openkcm/cmk/internal/constants" @@ -28,13 +25,6 @@ import ( "github.com/openkcm/cmk/internal/repo/sql" ) -var ( - BuildInfo = "{}" - gracefulShutdownSec = flag.Int64("graceful-shutdown", 1, "graceful shutdown seconds") - gracefulShutdownMessage = flag.String("graceful-shutdown-message", "Graceful shutdown in %d seconds", - "graceful shutdown message") -) - const ( healthStatusTimeoutS = 5 * time.Second postgresDriverName = "pgx" @@ -44,54 +34,11 @@ const ( //nolint:mnd var defaultConfig = map[string]any{"Certificates": map[string]int{"ValidityDays": 30}} -// runFuncWithSignalHandling runs the given function with signal handling. When -// a CTRL-C is received, the context will be cancelled on which the function can -// act upon. -// It returns the exitCode -func runFuncWithSignalHandling(f func(context.Context, *config.Config) error) int { - ctx, cancelOnSignal := signal.NotifyContext( - context.Background(), - os.Interrupt, syscall.SIGTERM, - ) - defer cancelOnSignal() - - cfg, err := loadConfig() - if err != nil { - log.Error(ctx, "Failed to load the configuration", err) - _, _ = fmt.Fprintln(os.Stderr, err) - - return 1 - } - - log.Debug(ctx, "Starting the application", slog.Any("config", *cfg)) - - err = f(ctx, cfg) - if err != nil { - log.Error(ctx, "Failed to start the application", err) - _, _ = fmt.Fprintln(os.Stderr, err) - - return 1 - } - - // graceful shutdown so running goroutines may finish - _, _ = fmt.Fprintln(os.Stderr, fmt.Sprintf(*gracefulShutdownMessage, *gracefulShutdownSec)) - time.Sleep(time.Duration(*gracefulShutdownSec) * time.Second) - - return 0 -} - // - Starts the status server // - Starts the CMK API Server func run(ctx context.Context, cfg *config.Config) error { - // Update Version - err := commoncfg.UpdateConfigVersion(&cfg.BaseConfig, BuildInfo) - if err != nil { - return oops.In("main"). - Wrapf(err, "Failed to update the version configuration") - } - // LoggerConfig initialisation - err = logger.InitAsDefault(cfg.Logger, cfg.Application) + err := logger.InitAsDefault(cfg.Logger, cfg.Application) if err != nil { return oops.In("main"). Wrapf(err, "Failed to initialise the logger") @@ -221,7 +168,7 @@ func startStatusServer(ctx context.Context, cfg *config.Config) { }() } -func loadConfig() (*config.Config, error) { +func loadConfig(buildInfo string) (*config.Config, error) { cfg := &config.Config{} loader := commoncfg.NewLoader( @@ -240,6 +187,13 @@ func loadConfig() (*config.Config, error) { return nil, oops.In("main").Wrapf(err, "failed to load config") } + // Update Version + err = commoncfg.UpdateConfigVersion(&cfg.BaseConfig, buildInfo) + if err != nil { + return nil, oops.In("main"). + Wrapf(err, "Failed to update the version configuration") + } + err = cfg.Validate() if err != nil { return nil, oops.In("main").Wrapf(err, "failed to validate config") @@ -248,11 +202,25 @@ func loadConfig() (*config.Config, error) { return cfg, nil } -// main is the entry point for the application. It is intentionally kept small -// because it is hard to test, which would lower test coverage. -func main() { - flag.Parse() +func Cmd(buildInfo string) *cobra.Command { + var cmd = &cobra.Command{ + Use: "api-server", + Short: "CMK API Server", + Long: "CMK API Server is a component of the Cloud Key Management system that provides ", + RunE: func(cmd *cobra.Command, args []string) error { + cfg, err := loadConfig(buildInfo) + if err != nil { + return oops.In("main").Wrapf(err, "failed to load config") + } + + err = run(cmd.Context(), cfg) + if err != nil { + return oops.In("main").Wrapf(err, "failed to run the api server") + } + + return err + }, + } - exitCode := runFuncWithSignalHandling(run) - os.Exit(exitCode) + return cmd } diff --git a/cmd/apiserver/command_test.go b/cmd/apiserver/command_test.go new file mode 100644 index 00000000..42464f67 --- /dev/null +++ b/cmd/apiserver/command_test.go @@ -0,0 +1,70 @@ +package apiserver_test + +import ( + "context" + "testing" + "time" + + "github.com/openkcm/common-sdk/pkg/commoncfg" + "github.com/stretchr/testify/require" + + "github.com/openkcm/cmk/cmd/apiserver" + "github.com/openkcm/cmk/internal/config" +) + +func TestRun(t *testing.T) { + t.Run("Should error on not possible database connection", func(t *testing.T) { + err := apiserver.Run(t.Context(), &config.Config{ + HTTP: config.HTTPServer{ + Address: "localhost:8082", + }, + Database: config.Database{ + Host: commoncfg.SourceRef{ + Value: "error", + }, + User: commoncfg.SourceRef{ + Value: "error", + }, + Secret: commoncfg.SourceRef{ + Value: "error", + }, + Name: "error", + Port: "5433", + }, + BaseConfig: commoncfg.BaseConfig{ + Logger: commoncfg.Logger{ + Format: "json", + Level: "info", + }, + }, + }) + require.Error(t, err) + }) +} + +func TestMonitorKeystorePoolSize(t *testing.T) { + ctx, cancel := context.WithTimeout(context.Background(), 500*time.Millisecond) + defer cancel() + + cfg := config.Config{ + KeystorePool: config.KeystorePool{ + Interval: 100 * time.Millisecond, + }, + Database: config.Database{ + Host: commoncfg.SourceRef{Source: "embedded", Value: "localhost"}, + User: commoncfg.SourceRef{Source: "embedded", Value: "postgres"}, + Secret: commoncfg.SourceRef{Source: "embedded", Value: "secret"}, + Name: "cmk", + Port: "5433", + }, + } + + // Run in goroutine, should exit after context timeout + go func() { + apiserver.MonitorKeystorePoolSize(ctx, cfg) + }() + + <-ctx.Done() + // Check if the error is due to context deadline exceeded, not due to other reasons + require.Error(t, ctx.Err(), &context.DeadlineExceeded) +} diff --git a/cmd/apiserver/export_test.go b/cmd/apiserver/export_test.go new file mode 100644 index 00000000..82accbc0 --- /dev/null +++ b/cmd/apiserver/export_test.go @@ -0,0 +1,6 @@ +package apiserver + +var ( + Run = run + MonitorKeystorePoolSize = monitorKeystorePoolSize +) diff --git a/cmd/cmk/main.go b/cmd/cmk/main.go new file mode 100644 index 00000000..b21e5b99 --- /dev/null +++ b/cmd/cmk/main.go @@ -0,0 +1,84 @@ +package main + +import ( + "context" + "fmt" + "os" + "os/signal" + "syscall" + "time" + + "github.com/openkcm/cmk/cmd/apiserver" + "github.com/openkcm/cmk/cmd/taskscheduler" + "github.com/openkcm/cmk/cmd/taskworker" + "github.com/openkcm/cmk/cmd/tenantmanager" + "github.com/openkcm/cmk/cmd/tenantmanagercli" + "github.com/openkcm/common-sdk/pkg/utils" + "github.com/spf13/cobra" + slogctx "github.com/veqryn/slog-context" +) + +var ( + // BuildInfo will be set by the build system + BuildInfo = "{}" + + isVersionCmd bool + gracefulShutdownSec int64 + gracefulShutdownMessage string +) + +func rootCmd() *cobra.Command { + cmd := &cobra.Command{ + Use: "cmk", + Short: "OpenKCM CMK - Customer Manager Keys", + Long: `OpenKCM Customer Manager Keys(CMK) is a key management service to manage encryption keys for applications and services.`, + } + + cmd.PersistentFlags().Int64Var(&gracefulShutdownSec, "graceful-shutdown", 1, "graceful shutdown seconds") + cmd.PersistentFlags().StringVar(&gracefulShutdownMessage, "graceful-shutdown-message", "Graceful shutdown in %d seconds", + "graceful shutdown message") + + cmd.AddCommand( + &cobra.Command{ + Use: "version", + Short: "CMK Version", + RunE: func(cmd *cobra.Command, args []string) error { + isVersionCmd = true + value, err := utils.ExtractFromComplexValue(BuildInfo) + if err != nil { + return err + } + fmt.Println(value) + return nil + }, + }, + apiserver.Cmd(BuildInfo), + taskscheduler.Cmd(BuildInfo), + taskworker.Cmd(BuildInfo), + tenantmanager.Cmd(BuildInfo), + tenantmanagercli.Cmd(BuildInfo), + ) + + return cmd +} + +func main() { + ctx, cancelOnSignal := signal.NotifyContext( + context.Background(), + os.Interrupt, syscall.SIGTERM, + ) + defer cancelOnSignal() + + err := rootCmd().ExecuteContext(ctx) + if err != nil { + slogctx.Error(ctx, "Failed to start the application", "error", err) + _, _ = fmt.Fprintln(os.Stderr, err) + os.Exit(1) + } + + // graceful shutdown so running goroutines may finish + if !isVersionCmd { + _, _ = fmt.Fprintln(os.Stderr, fmt.Sprintf(gracefulShutdownMessage, gracefulShutdownSec)) + time.Sleep(time.Duration(gracefulShutdownSec) * time.Second) + } +} diff --git a/cmd/task-scheduler/main.go b/cmd/task-scheduler/main.go deleted file mode 100644 index 613429f8..00000000 --- a/cmd/task-scheduler/main.go +++ /dev/null @@ -1,78 +0,0 @@ -package main - -import ( - "context" - "log" - "os" - "os/signal" - "syscall" - - "github.com/openkcm/common-sdk/pkg/commoncfg" - "github.com/openkcm/common-sdk/pkg/logger" - "github.com/samber/oops" - - "github.com/openkcm/cmk/internal/async" - "github.com/openkcm/cmk/internal/config" - "github.com/openkcm/cmk/internal/constants" - cmklog "github.com/openkcm/cmk/internal/log" -) - -const AppName = "scheduler" - -func start() error { - ctx, cancelOnSignal := signal.NotifyContext( - context.Background(), - os.Interrupt, syscall.SIGTERM, - ) - - defer cancelOnSignal() - - defaultValues := map[string]any{} - cfg := &config.Config{} - - err := commoncfg.LoadConfig( - cfg, - defaultValues, - constants.DefaultConfigPath1, - constants.DefaultConfigPath2, - ".", - ) - if err != nil { - return oops.In("main").Wrapf(err, "failed to load the config") - } - - // LoggerConfig initialisation - err = logger.InitAsDefault(cfg.Logger, cfg.Application) - if err != nil { - return oops.In("main"). - Wrapf(err, "Failed to initialise the logger") - } - - cronJob, err := async.New(cfg) - if err != nil { - return oops.In("main").Wrapf(err, "failed to create the scheduler") - } - - err = cronJob.RunScheduler() - if err != nil { - return oops.In("main").Wrapf(err, "failed to start the scheduler job") - } - - <-ctx.Done() - - err = cronJob.Shutdown(ctx) - if err != nil { - return oops.In("main").Wrapf(err, "failed to shutdown the scheduler") - } - - cmklog.Info(ctx, "shutting down scheduler") - - return nil -} - -func main() { - err := start() - if err != nil { - log.Fatal(err) - } -} diff --git a/cmd/task-worker/main.go b/cmd/task-worker/main.go deleted file mode 100644 index 7dc1a404..00000000 --- a/cmd/task-worker/main.go +++ /dev/null @@ -1,78 +0,0 @@ -package main - -import ( - "context" - "log" - "os" - "os/signal" - "syscall" - - "github.com/openkcm/common-sdk/pkg/commoncfg" - "github.com/openkcm/common-sdk/pkg/logger" - "github.com/samber/oops" - - "github.com/openkcm/cmk/internal/async" - "github.com/openkcm/cmk/internal/config" - "github.com/openkcm/cmk/internal/constants" - cmklog "github.com/openkcm/cmk/internal/log" -) - -const AppName = "worker" - -func start() error { - ctx, cancelOnSignal := signal.NotifyContext( - context.Background(), - os.Interrupt, syscall.SIGTERM, - ) - - defer cancelOnSignal() - - defaultValues := map[string]any{} - cfg := &config.Config{} - - err := commoncfg.LoadConfig( - cfg, - defaultValues, - constants.DefaultConfigPath1, - constants.DefaultConfigPath2, - ".", - ) - if err != nil { - return oops.In("main").Wrapf(err, "failed to load the config") - } - - // LoggerConfig initialisation - err = logger.InitAsDefault(cfg.Logger, cfg.Application) - if err != nil { - return oops.In("main"). - Wrapf(err, "Failed to initialise the logger") - } - - cronJob, err := async.New(cfg) - if err != nil { - return oops.In("main").Wrapf(err, "failed to create the worker") - } - - err = cronJob.RunWorker(ctx, cfg) - if err != nil { - return oops.In("main").Wrapf(err, "failed to start the worker") - } - - <-ctx.Done() - - err = cronJob.Shutdown(ctx) - if err != nil { - return oops.In("main").Wrapf(err, "%s", async.ErrClientShutdown.Error()) - } - - cmklog.Info(ctx, "shutting down worker") - - return nil -} - -func main() { - err := start() - if err != nil { - log.Fatal(err) - } -} diff --git a/cmd/taskscheduler/command.go b/cmd/taskscheduler/command.go new file mode 100644 index 00000000..8f91dc56 --- /dev/null +++ b/cmd/taskscheduler/command.go @@ -0,0 +1,75 @@ +package taskscheduler + +import ( + "github.com/openkcm/common-sdk/pkg/commoncfg" + "github.com/openkcm/common-sdk/pkg/logger" + "github.com/samber/oops" + "github.com/spf13/cobra" + + "github.com/openkcm/cmk/internal/async" + "github.com/openkcm/cmk/internal/config" + "github.com/openkcm/cmk/internal/constants" + cmklog "github.com/openkcm/cmk/internal/log" +) + +func Cmd(buildInfo string) *cobra.Command { + var cmd = &cobra.Command{ + Use: "task-scheduler", + Short: "CMK Task Scheduler", + Long: "CMK Task Scheduler - Customizable and efficient task scheduling solution.", + RunE: func(cmd *cobra.Command, args []string) error { + ctx := cmd.Context() + + defaultValues := map[string]any{} + cfg := &config.Config{} + + err := commoncfg.LoadConfig( + cfg, + defaultValues, + constants.DefaultConfigPath1, + constants.DefaultConfigPath2, + ".", + ) + if err != nil { + return oops.In("main").Wrapf(err, "failed to load the config") + } + + // Update Version + err = commoncfg.UpdateConfigVersion(&cfg.BaseConfig, buildInfo) + if err != nil { + return oops.In("main"). + Wrapf(err, "Failed to update the version configuration") + } + + // LoggerConfig initialisation + err = logger.InitAsDefault(cfg.Logger, cfg.Application) + if err != nil { + return oops.In("main"). + Wrapf(err, "Failed to initialise the logger") + } + + cronJob, err := async.New(cfg) + if err != nil { + return oops.In("main").Wrapf(err, "failed to create the scheduler") + } + + err = cronJob.RunScheduler() + if err != nil { + return oops.In("main").Wrapf(err, "failed to start the scheduler job") + } + + <-ctx.Done() + + err = cronJob.Shutdown(ctx) + if err != nil { + return oops.In("main").Wrapf(err, "failed to shutdown the scheduler") + } + + cmklog.Info(ctx, "shutting down scheduler") + + return err + }, + } + + return cmd +} diff --git a/cmd/taskworker/command.go b/cmd/taskworker/command.go new file mode 100644 index 00000000..28ab7d61 --- /dev/null +++ b/cmd/taskworker/command.go @@ -0,0 +1,77 @@ +package taskworker + +import ( + "context" + + "github.com/openkcm/common-sdk/pkg/commoncfg" + "github.com/openkcm/common-sdk/pkg/logger" + "github.com/samber/oops" + "github.com/spf13/cobra" + + "github.com/openkcm/cmk/internal/async" + "github.com/openkcm/cmk/internal/config" + "github.com/openkcm/cmk/internal/constants" + cmklog "github.com/openkcm/cmk/internal/log" +) + +func Cmd(buildInfo string) *cobra.Command { + var cmd = &cobra.Command{ + Use: "task-worker", + Short: "CMK Task Worker", + Long: "CMK Task Worker - A background service that processes tasks asynchronously.", + RunE: func(cmd *cobra.Command, args []string) error { + ctx := context.Background() + + defaultValues := map[string]any{} + cfg := &config.Config{} + + err := commoncfg.LoadConfig( + cfg, + defaultValues, + constants.DefaultConfigPath1, + constants.DefaultConfigPath2, + ".", + ) + if err != nil { + return oops.In("main").Wrapf(err, "failed to load the config") + } + + // Update Version + err = commoncfg.UpdateConfigVersion(&cfg.BaseConfig, buildInfo) + if err != nil { + return oops.In("main"). + Wrapf(err, "Failed to update the version configuration") + } + + // LoggerConfig initialisation + err = logger.InitAsDefault(cfg.Logger, cfg.Application) + if err != nil { + return oops.In("main"). + Wrapf(err, "Failed to initialise the logger") + } + + cronJob, err := async.New(cfg) + if err != nil { + return oops.In("main").Wrapf(err, "failed to create the worker") + } + + err = cronJob.RunWorker(ctx, cfg) + if err != nil { + return oops.In("main").Wrapf(err, "failed to start the worker") + } + + <-ctx.Done() + + err = cronJob.Shutdown(ctx) + if err != nil { + return oops.In("main").Wrapf(err, "%s", async.ErrClientShutdown.Error()) + } + + cmklog.Info(ctx, "shutting down worker") + + return nil + }, + } + + return cmd +} diff --git a/cmd/tenant-manager-cli/export_test.go b/cmd/tenant-manager-cli/export_test.go deleted file mode 100644 index f487b801..00000000 --- a/cmd/tenant-manager-cli/export_test.go +++ /dev/null @@ -1,7 +0,0 @@ -package main - -var ( - Run = run - RunFunctionWithSigHandling = runFuncWithSignalHandling - SetupCommands = setupCommands -) diff --git a/cmd/tenant-manager/export_test.go b/cmd/tenant-manager/export_test.go deleted file mode 100644 index b0739c5f..00000000 --- a/cmd/tenant-manager/export_test.go +++ /dev/null @@ -1,8 +0,0 @@ -package main - -var ( - Run = run - RunFunctionWithSigHandling = runFuncWithSignalHandling - LoadConfig = loadConfig - StartStatusServer = startStatusServer -) diff --git a/cmd/tenant-manager/main.go b/cmd/tenant-manager/main.go deleted file mode 100644 index 6d896290..00000000 --- a/cmd/tenant-manager/main.go +++ /dev/null @@ -1,174 +0,0 @@ -package main - -import ( - "context" - "flag" - "fmt" - "log/slog" - "os" - "os/signal" - "syscall" - "time" - - "github.com/openkcm/common-sdk/pkg/commoncfg" - "github.com/openkcm/common-sdk/pkg/health" - "github.com/openkcm/common-sdk/pkg/logger" - "github.com/openkcm/common-sdk/pkg/otlp" - "github.com/openkcm/common-sdk/pkg/status" - "github.com/samber/oops" - - "github.com/openkcm/cmk/internal/config" - "github.com/openkcm/cmk/internal/db/dsn" - "github.com/openkcm/cmk/internal/log" - "github.com/openkcm/cmk/tenant-manager/business" -) - -const ( - defaultTimeout = 5 - errMsgLoadConfig = "Failed to load the configuration" - errMsgLoggerInit = "Failed to initialise the logger" - errMsgLoadTelemetry = "Failed to load the telemetry" - errMsgStartTheBusinessApp = "Failed to start the main business application" - errMsgStatusServer = "Failure on the status server" - errMsgStartApp = "Failed to start the application" - postgresDriverName = "pgx" -) - -var ( - gracefulShutdownSec = flag.Int64("graceful-shutdown", 1, "graceful shutdown seconds") - gracefulShutdownMessage = flag.String("graceful-shutdown-message", "Graceful shutdown in %d seconds", - "graceful shutdown message") -) - -// run does the heavy lifting until the service is up and running. It will: -// - Load the config and initializes the logger -// - Start the status server in a goroutine -// - Start the business logic and eventually return the error from it -// - -func run(ctx context.Context) error { - // Load Configuration - cfg, err := loadConfig() - if err != nil { - return oops.In("main"). - Wrapf(err, errMsgLoadConfig) - } - - // LoggerConfig initialisation - err = logger.InitAsDefault(cfg.Logger, cfg.Application) - if err != nil { - return oops.In("main"). - Wrapf(err, errMsgLoggerInit) - } - - // OpenTelemetry initialisation - err = otlp.Init(ctx, &cfg.Application, &cfg.Telemetry, &cfg.Logger) - if err != nil { - return oops.In("main"). - Wrapf(err, errMsgLoadTelemetry) - } - - // Status Server Initialisation - startStatusServer(ctx, cfg) - - // Business Logic - err = business.Main(ctx, cfg) - if err != nil { - return oops.In("main"). - Wrapf(err, errMsgStartTheBusinessApp) - } - - return nil -} - -func startStatusServer(ctx context.Context, cfg *config.Config) { - liveness := status.WithLiveness( - health.NewHandler( - health.NewChecker(health.WithDisabledAutostart()), - ), - ) - - healthOptions := make([]health.Option, 0) - healthOptions = append(healthOptions, - health.WithDisabledAutostart(), - health.WithTimeout(defaultTimeout*time.Second), - health.WithStatusListener(func(ctx context.Context, state health.State) { - log.Info(ctx, "readiness status changed", slog.String("status", string(state.Status))) - }), - ) - - dsnFromConfig, err := dsn.FromDBConfig(cfg.Database) - if err != nil { - log.Error(ctx, "Could not load DSN from database config", err) - } - - healthOptions = append(healthOptions, - health.WithDatabaseChecker( - postgresDriverName, - dsnFromConfig, - ), - ) - - readiness := status.WithReadiness( - health.NewHandler( - health.NewChecker(healthOptions...), - ), - ) - - go func() { - err := status.Start(ctx, &cfg.BaseConfig, liveness, readiness) - if err != nil { - log.Error(ctx, errMsgStatusServer, err) - - _ = syscall.Kill(syscall.Getpid(), syscall.SIGTERM) - } - }() -} - -func loadConfig() (*config.Config, error) { - cfg := &config.Config{} - - err := commoncfg.LoadConfig( - cfg, - map[string]any{}, - "/etc/tenant-manager", - ".", - ) - - return cfg, err -} - -// runFuncWithSignalHandling runs the given function with signal handling. When -// a CTRL-C is received, the context will be cancelled on which the function can -// act upon. -func runFuncWithSignalHandling(f func(context.Context) error) int { - ctx, cancelOnSignal := signal.NotifyContext( - context.Background(), - os.Interrupt, syscall.SIGTERM, - ) - defer cancelOnSignal() - - exitCode := 0 - - err := f(ctx) - if err != nil { - log.Error(ctx, errMsgStartApp, err) - _, _ = fmt.Fprintln(os.Stderr, err) - exitCode = 1 - } - - // graceful shutdown so running goroutines may finish - _, _ = fmt.Fprintln(os.Stderr, fmt.Sprintf(*gracefulShutdownMessage, *gracefulShutdownSec)) - time.Sleep(time.Duration(*gracefulShutdownSec) * time.Second) - - return exitCode -} - -// main is the entry point for the application. It is intentionally kept small -// because it is hard to test, which would lower test coverage. -func main() { - flag.Parse() - - exitCode := runFuncWithSignalHandling(run) - os.Exit(exitCode) -} diff --git a/cmd/tenantmanager/command.go b/cmd/tenantmanager/command.go new file mode 100644 index 00000000..8ade57eb --- /dev/null +++ b/cmd/tenantmanager/command.go @@ -0,0 +1,143 @@ +package tenantmanager + +import ( + "context" + "log/slog" + "syscall" + "time" + + "github.com/openkcm/cmk/internal/constants" + "github.com/openkcm/common-sdk/pkg/commoncfg" + "github.com/openkcm/common-sdk/pkg/health" + "github.com/openkcm/common-sdk/pkg/logger" + "github.com/openkcm/common-sdk/pkg/otlp" + "github.com/openkcm/common-sdk/pkg/status" + "github.com/samber/oops" + "github.com/spf13/cobra" + + "github.com/openkcm/cmk/internal/config" + "github.com/openkcm/cmk/internal/db/dsn" + "github.com/openkcm/cmk/internal/log" + "github.com/openkcm/cmk/tenant-manager/business" +) + +const ( + defaultTimeout = 5 + errMsgLoadConfig = "Failed to load the configuration" + errMsgLoggerInit = "Failed to initialise the logger" + errMsgLoadTelemetry = "Failed to load the telemetry" + errMsgStartTheBusinessApp = "Failed to start the main business application" + errMsgStatusServer = "Failure on the status server" + postgresDriverName = "pgx" +) + +func startStatusServer(ctx context.Context, cfg *config.Config) { + liveness := status.WithLiveness( + health.NewHandler( + health.NewChecker(health.WithDisabledAutostart()), + ), + ) + + healthOptions := make([]health.Option, 0) + healthOptions = append(healthOptions, + health.WithDisabledAutostart(), + health.WithTimeout(defaultTimeout*time.Second), + health.WithStatusListener(func(ctx context.Context, state health.State) { + log.Info(ctx, "readiness status changed", slog.String("status", string(state.Status))) + }), + ) + + dsnFromConfig, err := dsn.FromDBConfig(cfg.Database) + if err != nil { + log.Error(ctx, "Could not load DSN from database config", err) + } + + healthOptions = append(healthOptions, + health.WithDatabaseChecker( + postgresDriverName, + dsnFromConfig, + ), + ) + + readiness := status.WithReadiness( + health.NewHandler( + health.NewChecker(healthOptions...), + ), + ) + + go func() { + err := status.Start(ctx, &cfg.BaseConfig, liveness, readiness) + if err != nil { + log.Error(ctx, errMsgStatusServer, err) + + _ = syscall.Kill(syscall.Getpid(), syscall.SIGTERM) + } + }() +} + +func loadConfig() (*config.Config, error) { + cfg := &config.Config{} + + err := commoncfg.LoadConfig( + cfg, + map[string]any{}, + constants.DefaultConfigPath1, + constants.DefaultConfigPath2, + ".", + ) + + return cfg, err +} + +func Cmd(buildInfo string) *cobra.Command { + var cmd = &cobra.Command{ + Use: "tenant-manager", + Short: "CMK the Tenant Manager", + Long: `CMK Tenant Manager - a service to manage tenants.`, + RunE: func(cmd *cobra.Command, args []string) error { + ctx := cmd.Context() + + // Load Configuration + cfg, err := loadConfig() + if err != nil { + return oops.In("main"). + Wrapf(err, errMsgLoadConfig) + } + + // Update Version + err = commoncfg.UpdateConfigVersion(&cfg.BaseConfig, buildInfo) + if err != nil { + return oops.In("main"). + Wrapf(err, "Failed to update the version configuration") + } + + // LoggerConfig initialisation + err = logger.InitAsDefault(cfg.Logger, cfg.Application) + if err != nil { + return oops.In("main"). + Wrapf(err, errMsgLoggerInit) + } + + // OpenTelemetry initialisation + err = otlp.Init(ctx, &cfg.Application, &cfg.Telemetry, &cfg.Logger) + if err != nil { + return oops.In("main"). + Wrapf(err, errMsgLoadTelemetry) + } + + // Status Server Initialisation + startStatusServer(ctx, cfg) + + // Business Logic + err = business.Main(ctx, cfg) + if err != nil { + return oops.In("main"). + Wrapf(err, errMsgStartTheBusinessApp) + } + + return nil + }, + } + + return cmd +} diff --git a/cmd/tenant-manager/main_test.go b/cmd/tenantmanager/command_test.go similarity index 63% rename from cmd/tenant-manager/main_test.go rename to cmd/tenantmanager/command_test.go index 84422ff7..6c01ec8c 100644 --- a/cmd/tenant-manager/main_test.go +++ b/cmd/tenantmanager/command_test.go @@ -1,21 +1,16 @@ -package main_test +package tenantmanager_test import ( - "context" - "errors" "os" "testing" "time" - "github.com/stretchr/testify/assert" + "github.com/openkcm/cmk/cmd/tenantmanager" "github.com/stretchr/testify/require" - tenantmanager "github.com/openkcm/cmk/cmd/tenant-manager" "github.com/openkcm/cmk/internal/config" ) -var ErrTest = errors.New("test error") - func TestLoadConfig(t *testing.T) { t.Run("Should return error if config file not found", func(t *testing.T) { _, err := tenantmanager.LoadConfig() @@ -49,24 +44,6 @@ func TestLoadConfig(t *testing.T) { }) } -func TestRunFuncWithSignalHandling(t *testing.T) { - t.Run("success", func(t *testing.T) { - exitCode := tenantmanager.RunFunctionWithSigHandling(func(_ context.Context) error { - return nil - }) - - assert.Equal(t, 0, exitCode) - }) - - t.Run("error", func(t *testing.T) { - exitCode := tenantmanager.RunFunctionWithSigHandling(func(_ context.Context) error { - return ErrTest - }) - - assert.Equal(t, 1, exitCode) - }) -} - func TestStartStatusServer(t *testing.T) { cfg := &config.Config{} @@ -76,10 +53,3 @@ func TestStartStatusServer(t *testing.T) { // Optionally, wait a short time to let the goroutine start time.Sleep(100 * time.Millisecond) } - -func TestRun(t *testing.T) { - t.Run("should fail if no config", func(t *testing.T) { - err := tenantmanager.Run(t.Context()) - require.Error(t, err, "Run should return an error") - }) -} diff --git a/cmd/tenantmanager/export_test.go b/cmd/tenantmanager/export_test.go new file mode 100644 index 00000000..627c8aba --- /dev/null +++ b/cmd/tenantmanager/export_test.go @@ -0,0 +1,6 @@ +package tenantmanager + +var ( + LoadConfig = loadConfig + StartStatusServer = startStatusServer +) diff --git a/cmd/tenant-manager-cli/main.go b/cmd/tenantmanagercli/command.go similarity index 75% rename from cmd/tenant-manager-cli/main.go rename to cmd/tenantmanagercli/command.go index 36f5b34c..1d91f333 100644 --- a/cmd/tenant-manager-cli/main.go +++ b/cmd/tenantmanagercli/command.go @@ -1,11 +1,7 @@ -package main +package tenantmanagercli import ( "context" - "log/slog" - "os" - "os/signal" - "syscall" "github.com/openkcm/common-sdk/pkg/commoncfg" "github.com/openkcm/common-sdk/pkg/logger" @@ -17,43 +13,9 @@ import ( "github.com/openkcm/cmk/internal/config" "github.com/openkcm/cmk/internal/constants" "github.com/openkcm/cmk/internal/db" - "github.com/openkcm/cmk/internal/log" "github.com/openkcm/cmk/tenant-manager/tenant-cli/cmd" ) -func runFuncWithSignalHandling(f func(context.Context, *config.Config) error) int { - ctx, cancel := context.WithCancel(context.Background()) - defer cancel() - - // Create signal channel - sigChan := make(chan os.Signal, 1) - signal.Notify(sigChan, os.Interrupt, syscall.SIGTERM) - - // Handle signals in a separate goroutine - go func() { - <-sigChan - log.Info(ctx, "Interrupt signal received, shutting down...") - cancel() - }() - - cfg, err := loadConfig() - if err != nil { - log.Error(ctx, "Failed to load config:", err) - - return 1 - } - - log.Debug(ctx, "Starting the application", slog.Any("config", cfg)) - - err = f(ctx, cfg) - if err != nil { - log.Error(ctx, "Falied running tenant-manager-cli", err) - return 1 - } - - return 0 -} - func run(ctx context.Context, cfg *config.Config) error { err := logger.InitAsDefault(cfg.Logger, cfg.Application) if err != nil { @@ -122,8 +84,9 @@ func loadConfig() (*config.Config, error) { loader := commoncfg.NewLoader( cfg, commoncfg.WithPaths( + constants.DefaultConfigPath1, + constants.DefaultConfigPath2, ".", - "/etc/tenant-manager-cli", ), commoncfg.WithEnvOverride(constants.APIName), ) @@ -136,7 +99,31 @@ func loadConfig() (*config.Config, error) { return cfg, nil } -func main() { - exitCode := runFuncWithSignalHandling(run) - os.Exit(exitCode) +func Cmd(buildInfo string) *cobra.Command { + var cmd = &cobra.Command{ + Use: "tenant-manager-cli", + Short: "CMK Tenant Manager", + Long: "CMK Tenant Manager CLI - Command Line Interface to manage tenants.", + RunE: func(cmd *cobra.Command, args []string) error { + ctx := cmd.Context() + + // Load Configuration + cfg, err := loadConfig() + if err != nil { + return oops.In("main"). + Wrapf(err, "Failed to load config") + } + + // Update Version + err = commoncfg.UpdateConfigVersion(&cfg.BaseConfig, buildInfo) + if err != nil { + return oops.In("main"). + Wrapf(err, "Failed to update the version configuration") + } + + return run(ctx, cfg) + }, + } + + return cmd } diff --git a/cmd/tenant-manager-cli/main_test.go b/cmd/tenantmanagercli/command_test.go similarity index 58% rename from cmd/tenant-manager-cli/main_test.go rename to cmd/tenantmanagercli/command_test.go index 677fe1db..2c2e12bc 100644 --- a/cmd/tenant-manager-cli/main_test.go +++ b/cmd/tenantmanagercli/command_test.go @@ -1,31 +1,17 @@ -package main_test +package tenantmanagercli_test import ( - "context" - "errors" "os" "testing" + tmCLI "github.com/openkcm/cmk/cmd/tenantmanagercli" "github.com/openkcm/common-sdk/pkg/commoncfg" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - tmCLI "github.com/openkcm/cmk/cmd/tenant-manager-cli" "github.com/openkcm/cmk/internal/config" ) -var errTest = errors.New("test error") - -const ( - validConfigContent = `application: - name: test-app -logger: - level: info` - - invalidConfigContent = `invalid: yaml: content: [ - malformed: yaml` -) - func TestSetupCommands(t *testing.T) { t.Run("Should create root command with all subcommands", func(t *testing.T) { ctx := t.Context() @@ -47,49 +33,6 @@ func TestSetupCommands(t *testing.T) { }) } -func TestRunFunctionWithSigHandling(t *testing.T) { - t.Run("Should return exit code 1 when config loading fails", func(t *testing.T) { - // Setup environment with invalid config to force loading failure - setupTestEnvironment(t, invalidConfigContent) - - testFunc := func(_ context.Context, _ *config.Config) error { - t.Error("Should not reach this point when config loading fails") - return nil - } - - exitCode := tmCLI.RunFunctionWithSigHandling(testFunc) - assert.Equal(t, 1, exitCode) - }) - - t.Run("Should return exit code 1 when run function returns error", func(t *testing.T) { - setupTestEnvironment(t, validConfigContent) - - testFunc := func(_ context.Context, _ *config.Config) error { - return errTest - } - - exitCode := tmCLI.RunFunctionWithSigHandling(testFunc) - assert.Equal(t, 1, exitCode) - }) - - t.Run("Should return exit code 0 when run function succeeds", func(t *testing.T) { - setupTestEnvironment(t, validConfigContent) - - executed := false - testFunc := func(_ context.Context, cfg *config.Config) error { - executed = true - - assert.Equal(t, "test-app", cfg.Application.Name) - - return nil - } - - exitCode := tmCLI.RunFunctionWithSigHandling(testFunc) - assert.Equal(t, 0, exitCode) - assert.True(t, executed) - }) -} - func TestRun(t *testing.T) { t.Run("Should error on invalid logger config", func(t *testing.T) { ctx := t.Context() diff --git a/cmd/tenantmanagercli/export_test.go b/cmd/tenantmanagercli/export_test.go new file mode 100644 index 00000000..562431b2 --- /dev/null +++ b/cmd/tenantmanagercli/export_test.go @@ -0,0 +1,6 @@ +package tenantmanagercli + +var ( + Run = run + SetupCommands = setupCommands +) diff --git a/go.mod b/go.mod index 54f850be..4ef5a0a2 100644 --- a/go.mod +++ b/go.mod @@ -25,6 +25,7 @@ require ( github.com/lib/pq v1.10.9 github.com/looplab/fsm v1.0.3 github.com/magodo/slog2hclog v0.0.0-20240614031327-090ebd72a033 + github.com/mitchellh/go-homedir v1.1.0 github.com/oapi-codegen/nethttp-middleware v1.1.2 github.com/oapi-codegen/runtime v1.1.1 github.com/openkcm/api-sdk v0.7.0 @@ -34,6 +35,7 @@ require ( github.com/prometheus/client_golang v1.23.2 github.com/samber/oops v1.19.3 github.com/spf13/cobra v1.10.1 + github.com/spf13/viper v1.21.0 github.com/stretchr/testify v1.11.1 github.com/testcontainers/testcontainers-go v0.39.0 github.com/testcontainers/testcontainers-go/modules/postgres v0.38.0 @@ -152,7 +154,6 @@ require ( github.com/spf13/afero v1.15.0 // indirect github.com/spf13/cast v1.10.0 // indirect github.com/spf13/pflag v1.0.10 // indirect - github.com/spf13/viper v1.21.0 // indirect github.com/subosito/gotenv v1.6.0 // indirect github.com/tklauser/go-sysconf v0.3.15 // indirect github.com/tklauser/numcpus v0.10.0 // indirect diff --git a/go.sum b/go.sum index c07897ea..7409f3e7 100644 --- a/go.sum +++ b/go.sum @@ -214,6 +214,8 @@ github.com/mcuadros/go-defaults v1.2.0 h1:FODb8WSf0uGaY8elWJAkoLL0Ri6AlZ1bFlenk5 github.com/mcuadros/go-defaults v1.2.0/go.mod h1:WEZtHEVIGYVDqkKSWBdWKUVdRyKlMfulPaGDWIVeCWY= github.com/mdelapenya/tlscert v0.2.0 h1:7H81W6Z/4weDvZBNOfQte5GpIMo0lGYEeWbkGp5LJHI= github.com/mdelapenya/tlscert v0.2.0/go.mod h1:O4njj3ELLnJjGdkN7M/vIVCpZ+Cf0L6muqOG4tLSl8o= +github.com/mitchellh/go-homedir v1.1.0 h1:lukF9ziXFxDFPkA1vsr5zpc1XuPDn/wFntq5mG+4E0Y= +github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= github.com/moby/docker-image-spec v1.3.1 h1:jMKff3w6PgbfSa69GfNg+zN/XLhfXJGnEx3Nl2EsFP0= github.com/moby/docker-image-spec v1.3.1/go.mod h1:eKmb5VW8vQEh/BAr2yvVNvuiJuY6UIocYsFu/DxxRpo= github.com/moby/go-archive v0.1.0 h1:Kk/5rdW/g+H8NHdJW2gsXyZ7UnzvJNOy6VKJqueWdcQ= From 4b37582bc18a49912679be836a2b51cdafea7753 Mon Sep 17 00:00:00 2001 From: Nicolae Nicora Date: Sat, 11 Oct 2025 23:01:45 +0200 Subject: [PATCH 02/14] update the dependencies --- go.mod | 3 +-- go.sum | 2 -- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/go.mod b/go.mod index 4ef5a0a2..54f850be 100644 --- a/go.mod +++ b/go.mod @@ -25,7 +25,6 @@ require ( github.com/lib/pq v1.10.9 github.com/looplab/fsm v1.0.3 github.com/magodo/slog2hclog v0.0.0-20240614031327-090ebd72a033 - github.com/mitchellh/go-homedir v1.1.0 github.com/oapi-codegen/nethttp-middleware v1.1.2 github.com/oapi-codegen/runtime v1.1.1 github.com/openkcm/api-sdk v0.7.0 @@ -35,7 +34,6 @@ require ( github.com/prometheus/client_golang v1.23.2 github.com/samber/oops v1.19.3 github.com/spf13/cobra v1.10.1 - github.com/spf13/viper v1.21.0 github.com/stretchr/testify v1.11.1 github.com/testcontainers/testcontainers-go v0.39.0 github.com/testcontainers/testcontainers-go/modules/postgres v0.38.0 @@ -154,6 +152,7 @@ require ( github.com/spf13/afero v1.15.0 // indirect github.com/spf13/cast v1.10.0 // indirect github.com/spf13/pflag v1.0.10 // indirect + github.com/spf13/viper v1.21.0 // indirect github.com/subosito/gotenv v1.6.0 // indirect github.com/tklauser/go-sysconf v0.3.15 // indirect github.com/tklauser/numcpus v0.10.0 // indirect diff --git a/go.sum b/go.sum index 7409f3e7..c07897ea 100644 --- a/go.sum +++ b/go.sum @@ -214,8 +214,6 @@ github.com/mcuadros/go-defaults v1.2.0 h1:FODb8WSf0uGaY8elWJAkoLL0Ri6AlZ1bFlenk5 github.com/mcuadros/go-defaults v1.2.0/go.mod h1:WEZtHEVIGYVDqkKSWBdWKUVdRyKlMfulPaGDWIVeCWY= github.com/mdelapenya/tlscert v0.2.0 h1:7H81W6Z/4weDvZBNOfQte5GpIMo0lGYEeWbkGp5LJHI= github.com/mdelapenya/tlscert v0.2.0/go.mod h1:O4njj3ELLnJjGdkN7M/vIVCpZ+Cf0L6muqOG4tLSl8o= -github.com/mitchellh/go-homedir v1.1.0 h1:lukF9ziXFxDFPkA1vsr5zpc1XuPDn/wFntq5mG+4E0Y= -github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= github.com/moby/docker-image-spec v1.3.1 h1:jMKff3w6PgbfSa69GfNg+zN/XLhfXJGnEx3Nl2EsFP0= github.com/moby/docker-image-spec v1.3.1/go.mod h1:eKmb5VW8vQEh/BAr2yvVNvuiJuY6UIocYsFu/DxxRpo= github.com/moby/go-archive v0.1.0 h1:Kk/5rdW/g+H8NHdJW2gsXyZ7UnzvJNOy6VKJqueWdcQ= From d8d0a8401e31036dc7100d39d95181b86981443f Mon Sep 17 00:00:00 2001 From: Nicolae Nicora Date: Sat, 11 Oct 2025 23:03:39 +0200 Subject: [PATCH 03/14] update the dependencies --- Taskfile.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Taskfile.yaml b/Taskfile.yaml index c50074b4..9dc0df03 100644 --- a/Taskfile.yaml +++ b/Taskfile.yaml @@ -7,6 +7,6 @@ includes: excludes: [] # put task names in here which are overwritten in this file vars: CODE_DIRS: '{{.ROOT_DIR}}/cmd/... {{.ROOT_DIR}}/internal/... {{.ROOT_DIR}}/apis/... {{.ROOT_DIR}}/providers/... {{.ROOT_DIR}}/tenant-manager/... {{.ROOT_DIR}}/test/... {{.ROOT_DIR}}/utils/...' - COMPONENTS: 'api-server task-scheduler task-worker tenant-manager tenant-manager-cli' + COMPONENTS: 'cmk' REPO_URL: 'https://github.com/openkcm/cmk' From 88ecc26acbcdc5e9b2a71053501ac9f1ab267b2e Mon Sep 17 00:00:00 2001 From: Nicolae Nicora Date: Sat, 11 Oct 2025 23:15:06 +0200 Subject: [PATCH 04/14] fix the lint --- cmd/apiserver/command.go | 2 +- cmd/cmk/main.go | 68 +++++++++++++++++++--------- cmd/taskscheduler/command.go | 2 +- cmd/taskworker/command.go | 6 +-- cmd/tenantmanager/command.go | 4 +- cmd/tenantmanager/command_test.go | 2 +- cmd/tenantmanagercli/command.go | 2 +- cmd/tenantmanagercli/command_test.go | 23 +--------- 8 files changed, 55 insertions(+), 54 deletions(-) diff --git a/cmd/apiserver/command.go b/cmd/apiserver/command.go index 2997de37..fe1a75c1 100644 --- a/cmd/apiserver/command.go +++ b/cmd/apiserver/command.go @@ -207,7 +207,7 @@ func Cmd(buildInfo string) *cobra.Command { Use: "api-server", Short: "CMK API Server", Long: "CMK API Server is a component of the Cloud Key Management system that provides ", - RunE: func(cmd *cobra.Command, args []string) error { + RunE: func(cmd *cobra.Command, _ []string) error { cfg, err := loadConfig(buildInfo) if err != nil { return oops.In("main").Wrapf(err, "failed to load config") diff --git a/cmd/cmk/main.go b/cmd/cmk/main.go index b21e5b99..9e4eb76e 100644 --- a/cmd/cmk/main.go +++ b/cmd/cmk/main.go @@ -3,19 +3,22 @@ package main import ( "context" "fmt" + "log/slog" "os" "os/signal" "syscall" "time" + "github.com/openkcm/common-sdk/pkg/utils" + "github.com/spf13/cobra" + + slogctx "github.com/veqryn/slog-context" + "github.com/openkcm/cmk/cmd/apiserver" "github.com/openkcm/cmk/cmd/taskscheduler" "github.com/openkcm/cmk/cmd/taskworker" "github.com/openkcm/cmk/cmd/tenantmanager" "github.com/openkcm/cmk/cmd/tenantmanagercli" - "github.com/openkcm/common-sdk/pkg/utils" - "github.com/spf13/cobra" - slogctx "github.com/veqryn/slog-context" ) var ( @@ -27,31 +30,42 @@ var ( gracefulShutdownMessage string ) +var versionCmd = &cobra.Command{ + Use: "version", + Short: "CMK Version", + RunE: func(cmd *cobra.Command, _ []string) error { + isVersionCmd = true + + value, err := utils.ExtractFromComplexValue(BuildInfo) + if err != nil { + return err + } + + slog.InfoContext(cmd.Context(), value) + + return nil + }, +} + func rootCmd() *cobra.Command { cmd := &cobra.Command{ Use: "cmk", Short: "OpenKCM CMK - Customer Manager Keys", - Long: `OpenKCM Customer Manager Keys(CMK) is a key management service to manage encryption keys for applications and services.`, + Long: "OpenKCM Customer Manager Keys(CMK) is a key management service to manage " + + "encryption keys for applications and services.", } - cmd.PersistentFlags().Int64Var(&gracefulShutdownSec, "graceful-shutdown", 1, "graceful shutdown seconds") - cmd.PersistentFlags().StringVar(&gracefulShutdownMessage, "graceful-shutdown-message", "Graceful shutdown in %d seconds", - "graceful shutdown message") + cmd.PersistentFlags().Int64Var(&gracefulShutdownSec, "graceful-shutdown", + 1, + "graceful shutdown seconds", + ) + cmd.PersistentFlags().StringVar(&gracefulShutdownMessage, "graceful-shutdown-message", + "Graceful shutdown in %d seconds", + "graceful shutdown message", + ) cmd.AddCommand( - &cobra.Command{ - Use: "version", - Short: "CMK Version", - RunE: func(cmd *cobra.Command, args []string) error { - isVersionCmd = true - value, err := utils.ExtractFromComplexValue(BuildInfo) - if err != nil { - return err - } - fmt.Println(value) - return nil - }, - }, + versionCmd, apiserver.Cmd(BuildInfo), taskscheduler.Cmd(BuildInfo), taskworker.Cmd(BuildInfo), @@ -62,7 +76,7 @@ func rootCmd() *cobra.Command { return cmd } -func main() { +func execute() error { ctx, cancelOnSignal := signal.NotifyContext( context.Background(), os.Interrupt, syscall.SIGTERM, @@ -73,7 +87,8 @@ func main() { if err != nil { slogctx.Error(ctx, "Failed to start the application", "error", err) _, _ = fmt.Fprintln(os.Stderr, err) - os.Exit(1) + + return err } // graceful shutdown so running goroutines may finish @@ -81,4 +96,13 @@ func main() { _, _ = fmt.Fprintln(os.Stderr, fmt.Sprintf(gracefulShutdownMessage, gracefulShutdownSec)) time.Sleep(time.Duration(gracefulShutdownSec) * time.Second) } + + return nil +} + +func main() { + err := execute() + if err != nil { + os.Exit(1) + } } diff --git a/cmd/taskscheduler/command.go b/cmd/taskscheduler/command.go index 8f91dc56..474107b6 100644 --- a/cmd/taskscheduler/command.go +++ b/cmd/taskscheduler/command.go @@ -17,7 +17,7 @@ func Cmd(buildInfo string) *cobra.Command { Use: "task-scheduler", Short: "CMK Task Scheduler", Long: "CMK Task Scheduler - Customizable and efficient task scheduling solution.", - RunE: func(cmd *cobra.Command, args []string) error { + RunE: func(cmd *cobra.Command, _ []string) error { ctx := cmd.Context() defaultValues := map[string]any{} diff --git a/cmd/taskworker/command.go b/cmd/taskworker/command.go index 28ab7d61..5da82f4e 100644 --- a/cmd/taskworker/command.go +++ b/cmd/taskworker/command.go @@ -1,8 +1,6 @@ package taskworker import ( - "context" - "github.com/openkcm/common-sdk/pkg/commoncfg" "github.com/openkcm/common-sdk/pkg/logger" "github.com/samber/oops" @@ -19,8 +17,8 @@ func Cmd(buildInfo string) *cobra.Command { Use: "task-worker", Short: "CMK Task Worker", Long: "CMK Task Worker - A background service that processes tasks asynchronously.", - RunE: func(cmd *cobra.Command, args []string) error { - ctx := context.Background() + RunE: func(cmd *cobra.Command, _ []string) error { + ctx := cmd.Context() defaultValues := map[string]any{} cfg := &config.Config{} diff --git a/cmd/tenantmanager/command.go b/cmd/tenantmanager/command.go index 8ade57eb..a9ca55a5 100644 --- a/cmd/tenantmanager/command.go +++ b/cmd/tenantmanager/command.go @@ -6,7 +6,6 @@ import ( "syscall" "time" - "github.com/openkcm/cmk/internal/constants" "github.com/openkcm/common-sdk/pkg/commoncfg" "github.com/openkcm/common-sdk/pkg/health" "github.com/openkcm/common-sdk/pkg/logger" @@ -16,6 +15,7 @@ import ( "github.com/spf13/cobra" "github.com/openkcm/cmk/internal/config" + "github.com/openkcm/cmk/internal/constants" "github.com/openkcm/cmk/internal/db/dsn" "github.com/openkcm/cmk/internal/log" "github.com/openkcm/cmk/tenant-manager/business" @@ -94,7 +94,7 @@ func Cmd(buildInfo string) *cobra.Command { Use: "tenant-manager", Short: "CMK the Tenant Manager", Long: `CMK Tenant Manager - a service to manage tenants.`, - RunE: func(cmd *cobra.Command, args []string) error { + RunE: func(cmd *cobra.Command, _ []string) error { ctx := cmd.Context() // Load Configuration diff --git a/cmd/tenantmanager/command_test.go b/cmd/tenantmanager/command_test.go index 6c01ec8c..5f9370f2 100644 --- a/cmd/tenantmanager/command_test.go +++ b/cmd/tenantmanager/command_test.go @@ -5,9 +5,9 @@ import ( "testing" "time" - "github.com/openkcm/cmk/cmd/tenantmanager" "github.com/stretchr/testify/require" + "github.com/openkcm/cmk/cmd/tenantmanager" "github.com/openkcm/cmk/internal/config" ) diff --git a/cmd/tenantmanagercli/command.go b/cmd/tenantmanagercli/command.go index 1d91f333..7eb975b8 100644 --- a/cmd/tenantmanagercli/command.go +++ b/cmd/tenantmanagercli/command.go @@ -104,7 +104,7 @@ func Cmd(buildInfo string) *cobra.Command { Use: "tenant-manager-cli", Short: "CMK Tenant Manager", Long: "CMK Tenant Manager CLI - Command Line Interface to manage tenants.", - RunE: func(cmd *cobra.Command, args []string) error { + RunE: func(cmd *cobra.Command, _ []string) error { ctx := cmd.Context() // Load Configuration diff --git a/cmd/tenantmanagercli/command_test.go b/cmd/tenantmanagercli/command_test.go index 2c2e12bc..3db5ee6b 100644 --- a/cmd/tenantmanagercli/command_test.go +++ b/cmd/tenantmanagercli/command_test.go @@ -1,14 +1,13 @@ package tenantmanagercli_test import ( - "os" "testing" - tmCLI "github.com/openkcm/cmk/cmd/tenantmanagercli" "github.com/openkcm/common-sdk/pkg/commoncfg" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + tmCLI "github.com/openkcm/cmk/cmd/tenantmanagercli" "github.com/openkcm/cmk/internal/config" ) @@ -76,23 +75,3 @@ func TestRun(t *testing.T) { assert.Contains(t, err.Error(), "Failed to initialise db connection") }) } - -// Helper function to create a temporary test environment with config file -func setupTestEnvironment(t *testing.T, configContent string) { - t.Helper() - - tempDir := t.TempDir() - t.Chdir(tempDir) - - if configContent != "" { - writeConfigFile(t, configContent) - } -} - -// Helper function to write config file -func writeConfigFile(t *testing.T, content string) { - t.Helper() - - err := os.WriteFile("config.yaml", []byte(content), 0600) - require.NoError(t, err) -} From 3a8f9a33c6cc063ebc1c47bc20ace0702016b405 Mon Sep 17 00:00:00 2001 From: Nicolae Nicora Date: Sat, 11 Oct 2025 23:25:09 +0200 Subject: [PATCH 05/14] adjustments on the chart --- charts/cmk/templates/deployment.yaml | 20 +++++--- charts/cmk/templates/hpa.yaml | 16 +++--- charts/cmk/templates/pdb.yaml | 12 ++--- charts/cmk/values.yaml | 75 +++++++++++++++------------- 4 files changed, 66 insertions(+), 57 deletions(-) diff --git a/charts/cmk/templates/deployment.yaml b/charts/cmk/templates/deployment.yaml index ad1527b4..0a436228 100644 --- a/charts/cmk/templates/deployment.yaml +++ b/charts/cmk/templates/deployment.yaml @@ -6,7 +6,7 @@ metadata: labels: {{- include "cmk.labels" . | nindent 4 }} spec: - {{- if not .Values.autoscaling.enabled }} + {{- if not .Values.hpa.enabled }} replicas: {{ .Values.replicaCount }} {{- end }} selector: @@ -14,13 +14,13 @@ spec: {{- include "cmk.selectorLabels" . | nindent 6 }} template: metadata: - {{- with .Values.podAnnotations }} + {{- with .Values.pod.annotations }} annotations: {{- toYaml . | nindent 8 }} {{- end }} labels: {{- include "cmk.labels" . | nindent 8 }} - {{- with .Values.podLabels }} + {{- with .Values.pod.labels }} {{- toYaml . | nindent 8 }} {{- end }} spec: @@ -29,7 +29,7 @@ spec: {{- toYaml . | nindent 8 }} {{- end }} serviceAccountName: {{ include "cmk.serviceAccountName" . }} - {{- with .Values.podSecurityContext }} + {{- with .Values.pod.securityContext }} securityContext: {{- toYaml . | nindent 8 }} {{- end }} @@ -108,15 +108,19 @@ spec: {{- with .Values.extraVolumes }} {{- toYaml . | nindent 8 }} {{- end }} - {{- with .Values.nodeSelector }} + {{- with .Values.pod.nodeSelector }} nodeSelector: {{- toYaml . | nindent 8 }} {{- end }} - {{- with .Values.affinity }} + {{- with .Values.pod.affinity }} affinity: {{- toYaml . | nindent 8 }} {{- end }} - {{- with .Values.tolerations }} + {{- with .Values.pod.topologySpreadConstraints }} + topologySpreadConstraints: + {{- toYaml . | nindent 6 }} + {{- end }} + {{- with .Values.pod.tolerations }} tolerations: - {{- toYaml . | nindent 8 }} + {{- toYaml . | nindent 6 }} {{- end }} diff --git a/charts/cmk/templates/hpa.yaml b/charts/cmk/templates/hpa.yaml index 3e6941c0..cb351f2a 100644 --- a/charts/cmk/templates/hpa.yaml +++ b/charts/cmk/templates/hpa.yaml @@ -1,4 +1,4 @@ -{{- if .Values.autoscaling.enabled }} +{{- if .Values.hpa.enabled }} apiVersion: autoscaling/v2 kind: HorizontalPodAutoscaler metadata: @@ -10,25 +10,25 @@ spec: apiVersion: apps/v1 kind: Deployment name: {{ include "cmk.fullname" . }} - minReplicas: {{ .Values.autoscaling.minReplicas }} - maxReplicas: {{ .Values.autoscaling.maxReplicas }} + minReplicas: {{ .Values.hpa.minReplicas }} + maxReplicas: {{ .Values.hpa.maxReplicas }} metrics: - {{- if or .Values.autoscaling.targetCPUUtilizationPercentage .Values.autoscaling.targetMemoryUtilizationPercentage }} - {{- if .Values.autoscaling.targetCPUUtilizationPercentage }} + {{- if or .Values.hpa.targetCPUUtilizationPercentage .Values.hpa.targetMemoryUtilizationPercentage }} + {{- if .Values.hpa.targetCPUUtilizationPercentage }} - type: Resource resource: name: cpu target: type: Utilization - averageUtilization: {{ .Values.autoscaling.targetCPUUtilizationPercentage }} + averageUtilization: {{ .Values.hpa.targetCPUUtilizationPercentage }} {{- end }} - {{- if .Values.autoscaling.targetMemoryUtilizationPercentage }} + {{- if .Values.hpa.targetMemoryUtilizationPercentage }} - type: Resource resource: name: memory target: type: Utilization - averageUtilization: {{ .Values.autoscaling.targetMemoryUtilizationPercentage }} + averageUtilization: {{ .Values.hpa.targetMemoryUtilizationPercentage }} {{- end }} {{- else }} [] diff --git a/charts/cmk/templates/pdb.yaml b/charts/cmk/templates/pdb.yaml index 48eaa680..078b8f0d 100644 --- a/charts/cmk/templates/pdb.yaml +++ b/charts/cmk/templates/pdb.yaml @@ -1,4 +1,4 @@ -{{- if .Values.podDisruptionBudget.enabled }} +{{- if .Values.pod.disruptionBudget.enabled }} --- apiVersion: policy/v1 kind: PodDisruptionBudget @@ -11,13 +11,13 @@ spec: selector: matchLabels: {{- include "cmk.selectorLabels" . | nindent 6 }} - {{- if not (or (hasKey .Values.podDisruptionBudget "minAvailable") (hasKey .Values.podDisruptionBudget "maxUnavailable")) }} + {{- if not (or (hasKey .Values.pod.disruptionBudget "minAvailable") (hasKey .Values.pod.disruptionBudget "maxUnavailable")) }} minAvailable: 1 # Default value because minAvailable and maxUnavailable are not set {{- end }} - {{- if hasKey .Values.podDisruptionBudget "minAvailable" }} - minAvailable: {{ .Values.podDisruptionBudget.minAvailable }} + {{- if hasKey .Values.pod.disruptionBudget "minAvailable" }} + minAvailable: {{ .Values.pod.disruptionBudget.minAvailable }} {{- end }} - {{- if hasKey .Values.podDisruptionBudget "maxUnavailable" }} - maxUnavailable: {{ .Values.podDisruptionBudget.maxUnavailable }} + {{- if hasKey .Values.pod.disruptionBudget "maxUnavailable" }} + maxUnavailable: {{ .Values.pod.disruptionBudget.maxUnavailable }} {{- end }} {{- end }} diff --git a/charts/cmk/values.yaml b/charts/cmk/values.yaml index d9a46ae3..9953b68b 100644 --- a/charts/cmk/values.yaml +++ b/charts/cmk/values.yaml @@ -76,15 +76,46 @@ serviceAccount: # If not set and create is true, a name is generated using the fullname template name: "" -# This is for setting Kubernetes Annotations to a Pod. -# For more information checkout: https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/ -podAnnotations: {} -# This is for setting Kubernetes Labels to a Pod. -# For more information checkout: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/ -podLabels: {} +pod: + # This is for setting Kubernetes Annotations to a Pod. + # For more information checkout: https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/ + annotations: { } + + # This is for setting Kubernetes Labels to a Pod. + # For more information checkout: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/ + labels: {} + + securityContext: {} + # fsGroup: 2000 + + disruptionBudget: + # Enable or disable the PodDisruptionBudget resource. + # + # This prevents downtime during voluntary disruptions such as during a Node upgrade. + # For example, the PodDisruptionBudget will block `kubectl drain` + # Pod is currently running. + enabled: false + + # This configures the minimum available pods for disruptions. It can either be set to + # an integer (e.g. 1) or a percentage value (e.g. 25%). + # It cannot be used if `maxUnavailable` is set. + # +docs:property + # +docs:type=unknown + # minAvailable: 1 + + # This configures the maximum unavailable pods for disruptions. It can either be set to + # an integer (e.g. 1) or a percentage value (e.g. 25%). + # it cannot be used if `minAvailable` is set. + # +docs:property + # +docs:type=unknown + # maxUnavailable: 1 + nodeSelector: { } + tolerations: [ ] + affinity: { } + topologySpreadConstraints: [] + + -podSecurityContext: {} -# fsGroup: 2000 securityContext: {} # capabilities: @@ -94,27 +125,6 @@ securityContext: {} # runAsNonRoot: true # runAsUser: 1000 -podDisruptionBudget: - # Enable or disable the PodDisruptionBudget resource. - # - # This prevents downtime during voluntary disruptions such as during a Node upgrade. - # For example, the PodDisruptionBudget will block `kubectl drain` - # Pod is currently running. - enabled: false - - # This configures the minimum available pods for disruptions. It can either be set to - # an integer (e.g. 1) or a percentage value (e.g. 25%). - # It cannot be used if `maxUnavailable` is set. - # +docs:property - # +docs:type=unknown - # minAvailable: 1 - - # This configures the maximum unavailable pods for disruptions. It can either be set to - # an integer (e.g. 1) or a percentage value (e.g. 25%). - # it cannot be used if `minAvailable` is set. - # +docs:property - # +docs:type=unknown - # maxUnavailable: 1 # This is for setting up a service more information can be found here: https://kubernetes.io/docs/concepts/services-networking/service/ service: @@ -160,7 +170,7 @@ readinessProbe: periodSeconds: 10 # This section is for setting up autoscaling more information can be found here: https://kubernetes.io/docs/concepts/workloads/autoscaling/ -autoscaling: +hpa: enabled: false minReplicas: 1 maxReplicas: 1 @@ -185,9 +195,6 @@ extraEnvs: [] # Additional envsFrom on the output Deployment definition. extraEnvsFrom: [] -nodeSelector: {} - -tolerations: [] ports: - name: http-status @@ -197,8 +204,6 @@ ports: containerPort: 8081 protocol: TCP -affinity: {} - application: isImmutable: false # Environment where the application is running From be0d66c4029cfae630ebd9ba64eaf7ca366aeb49 Mon Sep 17 00:00:00 2001 From: Nicolae Nicora Date: Sun, 12 Oct 2025 12:48:20 +0200 Subject: [PATCH 06/14] adjustments --- Makefile | 2 +- cmd/apiserver/command.go | 2 +- cmd/cmk/main.go | 2 - cmd/tenantmanager/cli/command.go | 20 +++ cmd/tenantmanager/command.go | 7 +- cmd/tenantmanagercli/command.go | 129 ------------------ cmd/tenantmanagercli/command_test.go | 77 ----------- cmd/tenantmanagercli/export_test.go | 6 - .../keyconfiguration_tags_controller_test.go | 2 +- internal/db/connection.go | 4 +- internal/db/db.go | 12 +- internal/db/dialect/postgres.go | 2 +- internal/manager/certificate_test.go | 4 +- internal/manager/group_test.go | 2 +- internal/manager/key.go | 2 +- internal/manager/system.go | 2 +- internal/manager/system_test.go | 6 +- internal/manager/workflow.go | 4 +- .../tenant-manager}/business/business.go | 2 +- .../tenant-manager}/business/business_test.go | 2 +- .../tenant-manager/cli}/README.md | 0 .../tenant-manager/cli}/cli_test.go | 55 +++----- internal/tenant-manager/cli/command.go | 120 ++++++++++++++++ .../tenant-manager/cli}/creategroupscmd.go | 25 ++-- .../tenant-manager/cli}/createtenantcmd.go | 29 ++-- .../tenant-manager/cli}/db_test.go | 4 +- .../tenant-manager/cli}/deletetenantcmd.go | 24 ++-- .../tenant-manager/cli}/errors.go | 2 +- .../tenant-manager/cli}/gettenantcmd.go | 23 +++- .../tenant-manager/cli}/listtenantscmd.go | 20 +-- .../tenant-manager/cli}/updatetenantcmd.go | 26 ++-- .../tenant-manager/cli}/utils.go | 2 +- .../tenant-manager}/db/db.go | 0 .../tenant-manager}/db/db_test.go | 2 +- .../tenant-manager}/db/errors.go | 0 .../tenant-manager}/operator/errors.go | 0 .../tenant-manager}/operator/export_test.go | 0 .../tenant-manager}/operator/operator.go | 2 +- .../tenant-manager}/operator/operator_test.go | 2 +- .../tenant-manager}/operator/probe.go | 0 .../tenant-manager}/operator/probe_test.go | 4 +- internal/testutils/db.go | 4 +- internal/testutils/grpc.go | 2 +- tenant-manager/VERSION | 1 - tenant-manager/tenant-cli/cmd/commands.go | 20 --- tenant-manager/tenant-cli/cmd/rootcmd.go | 48 ------- 46 files changed, 295 insertions(+), 409 deletions(-) create mode 100644 cmd/tenantmanager/cli/command.go delete mode 100644 cmd/tenantmanagercli/command.go delete mode 100644 cmd/tenantmanagercli/command_test.go delete mode 100644 cmd/tenantmanagercli/export_test.go rename {tenant-manager => internal/tenant-manager}/business/business.go (97%) rename {tenant-manager => internal/tenant-manager}/business/business_test.go (97%) rename {tenant-manager/tenant-cli/cmd => internal/tenant-manager/cli}/README.md (100%) rename {tenant-manager/integration => internal/tenant-manager/cli}/cli_test.go (76%) create mode 100644 internal/tenant-manager/cli/command.go rename {tenant-manager/tenant-cli/cmd => internal/tenant-manager/cli}/creategroupscmd.go (68%) rename {tenant-manager/tenant-cli/cmd => internal/tenant-manager/cli}/createtenantcmd.go (70%) rename {tenant-manager/integration => internal/tenant-manager/cli}/db_test.go (99%) rename {tenant-manager/tenant-cli/cmd => internal/tenant-manager/cli}/deletetenantcmd.go (69%) rename {tenant-manager/tenant-cli/cmd => internal/tenant-manager/cli}/errors.go (96%) rename {tenant-manager/tenant-cli/cmd => internal/tenant-manager/cli}/gettenantcmd.go (63%) rename {tenant-manager/tenant-cli/cmd => internal/tenant-manager/cli}/listtenantscmd.go (69%) rename {tenant-manager/tenant-cli/cmd => internal/tenant-manager/cli}/updatetenantcmd.go (65%) rename {tenant-manager/tenant-cli/cmd => internal/tenant-manager/cli}/utils.go (98%) rename {tenant-manager/internal => internal/tenant-manager}/db/db.go (100%) rename {tenant-manager/internal => internal/tenant-manager}/db/db_test.go (99%) rename {tenant-manager/internal => internal/tenant-manager}/db/errors.go (100%) rename {tenant-manager/internal => internal/tenant-manager}/operator/errors.go (100%) rename {tenant-manager/internal => internal/tenant-manager}/operator/export_test.go (100%) rename {tenant-manager/internal => internal/tenant-manager}/operator/operator.go (99%) rename {tenant-manager/internal => internal/tenant-manager}/operator/operator_test.go (99%) rename {tenant-manager/internal => internal/tenant-manager}/operator/probe.go (100%) rename {tenant-manager/internal => internal/tenant-manager}/operator/probe_test.go (99%) delete mode 100644 tenant-manager/VERSION delete mode 100644 tenant-manager/tenant-cli/cmd/commands.go delete mode 100644 tenant-manager/tenant-cli/cmd/rootcmd.go diff --git a/Makefile b/Makefile index 51bb6fa1..8748542c 100644 --- a/Makefile +++ b/Makefile @@ -56,7 +56,7 @@ test: install-gotestsum spin-postgres-db spin-rabbitmq build_test_plugins --rerun-fails-max-failures=1550 \ --format testname \ --junitfile junit.xml \ - --packages="./internal/... ./providers/... ./utils... ./cmd/... ./tenant-manager/..." \ + --packages="./internal/... ./providers/... ./utils... ./cmd/..." \ -- -count=1 -covermode=atomic -coverpkg=./... -parallel=$$PARALLEL \ -args -test.gocoverdir=$$(pwd)/cover; \ } || status=$$?; \ diff --git a/cmd/apiserver/command.go b/cmd/apiserver/command.go index fe1a75c1..c02ba682 100644 --- a/cmd/apiserver/command.go +++ b/cmd/apiserver/command.go @@ -95,7 +95,7 @@ func monitorKeystorePoolSize( dbCon, err := db.StartDBConnection(cfg.Database, cfg.DatabaseReplicas) if err != nil { - log.Error(ctx, "failed to initialize DB Connection", err) + log.Error(ctx, "failed to initialize db Connection", err) } pool := manager.NewPool(sql.NewRepository(dbCon)) diff --git a/cmd/cmk/main.go b/cmd/cmk/main.go index 9e4eb76e..59a10d18 100644 --- a/cmd/cmk/main.go +++ b/cmd/cmk/main.go @@ -18,7 +18,6 @@ import ( "github.com/openkcm/cmk/cmd/taskscheduler" "github.com/openkcm/cmk/cmd/taskworker" "github.com/openkcm/cmk/cmd/tenantmanager" - "github.com/openkcm/cmk/cmd/tenantmanagercli" ) var ( @@ -70,7 +69,6 @@ func rootCmd() *cobra.Command { taskscheduler.Cmd(BuildInfo), taskworker.Cmd(BuildInfo), tenantmanager.Cmd(BuildInfo), - tenantmanagercli.Cmd(BuildInfo), ) return cmd diff --git a/cmd/tenantmanager/cli/command.go b/cmd/tenantmanager/cli/command.go new file mode 100644 index 00000000..f510bb13 --- /dev/null +++ b/cmd/tenantmanager/cli/command.go @@ -0,0 +1,20 @@ +package cli + +import ( + "github.com/spf13/cobra" + + "github.com/openkcm/cmk/internal/tenant-manager/cli" +) + +func Cmd() *cobra.Command { + factory := cli.NewCommandFactory() + + return cli.InitWithCommandFactory( + factory.NewCreateGroupsCmd(), + factory.NewCreateTenantCmd(), + factory.NewDeleteTenantCmd(), + factory.NewGetTenantCmd(), + factory.NewListTenantsCmd(), + factory.NewUpdateTenantCmd(), + ) +} diff --git a/cmd/tenantmanager/command.go b/cmd/tenantmanager/command.go index a9ca55a5..eda5ff3a 100644 --- a/cmd/tenantmanager/command.go +++ b/cmd/tenantmanager/command.go @@ -14,11 +14,12 @@ import ( "github.com/samber/oops" "github.com/spf13/cobra" + "github.com/openkcm/cmk/cmd/tenantmanager/cli" "github.com/openkcm/cmk/internal/config" "github.com/openkcm/cmk/internal/constants" "github.com/openkcm/cmk/internal/db/dsn" "github.com/openkcm/cmk/internal/log" - "github.com/openkcm/cmk/tenant-manager/business" + "github.com/openkcm/cmk/internal/tenant-manager/business" ) const ( @@ -139,5 +140,9 @@ func Cmd(buildInfo string) *cobra.Command { }, } + cmd.AddCommand( + cli.Cmd(), + ) + return cmd } diff --git a/cmd/tenantmanagercli/command.go b/cmd/tenantmanagercli/command.go deleted file mode 100644 index 7eb975b8..00000000 --- a/cmd/tenantmanagercli/command.go +++ /dev/null @@ -1,129 +0,0 @@ -package tenantmanagercli - -import ( - "context" - - "github.com/openkcm/common-sdk/pkg/commoncfg" - "github.com/openkcm/common-sdk/pkg/logger" - "github.com/samber/oops" - "github.com/spf13/cobra" - - multitenancy "github.com/bartventer/gorm-multitenancy/v8" - - "github.com/openkcm/cmk/internal/config" - "github.com/openkcm/cmk/internal/constants" - "github.com/openkcm/cmk/internal/db" - "github.com/openkcm/cmk/tenant-manager/tenant-cli/cmd" -) - -func run(ctx context.Context, cfg *config.Config) error { - err := logger.InitAsDefault(cfg.Logger, cfg.Application) - if err != nil { - return oops.In("main").Wrapf(err, "Failed to initialise the logger") - } - - dbCon, err := db.StartDB(ctx, cfg.Database, cfg.Provisioning, cfg.DatabaseReplicas) - if err != nil { - return oops.In("main").Wrapf(err, "Failed to initialise db connection") - } - - rootCmd := setupCommands(ctx, dbCon) - - err = rootCmd.ExecuteContext(ctx) - if err != nil { - return oops.In("main").Wrapf(err, "error executing command") - } - - return nil -} - -// setupCommands creates and configures all CLI commands and flags -func setupCommands(ctx context.Context, dbCon *multitenancy.DB) *cobra.Command { - var ( - id, region, status string - sleep bool - ) - - factory := cmd.NewCommandFactory(dbCon) - rootCmd := factory.NewRootCmd(ctx) - rootCmd.PersistentFlags().BoolVar(&sleep, "sleep", false, "Enable sleep mode") - - createGroupsCmd := factory.NewCreateGroupsCmd(ctx) - createGroupsCmd.Flags().StringVarP(&id, "id", "i", "", "Tenant id") - rootCmd.AddCommand(createGroupsCmd) - - createCmd := factory.NewCreateTenantCmd(ctx) - createCmd.Flags().StringVarP(&id, "id", "i", "", "Tenant id") - createCmd.Flags().StringVarP(®ion, "region", "r", "", "Tenant region") - createCmd.Flags().StringVarP(&status, "status", "s", "", "Tenant status") - rootCmd.AddCommand(createCmd) - - deleteTenantCmd := factory.NewDeleteTenantCmd(ctx) - deleteTenantCmd.Flags().StringVarP(&id, "id", "i", "", "Tenant id") - rootCmd.AddCommand(deleteTenantCmd) - - getTenantCmd := factory.NewGetTenantCmd(ctx) - getTenantCmd.Flags().StringVarP(&id, "id", "i", "", "Tenant id") - rootCmd.AddCommand(getTenantCmd) - - listTenantsCmd := factory.NewListTenantsCmd(ctx) - rootCmd.AddCommand(listTenantsCmd) - - updateTenantCmd := factory.NewUpdateTenantCmd(ctx) - updateTenantCmd.Flags().StringVarP(&id, "id", "i", "", "Tenant id") - updateTenantCmd.Flags().StringVarP(®ion, "region", "r", "", "Tenant region") - updateTenantCmd.Flags().StringVarP(&status, "status", "s", "", "Tenant status") - rootCmd.AddCommand(updateTenantCmd) - - return rootCmd -} - -func loadConfig() (*config.Config, error) { - cfg := &config.Config{} - - loader := commoncfg.NewLoader( - cfg, - commoncfg.WithPaths( - constants.DefaultConfigPath1, - constants.DefaultConfigPath2, - ".", - ), - commoncfg.WithEnvOverride(constants.APIName), - ) - - err := loader.LoadConfig() - if err != nil { - return nil, oops.In("main").Wrapf(err, "failed to load config") - } - - return cfg, nil -} - -func Cmd(buildInfo string) *cobra.Command { - var cmd = &cobra.Command{ - Use: "tenant-manager-cli", - Short: "CMK Tenant Manager", - Long: "CMK Tenant Manager CLI - Command Line Interface to manage tenants.", - RunE: func(cmd *cobra.Command, _ []string) error { - ctx := cmd.Context() - - // Load Configuration - cfg, err := loadConfig() - if err != nil { - return oops.In("main"). - Wrapf(err, "Failed to load config") - } - - // Update Version - err = commoncfg.UpdateConfigVersion(&cfg.BaseConfig, buildInfo) - if err != nil { - return oops.In("main"). - Wrapf(err, "Failed to update the version configuration") - } - - return run(ctx, cfg) - }, - } - - return cmd -} diff --git a/cmd/tenantmanagercli/command_test.go b/cmd/tenantmanagercli/command_test.go deleted file mode 100644 index 3db5ee6b..00000000 --- a/cmd/tenantmanagercli/command_test.go +++ /dev/null @@ -1,77 +0,0 @@ -package tenantmanagercli_test - -import ( - "testing" - - "github.com/openkcm/common-sdk/pkg/commoncfg" - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/require" - - tmCLI "github.com/openkcm/cmk/cmd/tenantmanagercli" - "github.com/openkcm/cmk/internal/config" -) - -func TestSetupCommands(t *testing.T) { - t.Run("Should create root command with all subcommands", func(t *testing.T) { - ctx := t.Context() - - rootCmd := tmCLI.SetupCommands(ctx, nil) - - assert.NotNil(t, rootCmd) - assert.NotEmpty(t, rootCmd.Use) - assert.NotNil(t, rootCmd.PersistentFlags().Lookup("sleep")) - - commands := rootCmd.Commands() - t.Logf("Found %d commands", len(commands)) - - for _, cmd := range commands { - t.Logf("Command: %s", cmd.Name()) - } - - assert.GreaterOrEqual(t, len(commands), 1, "Root command should be created") - }) -} - -func TestRun(t *testing.T) { - t.Run("Should error on invalid logger config", func(t *testing.T) { - ctx := t.Context() - - cfg := &config.Config{ - BaseConfig: commoncfg.BaseConfig{ - Logger: commoncfg.Logger{ - Level: "invalid-level", - Format: "invalid-format", - Formatter: commoncfg.LoggerFormatter{ - Time: commoncfg.LoggerTime{ - Type: "unix", - Precision: "*#md1", - }, - }, - }, - }, - } - - err := tmCLI.Run(ctx, cfg) - - require.Error(t, err) - assert.Contains(t, err.Error(), "Failed to initialise the logger") - }) - - t.Run("Should error on invalid database config", func(t *testing.T) { - ctx := t.Context() - - cfg := &config.Config{ - BaseConfig: commoncfg.BaseConfig{ - Logger: commoncfg.Logger{ - Level: "info", - Format: "json", - }, - }, - Database: config.Database{}, - } - - err := tmCLI.Run(ctx, cfg) - require.Error(t, err) - assert.Contains(t, err.Error(), "Failed to initialise db connection") - }) -} diff --git a/cmd/tenantmanagercli/export_test.go b/cmd/tenantmanagercli/export_test.go deleted file mode 100644 index 562431b2..00000000 --- a/cmd/tenantmanagercli/export_test.go +++ /dev/null @@ -1,6 +0,0 @@ -package tenantmanagercli - -var ( - Run = run - SetupCommands = setupCommands -) diff --git a/internal/controllers/cmk/keyconfiguration_tags_controller_test.go b/internal/controllers/cmk/keyconfiguration_tags_controller_test.go index d31b730e..0d1da033 100644 --- a/internal/controllers/cmk/keyconfiguration_tags_controller_test.go +++ b/internal/controllers/cmk/keyconfiguration_tags_controller_test.go @@ -19,7 +19,7 @@ import ( cmkcontext "github.com/openkcm/cmk/utils/context" ) -// startAPIKeyConfigTags starts the API server and returns a DB connection and a mux for testing +// startAPIKeyConfigTags starts the API server and returns a db connection and a mux for testing func startAPIKeyConfigTags(t *testing.T) (*multitenancy.DB, *http.ServeMux, string) { t.Helper() diff --git a/internal/db/connection.go b/internal/db/connection.go index 3bcd9ad9..0385800b 100644 --- a/internal/db/connection.go +++ b/internal/db/connection.go @@ -21,7 +21,7 @@ var ( ErrLoadingReplicaDialectors = errors.New("error loading replica dialectors") ) -// StartDBConnection opens DB connection using data from `config.DB`. +// StartDBConnection opens db connection using data from `config.db`. func StartDBConnection( conf config.Database, replicas []config.Database, @@ -29,7 +29,7 @@ func StartDBConnection( return StartDBConnectionPlugins(conf, replicas, map[string]gorm.Plugin{}) } -// StartDBConnectionPlugins opens DB connection using data from `config.DB` +// StartDBConnectionPlugins opens db connection using data from `config.db` // and plugins that are passed in a form of map because GORM config stores // them this way. // It is an extension of `StartDBConnection` functionality. diff --git a/internal/db/db.go b/internal/db/db.go index bb4ae199..d5c4c221 100644 --- a/internal/db/db.go +++ b/internal/db/db.go @@ -32,30 +32,30 @@ var ( const DBLogDomain = "db" -// StartDB starts DB connection and runs migrations +// StartDB starts db connection and runs migrations func StartDB( ctx context.Context, dbConf config.Database, provisioning config.Provisioning, replicas []config.Database, ) (*multitenancy.DB, error) { - log.Info(ctx, "Starting DB connection ") + log.Info(ctx, "Starting db connection ") dbCon, err := StartDBConnection(dbConf, replicas) if err != nil { - return nil, oops.In(DBLogDomain).Wrapf(err, "failed to initialize DB Connection") + return nil, oops.In(DBLogDomain).Wrapf(err, "failed to initialize db Connection") } dbCon = dbCon.WithContext(ctx) - log.Info(ctx, "Starting DB migration") + log.Info(ctx, "Starting db migration") err = migrate(ctx, dbCon) if err != nil { return nil, oops.In(DBLogDomain).Wrapf(err, "failed to run table creation migration") } - log.Info(ctx, "DB migration finished") + log.Info(ctx, "db migration finished") err = addKeystoreFromConfig(ctx, dbCon, provisioning.InitKeystoreConfig) if err != nil { @@ -65,7 +65,7 @@ func StartDB( return dbCon, nil } -// migrate runs DB migrations +// migrate runs db migrations func migrate(ctx context.Context, db *multitenancy.DB) error { err := db.RegisterModels( ctx, diff --git a/internal/db/dialect/postgres.go b/internal/db/dialect/postgres.go index 2677e15e..dba0481b 100644 --- a/internal/db/dialect/postgres.go +++ b/internal/db/dialect/postgres.go @@ -8,7 +8,7 @@ import ( ) // NewFrom returns a postgres dialector. -// Hint: `dsn` package contains utility to convert `config.DB` to DSN string that can be passed here. +// Hint: `dsn` package contains utility to convert `config.db` to DSN string that can be passed here. func NewFrom(dsn string) gorm.Dialector { return pg.New(pg.Config{ Config: postgres.Config{ diff --git a/internal/manager/certificate_test.go b/internal/manager/certificate_test.go index 2f6d60bf..d8130b83 100644 --- a/internal/manager/certificate_test.go +++ b/internal/manager/certificate_test.go @@ -313,7 +313,7 @@ func TestCertificateManager_GetDefaultClientCert(t *testing.T) { assert.Nil(t, cert) }) - t.Run("Failed to get default keystore certificate with DB error", func(t *testing.T) { + t.Run("Failed to get default keystore certificate with db error", func(t *testing.T) { forced := testutils.NewDBErrorForced(db, ErrForced) forced.Register() @@ -333,7 +333,7 @@ func TestCertificateManager_GetDefaultClientCert(t *testing.T) { assert.NotNil(t, cert) }) - t.Run("Failed to get default HYOK certificate with DB error", func(t *testing.T) { + t.Run("Failed to get default HYOK certificate with db error", func(t *testing.T) { forced := testutils.NewDBErrorForced(db, ErrForced) forced.Register() diff --git a/internal/manager/group_test.go b/internal/manager/group_test.go index 82d55380..98dc0a56 100644 --- a/internal/manager/group_test.go +++ b/internal/manager/group_test.go @@ -292,7 +292,7 @@ func TestUpdateGroup(t *testing.T) { assert.Error(t, err) }) - t.Run("Should error on rename with DB error", func(t *testing.T) { + t.Run("Should error on rename with db error", func(t *testing.T) { forced := testutils.NewDBErrorForced(db, ErrForced) forced.WithUpdate().Register() diff --git a/internal/manager/key.go b/internal/manager/key.go index 71e52cb5..3f6f2137 100644 --- a/internal/manager/key.go +++ b/internal/manager/key.go @@ -767,7 +767,7 @@ func (km *KeyManager) fetchImportParams(ctx context.Context, key *model.Key) (*m if err != nil { return nil, err } - // Set ImportParams in DB + // Set ImportParams in db err = km.repo.Transaction(ctx, func(ctx context.Context, r repo.Repo) error { err = r.Set(ctx, importParams) if err != nil { diff --git a/internal/manager/system.go b/internal/manager/system.go index e7ce5d24..c606da8b 100644 --- a/internal/manager/system.go +++ b/internal/manager/system.go @@ -418,7 +418,7 @@ func (m *SystemManager) createSystemIfNotExists(ctx context.Context, newSystem * } ctx = log.InjectSystem(ctx, newSystem) - log.Info(ctx, "Found new system from registry, adding to CMK DB") + log.Info(ctx, "Found new system from registry, adding to CMK db") err := m.repo.Create(ctx, newSystem) if err != nil { diff --git a/internal/manager/system_test.go b/internal/manager/system_test.go index 8d9ea1b1..e99e04b7 100644 --- a/internal/manager/system_test.go +++ b/internal/manager/system_test.go @@ -633,7 +633,7 @@ func TestRefreshSystems(t *testing.T) { } testutils.CreateTestEntities(ctx, t, r, existingSystem) - t.Run("No systems in registry - systems in DB remain unchanged", func(t *testing.T) { + t.Run("No systems in registry - systems in db remain unchanged", func(t *testing.T) { // Act m.RefreshSystemsData(ctx) // Verify @@ -649,7 +649,7 @@ func TestRefreshSystems(t *testing.T) { assert.Equal(t, existingSystem.ID, systems[0].ID) }) - t.Run("No systems for current tenant in registry - systems in DB remain unchanged", func(t *testing.T) { + t.Run("No systems for current tenant in registry - systems in db remain unchanged", func(t *testing.T) { // Prepare existingSystems := []*model.System{} existingSystemsCount, _ := r.List(ctx, &model.System{}, &existingSystems, *repo.NewQuery()) @@ -736,7 +736,7 @@ func TestRefreshSystems(t *testing.T) { assert.Equal(t, region, foundSystem.Region) }) - t.Run("Same System in a different region returned by the registry - two different systems in DB", func(t *testing.T) { + t.Run("Same System in a different region returned by the registry - two different systems in db", func(t *testing.T) { // Prepare existingSystems := []*model.System{} existingSystemsCount, _ := r.List(ctx, &model.System{}, &existingSystems, *repo.NewQuery()) diff --git a/internal/manager/workflow.go b/internal/manager/workflow.go index 18a83d28..b9060544 100644 --- a/internal/manager/workflow.go +++ b/internal/manager/workflow.go @@ -301,7 +301,7 @@ func (w *WorkflowManager) TransitionWorkflow( // addApprovers adds the specified approvers to the workflow // and transitions the workflow to the next state. -// This is wrapped in a transaction to ensure that DB state is consistent +// This is wrapped in a transaction to ensure that db state is consistent func (w *WorkflowManager) addApprovers( ctx context.Context, userID uuid.UUID, @@ -373,7 +373,7 @@ func (w *WorkflowManager) checkOngoingWorkflowForArtifact( // updateApproverDecisionAndApplyTransition updates the approver // decision and applies the transition to the wf. -// This is wrapped in a transaction to ensure that DB state is +// This is wrapped in a transaction to ensure that db state is // consistent in case of errors. func (w *WorkflowManager) applyTransition( ctx context.Context, diff --git a/tenant-manager/business/business.go b/internal/tenant-manager/business/business.go similarity index 97% rename from tenant-manager/business/business.go rename to internal/tenant-manager/business/business.go index cba10bc0..23d0264c 100644 --- a/tenant-manager/business/business.go +++ b/internal/tenant-manager/business/business.go @@ -12,7 +12,7 @@ import ( "github.com/openkcm/cmk/internal/config" "github.com/openkcm/cmk/internal/db" "github.com/openkcm/cmk/internal/log" - "github.com/openkcm/cmk/tenant-manager/internal/operator" + "github.com/openkcm/cmk/internal/tenant-manager/operator" ) const logDomain = "business" diff --git a/tenant-manager/business/business_test.go b/internal/tenant-manager/business/business_test.go similarity index 97% rename from tenant-manager/business/business_test.go rename to internal/tenant-manager/business/business_test.go index 9d7735a0..d4e460da 100644 --- a/tenant-manager/business/business_test.go +++ b/internal/tenant-manager/business/business_test.go @@ -8,8 +8,8 @@ import ( "github.com/stretchr/testify/assert" "github.com/openkcm/cmk/internal/config" + "github.com/openkcm/cmk/internal/tenant-manager/business" "github.com/openkcm/cmk/internal/testutils" - "github.com/openkcm/cmk/tenant-manager/business" ) func TestBusinessMain(t *testing.T) { diff --git a/tenant-manager/tenant-cli/cmd/README.md b/internal/tenant-manager/cli/README.md similarity index 100% rename from tenant-manager/tenant-cli/cmd/README.md rename to internal/tenant-manager/cli/README.md diff --git a/tenant-manager/integration/cli_test.go b/internal/tenant-manager/cli/cli_test.go similarity index 76% rename from tenant-manager/integration/cli_test.go rename to internal/tenant-manager/cli/cli_test.go index ec7fdf60..c6fd141e 100644 --- a/tenant-manager/integration/cli_test.go +++ b/internal/tenant-manager/cli/cli_test.go @@ -1,4 +1,4 @@ -package integration_test +package cli_test import ( "bytes" @@ -16,9 +16,9 @@ import ( tenantgrpc "github.com/openkcm/api-sdk/proto/kms/api/cmk/registry/tenant/v1" "github.com/openkcm/cmk/internal/model" + "github.com/openkcm/cmk/internal/tenant-manager/cli" + tmdb "github.com/openkcm/cmk/internal/tenant-manager/db" "github.com/openkcm/cmk/internal/testutils" - tmdb "github.com/openkcm/cmk/tenant-manager/internal/db" - "github.com/openkcm/cmk/tenant-manager/tenant-cli/cmd" integrationutils "github.com/openkcm/cmk/test/integration_utils" "github.com/openkcm/cmk/utils/base62" ) @@ -29,10 +29,6 @@ type CLISuite struct { cancel context.CancelFunc db *multitenancy.DB - sleep bool - id string - status string - region string rootCmd *cobra.Command createGroupsCmd *cobra.Command createCmd *cobra.Command @@ -48,36 +44,21 @@ func (s *CLISuite) SetupSuite() { Models: []driver.TenantTabler{&model.Tenant{}, &model.Group{}}, }) - factory := cmd.NewCommandFactory(s.db) - s.rootCmd = factory.NewRootCmd(s.T().Context()) - s.rootCmd.PersistentFlags().BoolVar(&s.sleep, "sleep", false, "Enable sleep mode") - - s.createGroupsCmd = factory.NewCreateGroupsCmd(s.T().Context()) - s.createGroupsCmd.Flags().StringVarP(&s.id, "id", "i", "", "Tenant id") - s.rootCmd.AddCommand(s.createGroupsCmd) - - s.createCmd = factory.NewCreateTenantCmd(s.T().Context()) - s.createCmd.Flags().StringVarP(&s.id, "id", "i", "", "Tenant id") - s.createCmd.Flags().StringVarP(&s.region, "region", "r", "", "Tenant region") - s.createCmd.Flags().StringVarP(&s.status, "status", "s", "", "Tenant status") - s.rootCmd.AddCommand(s.createCmd) - - s.deleteTenantCmd = factory.NewDeleteTenantCmd(s.T().Context()) - s.deleteTenantCmd.Flags().StringVarP(&s.id, "id", "i", "", "Tenant id") - s.rootCmd.AddCommand(s.deleteTenantCmd) - - s.getTenantCmd = factory.NewGetTenantCmd(s.T().Context()) - s.getTenantCmd.Flags().StringVarP(&s.id, "id", "i", "", "Tenant id") - s.rootCmd.AddCommand(s.getTenantCmd) - - s.listTenantsCmd = factory.NewListTenantsCmd(s.T().Context()) - s.rootCmd.AddCommand(s.listTenantsCmd) - - s.updateTenantCmd = factory.NewUpdateTenantCmd(s.T().Context()) - s.updateTenantCmd.Flags().StringVarP(&s.id, "id", "i", "", "Tenant id") - s.updateTenantCmd.Flags().StringVarP(&s.region, "region", "r", "", "Tenant region") - s.updateTenantCmd.Flags().StringVarP(&s.status, "status", "s", "", "Tenant status") - s.rootCmd.AddCommand(s.updateTenantCmd) + factory := cli.NewCommandFactoryWithDB(s.db) + s.createGroupsCmd = factory.NewCreateGroupsCmd() + s.createCmd = factory.NewCreateTenantCmd() + s.deleteTenantCmd = factory.NewDeleteTenantCmd() + s.getTenantCmd = factory.NewGetTenantCmd() + s.listTenantsCmd = factory.NewListTenantsCmd() + s.updateTenantCmd = factory.NewUpdateTenantCmd() + s.rootCmd = cli.InitWithCommandFactory( + s.createGroupsCmd, + s.createCmd, + s.deleteTenantCmd, + s.getTenantCmd, + s.listTenantsCmd, + s.updateTenantCmd, + ) } func (s *CLISuite) TearDownSuite() { diff --git a/internal/tenant-manager/cli/command.go b/internal/tenant-manager/cli/command.go new file mode 100644 index 00000000..bb006360 --- /dev/null +++ b/internal/tenant-manager/cli/command.go @@ -0,0 +1,120 @@ +package cli + +import ( + "context" + "os" + "os/signal" + "syscall" + + "github.com/openkcm/common-sdk/pkg/commoncfg" + "github.com/openkcm/common-sdk/pkg/logger" + "github.com/samber/oops" + "github.com/spf13/cobra" + + multitenancy "github.com/bartventer/gorm-multitenancy/v8" + + "github.com/openkcm/cmk/internal/config" + "github.com/openkcm/cmk/internal/constants" + "github.com/openkcm/cmk/internal/db" +) + +var ( + id, region, status string + sleep bool +) + +type CommandFactory struct { + dbConn *multitenancy.DB +} + +func NewCommandFactory() *CommandFactory { + return &CommandFactory{} +} + +func NewCommandFactoryWithDB(dbConn *multitenancy.DB) *CommandFactory { + return &CommandFactory{ + dbConn: dbConn, + } +} + +func loadConfig() (*config.Config, error) { + cfg := &config.Config{} + + loader := commoncfg.NewLoader( + cfg, + commoncfg.WithPaths( + constants.DefaultConfigPath1, + constants.DefaultConfigPath2, + ".", + ), + commoncfg.WithEnvOverride(constants.APIName), + ) + + err := loader.LoadConfig() + if err != nil { + return nil, oops.Hint("failed to load config").Wrap(err) + } + + err = logger.InitAsDefault(cfg.Logger, cfg.Application) + if err != nil { + return nil, oops.Hint("Unable to initialize logger").Wrap(err) + } + + return cfg, nil +} + +func (f *CommandFactory) db(ctx context.Context) (*multitenancy.DB, error) { + if f.dbConn != nil { + return f.dbConn, nil + } + + cfg, err := loadConfig() + if err != nil { + return nil, oops.Hint("failed to load config").Wrap(err) + } + + dbCon, err := db.StartDB(ctx, cfg.Database, cfg.Provisioning, cfg.DatabaseReplicas) + if err != nil { + return nil, oops.Hint("Check database configuration").Wrap(err) + } + + f.dbConn = dbCon + + return f.dbConn, err +} + +func InitWithCommandFactory(cmds ...*cobra.Command) *cobra.Command { + cmd := &cobra.Command{ + Use: "cli", + Short: "Tenant Manager CLI Application", + Long: "Tenant Manager is a simple CLI tool to manage tenants, supporting: creating tenant, " + + "creating tenant with groups, " + + "creating groups, " + + "updating of region and status field on a tenant entity in public table, " + + "updating of group names, " + + "changing any field value in any table of a tenant schema.", + + PersistentPreRunE: func(_ *cobra.Command, _ []string) error { + return nil + }, + + Run: func(cmd *cobra.Command, _ []string) { + sleep, _ := cmd.Flags().GetBool("sleep") + if sleep { + cmd.Println("Pod running...") + + sigs := make(chan os.Signal, 1) + signal.Notify(sigs, syscall.SIGINT, syscall.SIGTERM) + + <-sigs + cmd.Println("Shutting down gracefully...") + } + }, + } + + cmd.PersistentFlags().BoolVar(&sleep, "sleep", false, "Enable sleep mode") + + cmd.AddCommand(cmds...) + + return cmd +} diff --git a/tenant-manager/tenant-cli/cmd/creategroupscmd.go b/internal/tenant-manager/cli/creategroupscmd.go similarity index 68% rename from tenant-manager/tenant-cli/cmd/creategroupscmd.go rename to internal/tenant-manager/cli/creategroupscmd.go index 33d99566..60c7d98f 100644 --- a/tenant-manager/tenant-cli/cmd/creategroupscmd.go +++ b/internal/tenant-manager/cli/creategroupscmd.go @@ -1,24 +1,24 @@ -package cmd +package cli import ( - "context" "errors" "github.com/spf13/cobra" "github.com/openkcm/cmk/internal/repo/sql" - tmdb "github.com/openkcm/cmk/tenant-manager/internal/db" + tmdb "github.com/openkcm/cmk/internal/tenant-manager/db" ) -func (f *CommandFactory) NewCreateGroupsCmd(ctx context.Context) *cobra.Command { +func (f *CommandFactory) NewCreateGroupsCmd() *cobra.Command { cmd := &cobra.Command{ Use: "add-default-groups", Short: "Create a group for tenant. Usage: tm add-default-groups -i [tenant id]", Long: "Create a group for tenant. Usage: tm add-default-groups --id [tenant id]", Args: cobra.ExactArgs(0), - //nolint:contextcheck RunE: func(cmd *cobra.Command, _ []string) error { + ctx := cmd.Context() + id, _ := cmd.Flags().GetString("id") if id == "" { cmd.Println("Tenant id is required") @@ -26,17 +26,22 @@ func (f *CommandFactory) NewCreateGroupsCmd(ctx context.Context) *cobra.Command return nil } - ctx := cmd.Context() - r := sql.NewRepository(f.dbCon) + dbCon, err := f.db(ctx) + if err != nil { + cmd.Printf("Failed to connect to database: %v\n", err) + return nil + } + + r := sql.NewRepository(dbCon) - tenant := FindTenant(ctx, cmd, id, f.r) + tenant := FindTenant(ctx, cmd, id, r) if tenant == nil { cmd.Printf("Tenant with id %s not found\n", id) return nil } - err := tmdb.CreateDefaultGroups(cmd.Context(), tenant, r) + err = tmdb.CreateDefaultGroups(ctx, tenant, r) if err != nil { if errors.Is(err, tmdb.ErrOnboardingInProgress) { cmd.Printf("Default groups for tenant already exists") @@ -53,7 +58,7 @@ func (f *CommandFactory) NewCreateGroupsCmd(ctx context.Context) *cobra.Command }, } - cmd.SetContext(ctx) + cmd.Flags().StringVarP(&id, "id", "i", "", "Tenant id") return cmd } diff --git a/tenant-manager/tenant-cli/cmd/createtenantcmd.go b/internal/tenant-manager/cli/createtenantcmd.go similarity index 70% rename from tenant-manager/tenant-cli/cmd/createtenantcmd.go rename to internal/tenant-manager/cli/createtenantcmd.go index 77540b85..4255ca95 100644 --- a/tenant-manager/tenant-cli/cmd/createtenantcmd.go +++ b/internal/tenant-manager/cli/createtenantcmd.go @@ -1,7 +1,6 @@ -package cmd +package cli import ( - "context" "errors" "github.com/spf13/cobra" @@ -9,22 +8,24 @@ import ( multitenancy "github.com/bartventer/gorm-multitenancy/v8" "github.com/openkcm/cmk/internal/model" - tmdb "github.com/openkcm/cmk/tenant-manager/internal/db" + tmdb "github.com/openkcm/cmk/internal/tenant-manager/db" "github.com/openkcm/cmk/utils/base62" ) -func (f *CommandFactory) NewCreateTenantCmd(ctx context.Context) *cobra.Command { +//nolint:funlen +func (f *CommandFactory) NewCreateTenantCmd() *cobra.Command { cmd := &cobra.Command{ Use: "create", Short: "Create a new tenant. Usage: tm create -i [tenant id] -r [tenant region] -s [tenant status]", Long: "Create a new tenant. Usage: tm create -id [tenant id] -region [tenant region] -status [tenant status]", Args: cobra.ExactArgs(0), - //nolint:contextcheck RunE: func(cmd *cobra.Command, _ []string) error { - id, _ := cmd.Flags().GetString("id") - region, _ := cmd.Flags().GetString("region") - status, _ := cmd.Flags().GetString("status") + ctx := cmd.Context() + + id, _ = cmd.Flags().GetString("id") + region, _ = cmd.Flags().GetString("region") + status, _ = cmd.Flags().GetString("status") if id == "" || region == "" || status == "" { cmd.Println("Tenant id, is required") @@ -57,7 +58,13 @@ func (f *CommandFactory) NewCreateTenantCmd(ctx context.Context) *cobra.Command }, } - err = tmdb.CreateSchema(cmd.Context(), f.dbCon, tenant) + dbCon, err := f.db(ctx) + if err != nil { + cmd.Printf("Failed to connect to database: %v\n", err) + return nil + } + + err = tmdb.CreateSchema(ctx, dbCon, tenant) if err != nil { if errors.Is(err, tmdb.ErrOnboardingInProgress) { cmd.Printf("Tenant with ID: %s already exists", tenant.ID) @@ -72,7 +79,9 @@ func (f *CommandFactory) NewCreateTenantCmd(ctx context.Context) *cobra.Command }, } - cmd.SetContext(ctx) + cmd.Flags().StringVarP(&id, "id", "i", "", "Tenant id") + cmd.Flags().StringVarP(®ion, "region", "r", "", "Tenant region") + cmd.Flags().StringVarP(&status, "status", "s", "", "Tenant status") return cmd } diff --git a/tenant-manager/integration/db_test.go b/internal/tenant-manager/cli/db_test.go similarity index 99% rename from tenant-manager/integration/db_test.go rename to internal/tenant-manager/cli/db_test.go index fd557605..3580a040 100644 --- a/tenant-manager/integration/db_test.go +++ b/internal/tenant-manager/cli/db_test.go @@ -1,4 +1,4 @@ -package integration_test +package cli_test import ( "context" @@ -18,8 +18,8 @@ import ( "github.com/openkcm/cmk/internal/model" sqlRepo "github.com/openkcm/cmk/internal/repo/sql" + tmdb "github.com/openkcm/cmk/internal/tenant-manager/db" "github.com/openkcm/cmk/internal/testutils" - tmdb "github.com/openkcm/cmk/tenant-manager/internal/db" integrationutils "github.com/openkcm/cmk/test/integration_utils" "github.com/openkcm/cmk/utils/base62" ) diff --git a/tenant-manager/tenant-cli/cmd/deletetenantcmd.go b/internal/tenant-manager/cli/deletetenantcmd.go similarity index 69% rename from tenant-manager/tenant-cli/cmd/deletetenantcmd.go rename to internal/tenant-manager/cli/deletetenantcmd.go index 9d231f9b..c18fd586 100644 --- a/tenant-manager/tenant-cli/cmd/deletetenantcmd.go +++ b/internal/tenant-manager/cli/deletetenantcmd.go @@ -1,7 +1,6 @@ -package cmd +package cli import ( - "context" "fmt" "github.com/spf13/cobra" @@ -10,34 +9,43 @@ import ( "github.com/openkcm/cmk/internal/model" "github.com/openkcm/cmk/internal/repo" + "github.com/openkcm/cmk/internal/repo/sql" ) -func (f *CommandFactory) NewDeleteTenantCmd(ctx context.Context) *cobra.Command { +func (f *CommandFactory) NewDeleteTenantCmd() *cobra.Command { cmd := &cobra.Command{ Use: "delete", Short: "Delete a new tenant. Usage: tm create -i [tenant id] -r [tenant region] -s [tenant status]", Long: "Delete a new tenant. Usage: tm create -id [tenant id] -region [tenant region] -status [tenant status]", Args: cobra.ExactArgs(0), - //nolint:contextcheck RunE: func(cmd *cobra.Command, _ []string) error { + ctx := cmd.Context() + id, _ := cmd.Flags().GetString("id") if id == "" { cmd.Println("Tenant id is required") return ErrTenantIDRequired } - tenant := FindTenant(cmd.Context(), cmd, id, f.r) + dbCon, err := f.db(ctx) + if err != nil { + cmd.Printf("Failed to connect to database: %v\n", err) + return nil + } + + r := sql.NewRepository(dbCon) + tenant := FindTenant(cmd.Context(), cmd, id, r) cmd.Printf("Deleting tenant. Id: %s, SchemaName: %s\n", tenant.ID, tenant.SchemaName) - err := DropSchema(f.dbCon, tenant.SchemaName) + err = DropSchema(dbCon, tenant.SchemaName) if err != nil { cmd.PrintErrf("%v %v\n", ErrDeleteTenant, err) return err } - _, err = f.r.Delete(cmd.Context(), &model.Tenant{ID: id}, *repo.NewQuery()) + _, err = r.Delete(ctx, &model.Tenant{ID: id}, *repo.NewQuery()) if err != nil { cmd.PrintErrf("%v %v\n", ErrDeleteTenant, err) return err @@ -49,7 +57,7 @@ func (f *CommandFactory) NewDeleteTenantCmd(ctx context.Context) *cobra.Command }, } - cmd.SetContext(ctx) + cmd.Flags().StringVarP(&id, "id", "i", "", "Tenant id") return cmd } diff --git a/tenant-manager/tenant-cli/cmd/errors.go b/internal/tenant-manager/cli/errors.go similarity index 96% rename from tenant-manager/tenant-cli/cmd/errors.go rename to internal/tenant-manager/cli/errors.go index 0f321684..ba065fc7 100644 --- a/tenant-manager/tenant-cli/cmd/errors.go +++ b/internal/tenant-manager/cli/errors.go @@ -1,4 +1,4 @@ -package cmd +package cli import "errors" diff --git a/tenant-manager/tenant-cli/cmd/gettenantcmd.go b/internal/tenant-manager/cli/gettenantcmd.go similarity index 63% rename from tenant-manager/tenant-cli/cmd/gettenantcmd.go rename to internal/tenant-manager/cli/gettenantcmd.go index 668ddc38..a6675923 100644 --- a/tenant-manager/tenant-cli/cmd/gettenantcmd.go +++ b/internal/tenant-manager/cli/gettenantcmd.go @@ -1,21 +1,23 @@ -package cmd +package cli import ( - "context" "encoding/json" "github.com/spf13/cobra" + + "github.com/openkcm/cmk/internal/repo/sql" ) -func (f *CommandFactory) NewGetTenantCmd(ctx context.Context) *cobra.Command { +func (f *CommandFactory) NewGetTenantCmd() *cobra.Command { cmd := &cobra.Command{ Use: "get", Short: "Get tenant by id. Usage: tm get -i [tenant id]", Long: "Get tenant by id. Usage: tm get --id [tenant id]", Args: cobra.ExactArgs(0), - //nolint:contextcheck RunE: func(cmd *cobra.Command, _ []string) error { + ctx := cmd.Context() + id, _ := cmd.Flags().GetString("id") if id == "" { @@ -23,7 +25,15 @@ func (f *CommandFactory) NewGetTenantCmd(ctx context.Context) *cobra.Command { return ErrTenantIDRequired } - tenant := FindTenant(cmd.Context(), cmd, id, f.r) + dbCon, err := f.db(ctx) + if err != nil { + cmd.Printf("Failed to connect to database: %v\n", err) + return nil + } + + r := sql.NewRepository(dbCon) + + tenant := FindTenant(ctx, cmd, id, r) if tenant == nil { cmd.Printf("Tenant with id %s not found\n", id) return ErrTenantNotFound @@ -39,8 +49,7 @@ func (f *CommandFactory) NewGetTenantCmd(ctx context.Context) *cobra.Command { return nil }, } - - cmd.SetContext(ctx) + cmd.Flags().StringVarP(&id, "id", "i", "", "Tenant id") return cmd } diff --git a/tenant-manager/tenant-cli/cmd/listtenantscmd.go b/internal/tenant-manager/cli/listtenantscmd.go similarity index 69% rename from tenant-manager/tenant-cli/cmd/listtenantscmd.go rename to internal/tenant-manager/cli/listtenantscmd.go index d8ea3fa3..764b339a 100644 --- a/tenant-manager/tenant-cli/cmd/listtenantscmd.go +++ b/internal/tenant-manager/cli/listtenantscmd.go @@ -1,27 +1,33 @@ -package cmd +package cli import ( - "context" - "github.com/spf13/cobra" "github.com/openkcm/cmk/internal/model" "github.com/openkcm/cmk/internal/repo" + "github.com/openkcm/cmk/internal/repo/sql" ) -func (f *CommandFactory) NewListTenantsCmd(ctx context.Context) *cobra.Command { +func (f *CommandFactory) NewListTenantsCmd() *cobra.Command { cmd := &cobra.Command{ Use: "list", Short: "List all tenants. Usage: tm list", Long: "List all tenants. Usage: tm list", - //nolint:contextcheck RunE: func(cmd *cobra.Command, _ []string) error { ctx := cmd.Context() + dbCon, err := f.db(ctx) + if err != nil { + cmd.Printf("Failed to connect to database: %v\n", err) + return nil + } + + r := sql.NewRepository(dbCon) + var tenants []model.Tenant - _, err := f.r.List( + _, err = r.List( ctx, &model.Tenant{}, &tenants, *repo.NewQuery(), ) if err != nil { @@ -40,7 +46,5 @@ func (f *CommandFactory) NewListTenantsCmd(ctx context.Context) *cobra.Command { }, } - cmd.SetContext(ctx) - return cmd } diff --git a/tenant-manager/tenant-cli/cmd/updatetenantcmd.go b/internal/tenant-manager/cli/updatetenantcmd.go similarity index 65% rename from tenant-manager/tenant-cli/cmd/updatetenantcmd.go rename to internal/tenant-manager/cli/updatetenantcmd.go index a7cdac12..3a96bfdf 100644 --- a/tenant-manager/tenant-cli/cmd/updatetenantcmd.go +++ b/internal/tenant-manager/cli/updatetenantcmd.go @@ -1,15 +1,14 @@ -package cmd +package cli import ( - "context" - "github.com/spf13/cobra" "github.com/openkcm/cmk/internal/model" "github.com/openkcm/cmk/internal/repo" + "github.com/openkcm/cmk/internal/repo/sql" ) -func (f *CommandFactory) NewUpdateTenantCmd(ctx context.Context) *cobra.Command { +func (f *CommandFactory) NewUpdateTenantCmd() *cobra.Command { cmd := &cobra.Command{ Use: "update", Short: "Update existing tenant. Usage: tm update -i [tenant id] (-r [tenant region]) (-s [tenant status])", @@ -17,8 +16,9 @@ func (f *CommandFactory) NewUpdateTenantCmd(ctx context.Context) *cobra.Command "(--region [tenant region]) (--status [tenant status])", Args: cobra.ExactArgs(0), - //nolint:contextcheck RunE: func(cmd *cobra.Command, _ []string) error { + ctx := cmd.Context() + id, _ := cmd.Flags().GetString("id") region, _ := cmd.Flags().GetString("region") status, _ := cmd.Flags().GetString("status") @@ -28,9 +28,15 @@ func (f *CommandFactory) NewUpdateTenantCmd(ctx context.Context) *cobra.Command return ErrTenantIDRequired } - ctx := cmd.Context() + dbCon, err := f.db(ctx) + if err != nil { + cmd.Printf("Failed to connect to database: %v\n", err) + return nil + } + + r := sql.NewRepository(dbCon) - tenant := FindTenant(ctx, cmd, id, f.r) + tenant := FindTenant(ctx, cmd, id, r) query := repo.NewQuery() @@ -42,7 +48,7 @@ func (f *CommandFactory) NewUpdateTenantCmd(ctx context.Context) *cobra.Command tenant.Region = region } - _, err := f.r.Patch(ctx, tenant, *query) + _, err = r.Patch(ctx, tenant, *query) if err != nil { cmd.PrintErrf("Failed to update tenant: %v\n", err) return err @@ -54,7 +60,9 @@ func (f *CommandFactory) NewUpdateTenantCmd(ctx context.Context) *cobra.Command }, } - cmd.SetContext(ctx) + cmd.Flags().StringVarP(&id, "id", "i", "", "Tenant id") + cmd.Flags().StringVarP(®ion, "region", "r", "", "Tenant region") + cmd.Flags().StringVarP(&status, "status", "s", "", "Tenant status") return cmd } diff --git a/tenant-manager/tenant-cli/cmd/utils.go b/internal/tenant-manager/cli/utils.go similarity index 98% rename from tenant-manager/tenant-cli/cmd/utils.go rename to internal/tenant-manager/cli/utils.go index f8262b30..e54bbdbc 100644 --- a/tenant-manager/tenant-cli/cmd/utils.go +++ b/internal/tenant-manager/cli/utils.go @@ -1,4 +1,4 @@ -package cmd +package cli import ( "context" diff --git a/tenant-manager/internal/db/db.go b/internal/tenant-manager/db/db.go similarity index 100% rename from tenant-manager/internal/db/db.go rename to internal/tenant-manager/db/db.go diff --git a/tenant-manager/internal/db/db_test.go b/internal/tenant-manager/db/db_test.go similarity index 99% rename from tenant-manager/internal/db/db_test.go rename to internal/tenant-manager/db/db_test.go index e5e7c91e..c97e34c2 100644 --- a/tenant-manager/internal/db/db_test.go +++ b/internal/tenant-manager/db/db_test.go @@ -12,8 +12,8 @@ import ( "github.com/openkcm/cmk/internal/constants" "github.com/openkcm/cmk/internal/model" + "github.com/openkcm/cmk/internal/tenant-manager/db" "github.com/openkcm/cmk/internal/testutils" - "github.com/openkcm/cmk/tenant-manager/internal/db" integrationutils "github.com/openkcm/cmk/test/integration_utils" "github.com/openkcm/cmk/utils/base62" ) diff --git a/tenant-manager/internal/db/errors.go b/internal/tenant-manager/db/errors.go similarity index 100% rename from tenant-manager/internal/db/errors.go rename to internal/tenant-manager/db/errors.go diff --git a/tenant-manager/internal/operator/errors.go b/internal/tenant-manager/operator/errors.go similarity index 100% rename from tenant-manager/internal/operator/errors.go rename to internal/tenant-manager/operator/errors.go diff --git a/tenant-manager/internal/operator/export_test.go b/internal/tenant-manager/operator/export_test.go similarity index 100% rename from tenant-manager/internal/operator/export_test.go rename to internal/tenant-manager/operator/export_test.go diff --git a/tenant-manager/internal/operator/operator.go b/internal/tenant-manager/operator/operator.go similarity index 99% rename from tenant-manager/internal/operator/operator.go rename to internal/tenant-manager/operator/operator.go index 92b6bc52..5f7bca82 100644 --- a/tenant-manager/internal/operator/operator.go +++ b/internal/tenant-manager/operator/operator.go @@ -23,7 +23,7 @@ import ( "github.com/openkcm/cmk/internal/model" "github.com/openkcm/cmk/internal/repo" "github.com/openkcm/cmk/internal/repo/sql" - tmdb "github.com/openkcm/cmk/tenant-manager/internal/db" + tmdb "github.com/openkcm/cmk/internal/tenant-manager/db" "github.com/openkcm/cmk/utils/base62" ) diff --git a/tenant-manager/internal/operator/operator_test.go b/internal/tenant-manager/operator/operator_test.go similarity index 99% rename from tenant-manager/internal/operator/operator_test.go rename to internal/tenant-manager/operator/operator_test.go index 4e147643..7d348395 100644 --- a/tenant-manager/internal/operator/operator_test.go +++ b/internal/tenant-manager/operator/operator_test.go @@ -24,8 +24,8 @@ import ( "github.com/openkcm/cmk/internal/clients/registry/tenants" "github.com/openkcm/cmk/internal/model" + "github.com/openkcm/cmk/internal/tenant-manager/operator" "github.com/openkcm/cmk/internal/testutils" - "github.com/openkcm/cmk/tenant-manager/internal/operator" integrationutils "github.com/openkcm/cmk/test/integration_utils" tmdb "github.com/openkcm/cmk/utils/base62" ) diff --git a/tenant-manager/internal/operator/probe.go b/internal/tenant-manager/operator/probe.go similarity index 100% rename from tenant-manager/internal/operator/probe.go rename to internal/tenant-manager/operator/probe.go diff --git a/tenant-manager/internal/operator/probe_test.go b/internal/tenant-manager/operator/probe_test.go similarity index 99% rename from tenant-manager/internal/operator/probe_test.go rename to internal/tenant-manager/operator/probe_test.go index 58c204e5..74a66a27 100644 --- a/tenant-manager/internal/operator/probe_test.go +++ b/internal/tenant-manager/operator/probe_test.go @@ -13,9 +13,9 @@ import ( "github.com/openkcm/cmk/internal/constants" "github.com/openkcm/cmk/internal/model" "github.com/openkcm/cmk/internal/repo/sql" + "github.com/openkcm/cmk/internal/tenant-manager/db" + "github.com/openkcm/cmk/internal/tenant-manager/operator" "github.com/openkcm/cmk/internal/testutils" - "github.com/openkcm/cmk/tenant-manager/internal/db" - "github.com/openkcm/cmk/tenant-manager/internal/operator" ) const ( diff --git a/internal/testutils/db.go b/internal/testutils/db.go index 4eeeae01..ec55c8a9 100644 --- a/internal/testutils/db.go +++ b/internal/testutils/db.go @@ -228,7 +228,7 @@ type TestDBConfig struct { // By default it creates only one tenant TenantCount int - // If true create DB instance for test instead of tenant + // If true create db instance for test instead of tenant RequiresMultitenancyOrShared bool // Tables that the test should contain @@ -255,7 +255,7 @@ func processNameForDB(n string) string { // If cfg.RequiresMultitenancy create a separate database to test multitenancy // // This is intended for internal use. In most cases please use NewTestDB -// to setup a DB for unit tests +// to setup a db for unit tests func newTestDBCon(tb testing.TB, cfg TestDBConfig) *multitenancy.DB { tb.Helper() diff --git a/internal/testutils/grpc.go b/internal/testutils/grpc.go index c203527e..b6e2621f 100644 --- a/internal/testutils/grpc.go +++ b/internal/testutils/grpc.go @@ -60,7 +60,7 @@ func NewGRPCSuite( } // NewGRPCServer is mostly used for internal reasons. -// In most cases please use NewGRPCSuite to set up a DB for unit tests +// In most cases please use NewGRPCSuite to set up a db for unit tests func NewGRPCServer( tb testing.TB, address string, diff --git a/tenant-manager/VERSION b/tenant-manager/VERSION deleted file mode 100644 index 45c7a584..00000000 --- a/tenant-manager/VERSION +++ /dev/null @@ -1 +0,0 @@ -v0.0.1 diff --git a/tenant-manager/tenant-cli/cmd/commands.go b/tenant-manager/tenant-cli/cmd/commands.go deleted file mode 100644 index 1ee8e09d..00000000 --- a/tenant-manager/tenant-cli/cmd/commands.go +++ /dev/null @@ -1,20 +0,0 @@ -package cmd - -import ( - multitenancy "github.com/bartventer/gorm-multitenancy/v8" - - "github.com/openkcm/cmk/internal/repo" - "github.com/openkcm/cmk/internal/repo/sql" -) - -type CommandFactory struct { - dbCon *multitenancy.DB - r repo.Repo -} - -func NewCommandFactory(dbCon *multitenancy.DB) *CommandFactory { - return &CommandFactory{ - dbCon: dbCon, - r: sql.NewRepository(dbCon), - } -} diff --git a/tenant-manager/tenant-cli/cmd/rootcmd.go b/tenant-manager/tenant-cli/cmd/rootcmd.go deleted file mode 100644 index 919608ec..00000000 --- a/tenant-manager/tenant-cli/cmd/rootcmd.go +++ /dev/null @@ -1,48 +0,0 @@ -package cmd - -import ( - "context" - "os" - "os/signal" - "syscall" - - "github.com/spf13/cobra" -) - -func (f *CommandFactory) NewRootCmd(ctx context.Context) *cobra.Command { - rootCmd := &cobra.Command{ - Use: "tm", - Short: "Tenant Manager CLI Application", - Long: "Tenant Manager is a simple CLI tool to manage tenants, supporting: creating tenant, " + - "creating tenant with groups, " + - "creating groups, " + - "updating of region and status field on a tenant entity in public table, " + - "updating of group names, " + - "changing any field value in any table of a tenant schema.", - - PersistentPreRunE: func(_ *cobra.Command, _ []string) error { - return nil - }, - - Run: func(cmd *cobra.Command, _ []string) { - sleep, _ := cmd.Flags().GetBool("sleep") - if sleep { - infiniteRun(cmd) - } - }, - } - - rootCmd.SetContext(ctx) - - return rootCmd -} - -func infiniteRun(cmd *cobra.Command) { - cmd.Println("Pod running...") - - sigs := make(chan os.Signal, 1) - signal.Notify(sigs, syscall.SIGINT, syscall.SIGTERM) - - <-sigs - cmd.Println("Shutting down gracefully...") -} From 110b7e9a6d9f31d46f60f3003cc599e6780dcbb4 Mon Sep 17 00:00:00 2001 From: Nicolae Nicora Date: Sun, 12 Oct 2025 12:59:37 +0200 Subject: [PATCH 07/14] adjustments --- Taskfile.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Taskfile.yaml b/Taskfile.yaml index 9dc0df03..888c5111 100644 --- a/Taskfile.yaml +++ b/Taskfile.yaml @@ -6,7 +6,7 @@ includes: flatten: true excludes: [] # put task names in here which are overwritten in this file vars: - CODE_DIRS: '{{.ROOT_DIR}}/cmd/... {{.ROOT_DIR}}/internal/... {{.ROOT_DIR}}/apis/... {{.ROOT_DIR}}/providers/... {{.ROOT_DIR}}/tenant-manager/... {{.ROOT_DIR}}/test/... {{.ROOT_DIR}}/utils/...' + CODE_DIRS: '{{.ROOT_DIR}}/cmd/... {{.ROOT_DIR}}/internal/... {{.ROOT_DIR}}/apis/... {{.ROOT_DIR}}/providers/... {{.ROOT_DIR}}/test/... {{.ROOT_DIR}}/utils/...' COMPONENTS: 'cmk' REPO_URL: 'https://github.com/openkcm/cmk' From cc6f6d3758cfe3b3af9b80b204ecb774f9c18864 Mon Sep 17 00:00:00 2001 From: Nicolae Nicora Date: Tue, 14 Oct 2025 13:52:06 +0200 Subject: [PATCH 08/14] separate the tenant manager --- Taskfile.yaml | 2 +- charts/tenant-manager/.helmignore | 23 + charts/tenant-manager/Chart.yaml | 24 + charts/tenant-manager/README.md | 39 + charts/tenant-manager/templates/NOTES.txt | 16 + charts/tenant-manager/templates/_helpers.tpl | 194 +++++ .../tenant-manager/templates/configmap.yaml | 23 + .../tenant-manager/templates/deployment.yaml | 126 ++++ charts/tenant-manager/templates/hpa.yaml | 36 + charts/tenant-manager/templates/pdb.yaml | 23 + charts/tenant-manager/templates/service.yaml | 22 + .../templates/serviceaccount.yaml | 12 + charts/tenant-manager/values.yaml | 669 ++++++++++++++++++ charts/tenantmanager-cli/.helmignore | 23 + charts/tenantmanager-cli/Chart.yaml | 24 + charts/tenantmanager-cli/README.md | 39 + charts/tenantmanager-cli/templates/NOTES.txt | 16 + .../tenantmanager-cli/templates/_helpers.tpl | 194 +++++ .../templates/configmap.yaml | 23 + .../templates/deployment.yaml | 126 ++++ charts/tenantmanager-cli/templates/hpa.yaml | 36 + charts/tenantmanager-cli/templates/pdb.yaml | 23 + .../tenantmanager-cli/templates/service.yaml | 22 + .../templates/serviceaccount.yaml | 12 + charts/tenantmanager-cli/values.yaml | 669 ++++++++++++++++++ cmd/{ => cmk}/apiserver/command.go | 0 cmd/{ => cmk}/apiserver/command_test.go | 0 cmd/{ => cmk}/apiserver/export_test.go | 0 cmd/cmk/main.go | 8 +- cmd/{ => cmk}/taskscheduler/command.go | 0 cmd/{ => cmk}/taskworker/command.go | 0 cmd/tenant-manager-cli/command.go | 87 +++ .../command.go | 90 ++- cmd/tenantmanager/cli/command.go | 20 - cmd/tenantmanager/command_test.go | 55 -- cmd/tenantmanager/export_test.go | 6 - internal/tenant-manager/cli/command.go | 11 +- 37 files changed, 2588 insertions(+), 105 deletions(-) create mode 100644 charts/tenant-manager/.helmignore create mode 100644 charts/tenant-manager/Chart.yaml create mode 100644 charts/tenant-manager/README.md create mode 100644 charts/tenant-manager/templates/NOTES.txt create mode 100644 charts/tenant-manager/templates/_helpers.tpl create mode 100644 charts/tenant-manager/templates/configmap.yaml create mode 100644 charts/tenant-manager/templates/deployment.yaml create mode 100644 charts/tenant-manager/templates/hpa.yaml create mode 100644 charts/tenant-manager/templates/pdb.yaml create mode 100644 charts/tenant-manager/templates/service.yaml create mode 100644 charts/tenant-manager/templates/serviceaccount.yaml create mode 100644 charts/tenant-manager/values.yaml create mode 100644 charts/tenantmanager-cli/.helmignore create mode 100644 charts/tenantmanager-cli/Chart.yaml create mode 100644 charts/tenantmanager-cli/README.md create mode 100644 charts/tenantmanager-cli/templates/NOTES.txt create mode 100644 charts/tenantmanager-cli/templates/_helpers.tpl create mode 100644 charts/tenantmanager-cli/templates/configmap.yaml create mode 100644 charts/tenantmanager-cli/templates/deployment.yaml create mode 100644 charts/tenantmanager-cli/templates/hpa.yaml create mode 100644 charts/tenantmanager-cli/templates/pdb.yaml create mode 100644 charts/tenantmanager-cli/templates/service.yaml create mode 100644 charts/tenantmanager-cli/templates/serviceaccount.yaml create mode 100644 charts/tenantmanager-cli/values.yaml rename cmd/{ => cmk}/apiserver/command.go (100%) rename cmd/{ => cmk}/apiserver/command_test.go (100%) rename cmd/{ => cmk}/apiserver/export_test.go (100%) rename cmd/{ => cmk}/taskscheduler/command.go (100%) rename cmd/{ => cmk}/taskworker/command.go (100%) create mode 100644 cmd/tenant-manager-cli/command.go rename cmd/{tenantmanager => tenant-manager}/command.go (68%) delete mode 100644 cmd/tenantmanager/cli/command.go delete mode 100644 cmd/tenantmanager/command_test.go delete mode 100644 cmd/tenantmanager/export_test.go diff --git a/Taskfile.yaml b/Taskfile.yaml index 888c5111..2bca5341 100644 --- a/Taskfile.yaml +++ b/Taskfile.yaml @@ -7,6 +7,6 @@ includes: excludes: [] # put task names in here which are overwritten in this file vars: CODE_DIRS: '{{.ROOT_DIR}}/cmd/... {{.ROOT_DIR}}/internal/... {{.ROOT_DIR}}/apis/... {{.ROOT_DIR}}/providers/... {{.ROOT_DIR}}/test/... {{.ROOT_DIR}}/utils/...' - COMPONENTS: 'cmk' + COMPONENTS: 'cmk tenant-manager tenant-manager-cli' REPO_URL: 'https://github.com/openkcm/cmk' diff --git a/charts/tenant-manager/.helmignore b/charts/tenant-manager/.helmignore new file mode 100644 index 00000000..0e8a0eb3 --- /dev/null +++ b/charts/tenant-manager/.helmignore @@ -0,0 +1,23 @@ +# Patterns to ignore when building packages. +# This supports shell glob matching, relative path matching, and +# negation (prefixed with !). Only one pattern per line. +.DS_Store +# Common VCS dirs +.git/ +.gitignore +.bzr/ +.bzrignore +.hg/ +.hgignore +.svn/ +# Common backup files +*.swp +*.bak +*.tmp +*.orig +*~ +# Various IDEs +.project +.idea/ +*.tmproj +.vscode/ diff --git a/charts/tenant-manager/Chart.yaml b/charts/tenant-manager/Chart.yaml new file mode 100644 index 00000000..659e2352 --- /dev/null +++ b/charts/tenant-manager/Chart.yaml @@ -0,0 +1,24 @@ +apiVersion: v2 +name: tenant-manager +description: A Helm chart for Kubernetes + +# A chart can be either an 'application' or a 'library' chart. +# +# Application charts are a collection of templates that can be packaged into versioned archives +# to be deployed. +# +# Library charts provide useful utilities or functions for the chart developer. They're included as +# a dependency of application charts to inject those utilities and functions into the rendering +# pipeline. Library charts do not define any templates and therefore cannot be deployed. +type: application + +# This is the chart version. This version number should be incremented each time you make changes +# to the chart and its templates, including the app version. +# Versions are expected to follow Semantic Versioning (https://semver.org/) +version: 0.1.0 + +# This is the version number of the application being deployed. This version number should be +# incremented each time you make changes to the application. Versions are not expected to +# follow Semantic Versioning. They should reflect the version the application is using. +# It is recommended to use it with quotes. +appVersion: "0.1.0" diff --git a/charts/tenant-manager/README.md b/charts/tenant-manager/README.md new file mode 100644 index 00000000..6b57d104 --- /dev/null +++ b/charts/tenant-manager/README.md @@ -0,0 +1,39 @@ +# CMK Helm Chart +KMS2.0 helm charts + +## How To + +Download all dependencies as defined in the parent chart and sub charts. + +```bash +helm dependency build ./charts +``` + +Update the dependencies after making changes to the chart. + +```bash +helm dependency update ./charts +``` + +After changing dependencies in a sub chart, update the sub charts dependencies first +and then update the parent chart dependencies. + +```bash +helm dependency update ./charts/ +helm dependency update ./charts +``` + +Render chart templates locally and display the output. +```bash +helm template kms2x ./charts +``` + +Install entire kms2x charts +```bash +helm install kms2x ./charts +``` + +UnInstall kms2x entire deployment +```bash +helm uninstall kms2x +``` \ No newline at end of file diff --git a/charts/tenant-manager/templates/NOTES.txt b/charts/tenant-manager/templates/NOTES.txt new file mode 100644 index 00000000..b9ad25fc --- /dev/null +++ b/charts/tenant-manager/templates/NOTES.txt @@ -0,0 +1,16 @@ +1. Get the application URL by running these commands: +{{- if contains "NodePort" .Values.service.type }} + export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ include "tenant-manager.fullname" . }}) + export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}") + echo http://$NODE_IP:$NODE_PORT +{{- else if contains "LoadBalancer" .Values.service.type }} + NOTE: It may take a few minutes for the LoadBalancer IP to be available. + You can watch its status by running 'kubectl get --namespace {{ .Release.Namespace }} svc -w {{ include "tenant-manager.fullname" . }}' + export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ include "tenant-manager.fullname" . }} --template "{{"{{ range (index .status.loadBalancer.ingress 0) }}{{.}}{{ end }}"}}") + echo http://$SERVICE_IP:{{ .Values.service.port }} +{{- else if contains "ClusterIP" .Values.service.type }} + export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app.kubernetes.io/name={{ include "tenant-manager.name" . }},app.kubernetes.io/instance={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}") + export CONTAINER_PORT=$(kubectl get pod --namespace {{ .Release.Namespace }} $POD_NAME -o jsonpath="{.spec.containers[0].ports[0].containerPort}") + echo "Visit http://127.0.0.1:8080 to use your application" + kubectl --namespace {{ .Release.Namespace }} port-forward $POD_NAME 8080:$CONTAINER_PORT +{{- end }} diff --git a/charts/tenant-manager/templates/_helpers.tpl b/charts/tenant-manager/templates/_helpers.tpl new file mode 100644 index 00000000..bdfd3144 --- /dev/null +++ b/charts/tenant-manager/templates/_helpers.tpl @@ -0,0 +1,194 @@ +{{/* +Expand the name of the chart. +*/}} +{{- define "tenant-manager.name" -}} +{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }} +{{- end }} + +{{/* +Namespace for all resources to be installed into +If not defined in values file then the helm release namespace is used +By default this is not set so the helm release namespace will be used + +This gets around an problem within helm discussed here +https://github.com/helm/helm/issues/5358 +*/}} +{{- define "tenant-manager.namespace" -}} + {{ .Values.namespace | default .Release.Namespace }} +{{- end -}} + +{{/* +Create a default fully qualified app name. +We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). +If release name contains chart name it will be used as a full name. +*/}} +{{- define "tenant-manager.fullname" -}} +{{- if .Values.fullnameOverride }} +{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }} +{{- else }} +{{- $name := default .Chart.Name .Values.nameOverride }} +{{- if contains $name .Release.Name }} +{{- .Release.Name | trunc 63 | trimSuffix "-" }} +{{- else }} +{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }} +{{- end }} +{{- end }} +{{- end }} + +{{/* +Create chart name and version as used by the chart label. +*/}} +{{- define "tenant-manager.chart" -}} +{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }} +{{- end }} + +{{/* +Common labels +*/}} +{{- define "tenant-manager.labels" -}} +helm.sh/chart: {{ include "tenant-manager.chart" . }} +{{ include "tenant-manager.selectorLabels" . }} +{{- if .Chart.AppVersion }} +app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} +{{- end }} +app.kubernetes.io/managed-by: {{ .Release.Service }} +{{- end }} + +{{/* +Task Scheduler labels +*/}} +{{- define "tenant-manager.task-scheduler.labels" -}} +helm.sh/chart: {{ include "tenant-manager.chart" . }} +{{ include "tenant-manager.task-scheduler.selectorLabels" . }} +{{- if .Chart.AppVersion }} +app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} +{{- end }} +app.kubernetes.io/managed-by: {{ .Release.Service }} +{{- end }} + +{{/* +Task Worker labels +*/}} +{{- define "tenant-manager.task-worker.labels" -}} +helm.sh/chart: {{ include "tenant-manager.chart" . }} +{{ include "tenant-manager.task-worker.selectorLabels" . }} +{{- if .Chart.AppVersion }} +app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} +{{- end }} +app.kubernetes.io/managed-by: {{ .Release.Service }} +{{- end }} + +{{/* +Tenant Manager labels +*/}} +{{- define "tenant-manager.tenant-manager.labels" -}} +helm.sh/chart: {{ include "tenant-manager.chart" . }} +{{ include "tenant-manager.tenant-manager.selectorLabels" . }} +{{- if .Chart.AppVersion }} +app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} +{{- end }} +app.kubernetes.io/managed-by: {{ .Release.Service }} +{{- end }} + +{{/* +Tenant Manager CLI labels +*/}} +{{- define "tenant-manager.tenant-manager-cli.labels" -}} +helm.sh/chart: {{ include "tenant-manager.chart" . }} +{{ include "tenant-manager.tenant-manager-cli.selectorLabels" . }} +{{- if .Chart.AppVersion }} +app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} +{{- end }} +app.kubernetes.io/managed-by: {{ .Release.Service }} +{{- end }} + +{{/* +Selector labels +*/}} +{{- define "tenant-manager.selectorLabels" -}} +app.kubernetes.io/name: {{ include "tenant-manager.name" . }} +app.kubernetes.io/instance: {{ .Release.Name }} +app.kubernetes.io/component: {{ .Chart.Name }} +{{- end }} + +{{/* +task-scheduler Selector Labels +*/}} +{{- define "tenant-manager.task-scheduler.selectorLabels" -}} +app.kubernetes.io/name: {{ include "tenant-manager.name" . }} +app.kubernetes.io/instance: {{ .Release.Name }}-task-scheduler +app.kubernetes.io/component: {{ .Chart.Name }}-task-scheduler +{{- end }} + +{{/* +task-worker Selector Labels +*/}} +{{- define "tenant-manager.task-worker.selectorLabels" -}} +app.kubernetes.io/name: {{ include "tenant-manager.name" . }} +app.kubernetes.io/instance: {{ .Release.Name }}-task-worker +app.kubernetes.io/component: {{ .Chart.Name }}-task-worker +{{- end }} + +{{/* +Tenant Manager Selector labels +*/}} +{{- define "tenant-manager.tenant-manager.selectorLabels" -}} +app.kubernetes.io/name: {{ include "tenant-manager.name" . }}-tenant-manager +app.kubernetes.io/instance: {{ .Release.Name }}-tenant-manager +app.kubernetes.io/component: {{ .Chart.Name }}-tenant-manager +{{- end }} + +{{/* +Tenant Manager CLI Selector labels +*/}} +{{- define "tenant-manager.tenant-manager-cli.selectorLabels" -}} +app.kubernetes.io/name: {{ include "tenant-manager.name" . }}-tenant-manager-cli +app.kubernetes.io/instance: {{ .Release.Name }}-tenant-manager-cli +app.kubernetes.io/component: {{ .Chart.Name }}-tenant-manager-cli +{{- end }} + +{{/* +Create the name of the service account to use +*/}} +{{- define "tenant-manager.serviceAccountName" -}} +{{- if .Values.serviceAccount.create }} +{{- default (include "tenant-manager.fullname" .) .Values.serviceAccount.name }} +{{- else }} +{{- default "default" .Values.serviceAccount.name }} +{{- end }} +{{- end }} + +{{- define "tenant-manager.postgresqlName" -}} +{{- printf "%s-postgresql" .Release.Name -}} +{{- end }} + +{{/* +Util function for generating the image URL based on the provided options. +*/}} +{{- define "tenant-manager.image" -}} +{{- $defaultTag := index . 1 -}} +{{- with index . 0 -}} +{{- if .registry -}}{{ printf "%s/%s" .registry .repository }}{{- else -}}{{- .repository -}}{{- end -}} +{{- if .digest -}}{{ printf "@%s" .digest }}{{- else -}}{{ printf ":%s" (default $defaultTag .tag) }}{{- end -}} +{{- end }} +{{- end }} + +{{/* +Active plugins +*/}} +{{- define "tenant-manager.plugins" -}} +{{- $ := . }} +{{- $plugins := list -}} +{{- range .plugins -}} +{{- $plugin := . -}} +{{- range .tags -}} +{{- if has . $.activePlugins -}} + +{{- $plugins = append $plugins $plugin -}} +{{- break -}} + +{{- end -}} +{{- end -}} +{{- end -}} +{{- toYaml $plugins -}} +{{- end -}} diff --git a/charts/tenant-manager/templates/configmap.yaml b/charts/tenant-manager/templates/configmap.yaml new file mode 100644 index 00000000..5a41bd54 --- /dev/null +++ b/charts/tenant-manager/templates/configmap.yaml @@ -0,0 +1,23 @@ +--- +apiVersion: v1 +kind: ConfigMap +metadata: + name: {{ include "tenant-manager.name" . }}-config + labels: + {{- include "tenant-manager.labels" . | nindent 4 }} +immutable: {{ .Values.application.isImmutable | default false }} +data: + config.yaml: |- + application: + name: {{ .Chart.Name }} + {{- with .Values.application }} + environment: {{ .environment }} + {{- with .labels }} + labels: + {{- toYaml . | nindent 8 }} + {{- end}} + {{- end}} + + {{- with .Values.config }} + {{- toYaml . | nindent 4 }} + {{- end}} \ No newline at end of file diff --git a/charts/tenant-manager/templates/deployment.yaml b/charts/tenant-manager/templates/deployment.yaml new file mode 100644 index 00000000..f149847b --- /dev/null +++ b/charts/tenant-manager/templates/deployment.yaml @@ -0,0 +1,126 @@ +--- +apiVersion: apps/v1 +kind: Deployment +metadata: + name: {{ include "tenant-manager.fullname" . }} + labels: + {{- include "tenant-manager.labels" . | nindent 4 }} +spec: + {{- if not .Values.hpa.enabled }} + replicas: {{ .Values.replicaCount }} + {{- end }} + selector: + matchLabels: + {{- include "tenant-manager.selectorLabels" . | nindent 6 }} + template: + metadata: + {{- with .Values.pod.annotations }} + annotations: + {{- toYaml . | nindent 8 }} + {{- end }} + labels: + {{- include "tenant-manager.labels" . | nindent 8 }} + {{- with .Values.pod.labels }} + {{- toYaml . | nindent 8 }} + {{- end }} + spec: + {{- with .Values.imagePullSecrets }} + imagePullSecrets: + {{- toYaml . | nindent 8 }} + {{- end }} + serviceAccountName: {{ include "tenant-manager.serviceAccountName" . }} + {{- with .Values.pod.securityContext }} + securityContext: + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with .Values.extraInitContainers }} + initContainers: + {{- toYaml . | nindent 8 }} + {{- end }} + containers: + {{- with .Values.extraContainers }} + {{- toYaml . | nindent 8 }} + {{- end }} + - name: {{ include "tenant-manager.name" . }} + {{- with .Values.securityContext }} + securityContext: + {{- toYaml . | nindent 12 }} + {{- end }} + image: "{{ template "tenant-manager.image" (tuple .Values.image $.Chart.AppVersion) }}" + imagePullPolicy: {{ .Values.image.pullPolicy }} + {{- with .Values.image.command }} + command: [ "{{- toYaml . }}" ] + {{- end }} + {{- with .Values.image.args }} + args: + {{- toYaml . | nindent 12 }} + {{- end }} + {{- with .Values.ports }} + ports: + {{- toYaml . | nindent 12 }} + {{- end }} + env: + - name: MY_POD_IP + valueFrom: + fieldRef: + apiVersion: v1 + fieldPath: status.podIP + - name: K8S_NODE_NAME + valueFrom: + fieldRef: + fieldPath: spec.nodeName + - name: K8S_NODE_IP + valueFrom: + fieldRef: + fieldPath: status.hostIP + {{- with .Values.extraEnvs }} + {{- toYaml . | nindent 12 }} + {{- end }} + {{- with .Values.extraEnvsFrom }} + envFrom: + {{- . | toYaml | nindent 12 }} + {{- end }} + {{- with .Values.livenessProbe }} + livenessProbe: + {{- toYaml . | nindent 12 }} + {{- end }} + {{- with .Values.readinessProbe }} + readinessProbe: + {{- toYaml . | nindent 12 }} + {{- end }} + {{- with .Values.resources }} + resources: + {{- toYaml . | nindent 12 }} + {{- end }} + volumeMounts: + - name: {{ include "tenant-manager.name" . }}-config-volume + mountPath: /etc/tenant-manager + readOnly: true + {{- with .Values.extraVolumeMounts }} + {{- toYaml . | nindent 12 }} + {{- end }} + volumes: + - name: {{ include "tenant-manager.name" . }}-config-volume + projected: + sources: + - configMap: + name: {{ include "tenant-manager.name" . }}-config + {{- with .Values.extraVolumes }} + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with .Values.pod.nodeSelector }} + nodeSelector: + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with .Values.pod.affinity }} + affinity: + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with .Values.pod.topologySpreadConstraints }} + topologySpreadConstraints: + {{- toYaml . | nindent 6 }} + {{- end }} + {{- with .Values.pod.tolerations }} + tolerations: + {{- toYaml . | nindent 6 }} + {{- end }} diff --git a/charts/tenant-manager/templates/hpa.yaml b/charts/tenant-manager/templates/hpa.yaml new file mode 100644 index 00000000..e30ed78e --- /dev/null +++ b/charts/tenant-manager/templates/hpa.yaml @@ -0,0 +1,36 @@ +{{- if .Values.hpa.enabled }} +apiVersion: autoscaling/v2 +kind: HorizontalPodAutoscaler +metadata: + name: {{ include "tenant-manager.fullname" . }} + labels: + {{- include "tenant-manager.labels" . | nindent 4 }} +spec: + scaleTargetRef: + apiVersion: apps/v1 + kind: Deployment + name: {{ include "tenant-manager.fullname" . }} + minReplicas: {{ .Values.hpa.minReplicas }} + maxReplicas: {{ .Values.hpa.maxReplicas }} + metrics: + {{- if or .Values.hpa.targetCPUUtilizationPercentage .Values.hpa.targetMemoryUtilizationPercentage }} + {{- if .Values.hpa.targetCPUUtilizationPercentage }} + - type: Resource + resource: + name: cpu + target: + type: Utilization + averageUtilization: {{ .Values.hpa.targetCPUUtilizationPercentage }} + {{- end }} + {{- if .Values.hpa.targetMemoryUtilizationPercentage }} + - type: Resource + resource: + name: memory + target: + type: Utilization + averageUtilization: {{ .Values.hpa.targetMemoryUtilizationPercentage }} + {{- end }} + {{- else }} + [] + {{- end }} +{{- end }} diff --git a/charts/tenant-manager/templates/pdb.yaml b/charts/tenant-manager/templates/pdb.yaml new file mode 100644 index 00000000..1447455e --- /dev/null +++ b/charts/tenant-manager/templates/pdb.yaml @@ -0,0 +1,23 @@ +{{- if .Values.pod.disruptionBudget.enabled }} +--- +apiVersion: policy/v1 +kind: PodDisruptionBudget +metadata: + name: {{ include "tenant-manager.fullname" . }} + namespace: {{ include "tenant-manager.namespace" . }} + labels: + {{- include "tenant-manager.labels" . | nindent 4 }} +spec: + selector: + matchLabels: + {{- include "tenant-manager.selectorLabels" . | nindent 6 }} + {{- if not (or (hasKey .Values.pod.disruptionBudget "minAvailable") (hasKey .Values.pod.disruptionBudget "maxUnavailable")) }} + minAvailable: 1 # Default value because minAvailable and maxUnavailable are not set + {{- end }} + {{- if hasKey .Values.pod.disruptionBudget "minAvailable" }} + minAvailable: {{ .Values.pod.disruptionBudget.minAvailable }} + {{- end }} + {{- if hasKey .Values.pod.disruptionBudget "maxUnavailable" }} + maxUnavailable: {{ .Values.pod.disruptionBudget.maxUnavailable }} + {{- end }} +{{- end }} diff --git a/charts/tenant-manager/templates/service.yaml b/charts/tenant-manager/templates/service.yaml new file mode 100644 index 00000000..b02b1a04 --- /dev/null +++ b/charts/tenant-manager/templates/service.yaml @@ -0,0 +1,22 @@ +--- +apiVersion: v1 +kind: Service +metadata: + name: {{ include "tenant-manager.fullname" . }} + labels: + {{- include "tenant-manager.labels" . | nindent 4 }} + {{- with .Values.service.labels }} + {{- toYaml . | nindent 4 }} + {{- end }} +{{- with .Values.service.annotations }} + annotations: + {{- toYaml . | nindent 4 }} +{{- end }} +spec: + type: {{ .Values.service.type }} +{{- with .Values.service.ports }} + ports: + {{- toYaml . | nindent 4 }} +{{- end }} + selector: + {{- include "tenant-manager.selectorLabels" . | nindent 4 }} \ No newline at end of file diff --git a/charts/tenant-manager/templates/serviceaccount.yaml b/charts/tenant-manager/templates/serviceaccount.yaml new file mode 100644 index 00000000..fcb42797 --- /dev/null +++ b/charts/tenant-manager/templates/serviceaccount.yaml @@ -0,0 +1,12 @@ +{{- if .Values.serviceAccount.create -}} +apiVersion: v1 +kind: ServiceAccount +metadata: + name: {{ include "tenant-manager.serviceAccountName" . }} + labels: + {{- include "tenant-manager.labels" . | nindent 4 }} + {{- with .Values.serviceAccount.annotations }} + annotations: + {{- toYaml . | nindent 4 }} + {{- end }} +automountServiceAccountToken: {{ .Values.serviceAccount.automount }} diff --git a/charts/tenant-manager/values.yaml b/charts/tenant-manager/values.yaml new file mode 100644 index 00000000..a9be6002 --- /dev/null +++ b/charts/tenant-manager/values.yaml @@ -0,0 +1,669 @@ +# Default values for cmk. +# This is a YAML-formatted file. +# Declare variables to be passed into your templates. + +# Override the "name" value, which is used to annotate some of +# the resources that are created by this Chart (using "app.kubernetes.io/name"). +# +docs:property +nameOverride: "" + +# Override the "fullname" value. This value is used as part of +# most of the names of the resources created by this Helm chart. +# +docs:property +fullnameOverride: "" + +# This namespace allows you to define where the services are installed into. +# If not set then they use the namespace of the release. +# This is helpful when installing a chart dependency (sub chart). +namespace: "" + +# This will set the replicaset count more information can be found here: https://kubernetes.io/docs/concepts/workloads/controllers/replicaset/ +replicaCount: 1 + +# This sets the container image more information can be found here: https://kubernetes.io/docs/concepts/containers/images/ +image: + # The container registry to pull the image from. + # For example: + # registry: ghcr.io/openkcm + # repository: images/checker + # +docs:property + registry: ghcr.io/openkcm + + # The container image + # +docs:property + repository: images/tenant-manager + + # Override the image tag to deploy by setting this variable. + # If no value is set, the chart's appVersion is used. + # +docs:property + tag: "" + + # Setting a digest will override any tag. + # +docs:property + # digest: sha256:0e072dddd1f7f8fc8909a2ca6f65e76c5f0d2fcfb8be47935ae3457e8bbceb20 + + # Kubernetes imagePullPolicy. + pullPolicy: IfNotPresent + + # # Setting the arguments for the container + # # +docs:property + args: + - api-server +# - task-scheduler +# - task-worker +# - task-manager +# - task-manager-cli + # - --graceful-shutdown 2 + # - --graceful-message 'Graceful shutdown in %d seconds' + + # Setting the command + # +docs:property + #command: "./extension-server" + +# This is for the secretes for pulling an image from a private repository more information can be found here: https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/ +imagePullSecrets: +# - name: "" + +# This section builds out the service account more information can be found here: https://kubernetes.io/docs/concepts/security/service-accounts/ +serviceAccount: + # Specifies whether a service account should be created + create: true + # Automatically mount a ServiceAccount's API credentials? + automount: true + # Annotations to add to the service account + annotations: {} + # The name of the service account to use. + # If not set and create is true, a name is generated using the fullname template + name: "" + +pod: + # This is for setting Kubernetes Annotations to a Pod. + # For more information checkout: https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/ + annotations: { } + + # This is for setting Kubernetes Labels to a Pod. + # For more information checkout: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/ + labels: {} + + securityContext: {} + # fsGroup: 2000 + + disruptionBudget: + # Enable or disable the PodDisruptionBudget resource. + # + # This prevents downtime during voluntary disruptions such as during a Node upgrade. + # For example, the PodDisruptionBudget will block `kubectl drain` + # Pod is currently running. + enabled: false + + # This configures the minimum available pods for disruptions. It can either be set to + # an integer (e.g. 1) or a percentage value (e.g. 25%). + # It cannot be used if `maxUnavailable` is set. + # +docs:property + # +docs:type=unknown + # minAvailable: 1 + + # This configures the maximum unavailable pods for disruptions. It can either be set to + # an integer (e.g. 1) or a percentage value (e.g. 25%). + # it cannot be used if `minAvailable` is set. + # +docs:property + # +docs:type=unknown + # maxUnavailable: 1 + nodeSelector: { } + tolerations: [ ] + affinity: { } + topologySpreadConstraints: [] + + + + +securityContext: {} + # capabilities: + # drop: + # - ALL + # readOnlyRootFilesystem: true + # runAsNonRoot: true + # runAsUser: 1000 + + +# This is for setting up a service more information can be found here: https://kubernetes.io/docs/concepts/services-networking/service/ +service: + # Labels to add to the service + labels: {} + # Annotations to add to the service + annotations: {} + # This sets the service type more information can be found here: https://kubernetes.io/docs/concepts/services-networking/service/#publishing-services-service-types + type: ClusterIP + # This sets the ports more information can be found here: https://kubernetes.io/docs/concepts/services-networking/service/#field-spec-ports + ports: + - port: 8081 # must match .Values.cmk.port + protocol: TCP + targetPort: http + name: http + +resources: {} + # We usually recommend not to specify default resources and to leave this as a conscious + # choice for the user. This also increases chances charts run on environments with little + # resources, such as Minikube. If you do want to specify resources, uncomment the following + # lines, adjust them as necessary, and remove the curly braces after 'resources:'. + # limits: + # cpu: 100m + # memory: 128Mi + # requests: + # cpu: 100m + # memory: 128Mi + +# This is to setup the liveness and readiness probes more information can be found here: https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-startup-probes/ +livenessProbe: + httpGet: + path: /probe/liveness + port: http-status + scheme: HTTP + failureThreshold: 1 + periodSeconds: 10 +readinessProbe: + httpGet: + path: /probe/readiness + port: http-status + scheme: HTTP + failureThreshold: 1 + periodSeconds: 10 + +# This section is for setting up autoscaling more information can be found here: https://kubernetes.io/docs/concepts/workloads/autoscaling/ +hpa: + enabled: false + minReplicas: 1 + maxReplicas: 1 + targetCPUUtilizationPercentage: 80 + targetMemoryUtilizationPercentage: 80 + +# Additional init containers on the output Deployment definition. +extraInitContainers: [] + +# Additional containers on the output Deployment definition. +extraContainers: [] + +# Additional volumes on the output Deployment definition. +extraVolumes: [] + +# Additional volumeMounts on the output Deployment definition. +extraVolumeMounts: [] + +# Additional ens on the output Deployment definition. +extraEnvs: [] + +# Additional envsFrom on the output Deployment definition. +extraEnvsFrom: [] + + +ports: + - name: http-status + containerPort: 8888 + protocol: TCP + - name: http + containerPort: 8081 + protocol: TCP + +application: + isImmutable: false + # Environment where the application is running + environment: local + # Labels associated to metrics, traces and logs + labels: { } + +config: + # Feature gates + featureGates: + enrich-header-with-client-type: true + enrich-header-with-client-region: true + disable-client-certificate-computation: false + disable-jwt-token-computation: false + + http: + port: 8081 + + # Expose the status port + status: + enabled: true + address: ":8888" + profiling: false + + # Certificates configuration + certificates: + # rootCertURL + rootCertURL: https://aia.pki.co.example.com/aia/EXAMPLE%20Cloud%20Root%20CA.crt + # Validity of the certificates in days; Must be between 7 and 30 days + validityDays: 30 + # Threshold in days to rotate the certificates; Must be between 1 and 30 days + rotationThresholdDays: 7 + + ## Crypto layer configuration + cryptoLayer: + certX509Trusts: + source: embedded + value: | + { + "crypto-1": { + "Subject": "FakeCert", + "RootCA": "https://aia.pki.co.example.com/aia/EXAMPLE%20Cloud%20Root%20CA.crt" + } + } + # This does set the logger configuration + # +docs:property + logger: + level: debug # one of: debug, info, warn, error + # Format of the logs + format: json # one of: json, text + formatter: + time: + type: pattern # one of: pattern, unix + # Used only when the property type: pattern + # Should follow golang time pattern + # Default value time.RFC3339. + pattern: "Mon Jan 02 15:04:05 -0700 2006" + # Used only when the property type: unix + # Time units are "1ns", "1us" (or "1µs"), "1ms", "1s" + # Default value 1s. + precision: 1s + fields: + # Field names (this way the field name can be changed) to be used on log records; These are their defaults. + error: "error" + message: "msg" + level: "level" + time: "time" + # Fields names used by OTEL to track the Trace and Span ID + otel: + traceID: "trace.id" # Default is TraceID + spanID: "span.id" # Default is SpanID + masking: + # All fields under PII, the formatters will mask the value and keeping first 4 original characters + pii: + - email + - ip-address + # All fields under other, the formatters will mask the value, using given mask. + other: + jwt-token: "*****" + telemetry: + logs: + enabled: false + protocol: http # one of: http, grpc; Default is http + # Host configuration example set as a value: + # host: + # source: embedded + # value: localhost:4317 + # Host configuration example load value from an environment variable: + # host: + # source: env + # env: OTEL_LOGS_HOST + # Host configuration example load value from a JSON file: + # host: + # source: file + # file: + # path: /etc/credentials/config.json + # format: json # one of: json + # jsonPath: "$.credentials.ingest-otlp-endpoint" # Syntax JSONPath Query Expression + host: + source: embedded + value: localhost:4317 + url: /api/v2/otlp/v1/logs + # OpenTelemetry secret connections; Applicable in the same way for logs, traces and metrics + # Insecure configuration example: + # secretRef: + # type: insecure # one of: insecure, mtls, api-token + # APIToken configuration example loading value from environment variable: + # secretRef: + # type: api-token # one of: insecure, mtls, api-token + # apiToken: + # source: env + # env: OTEL_LOS_API_TOKEN + # APIToken configuration example loading value from binary file as is: + # secretRef: + # type: api-token # one of: insecure, mtls, api-token + # apiToken: + # source: file + # path: /etc/credentials/api-token + # format: binary # one of: json, binary + # APIToken configuration example loading value from JSON file, extracting a specific field: + # secretRef: + # type: api-token # one of: insecure, mtls, api-token + # apiToken: + # source: file + # path: /etc/credentials/api-token.json + # format: json # one of: json, binary + # jsonPath: "$.credentials.api-token" # Syntax JSONPath Query Expression + # mTLS configuration example loading value from environment variables: + # secretRef: + # type: mtls # one of: insecure, mtls, api-token + # mtls: + # cert: + # source: env + # env: OTEL_LOGS_X509_CERT + # certKey: + # source: env + # env: OTEL_LOGS_X509_CERT_KEY + # serverCA: + # source: env + # env: OTEL_LOGS_X509_SERVER_CA + # mTLS configuration example loading value from binary file as is: + # secretRef: + # type: mtls # one of: insecure, mtls, api-token + # mtls: + # cert: + # source: file + # file: + # path: /etc/credentials/cert.pem + # format: binary # one of: json, binary + # certKey: + # source: file + # file: + # path: /etc/credentials/cert-key.pem + # format: binary # one of: json, binary + # serverCA: + # source: file + # file: + # path: /etc/credentials/server-ca.pem + # format: binary # one of: json, binary + # mTLS configuration example loading value from JSON file, extracting a specific field: + # secretRef: + # type: mtls # one of: insecure, mtls, api-token + # mtls: + # cert: + # source: file + # file: + # path: /etc/credentials/config.json + # format: json # one of: json, binary + # jsonPath: "$.credentials.ingest-otlp-cert" # Syntax JSONPath Query Expression + # certKey: + # source: file + # file: + # path: /etc/credentials/config.json + # format: json # one of: json, binary + # jsonPath: "$.credentials.ingest-otlp-key" # Syntax JSONPath Query Expression + # serverCA: + # source: file + # file: + # path: /etc/credentials/config.json + # format: json # one of: json, binary + # jsonPath: "$.credentials.server-ca" # Syntax JSONPath Query Expression + secretRef: + type: api-token # one of: insecure, mtls, api-token + apiToken: + source: embedded + value: "unknown" + traces: + enabled: false + protocol: http # one of: http, grpc; Default is http + # Host configuration example set as a value: + # host: + # source: embedded + # value: localhost:4317 + # Host configuration example load value from an environment variable: + # host: + # source: env + # env: OTEL_LOGS_HOST + # Host configuration example load value from a JSON file: + # host: + # source: file + # file: + # path: /etc/credentials/config.json + # format: json # one of: json + # jsonPath: "$.credentials.ingest-otlp-endpoint" # Syntax JSONPath Query Expression + host: + source: embedded + value: localhost:4317 + url: /api/v2/otlp/v1/traces + # OpenTelemetry traces secret; See examples from logs. + secretRef: + type: api-token # insecure, mtls, api-token + apiToken: + source: embedded + value: "unknown" + metrics: + enabled: false + protocol: http # one of: http, grpc; Default is http + # Host configuration example set as a value: + # host: + # value: localhost:4317 + # Host configuration example load value from an environment variable: + # host: + # source: env + # env: OTEL_LOGS_HOST + # Host configuration example load value from a JSON file: + # host: + # source: file + # file: + # path: /etc/credentials/config.json + # format: json # one of: json + # jsonPath: "$.credentials.ingest-otlp-endpoint" # Syntax JSONPath Query Expression + host: + source: embedded + value: localhost:4317 + url: /api/v2/otlp/v1/metrics + # OpenTelemetry traces secret; See examples from logs. + secretRef: + type: api-token # insecure, mtls, api-token + apiToken: + source: embedded + value: "unknown" + # Metrics exposed through /metrics endpoint for prometheus + prometheus: + enabled: false + + # Database configuration + database: + host: + source: embedded + value: host.ns.svc.cluster.local + user: + source: embedded + value: user + secret: + source: embedded + value: secret + name: name + port: 1234 + + # Scheduler configuration + scheduler: + # Scheduler taskQueue configuration + taskQueue: + host: + source: embedded + value: host.ns.svc.cluster.local + port: 1234 + acl: + username: + source: embedded + value: default + password: + source: embedded + value: secret + enabled: true + secretRef: + type: insecure + # ServerCA is an optional field, if not provided, the default CA will be used. + # See secretRef -> see registry for spcific examples + # Scheduler tasks configuration + # Contains a list of configured tasks + # Each task consists of type name, retries count and cron expression + # Empty by default - uncomment and update example value(s) + tasks: [] +# - cronspec: "@every 1h" +# taskType: taskType1 +# retries: 1 +# - cronspec: "@every 2h" +# taskType: taskType2 +# retries: 2 +# - cronspec: "@every 3h" +# taskType: taskType3 +# retries: 3 + + # Services that CMK depends on configuration + services: + # Registry configuration + registry: + enabled: false + address: host.ns.svc.cluster.local:1234 + secretRef: + type: insecure + #secretRef: + # type: mtls + # mTLS: + # serverCA: + # source: file + # file: + # path: /etc/registry/ca + # format: binary + # cert: + # source: file + # file: + # path: /etc/registry/cert + # format: binary + # certKey: + # source: file + # file: + # path: /etc/registry/key + # format: binary + # AWS KMS configuration + aws: + kms: + port: 1234 + host: host.ns.svc.cluster.local + accessKeyId: + name: name + key: KEY + secretAccessKey: + name: name + key: KEY + + # Plugins configuration + # Contains a list of configured plugins + # Note: CMK API-server will not start without any plugin provided + # Empty by default - uncomment and update example value(s) + plugins: [] + # - name: plugin1 + # path: ./path/to/plugin1 + # type: Type1 + # logLevel: debug + # tags: ['tag1', 'tag2'] + # yamlConfiguration: | + # key1: value1 + # key2: value2 + # - name: plugin2 + # path: ./path/to/plugin2 + # type: Type2 + # logLevel: debug + # tags: ['tag1', 'tag2'] + # yamlConfiguration: | + # key1: value1 + # key2: value2 + + # Active plugins are controlled through Makefile. + # See k3d-apply-helm-chart target definition and ACTIVE_PLUGINS variable in the Makefile. + activePlugins: + # - plugin1 + # - plugin2 + # - plugin3 + + # Contains a list of System properties + # Properties set with optional are added to the system_properties table + # Properties set with internal are added to the systems table + # Can be set a displayName and default value for each property + system: + identifier: + displayName: "GTID" + internal: true + region: + displayName: "Region" + internal: true + type: + displayName: "Type" + internal: true + name: + displayName: "Name" + default: "n/a" + optional: true + systemrole: + displayName: "Role" + optional: true + systemroleid: + displayName: "RoleID" + optional: true + + # Event configuration + eventProcessor: + #secretRef: + # type: mtls + # mTLS: + # serverCA: + # source: file + # file: + # path: /etc/event-processor/secrets.json + # format: json + # jsonPath: "$.serverCA" # Syntax JSONPath Query Expression + # cert: + # source: file + # file: + # path: /etc/event-processor/secrets.json + # format: json + # jsonPath: "$.cert" # Syntax JSONPath Query Expression + # certKey: + # source: file + # file: + # path: /etc/event-processor/secrets.json + # format: json + # jsonPath: "$.certKey" # Syntax JSONPath Query Expression + # targets: + # Example of event targets: + #- region: eu10 + # amqp: + # url: "amqps://messaging.example.com:5671" + # target: "ks/eu10" + # source: "cmk/emea/keys" + #maxReconcileCount: 18 + # If want to limit the reconcile period for one task to one day, + # need maxReconcileCount = 18, as there is an exponential backoff for retries, + # starting with 10s and limiting at 10240s. + + audit: + #endpoint: http://localhost:4043/logs + #mtls: + # cert: + # source: file + # file: + # path: /etc/audit-logger/secrets.json + # format: json + # jsonPath: "$.ingest-otlp-cert" + # certKey: + # source: file + # file: + # path: /etc/audit-logger/secrets.json + # format: json + # jsonPath: "$.ingest-otlp-key" + # serverCa: + # source: file + # file: + # path: /etc/audit-logger/secrets.json + # format: json + # jsonPath: "$.server-ca" + #additionalProperties: | + # specVersion: "v1" + # appID: "cmk" + # folderPath: "/var/log/cmk" + # accountID: "123456789012" + # resourceGroupPath: "/cmk" + # region: "eu10" + # appImage: "cmk:latest" + # appVersion: "1.0.0" + + # Signed client data + clientData: + # This path is used to verify the signature of the client data + #signingKeysPath: /etc/signing-keys + + # Keystore pool configuration + # keystorePool: + # Target number of keystores to keep in the pool + # size: 5 + # Interval to report the size of the keystore pool + # interval: 10m diff --git a/charts/tenantmanager-cli/.helmignore b/charts/tenantmanager-cli/.helmignore new file mode 100644 index 00000000..0e8a0eb3 --- /dev/null +++ b/charts/tenantmanager-cli/.helmignore @@ -0,0 +1,23 @@ +# Patterns to ignore when building packages. +# This supports shell glob matching, relative path matching, and +# negation (prefixed with !). Only one pattern per line. +.DS_Store +# Common VCS dirs +.git/ +.gitignore +.bzr/ +.bzrignore +.hg/ +.hgignore +.svn/ +# Common backup files +*.swp +*.bak +*.tmp +*.orig +*~ +# Various IDEs +.project +.idea/ +*.tmproj +.vscode/ diff --git a/charts/tenantmanager-cli/Chart.yaml b/charts/tenantmanager-cli/Chart.yaml new file mode 100644 index 00000000..3566b859 --- /dev/null +++ b/charts/tenantmanager-cli/Chart.yaml @@ -0,0 +1,24 @@ +apiVersion: v2 +name: tenant-manager-cli +description: A Helm chart for Kubernetes + +# A chart can be either an 'application' or a 'library' chart. +# +# Application charts are a collection of templates that can be packaged into versioned archives +# to be deployed. +# +# Library charts provide useful utilities or functions for the chart developer. They're included as +# a dependency of application charts to inject those utilities and functions into the rendering +# pipeline. Library charts do not define any templates and therefore cannot be deployed. +type: application + +# This is the chart version. This version number should be incremented each time you make changes +# to the chart and its templates, including the app version. +# Versions are expected to follow Semantic Versioning (https://semver.org/) +version: 0.1.0 + +# This is the version number of the application being deployed. This version number should be +# incremented each time you make changes to the application. Versions are not expected to +# follow Semantic Versioning. They should reflect the version the application is using. +# It is recommended to use it with quotes. +appVersion: "0.1.0" diff --git a/charts/tenantmanager-cli/README.md b/charts/tenantmanager-cli/README.md new file mode 100644 index 00000000..6b57d104 --- /dev/null +++ b/charts/tenantmanager-cli/README.md @@ -0,0 +1,39 @@ +# CMK Helm Chart +KMS2.0 helm charts + +## How To + +Download all dependencies as defined in the parent chart and sub charts. + +```bash +helm dependency build ./charts +``` + +Update the dependencies after making changes to the chart. + +```bash +helm dependency update ./charts +``` + +After changing dependencies in a sub chart, update the sub charts dependencies first +and then update the parent chart dependencies. + +```bash +helm dependency update ./charts/ +helm dependency update ./charts +``` + +Render chart templates locally and display the output. +```bash +helm template kms2x ./charts +``` + +Install entire kms2x charts +```bash +helm install kms2x ./charts +``` + +UnInstall kms2x entire deployment +```bash +helm uninstall kms2x +``` \ No newline at end of file diff --git a/charts/tenantmanager-cli/templates/NOTES.txt b/charts/tenantmanager-cli/templates/NOTES.txt new file mode 100644 index 00000000..26443dee --- /dev/null +++ b/charts/tenantmanager-cli/templates/NOTES.txt @@ -0,0 +1,16 @@ +1. Get the application URL by running these commands: +{{- if contains "NodePort" .Values.service.type }} + export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ include "tenant-manager-cli.fullname" . }}) + export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}") + echo http://$NODE_IP:$NODE_PORT +{{- else if contains "LoadBalancer" .Values.service.type }} + NOTE: It may take a few minutes for the LoadBalancer IP to be available. + You can watch its status by running 'kubectl get --namespace {{ .Release.Namespace }} svc -w {{ include "tenant-manager-cli.fullname" . }}' + export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ include "tenant-manager-cli.fullname" . }} --template "{{"{{ range (index .status.loadBalancer.ingress 0) }}{{.}}{{ end }}"}}") + echo http://$SERVICE_IP:{{ .Values.service.port }} +{{- else if contains "ClusterIP" .Values.service.type }} + export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app.kubernetes.io/name={{ include "tenant-manager-cli.name" . }},app.kubernetes.io/instance={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}") + export CONTAINER_PORT=$(kubectl get pod --namespace {{ .Release.Namespace }} $POD_NAME -o jsonpath="{.spec.containers[0].ports[0].containerPort}") + echo "Visit http://127.0.0.1:8080 to use your application" + kubectl --namespace {{ .Release.Namespace }} port-forward $POD_NAME 8080:$CONTAINER_PORT +{{- end }} diff --git a/charts/tenantmanager-cli/templates/_helpers.tpl b/charts/tenantmanager-cli/templates/_helpers.tpl new file mode 100644 index 00000000..35f552cb --- /dev/null +++ b/charts/tenantmanager-cli/templates/_helpers.tpl @@ -0,0 +1,194 @@ +{{/* +Expand the name of the chart. +*/}} +{{- define "tenant-manager-cli.name" -}} +{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }} +{{- end }} + +{{/* +Namespace for all resources to be installed into +If not defined in values file then the helm release namespace is used +By default this is not set so the helm release namespace will be used + +This gets around an problem within helm discussed here +https://github.com/helm/helm/issues/5358 +*/}} +{{- define "tenant-manager-cli.namespace" -}} + {{ .Values.namespace | default .Release.Namespace }} +{{- end -}} + +{{/* +Create a default fully qualified app name. +We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). +If release name contains chart name it will be used as a full name. +*/}} +{{- define "tenant-manager-cli.fullname" -}} +{{- if .Values.fullnameOverride }} +{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }} +{{- else }} +{{- $name := default .Chart.Name .Values.nameOverride }} +{{- if contains $name .Release.Name }} +{{- .Release.Name | trunc 63 | trimSuffix "-" }} +{{- else }} +{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }} +{{- end }} +{{- end }} +{{- end }} + +{{/* +Create chart name and version as used by the chart label. +*/}} +{{- define "tenant-manager-cli.chart" -}} +{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }} +{{- end }} + +{{/* +Common labels +*/}} +{{- define "tenant-manager-cli.labels" -}} +helm.sh/chart: {{ include "tenant-manager-cli.chart" . }} +{{ include "tenant-manager-cli.selectorLabels" . }} +{{- if .Chart.AppVersion }} +app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} +{{- end }} +app.kubernetes.io/managed-by: {{ .Release.Service }} +{{- end }} + +{{/* +Task Scheduler labels +*/}} +{{- define "tenant-manager-cli.task-scheduler.labels" -}} +helm.sh/chart: {{ include "tenant-manager-cli.chart" . }} +{{ include "tenant-manager-cli.task-scheduler.selectorLabels" . }} +{{- if .Chart.AppVersion }} +app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} +{{- end }} +app.kubernetes.io/managed-by: {{ .Release.Service }} +{{- end }} + +{{/* +Task Worker labels +*/}} +{{- define "tenant-manager-cli.task-worker.labels" -}} +helm.sh/chart: {{ include "tenant-manager-cli.chart" . }} +{{ include "tenant-manager-cli.task-worker.selectorLabels" . }} +{{- if .Chart.AppVersion }} +app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} +{{- end }} +app.kubernetes.io/managed-by: {{ .Release.Service }} +{{- end }} + +{{/* +Tenant Manager labels +*/}} +{{- define "tenant-manager-cli.tenant-manager.labels" -}} +helm.sh/chart: {{ include "tenant-manager-cli.chart" . }} +{{ include "tenant-manager-cli.tenant-manager.selectorLabels" . }} +{{- if .Chart.AppVersion }} +app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} +{{- end }} +app.kubernetes.io/managed-by: {{ .Release.Service }} +{{- end }} + +{{/* +Tenant Manager CLI labels +*/}} +{{- define "tenant-manager-cli.tenant-manager-cli.labels" -}} +helm.sh/chart: {{ include "tenant-manager-cli.chart" . }} +{{ include "tenant-manager-cli.tenant-manager-cli.selectorLabels" . }} +{{- if .Chart.AppVersion }} +app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} +{{- end }} +app.kubernetes.io/managed-by: {{ .Release.Service }} +{{- end }} + +{{/* +Selector labels +*/}} +{{- define "tenant-manager-cli.selectorLabels" -}} +app.kubernetes.io/name: {{ include "tenant-manager-cli.name" . }} +app.kubernetes.io/instance: {{ .Release.Name }} +app.kubernetes.io/component: {{ .Chart.Name }} +{{- end }} + +{{/* +task-scheduler Selector Labels +*/}} +{{- define "tenant-manager-cli.task-scheduler.selectorLabels" -}} +app.kubernetes.io/name: {{ include "tenant-manager-cli.name" . }} +app.kubernetes.io/instance: {{ .Release.Name }}-task-scheduler +app.kubernetes.io/component: {{ .Chart.Name }}-task-scheduler +{{- end }} + +{{/* +task-worker Selector Labels +*/}} +{{- define "tenant-manager-cli.task-worker.selectorLabels" -}} +app.kubernetes.io/name: {{ include "tenant-manager-cli.name" . }} +app.kubernetes.io/instance: {{ .Release.Name }}-task-worker +app.kubernetes.io/component: {{ .Chart.Name }}-task-worker +{{- end }} + +{{/* +Tenant Manager Selector labels +*/}} +{{- define "tenant-manager-cli.tenant-manager.selectorLabels" -}} +app.kubernetes.io/name: {{ include "tenant-manager-cli.name" . }}-tenant-manager +app.kubernetes.io/instance: {{ .Release.Name }}-tenant-manager +app.kubernetes.io/component: {{ .Chart.Name }}-tenant-manager +{{- end }} + +{{/* +Tenant Manager CLI Selector labels +*/}} +{{- define "tenant-manager-cli.tenant-manager-cli.selectorLabels" -}} +app.kubernetes.io/name: {{ include "tenant-manager-cli.name" . }}-tenant-manager-cli +app.kubernetes.io/instance: {{ .Release.Name }}-tenant-manager-cli +app.kubernetes.io/component: {{ .Chart.Name }}-tenant-manager-cli +{{- end }} + +{{/* +Create the name of the service account to use +*/}} +{{- define "tenant-manager-cli.serviceAccountName" -}} +{{- if .Values.serviceAccount.create }} +{{- default (include "tenant-manager-cli.fullname" .) .Values.serviceAccount.name }} +{{- else }} +{{- default "default" .Values.serviceAccount.name }} +{{- end }} +{{- end }} + +{{- define "tenant-manager-cli.postgresqlName" -}} +{{- printf "%s-postgresql" .Release.Name -}} +{{- end }} + +{{/* +Util function for generating the image URL based on the provided options. +*/}} +{{- define "tenant-manager-cli.image" -}} +{{- $defaultTag := index . 1 -}} +{{- with index . 0 -}} +{{- if .registry -}}{{ printf "%s/%s" .registry .repository }}{{- else -}}{{- .repository -}}{{- end -}} +{{- if .digest -}}{{ printf "@%s" .digest }}{{- else -}}{{ printf ":%s" (default $defaultTag .tag) }}{{- end -}} +{{- end }} +{{- end }} + +{{/* +Active plugins +*/}} +{{- define "tenant-manager-cli.plugins" -}} +{{- $ := . }} +{{- $plugins := list -}} +{{- range .plugins -}} +{{- $plugin := . -}} +{{- range .tags -}} +{{- if has . $.activePlugins -}} + +{{- $plugins = append $plugins $plugin -}} +{{- break -}} + +{{- end -}} +{{- end -}} +{{- end -}} +{{- toYaml $plugins -}} +{{- end -}} diff --git a/charts/tenantmanager-cli/templates/configmap.yaml b/charts/tenantmanager-cli/templates/configmap.yaml new file mode 100644 index 00000000..db9462b9 --- /dev/null +++ b/charts/tenantmanager-cli/templates/configmap.yaml @@ -0,0 +1,23 @@ +--- +apiVersion: v1 +kind: ConfigMap +metadata: + name: {{ include "tenant-manager-cli.name" . }}-config + labels: + {{- include "tenant-manager-cli.labels" . | nindent 4 }} +immutable: {{ .Values.application.isImmutable | default false }} +data: + config.yaml: |- + application: + name: {{ .Chart.Name }} + {{- with .Values.application }} + environment: {{ .environment }} + {{- with .labels }} + labels: + {{- toYaml . | nindent 8 }} + {{- end}} + {{- end}} + + {{- with .Values.config }} + {{- toYaml . | nindent 4 }} + {{- end}} \ No newline at end of file diff --git a/charts/tenantmanager-cli/templates/deployment.yaml b/charts/tenantmanager-cli/templates/deployment.yaml new file mode 100644 index 00000000..19dca249 --- /dev/null +++ b/charts/tenantmanager-cli/templates/deployment.yaml @@ -0,0 +1,126 @@ +--- +apiVersion: apps/v1 +kind: Deployment +metadata: + name: {{ include "tenant-manager-cli.fullname" . }} + labels: + {{- include "tenant-manager-cli.labels" . | nindent 4 }} +spec: + {{- if not .Values.hpa.enabled }} + replicas: {{ .Values.replicaCount }} + {{- end }} + selector: + matchLabels: + {{- include "tenant-manager-cli.selectorLabels" . | nindent 6 }} + template: + metadata: + {{- with .Values.pod.annotations }} + annotations: + {{- toYaml . | nindent 8 }} + {{- end }} + labels: + {{- include "tenant-manager-cli.labels" . | nindent 8 }} + {{- with .Values.pod.labels }} + {{- toYaml . | nindent 8 }} + {{- end }} + spec: + {{- with .Values.imagePullSecrets }} + imagePullSecrets: + {{- toYaml . | nindent 8 }} + {{- end }} + serviceAccountName: {{ include "tenant-manager-cli.serviceAccountName" . }} + {{- with .Values.pod.securityContext }} + securityContext: + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with .Values.extraInitContainers }} + initContainers: + {{- toYaml . | nindent 8 }} + {{- end }} + containers: + {{- with .Values.extraContainers }} + {{- toYaml . | nindent 8 }} + {{- end }} + - name: {{ include "tenant-manager-cli.name" . }} + {{- with .Values.securityContext }} + securityContext: + {{- toYaml . | nindent 12 }} + {{- end }} + image: "{{ template "tenant-manager-cli.image" (tuple .Values.image $.Chart.AppVersion) }}" + imagePullPolicy: {{ .Values.image.pullPolicy }} + {{- with .Values.image.command }} + command: [ "{{- toYaml . }}" ] + {{- end }} + {{- with .Values.image.args }} + args: + {{- toYaml . | nindent 12 }} + {{- end }} + {{- with .Values.ports }} + ports: + {{- toYaml . | nindent 12 }} + {{- end }} + env: + - name: MY_POD_IP + valueFrom: + fieldRef: + apiVersion: v1 + fieldPath: status.podIP + - name: K8S_NODE_NAME + valueFrom: + fieldRef: + fieldPath: spec.nodeName + - name: K8S_NODE_IP + valueFrom: + fieldRef: + fieldPath: status.hostIP + {{- with .Values.extraEnvs }} + {{- toYaml . | nindent 12 }} + {{- end }} + {{- with .Values.extraEnvsFrom }} + envFrom: + {{- . | toYaml | nindent 12 }} + {{- end }} + {{- with .Values.livenessProbe }} + livenessProbe: + {{- toYaml . | nindent 12 }} + {{- end }} + {{- with .Values.readinessProbe }} + readinessProbe: + {{- toYaml . | nindent 12 }} + {{- end }} + {{- with .Values.resources }} + resources: + {{- toYaml . | nindent 12 }} + {{- end }} + volumeMounts: + - name: {{ include "tenant-manager-cli.name" . }}-config-volume + mountPath: /etc/tenant-manager-cli + readOnly: true + {{- with .Values.extraVolumeMounts }} + {{- toYaml . | nindent 12 }} + {{- end }} + volumes: + - name: {{ include "tenant-manager-cli.name" . }}-config-volume + projected: + sources: + - configMap: + name: {{ include "tenant-manager-cli.name" . }}-config + {{- with .Values.extraVolumes }} + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with .Values.pod.nodeSelector }} + nodeSelector: + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with .Values.pod.affinity }} + affinity: + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with .Values.pod.topologySpreadConstraints }} + topologySpreadConstraints: + {{- toYaml . | nindent 6 }} + {{- end }} + {{- with .Values.pod.tolerations }} + tolerations: + {{- toYaml . | nindent 6 }} + {{- end }} diff --git a/charts/tenantmanager-cli/templates/hpa.yaml b/charts/tenantmanager-cli/templates/hpa.yaml new file mode 100644 index 00000000..960e7498 --- /dev/null +++ b/charts/tenantmanager-cli/templates/hpa.yaml @@ -0,0 +1,36 @@ +{{- if .Values.hpa.enabled }} +apiVersion: autoscaling/v2 +kind: HorizontalPodAutoscaler +metadata: + name: {{ include "tenant-manager-cli.fullname" . }} + labels: + {{- include "tenant-manager-cli.labels" . | nindent 4 }} +spec: + scaleTargetRef: + apiVersion: apps/v1 + kind: Deployment + name: {{ include "tenant-manager-cli.fullname" . }} + minReplicas: {{ .Values.hpa.minReplicas }} + maxReplicas: {{ .Values.hpa.maxReplicas }} + metrics: + {{- if or .Values.hpa.targetCPUUtilizationPercentage .Values.hpa.targetMemoryUtilizationPercentage }} + {{- if .Values.hpa.targetCPUUtilizationPercentage }} + - type: Resource + resource: + name: cpu + target: + type: Utilization + averageUtilization: {{ .Values.hpa.targetCPUUtilizationPercentage }} + {{- end }} + {{- if .Values.hpa.targetMemoryUtilizationPercentage }} + - type: Resource + resource: + name: memory + target: + type: Utilization + averageUtilization: {{ .Values.hpa.targetMemoryUtilizationPercentage }} + {{- end }} + {{- else }} + [] + {{- end }} +{{- end }} diff --git a/charts/tenantmanager-cli/templates/pdb.yaml b/charts/tenantmanager-cli/templates/pdb.yaml new file mode 100644 index 00000000..038b80cd --- /dev/null +++ b/charts/tenantmanager-cli/templates/pdb.yaml @@ -0,0 +1,23 @@ +{{- if .Values.pod.disruptionBudget.enabled }} +--- +apiVersion: policy/v1 +kind: PodDisruptionBudget +metadata: + name: {{ include "tenant-manager-cli.fullname" . }} + namespace: {{ include "tenant-manager-cli.namespace" . }} + labels: + {{- include "tenant-manager-cli.labels" . | nindent 4 }} +spec: + selector: + matchLabels: + {{- include "tenant-manager-cli.selectorLabels" . | nindent 6 }} + {{- if not (or (hasKey .Values.pod.disruptionBudget "minAvailable") (hasKey .Values.pod.disruptionBudget "maxUnavailable")) }} + minAvailable: 1 # Default value because minAvailable and maxUnavailable are not set + {{- end }} + {{- if hasKey .Values.pod.disruptionBudget "minAvailable" }} + minAvailable: {{ .Values.pod.disruptionBudget.minAvailable }} + {{- end }} + {{- if hasKey .Values.pod.disruptionBudget "maxUnavailable" }} + maxUnavailable: {{ .Values.pod.disruptionBudget.maxUnavailable }} + {{- end }} +{{- end }} diff --git a/charts/tenantmanager-cli/templates/service.yaml b/charts/tenantmanager-cli/templates/service.yaml new file mode 100644 index 00000000..55b2d826 --- /dev/null +++ b/charts/tenantmanager-cli/templates/service.yaml @@ -0,0 +1,22 @@ +--- +apiVersion: v1 +kind: Service +metadata: + name: {{ include "tenant-manager-cli.fullname" . }} + labels: + {{- include "tenant-manager-cli.labels" . | nindent 4 }} + {{- with .Values.service.labels }} + {{- toYaml . | nindent 4 }} + {{- end }} +{{- with .Values.service.annotations }} + annotations: + {{- toYaml . | nindent 4 }} +{{- end }} +spec: + type: {{ .Values.service.type }} +{{- with .Values.service.ports }} + ports: + {{- toYaml . | nindent 4 }} +{{- end }} + selector: + {{- include "tenant-manager-cli.selectorLabels" . | nindent 4 }} \ No newline at end of file diff --git a/charts/tenantmanager-cli/templates/serviceaccount.yaml b/charts/tenantmanager-cli/templates/serviceaccount.yaml new file mode 100644 index 00000000..7970c0fb --- /dev/null +++ b/charts/tenantmanager-cli/templates/serviceaccount.yaml @@ -0,0 +1,12 @@ +{{- if .Values.serviceAccount.create -}} +apiVersion: v1 +kind: ServiceAccount +metadata: + name: {{ include "tenant-manager-cli.serviceAccountName" . }} + labels: + {{- include "tenant-manager-cli.labels" . | nindent 4 }} + {{- with .Values.serviceAccount.annotations }} + annotations: + {{- toYaml . | nindent 4 }} + {{- end }} +automountServiceAccountToken: {{ .Values.serviceAccount.automount }} diff --git a/charts/tenantmanager-cli/values.yaml b/charts/tenantmanager-cli/values.yaml new file mode 100644 index 00000000..9953b68b --- /dev/null +++ b/charts/tenantmanager-cli/values.yaml @@ -0,0 +1,669 @@ +# Default values for cmk. +# This is a YAML-formatted file. +# Declare variables to be passed into your templates. + +# Override the "name" value, which is used to annotate some of +# the resources that are created by this Chart (using "app.kubernetes.io/name"). +# +docs:property +nameOverride: "" + +# Override the "fullname" value. This value is used as part of +# most of the names of the resources created by this Helm chart. +# +docs:property +fullnameOverride: "" + +# This namespace allows you to define where the services are installed into. +# If not set then they use the namespace of the release. +# This is helpful when installing a chart dependency (sub chart). +namespace: "" + +# This will set the replicaset count more information can be found here: https://kubernetes.io/docs/concepts/workloads/controllers/replicaset/ +replicaCount: 1 + +# This sets the container image more information can be found here: https://kubernetes.io/docs/concepts/containers/images/ +image: + # The container registry to pull the image from. + # For example: + # registry: ghcr.io/openkcm + # repository: images/checker + # +docs:property + registry: ghcr.io/openkcm + + # The container image + # +docs:property + repository: images/cmk + + # Override the image tag to deploy by setting this variable. + # If no value is set, the chart's appVersion is used. + # +docs:property + tag: "" + + # Setting a digest will override any tag. + # +docs:property + # digest: sha256:0e072dddd1f7f8fc8909a2ca6f65e76c5f0d2fcfb8be47935ae3457e8bbceb20 + + # Kubernetes imagePullPolicy. + pullPolicy: IfNotPresent + + # # Setting the arguments for the container + # # +docs:property + args: + - api-server +# - task-scheduler +# - task-worker +# - task-manager +# - task-manager-cli + # - --graceful-shutdown 2 + # - --graceful-message 'Graceful shutdown in %d seconds' + + # Setting the command + # +docs:property + #command: "./extension-server" + +# This is for the secretes for pulling an image from a private repository more information can be found here: https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/ +imagePullSecrets: +# - name: "" + +# This section builds out the service account more information can be found here: https://kubernetes.io/docs/concepts/security/service-accounts/ +serviceAccount: + # Specifies whether a service account should be created + create: true + # Automatically mount a ServiceAccount's API credentials? + automount: true + # Annotations to add to the service account + annotations: {} + # The name of the service account to use. + # If not set and create is true, a name is generated using the fullname template + name: "" + +pod: + # This is for setting Kubernetes Annotations to a Pod. + # For more information checkout: https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/ + annotations: { } + + # This is for setting Kubernetes Labels to a Pod. + # For more information checkout: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/ + labels: {} + + securityContext: {} + # fsGroup: 2000 + + disruptionBudget: + # Enable or disable the PodDisruptionBudget resource. + # + # This prevents downtime during voluntary disruptions such as during a Node upgrade. + # For example, the PodDisruptionBudget will block `kubectl drain` + # Pod is currently running. + enabled: false + + # This configures the minimum available pods for disruptions. It can either be set to + # an integer (e.g. 1) or a percentage value (e.g. 25%). + # It cannot be used if `maxUnavailable` is set. + # +docs:property + # +docs:type=unknown + # minAvailable: 1 + + # This configures the maximum unavailable pods for disruptions. It can either be set to + # an integer (e.g. 1) or a percentage value (e.g. 25%). + # it cannot be used if `minAvailable` is set. + # +docs:property + # +docs:type=unknown + # maxUnavailable: 1 + nodeSelector: { } + tolerations: [ ] + affinity: { } + topologySpreadConstraints: [] + + + + +securityContext: {} + # capabilities: + # drop: + # - ALL + # readOnlyRootFilesystem: true + # runAsNonRoot: true + # runAsUser: 1000 + + +# This is for setting up a service more information can be found here: https://kubernetes.io/docs/concepts/services-networking/service/ +service: + # Labels to add to the service + labels: {} + # Annotations to add to the service + annotations: {} + # This sets the service type more information can be found here: https://kubernetes.io/docs/concepts/services-networking/service/#publishing-services-service-types + type: ClusterIP + # This sets the ports more information can be found here: https://kubernetes.io/docs/concepts/services-networking/service/#field-spec-ports + ports: + - port: 8081 # must match .Values.cmk.port + protocol: TCP + targetPort: http + name: http + +resources: {} + # We usually recommend not to specify default resources and to leave this as a conscious + # choice for the user. This also increases chances charts run on environments with little + # resources, such as Minikube. If you do want to specify resources, uncomment the following + # lines, adjust them as necessary, and remove the curly braces after 'resources:'. + # limits: + # cpu: 100m + # memory: 128Mi + # requests: + # cpu: 100m + # memory: 128Mi + +# This is to setup the liveness and readiness probes more information can be found here: https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-startup-probes/ +livenessProbe: + httpGet: + path: /probe/liveness + port: http-status + scheme: HTTP + failureThreshold: 1 + periodSeconds: 10 +readinessProbe: + httpGet: + path: /probe/readiness + port: http-status + scheme: HTTP + failureThreshold: 1 + periodSeconds: 10 + +# This section is for setting up autoscaling more information can be found here: https://kubernetes.io/docs/concepts/workloads/autoscaling/ +hpa: + enabled: false + minReplicas: 1 + maxReplicas: 1 + targetCPUUtilizationPercentage: 80 + targetMemoryUtilizationPercentage: 80 + +# Additional init containers on the output Deployment definition. +extraInitContainers: [] + +# Additional containers on the output Deployment definition. +extraContainers: [] + +# Additional volumes on the output Deployment definition. +extraVolumes: [] + +# Additional volumeMounts on the output Deployment definition. +extraVolumeMounts: [] + +# Additional ens on the output Deployment definition. +extraEnvs: [] + +# Additional envsFrom on the output Deployment definition. +extraEnvsFrom: [] + + +ports: + - name: http-status + containerPort: 8888 + protocol: TCP + - name: http + containerPort: 8081 + protocol: TCP + +application: + isImmutable: false + # Environment where the application is running + environment: local + # Labels associated to metrics, traces and logs + labels: { } + +config: + # Feature gates + featureGates: + enrich-header-with-client-type: true + enrich-header-with-client-region: true + disable-client-certificate-computation: false + disable-jwt-token-computation: false + + http: + port: 8081 + + # Expose the status port + status: + enabled: true + address: ":8888" + profiling: false + + # Certificates configuration + certificates: + # rootCertURL + rootCertURL: https://aia.pki.co.example.com/aia/EXAMPLE%20Cloud%20Root%20CA.crt + # Validity of the certificates in days; Must be between 7 and 30 days + validityDays: 30 + # Threshold in days to rotate the certificates; Must be between 1 and 30 days + rotationThresholdDays: 7 + + ## Crypto layer configuration + cryptoLayer: + certX509Trusts: + source: embedded + value: | + { + "crypto-1": { + "Subject": "FakeCert", + "RootCA": "https://aia.pki.co.example.com/aia/EXAMPLE%20Cloud%20Root%20CA.crt" + } + } + # This does set the logger configuration + # +docs:property + logger: + level: debug # one of: debug, info, warn, error + # Format of the logs + format: json # one of: json, text + formatter: + time: + type: pattern # one of: pattern, unix + # Used only when the property type: pattern + # Should follow golang time pattern + # Default value time.RFC3339. + pattern: "Mon Jan 02 15:04:05 -0700 2006" + # Used only when the property type: unix + # Time units are "1ns", "1us" (or "1µs"), "1ms", "1s" + # Default value 1s. + precision: 1s + fields: + # Field names (this way the field name can be changed) to be used on log records; These are their defaults. + error: "error" + message: "msg" + level: "level" + time: "time" + # Fields names used by OTEL to track the Trace and Span ID + otel: + traceID: "trace.id" # Default is TraceID + spanID: "span.id" # Default is SpanID + masking: + # All fields under PII, the formatters will mask the value and keeping first 4 original characters + pii: + - email + - ip-address + # All fields under other, the formatters will mask the value, using given mask. + other: + jwt-token: "*****" + telemetry: + logs: + enabled: false + protocol: http # one of: http, grpc; Default is http + # Host configuration example set as a value: + # host: + # source: embedded + # value: localhost:4317 + # Host configuration example load value from an environment variable: + # host: + # source: env + # env: OTEL_LOGS_HOST + # Host configuration example load value from a JSON file: + # host: + # source: file + # file: + # path: /etc/credentials/config.json + # format: json # one of: json + # jsonPath: "$.credentials.ingest-otlp-endpoint" # Syntax JSONPath Query Expression + host: + source: embedded + value: localhost:4317 + url: /api/v2/otlp/v1/logs + # OpenTelemetry secret connections; Applicable in the same way for logs, traces and metrics + # Insecure configuration example: + # secretRef: + # type: insecure # one of: insecure, mtls, api-token + # APIToken configuration example loading value from environment variable: + # secretRef: + # type: api-token # one of: insecure, mtls, api-token + # apiToken: + # source: env + # env: OTEL_LOS_API_TOKEN + # APIToken configuration example loading value from binary file as is: + # secretRef: + # type: api-token # one of: insecure, mtls, api-token + # apiToken: + # source: file + # path: /etc/credentials/api-token + # format: binary # one of: json, binary + # APIToken configuration example loading value from JSON file, extracting a specific field: + # secretRef: + # type: api-token # one of: insecure, mtls, api-token + # apiToken: + # source: file + # path: /etc/credentials/api-token.json + # format: json # one of: json, binary + # jsonPath: "$.credentials.api-token" # Syntax JSONPath Query Expression + # mTLS configuration example loading value from environment variables: + # secretRef: + # type: mtls # one of: insecure, mtls, api-token + # mtls: + # cert: + # source: env + # env: OTEL_LOGS_X509_CERT + # certKey: + # source: env + # env: OTEL_LOGS_X509_CERT_KEY + # serverCA: + # source: env + # env: OTEL_LOGS_X509_SERVER_CA + # mTLS configuration example loading value from binary file as is: + # secretRef: + # type: mtls # one of: insecure, mtls, api-token + # mtls: + # cert: + # source: file + # file: + # path: /etc/credentials/cert.pem + # format: binary # one of: json, binary + # certKey: + # source: file + # file: + # path: /etc/credentials/cert-key.pem + # format: binary # one of: json, binary + # serverCA: + # source: file + # file: + # path: /etc/credentials/server-ca.pem + # format: binary # one of: json, binary + # mTLS configuration example loading value from JSON file, extracting a specific field: + # secretRef: + # type: mtls # one of: insecure, mtls, api-token + # mtls: + # cert: + # source: file + # file: + # path: /etc/credentials/config.json + # format: json # one of: json, binary + # jsonPath: "$.credentials.ingest-otlp-cert" # Syntax JSONPath Query Expression + # certKey: + # source: file + # file: + # path: /etc/credentials/config.json + # format: json # one of: json, binary + # jsonPath: "$.credentials.ingest-otlp-key" # Syntax JSONPath Query Expression + # serverCA: + # source: file + # file: + # path: /etc/credentials/config.json + # format: json # one of: json, binary + # jsonPath: "$.credentials.server-ca" # Syntax JSONPath Query Expression + secretRef: + type: api-token # one of: insecure, mtls, api-token + apiToken: + source: embedded + value: "unknown" + traces: + enabled: false + protocol: http # one of: http, grpc; Default is http + # Host configuration example set as a value: + # host: + # source: embedded + # value: localhost:4317 + # Host configuration example load value from an environment variable: + # host: + # source: env + # env: OTEL_LOGS_HOST + # Host configuration example load value from a JSON file: + # host: + # source: file + # file: + # path: /etc/credentials/config.json + # format: json # one of: json + # jsonPath: "$.credentials.ingest-otlp-endpoint" # Syntax JSONPath Query Expression + host: + source: embedded + value: localhost:4317 + url: /api/v2/otlp/v1/traces + # OpenTelemetry traces secret; See examples from logs. + secretRef: + type: api-token # insecure, mtls, api-token + apiToken: + source: embedded + value: "unknown" + metrics: + enabled: false + protocol: http # one of: http, grpc; Default is http + # Host configuration example set as a value: + # host: + # value: localhost:4317 + # Host configuration example load value from an environment variable: + # host: + # source: env + # env: OTEL_LOGS_HOST + # Host configuration example load value from a JSON file: + # host: + # source: file + # file: + # path: /etc/credentials/config.json + # format: json # one of: json + # jsonPath: "$.credentials.ingest-otlp-endpoint" # Syntax JSONPath Query Expression + host: + source: embedded + value: localhost:4317 + url: /api/v2/otlp/v1/metrics + # OpenTelemetry traces secret; See examples from logs. + secretRef: + type: api-token # insecure, mtls, api-token + apiToken: + source: embedded + value: "unknown" + # Metrics exposed through /metrics endpoint for prometheus + prometheus: + enabled: false + + # Database configuration + database: + host: + source: embedded + value: host.ns.svc.cluster.local + user: + source: embedded + value: user + secret: + source: embedded + value: secret + name: name + port: 1234 + + # Scheduler configuration + scheduler: + # Scheduler taskQueue configuration + taskQueue: + host: + source: embedded + value: host.ns.svc.cluster.local + port: 1234 + acl: + username: + source: embedded + value: default + password: + source: embedded + value: secret + enabled: true + secretRef: + type: insecure + # ServerCA is an optional field, if not provided, the default CA will be used. + # See secretRef -> see registry for spcific examples + # Scheduler tasks configuration + # Contains a list of configured tasks + # Each task consists of type name, retries count and cron expression + # Empty by default - uncomment and update example value(s) + tasks: [] +# - cronspec: "@every 1h" +# taskType: taskType1 +# retries: 1 +# - cronspec: "@every 2h" +# taskType: taskType2 +# retries: 2 +# - cronspec: "@every 3h" +# taskType: taskType3 +# retries: 3 + + # Services that CMK depends on configuration + services: + # Registry configuration + registry: + enabled: false + address: host.ns.svc.cluster.local:1234 + secretRef: + type: insecure + #secretRef: + # type: mtls + # mTLS: + # serverCA: + # source: file + # file: + # path: /etc/registry/ca + # format: binary + # cert: + # source: file + # file: + # path: /etc/registry/cert + # format: binary + # certKey: + # source: file + # file: + # path: /etc/registry/key + # format: binary + # AWS KMS configuration + aws: + kms: + port: 1234 + host: host.ns.svc.cluster.local + accessKeyId: + name: name + key: KEY + secretAccessKey: + name: name + key: KEY + + # Plugins configuration + # Contains a list of configured plugins + # Note: CMK API-server will not start without any plugin provided + # Empty by default - uncomment and update example value(s) + plugins: [] + # - name: plugin1 + # path: ./path/to/plugin1 + # type: Type1 + # logLevel: debug + # tags: ['tag1', 'tag2'] + # yamlConfiguration: | + # key1: value1 + # key2: value2 + # - name: plugin2 + # path: ./path/to/plugin2 + # type: Type2 + # logLevel: debug + # tags: ['tag1', 'tag2'] + # yamlConfiguration: | + # key1: value1 + # key2: value2 + + # Active plugins are controlled through Makefile. + # See k3d-apply-helm-chart target definition and ACTIVE_PLUGINS variable in the Makefile. + activePlugins: + # - plugin1 + # - plugin2 + # - plugin3 + + # Contains a list of System properties + # Properties set with optional are added to the system_properties table + # Properties set with internal are added to the systems table + # Can be set a displayName and default value for each property + system: + identifier: + displayName: "GTID" + internal: true + region: + displayName: "Region" + internal: true + type: + displayName: "Type" + internal: true + name: + displayName: "Name" + default: "n/a" + optional: true + systemrole: + displayName: "Role" + optional: true + systemroleid: + displayName: "RoleID" + optional: true + + # Event configuration + eventProcessor: + #secretRef: + # type: mtls + # mTLS: + # serverCA: + # source: file + # file: + # path: /etc/event-processor/secrets.json + # format: json + # jsonPath: "$.serverCA" # Syntax JSONPath Query Expression + # cert: + # source: file + # file: + # path: /etc/event-processor/secrets.json + # format: json + # jsonPath: "$.cert" # Syntax JSONPath Query Expression + # certKey: + # source: file + # file: + # path: /etc/event-processor/secrets.json + # format: json + # jsonPath: "$.certKey" # Syntax JSONPath Query Expression + # targets: + # Example of event targets: + #- region: eu10 + # amqp: + # url: "amqps://messaging.example.com:5671" + # target: "ks/eu10" + # source: "cmk/emea/keys" + #maxReconcileCount: 18 + # If want to limit the reconcile period for one task to one day, + # need maxReconcileCount = 18, as there is an exponential backoff for retries, + # starting with 10s and limiting at 10240s. + + audit: + #endpoint: http://localhost:4043/logs + #mtls: + # cert: + # source: file + # file: + # path: /etc/audit-logger/secrets.json + # format: json + # jsonPath: "$.ingest-otlp-cert" + # certKey: + # source: file + # file: + # path: /etc/audit-logger/secrets.json + # format: json + # jsonPath: "$.ingest-otlp-key" + # serverCa: + # source: file + # file: + # path: /etc/audit-logger/secrets.json + # format: json + # jsonPath: "$.server-ca" + #additionalProperties: | + # specVersion: "v1" + # appID: "cmk" + # folderPath: "/var/log/cmk" + # accountID: "123456789012" + # resourceGroupPath: "/cmk" + # region: "eu10" + # appImage: "cmk:latest" + # appVersion: "1.0.0" + + # Signed client data + clientData: + # This path is used to verify the signature of the client data + #signingKeysPath: /etc/signing-keys + + # Keystore pool configuration + # keystorePool: + # Target number of keystores to keep in the pool + # size: 5 + # Interval to report the size of the keystore pool + # interval: 10m diff --git a/cmd/apiserver/command.go b/cmd/cmk/apiserver/command.go similarity index 100% rename from cmd/apiserver/command.go rename to cmd/cmk/apiserver/command.go diff --git a/cmd/apiserver/command_test.go b/cmd/cmk/apiserver/command_test.go similarity index 100% rename from cmd/apiserver/command_test.go rename to cmd/cmk/apiserver/command_test.go diff --git a/cmd/apiserver/export_test.go b/cmd/cmk/apiserver/export_test.go similarity index 100% rename from cmd/apiserver/export_test.go rename to cmd/cmk/apiserver/export_test.go diff --git a/cmd/cmk/main.go b/cmd/cmk/main.go index 59a10d18..56ae3cc3 100644 --- a/cmd/cmk/main.go +++ b/cmd/cmk/main.go @@ -14,10 +14,9 @@ import ( slogctx "github.com/veqryn/slog-context" - "github.com/openkcm/cmk/cmd/apiserver" - "github.com/openkcm/cmk/cmd/taskscheduler" - "github.com/openkcm/cmk/cmd/taskworker" - "github.com/openkcm/cmk/cmd/tenantmanager" + "github.com/openkcm/cmk/cmd/cmk/apiserver" + "github.com/openkcm/cmk/cmd/cmk/taskscheduler" + "github.com/openkcm/cmk/cmd/cmk/taskworker" ) var ( @@ -68,7 +67,6 @@ func rootCmd() *cobra.Command { apiserver.Cmd(BuildInfo), taskscheduler.Cmd(BuildInfo), taskworker.Cmd(BuildInfo), - tenantmanager.Cmd(BuildInfo), ) return cmd diff --git a/cmd/taskscheduler/command.go b/cmd/cmk/taskscheduler/command.go similarity index 100% rename from cmd/taskscheduler/command.go rename to cmd/cmk/taskscheduler/command.go diff --git a/cmd/taskworker/command.go b/cmd/cmk/taskworker/command.go similarity index 100% rename from cmd/taskworker/command.go rename to cmd/cmk/taskworker/command.go diff --git a/cmd/tenant-manager-cli/command.go b/cmd/tenant-manager-cli/command.go new file mode 100644 index 00000000..7cf8d292 --- /dev/null +++ b/cmd/tenant-manager-cli/command.go @@ -0,0 +1,87 @@ +package main + +import ( + "context" + "fmt" + "log/slog" + "os" + "os/signal" + "syscall" + "time" + + "github.com/openkcm/common-sdk/pkg/utils" + "github.com/spf13/cobra" + slogctx "github.com/veqryn/slog-context" + + "github.com/openkcm/cmk/internal/tenant-manager/cli" +) + +var ( + // BuildInfo will be set by the build system + BuildInfo = "{}" + + isVersionCmd bool + gracefulShutdownSec int64 + gracefulShutdownMessage string +) +var versionCmd = &cobra.Command{ + Use: "version", + Short: "Tenant Manager CLI Version", + RunE: func(cmd *cobra.Command, _ []string) error { + isVersionCmd = true + + value, err := utils.ExtractFromComplexValue(BuildInfo) + if err != nil { + return err + } + + slog.InfoContext(cmd.Context(), value) + + return nil + }, +} + +func rootCmd() *cobra.Command { + factory := cli.NewCommandFactory() + + return cli.InitWithCommandFactory( + factory.NewCreateGroupsCmd(), + factory.NewCreateTenantCmd(), + factory.NewDeleteTenantCmd(), + factory.NewGetTenantCmd(), + factory.NewListTenantsCmd(), + factory.NewUpdateTenantCmd(), + versionCmd, + ) +} + +func execute() error { + ctx, cancelOnSignal := signal.NotifyContext( + context.Background(), + os.Interrupt, syscall.SIGTERM, + ) + defer cancelOnSignal() + + err := rootCmd().ExecuteContext(ctx) + if err != nil { + slogctx.Error(ctx, "Failed to start the application", "error", err) + _, _ = fmt.Fprintln(os.Stderr, err) + + return err + } + + // graceful shutdown so running goroutines may finish + if !isVersionCmd { + _, _ = fmt.Fprintln(os.Stderr, fmt.Sprintf(gracefulShutdownMessage, gracefulShutdownSec)) + time.Sleep(time.Duration(gracefulShutdownSec) * time.Second) + } + + return nil +} + +func main() { + err := execute() + if err != nil { + os.Exit(1) + } +} diff --git a/cmd/tenantmanager/command.go b/cmd/tenant-manager/command.go similarity index 68% rename from cmd/tenantmanager/command.go rename to cmd/tenant-manager/command.go index eda5ff3a..255024ee 100644 --- a/cmd/tenantmanager/command.go +++ b/cmd/tenant-manager/command.go @@ -1,28 +1,33 @@ -package tenantmanager +package main import ( "context" + "fmt" "log/slog" + "os" + "os/signal" "syscall" "time" + "github.com/openkcm/cmk/internal/config" + "github.com/openkcm/cmk/internal/db/dsn" + "github.com/openkcm/cmk/internal/log" + "github.com/openkcm/cmk/internal/tenant-manager/business" "github.com/openkcm/common-sdk/pkg/commoncfg" "github.com/openkcm/common-sdk/pkg/health" "github.com/openkcm/common-sdk/pkg/logger" "github.com/openkcm/common-sdk/pkg/otlp" "github.com/openkcm/common-sdk/pkg/status" + "github.com/openkcm/common-sdk/pkg/utils" "github.com/samber/oops" "github.com/spf13/cobra" - - "github.com/openkcm/cmk/cmd/tenantmanager/cli" - "github.com/openkcm/cmk/internal/config" - "github.com/openkcm/cmk/internal/constants" - "github.com/openkcm/cmk/internal/db/dsn" - "github.com/openkcm/cmk/internal/log" - "github.com/openkcm/cmk/internal/tenant-manager/business" + slogctx "github.com/veqryn/slog-context" ) const ( + DefaultConfigPath1 = "/etc/tenant-manager" + DefaultConfigPath2 = "$HOME/.tenant-manager" + defaultTimeout = 5 errMsgLoadConfig = "Failed to load the configuration" errMsgLoggerInit = "Failed to initialise the logger" @@ -82,15 +87,41 @@ func loadConfig() (*config.Config, error) { err := commoncfg.LoadConfig( cfg, map[string]any{}, - constants.DefaultConfigPath1, - constants.DefaultConfigPath2, + DefaultConfigPath1, + DefaultConfigPath2, ".", ) return cfg, err } -func Cmd(buildInfo string) *cobra.Command { +var ( + // BuildInfo will be set by the build system + BuildInfo = "{}" + + isVersionCmd bool + gracefulShutdownSec int64 + gracefulShutdownMessage string +) + +var versionCmd = &cobra.Command{ + Use: "version", + Short: "Tenant Manager Version", + RunE: func(cmd *cobra.Command, _ []string) error { + isVersionCmd = true + + value, err := utils.ExtractFromComplexValue(BuildInfo) + if err != nil { + return err + } + + slog.InfoContext(cmd.Context(), value) + + return nil + }, +} + +func rootCmd() *cobra.Command { var cmd = &cobra.Command{ Use: "tenant-manager", Short: "CMK the Tenant Manager", @@ -106,7 +137,7 @@ func Cmd(buildInfo string) *cobra.Command { } // Update Version - err = commoncfg.UpdateConfigVersion(&cfg.BaseConfig, buildInfo) + err = commoncfg.UpdateConfigVersion(&cfg.BaseConfig, BuildInfo) if err != nil { return oops.In("main"). Wrapf(err, "Failed to update the version configuration") @@ -140,9 +171,38 @@ func Cmd(buildInfo string) *cobra.Command { }, } - cmd.AddCommand( - cli.Cmd(), - ) + cmd.AddCommand(versionCmd) return cmd } + +func execute() error { + ctx, cancelOnSignal := signal.NotifyContext( + context.Background(), + os.Interrupt, syscall.SIGTERM, + ) + defer cancelOnSignal() + + err := rootCmd().ExecuteContext(ctx) + if err != nil { + slogctx.Error(ctx, "Failed to start the application", "error", err) + _, _ = fmt.Fprintln(os.Stderr, err) + + return err + } + + // graceful shutdown so running goroutines may finish + if !isVersionCmd { + _, _ = fmt.Fprintln(os.Stderr, fmt.Sprintf(gracefulShutdownMessage, gracefulShutdownSec)) + time.Sleep(time.Duration(gracefulShutdownSec) * time.Second) + } + + return nil +} + +func main() { + err := execute() + if err != nil { + os.Exit(1) + } +} diff --git a/cmd/tenantmanager/cli/command.go b/cmd/tenantmanager/cli/command.go deleted file mode 100644 index f510bb13..00000000 --- a/cmd/tenantmanager/cli/command.go +++ /dev/null @@ -1,20 +0,0 @@ -package cli - -import ( - "github.com/spf13/cobra" - - "github.com/openkcm/cmk/internal/tenant-manager/cli" -) - -func Cmd() *cobra.Command { - factory := cli.NewCommandFactory() - - return cli.InitWithCommandFactory( - factory.NewCreateGroupsCmd(), - factory.NewCreateTenantCmd(), - factory.NewDeleteTenantCmd(), - factory.NewGetTenantCmd(), - factory.NewListTenantsCmd(), - factory.NewUpdateTenantCmd(), - ) -} diff --git a/cmd/tenantmanager/command_test.go b/cmd/tenantmanager/command_test.go deleted file mode 100644 index 5f9370f2..00000000 --- a/cmd/tenantmanager/command_test.go +++ /dev/null @@ -1,55 +0,0 @@ -package tenantmanager_test - -import ( - "os" - "testing" - "time" - - "github.com/stretchr/testify/require" - - "github.com/openkcm/cmk/cmd/tenantmanager" - "github.com/openkcm/cmk/internal/config" -) - -func TestLoadConfig(t *testing.T) { - t.Run("Should return error if config file not found", func(t *testing.T) { - _, err := tenantmanager.LoadConfig() - t.Log("Error:", err) - require.Error(t, err) - }) - - t.Run("Should return error if config file has wrong struct", func(t *testing.T) { - content := []byte("application:\n nameE: test-app\n") - err := os.WriteFile("config.yaml", content, 0600) - require.NoError(t, err) - - defer os.Remove("config.yaml") - - _, err = tenantmanager.LoadConfig() - t.Log("Error:", err) - require.Error(t, err) - }) - - t.Run("Should load config if config file exists", func(t *testing.T) { - content := []byte("application:\n name: test-app\nlogger:\n level: info\n") - err := os.WriteFile("config.yaml", content, 0600) - require.NoError(t, err) - - defer os.Remove("config.yaml") - - cfg, err := tenantmanager.LoadConfig() - require.NoError(t, err) - require.NotNil(t, cfg) - require.Equal(t, "test-app", cfg.Application.Name) - }) -} - -func TestStartStatusServer(t *testing.T) { - cfg := &config.Config{} - - // Call and check for no panic. - tenantmanager.StartStatusServer(t.Context(), cfg) - - // Optionally, wait a short time to let the goroutine start - time.Sleep(100 * time.Millisecond) -} diff --git a/cmd/tenantmanager/export_test.go b/cmd/tenantmanager/export_test.go deleted file mode 100644 index 627c8aba..00000000 --- a/cmd/tenantmanager/export_test.go +++ /dev/null @@ -1,6 +0,0 @@ -package tenantmanager - -var ( - LoadConfig = loadConfig - StartStatusServer = startStatusServer -) diff --git a/internal/tenant-manager/cli/command.go b/internal/tenant-manager/cli/command.go index bb006360..0cf0a231 100644 --- a/internal/tenant-manager/cli/command.go +++ b/internal/tenant-manager/cli/command.go @@ -18,6 +18,11 @@ import ( "github.com/openkcm/cmk/internal/db" ) +const ( + DefaultConfigPath1 = "/etc/tenant-manager-cli" + DefaultConfigPath2 = "$HOME/.tenant-manager-cli" +) + var ( id, region, status string sleep bool @@ -43,8 +48,8 @@ func loadConfig() (*config.Config, error) { loader := commoncfg.NewLoader( cfg, commoncfg.WithPaths( - constants.DefaultConfigPath1, - constants.DefaultConfigPath2, + DefaultConfigPath1, + DefaultConfigPath2, ".", ), commoncfg.WithEnvOverride(constants.APIName), @@ -85,7 +90,7 @@ func (f *CommandFactory) db(ctx context.Context) (*multitenancy.DB, error) { func InitWithCommandFactory(cmds ...*cobra.Command) *cobra.Command { cmd := &cobra.Command{ - Use: "cli", + Use: "tenant-manager-cli", Short: "Tenant Manager CLI Application", Long: "Tenant Manager is a simple CLI tool to manage tenants, supporting: creating tenant, " + "creating tenant with groups, " + From 4adf40194f5246f8b9819d3464d9e2dd05511ea3 Mon Sep 17 00:00:00 2001 From: Nicolae Nicora Date: Tue, 14 Oct 2025 15:06:32 +0200 Subject: [PATCH 09/14] renamed the folder --- charts/{cmk => core}/.helmignore | 0 charts/{cmk => core}/Chart.yaml | 0 charts/{cmk => core}/README.md | 0 charts/{cmk => core}/templates/NOTES.txt | 0 charts/{cmk => core}/templates/_helpers.tpl | 0 charts/{cmk => core}/templates/configmap.yaml | 0 charts/{cmk => core}/templates/deployment.yaml | 0 charts/{cmk => core}/templates/hpa.yaml | 0 charts/{cmk => core}/templates/pdb.yaml | 0 charts/{cmk => core}/templates/service.yaml | 0 charts/{cmk => core}/templates/serviceaccount.yaml | 0 charts/{cmk => core}/values.yaml | 0 cmd/{cmk => core}/apiserver/command.go | 0 cmd/{cmk => core}/apiserver/command_test.go | 2 +- cmd/{cmk => core}/apiserver/export_test.go | 0 cmd/{cmk => core}/main.go | 6 +++--- cmd/{cmk => core}/taskscheduler/command.go | 0 cmd/{cmk => core}/taskworker/command.go | 0 18 files changed, 4 insertions(+), 4 deletions(-) rename charts/{cmk => core}/.helmignore (100%) rename charts/{cmk => core}/Chart.yaml (100%) rename charts/{cmk => core}/README.md (100%) rename charts/{cmk => core}/templates/NOTES.txt (100%) rename charts/{cmk => core}/templates/_helpers.tpl (100%) rename charts/{cmk => core}/templates/configmap.yaml (100%) rename charts/{cmk => core}/templates/deployment.yaml (100%) rename charts/{cmk => core}/templates/hpa.yaml (100%) rename charts/{cmk => core}/templates/pdb.yaml (100%) rename charts/{cmk => core}/templates/service.yaml (100%) rename charts/{cmk => core}/templates/serviceaccount.yaml (100%) rename charts/{cmk => core}/values.yaml (100%) rename cmd/{cmk => core}/apiserver/command.go (100%) rename cmd/{cmk => core}/apiserver/command_test.go (97%) rename cmd/{cmk => core}/apiserver/export_test.go (100%) rename cmd/{cmk => core}/main.go (93%) rename cmd/{cmk => core}/taskscheduler/command.go (100%) rename cmd/{cmk => core}/taskworker/command.go (100%) diff --git a/charts/cmk/.helmignore b/charts/core/.helmignore similarity index 100% rename from charts/cmk/.helmignore rename to charts/core/.helmignore diff --git a/charts/cmk/Chart.yaml b/charts/core/Chart.yaml similarity index 100% rename from charts/cmk/Chart.yaml rename to charts/core/Chart.yaml diff --git a/charts/cmk/README.md b/charts/core/README.md similarity index 100% rename from charts/cmk/README.md rename to charts/core/README.md diff --git a/charts/cmk/templates/NOTES.txt b/charts/core/templates/NOTES.txt similarity index 100% rename from charts/cmk/templates/NOTES.txt rename to charts/core/templates/NOTES.txt diff --git a/charts/cmk/templates/_helpers.tpl b/charts/core/templates/_helpers.tpl similarity index 100% rename from charts/cmk/templates/_helpers.tpl rename to charts/core/templates/_helpers.tpl diff --git a/charts/cmk/templates/configmap.yaml b/charts/core/templates/configmap.yaml similarity index 100% rename from charts/cmk/templates/configmap.yaml rename to charts/core/templates/configmap.yaml diff --git a/charts/cmk/templates/deployment.yaml b/charts/core/templates/deployment.yaml similarity index 100% rename from charts/cmk/templates/deployment.yaml rename to charts/core/templates/deployment.yaml diff --git a/charts/cmk/templates/hpa.yaml b/charts/core/templates/hpa.yaml similarity index 100% rename from charts/cmk/templates/hpa.yaml rename to charts/core/templates/hpa.yaml diff --git a/charts/cmk/templates/pdb.yaml b/charts/core/templates/pdb.yaml similarity index 100% rename from charts/cmk/templates/pdb.yaml rename to charts/core/templates/pdb.yaml diff --git a/charts/cmk/templates/service.yaml b/charts/core/templates/service.yaml similarity index 100% rename from charts/cmk/templates/service.yaml rename to charts/core/templates/service.yaml diff --git a/charts/cmk/templates/serviceaccount.yaml b/charts/core/templates/serviceaccount.yaml similarity index 100% rename from charts/cmk/templates/serviceaccount.yaml rename to charts/core/templates/serviceaccount.yaml diff --git a/charts/cmk/values.yaml b/charts/core/values.yaml similarity index 100% rename from charts/cmk/values.yaml rename to charts/core/values.yaml diff --git a/cmd/cmk/apiserver/command.go b/cmd/core/apiserver/command.go similarity index 100% rename from cmd/cmk/apiserver/command.go rename to cmd/core/apiserver/command.go diff --git a/cmd/cmk/apiserver/command_test.go b/cmd/core/apiserver/command_test.go similarity index 97% rename from cmd/cmk/apiserver/command_test.go rename to cmd/core/apiserver/command_test.go index 42464f67..7fb81aba 100644 --- a/cmd/cmk/apiserver/command_test.go +++ b/cmd/core/apiserver/command_test.go @@ -8,7 +8,7 @@ import ( "github.com/openkcm/common-sdk/pkg/commoncfg" "github.com/stretchr/testify/require" - "github.com/openkcm/cmk/cmd/apiserver" + "github.com/openkcm/cmk/cmd/core/apiserver" "github.com/openkcm/cmk/internal/config" ) diff --git a/cmd/cmk/apiserver/export_test.go b/cmd/core/apiserver/export_test.go similarity index 100% rename from cmd/cmk/apiserver/export_test.go rename to cmd/core/apiserver/export_test.go diff --git a/cmd/cmk/main.go b/cmd/core/main.go similarity index 93% rename from cmd/cmk/main.go rename to cmd/core/main.go index 56ae3cc3..12aee006 100644 --- a/cmd/cmk/main.go +++ b/cmd/core/main.go @@ -14,9 +14,9 @@ import ( slogctx "github.com/veqryn/slog-context" - "github.com/openkcm/cmk/cmd/cmk/apiserver" - "github.com/openkcm/cmk/cmd/cmk/taskscheduler" - "github.com/openkcm/cmk/cmd/cmk/taskworker" + "github.com/openkcm/cmk/cmd/core/apiserver" + "github.com/openkcm/cmk/cmd/core/taskscheduler" + "github.com/openkcm/cmk/cmd/core/taskworker" ) var ( diff --git a/cmd/cmk/taskscheduler/command.go b/cmd/core/taskscheduler/command.go similarity index 100% rename from cmd/cmk/taskscheduler/command.go rename to cmd/core/taskscheduler/command.go diff --git a/cmd/cmk/taskworker/command.go b/cmd/core/taskworker/command.go similarity index 100% rename from cmd/cmk/taskworker/command.go rename to cmd/core/taskworker/command.go From 04fb56a77ce2f93fab469851b10568b03d8c6ab9 Mon Sep 17 00:00:00 2001 From: Nicolae Nicora Date: Tue, 14 Oct 2025 15:07:08 +0200 Subject: [PATCH 10/14] renamed the folder --- Taskfile.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Taskfile.yaml b/Taskfile.yaml index 2bca5341..da6d7859 100644 --- a/Taskfile.yaml +++ b/Taskfile.yaml @@ -7,6 +7,6 @@ includes: excludes: [] # put task names in here which are overwritten in this file vars: CODE_DIRS: '{{.ROOT_DIR}}/cmd/... {{.ROOT_DIR}}/internal/... {{.ROOT_DIR}}/apis/... {{.ROOT_DIR}}/providers/... {{.ROOT_DIR}}/test/... {{.ROOT_DIR}}/utils/...' - COMPONENTS: 'cmk tenant-manager tenant-manager-cli' + COMPONENTS: 'core tenant-manager tenant-manager-cli' REPO_URL: 'https://github.com/openkcm/cmk' From 9e914e72c2a167b6cb11fd1fc4b0e57178101d96 Mon Sep 17 00:00:00 2001 From: Nicolae Nicora Date: Tue, 14 Oct 2025 15:24:39 +0200 Subject: [PATCH 11/14] fix lints --- cmd/tenant-manager-cli/command.go | 1 + cmd/tenant-manager/command.go | 10 ++++++---- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/cmd/tenant-manager-cli/command.go b/cmd/tenant-manager-cli/command.go index 7cf8d292..9c455a6d 100644 --- a/cmd/tenant-manager-cli/command.go +++ b/cmd/tenant-manager-cli/command.go @@ -11,6 +11,7 @@ import ( "github.com/openkcm/common-sdk/pkg/utils" "github.com/spf13/cobra" + slogctx "github.com/veqryn/slog-context" "github.com/openkcm/cmk/internal/tenant-manager/cli" diff --git a/cmd/tenant-manager/command.go b/cmd/tenant-manager/command.go index 255024ee..61a1fe66 100644 --- a/cmd/tenant-manager/command.go +++ b/cmd/tenant-manager/command.go @@ -9,10 +9,6 @@ import ( "syscall" "time" - "github.com/openkcm/cmk/internal/config" - "github.com/openkcm/cmk/internal/db/dsn" - "github.com/openkcm/cmk/internal/log" - "github.com/openkcm/cmk/internal/tenant-manager/business" "github.com/openkcm/common-sdk/pkg/commoncfg" "github.com/openkcm/common-sdk/pkg/health" "github.com/openkcm/common-sdk/pkg/logger" @@ -21,7 +17,13 @@ import ( "github.com/openkcm/common-sdk/pkg/utils" "github.com/samber/oops" "github.com/spf13/cobra" + slogctx "github.com/veqryn/slog-context" + + "github.com/openkcm/cmk/internal/config" + "github.com/openkcm/cmk/internal/db/dsn" + "github.com/openkcm/cmk/internal/log" + "github.com/openkcm/cmk/internal/tenant-manager/business" ) const ( From 8e189abd86b27239830247ecae018b24f98353b7 Mon Sep 17 00:00:00 2001 From: Nicolae Nicora Date: Fri, 24 Oct 2025 17:05:51 +0200 Subject: [PATCH 12/14] fix: renaming of repo name # Conflicts: # Taskfile.yaml # cmd/api-server/main_test.go # cmd/task-scheduler/main.go # cmd/task-worker/main.go # cmd/tenant-manager-cli/main.go # cmd/tenant-manager-cli/main_test.go # cmd/tenant-manager/command.go # cmd/tenant-manager/main_test.go # internal/tenant-manager/business/business.go # internal/tenant-manager/business/business_test.go # internal/tenant-manager/cli/cli_test.go # internal/tenant-manager/cli/creategroupscmd.go # internal/tenant-manager/cli/createtenantcmd.go # internal/tenant-manager/cli/db_test.go # internal/tenant-manager/cli/deletetenantcmd.go # internal/tenant-manager/cli/listtenantscmd.go # internal/tenant-manager/cli/updatetenantcmd.go # internal/tenant-manager/db/db_test.go # internal/tenant-manager/operator/operator.go # internal/tenant-manager/operator/operator_test.go # internal/tenant-manager/operator/probe_test.go # tenant-manager/tenant-cli/cmd/commands.go --- .golangci.yaml | 2 +- .release/release-metadata.hcl | 2 +- CHANGELOG.md | 6 ++-- README.md | 8 +++--- REUSE.toml | 2 +- Taskfile.yaml | 2 +- benchmark/system_model_test.go | 10 +++---- benchmark/total_lazyload_test.go | 10 +++---- cmd/core/apiserver/command.go | 16 +++++------ cmd/core/apiserver/command_test.go | 4 +-- cmd/core/main.go | 6 ++-- cmd/core/taskscheduler/command.go | 8 +++--- cmd/core/taskworker/command.go | 8 +++--- cmd/tenant-manager-cli/command.go | 2 +- cmd/tenant-manager/command.go | 8 +++--- go.mod | 2 +- .../clientcertificates/clientcertificates.go | 10 +++---- .../clientcertificates_test.go | 10 +++---- internal/api/transform/group/group.go | 8 +++--- internal/api/transform/group/group_test.go | 8 +++--- .../transform/importparams/importparams.go | 4 +-- .../importparams/importparams_test.go | 6 ++-- internal/api/transform/key/hyokkey/hyokkey.go | 12 ++++---- .../api/transform/key/hyokkey/hyokkey_test.go | 10 +++---- internal/api/transform/key/key.go | 22 +++++++-------- internal/api/transform/key/key_test.go | 20 ++++++------- internal/api/transform/key/sysmr/mrkey.go | 12 ++++---- .../api/transform/key/sysmr/mrkey_test.go | 10 +++---- .../transform/key/transformer/transformer.go | 8 +++--- .../key/transformer/transformer_test.go | 12 ++++---- .../keyconfiguration/keyconfiguration.go | 14 +++++----- .../keyconfiguration/keyconfiguration_test.go | 14 +++++----- .../api/transform/keyversion/keyversion.go | 8 +++--- .../transform/keyversion/keyversion_test.go | 12 ++++---- internal/api/transform/label/key_label.go | 12 ++++---- .../api/transform/label/key_label_test.go | 14 +++++----- internal/api/transform/list_test.go | 4 +-- internal/api/transform/system/system.go | 6 ++-- internal/api/transform/system/system_test.go | 10 +++---- internal/api/transform/tags/tags.go | 6 ++-- internal/api/transform/tags/tags_test.go | 8 +++--- internal/api/transform/tenant/tenant.go | 4 +-- .../api/transform/tenantconfigs/keystore.go | 4 +-- .../transform/tenantconfigs/keystore_test.go | 10 +++---- internal/api/transform/workflow/workflow.go | 8 +++--- .../api/transform/workflow/workflow_test.go | 10 +++---- internal/api/write/write.go | 6 ++-- internal/api/write/write_test.go | 8 +++--- internal/apierrors/base.go | 2 +- internal/apierrors/base_test.go | 4 +-- internal/apierrors/default.go | 4 +-- internal/apierrors/export_test.go | 2 +- internal/apierrors/groups.go | 6 ++-- internal/apierrors/key.go | 12 ++++---- internal/apierrors/keyconfiguration.go | 6 ++-- internal/apierrors/keyversion.go | 4 +-- internal/apierrors/labels.go | 4 +-- internal/apierrors/mapping.go | 6 ++-- internal/apierrors/mapping_test.go | 12 ++++---- internal/apierrors/priority.go | 4 +-- internal/apierrors/system.go | 8 +++--- internal/apierrors/tags.go | 2 +- internal/apierrors/tenant.go | 2 +- internal/apierrors/tenantconfigs.go | 2 +- internal/apierrors/workflow.go | 8 +++--- internal/async/async.go | 18 ++++++------ internal/async/async_test.go | 6 ++-- internal/async/scheduler_task_config.go | 2 +- internal/async/scheduler_task_config_test.go | 4 +-- internal/async/tasks/cert_rotation.go | 14 +++++----- internal/async/tasks/cert_rotation_test.go | 10 +++---- internal/async/tasks/hyok_sync.go | 12 ++++---- internal/async/tasks/hyok_sync_test.go | 8 +++--- internal/async/tasks/keystore_pool.go | 6 ++-- internal/async/tasks/keystore_pool_test.go | 8 +++--- internal/async/tasks/system_refresh.go | 12 ++++---- internal/async/tasks/system_refresh_test.go | 6 ++-- internal/auditor/auditor.go | 8 +++--- internal/auditor/auditor_test.go | 6 ++-- internal/auditor/key_test.go | 4 +-- internal/auditor/system_test.go | 2 +- internal/authz/authorization.go | 6 ++-- internal/authz/authorization_data.go | 2 +- internal/authz/authorization_test.go | 6 ++-- internal/authz/authz_logging.go | 2 +- internal/authz/policies.go | 2 +- internal/authz/request.go | 4 +-- internal/authz/request_test.go | 6 ++-- internal/clients/factory.go | 4 +-- internal/clients/registry/registry.go | 2 +- internal/clients/registry/systems/client.go | 4 +-- .../clients/registry/systems/client_test.go | 4 +-- .../clients/registry/systems/fake_service.go | 2 +- .../clients/registry/systems/helpers_test.go | 2 +- internal/clients/registry/systems/mapper.go | 2 +- .../clients/registry/systems/mapper_test.go | 4 +-- internal/config/config.go | 2 +- internal/config/config_test.go | 4 +-- internal/constants/logging_test.go | 2 +- internal/controllers/cmk/base_controller.go | 14 +++++----- internal/controllers/cmk/group_controller.go | 20 ++++++------- .../controllers/cmk/group_controller_test.go | 12 ++++---- internal/controllers/cmk/key_controller.go | 18 ++++++------ .../controllers/cmk/key_controller_test.go | 14 +++++----- .../controllers/cmk/key_labels_controller.go | 14 +++++----- .../cmk/key_labels_controller_test.go | 14 +++++----- .../cmk/keyconfiguration_controller.go | 16 +++++------ .../cmk/keyconfiguration_controller_test.go | 20 ++++++------- .../cmk/keyconfiguration_tags_controller.go | 12 ++++---- .../keyconfiguration_tags_controller_test.go | 12 ++++---- .../controllers/cmk/keyversion_controller.go | 14 +++++----- .../cmk/keyversion_controller_test.go | 12 ++++---- internal/controllers/cmk/system_controller.go | 10 +++---- .../controllers/cmk/system_controller_test.go | 20 ++++++------- internal/controllers/cmk/tenant_controller.go | 16 +++++------ .../controllers/cmk/tenant_controller_test.go | 6 ++-- .../cmk/tenantconfigs_controller.go | 8 +++--- .../cmk/tenantconfigs_controller_test.go | 4 +-- .../controllers/cmk/workflow_controller.go | 14 +++++----- .../cmk/workflow_controller_test.go | 14 +++++----- internal/daemon/server.go | 20 ++++++------- internal/daemon/server_test.go | 4 +-- internal/db/connection.go | 8 +++--- internal/db/connection_test.go | 6 ++-- internal/db/db.go | 8 +++--- internal/db/db_test.go | 8 +++--- internal/db/dsn/postgres.go | 4 +-- internal/event-processor/crypto.go | 16 +++++------ internal/event-processor/job_methods.go | 4 +-- internal/event-processor/proto/task.pb.go | 2 +- internal/event-processor/proto/task.proto | 2 +- internal/grpc/catalog/catalog.go | 4 +-- internal/grpc/catalog/catalog_test.go | 4 +-- internal/handlers/handlers.go | 10 +++---- internal/handlers/handlers_test.go | 8 +++--- internal/log/log.go | 4 +-- internal/manager/authz.go | 14 +++++----- internal/manager/authz_test.go | 12 ++++---- internal/manager/base.go | 10 +++---- internal/manager/base_test.go | 10 +++---- internal/manager/certificate.go | 14 +++++----- internal/manager/certificate_test.go | 16 +++++------ internal/manager/export_test.go | 4 +-- internal/manager/group.go | 14 +++++----- internal/manager/group_test.go | 16 +++++------ internal/manager/importparams.go | 6 ++-- internal/manager/importparams_test.go | 6 ++-- internal/manager/key.go | 18 ++++++------ internal/manager/key_label.go | 6 ++-- internal/manager/key_label_test.go | 12 ++++---- internal/manager/key_test.go | 24 ++++++++-------- internal/manager/keyconfiguration.go | 10 +++---- internal/manager/keyconfiguration_tag.go | 4 +-- internal/manager/keyconfiguration_tag_test.go | 14 +++++----- internal/manager/keyconfiguration_test.go | 22 +++++++-------- internal/manager/keystorepool.go | 6 ++-- internal/manager/keystorepool_test.go | 8 +++--- internal/manager/keyversion.go | 14 +++++----- internal/manager/keyversion_test.go | 18 ++++++------ internal/manager/notification.go | 2 +- internal/manager/notification_test.go | 8 +++--- internal/manager/providerconfigmanager.go | 16 +++++------ internal/manager/system.go | 28 +++++++++---------- internal/manager/system_test.go | 28 +++++++++---------- internal/manager/systeminformation.go | 12 ++++---- internal/manager/systeminformation_test.go | 14 +++++----- internal/manager/tag.go | 4 +-- internal/manager/tenant.go | 6 ++-- internal/manager/tenant_test.go | 6 ++-- internal/manager/tenantconfigs.go | 10 +++---- internal/manager/tenantconfigs_test.go | 14 +++++----- internal/manager/workflow.go | 16 +++++------ internal/manager/workflow_test.go | 26 ++++++++--------- internal/middleware/clientdata.go | 4 +-- internal/middleware/clientdata_test.go | 6 ++-- internal/middleware/context.go | 2 +- internal/middleware/logging.go | 2 +- internal/middleware/logging_test.go | 2 +- internal/middleware/multitenancy_test.go | 2 +- internal/middleware/oapi_validator.go | 2 +- internal/middleware/panic.go | 6 ++-- internal/middleware/panic_test.go | 2 +- internal/model/certificate_test.go | 2 +- internal/model/group.go | 2 +- internal/model/group_test.go | 2 +- internal/model/importparams_test.go | 2 +- internal/model/key_test.go | 2 +- internal/model/keyconfiguration_test.go | 2 +- internal/model/keystore_config.go | 2 +- internal/model/keystore_config_test.go | 2 +- internal/model/keyversion_test.go | 2 +- internal/model/label_test.go | 2 +- internal/model/system.go | 4 +-- internal/model/system_test.go | 2 +- internal/model/tag_test.go | 2 +- internal/model/tenant_status_test.go | 2 +- internal/model/tenant_test.go | 6 ++-- internal/model/workflow_test.go | 2 +- internal/plugins/builtin/builtin.go | 12 ++++---- internal/repo/mock/db.go | 6 ++-- internal/repo/mock/db_test.go | 6 ++-- internal/repo/mock/multitenancydb_test.go | 4 +-- internal/repo/mock/repo.go | 6 ++-- internal/repo/mock/repo_test.go | 8 +++--- internal/repo/query_test.go | 4 +-- internal/repo/repository.go | 4 +-- internal/repo/repository_test.go | 6 ++-- internal/repo/sql/repo.go | 12 ++++---- internal/repo/sql/repo_test.go | 8 +++--- internal/repo/violations/postgres_test.go | 2 +- internal/tenant-manager/business/business.go | 10 +++---- .../tenant-manager/business/business_test.go | 6 ++-- internal/tenant-manager/cli/cli_test.go | 12 ++++---- internal/tenant-manager/cli/command.go | 6 ++-- .../tenant-manager/cli/creategroupscmd.go | 4 +-- .../tenant-manager/cli/createtenantcmd.go | 6 ++-- internal/tenant-manager/cli/db_test.go | 12 ++++---- .../tenant-manager/cli/deletetenantcmd.go | 6 ++-- internal/tenant-manager/cli/gettenantcmd.go | 2 +- internal/tenant-manager/cli/listtenantscmd.go | 6 ++-- .../tenant-manager/cli/updatetenantcmd.go | 6 ++-- internal/tenant-manager/cli/utils.go | 4 +-- internal/tenant-manager/db/db.go | 14 +++++----- internal/tenant-manager/db/db_test.go | 12 ++++---- .../tenant-manager/operator/export_test.go | 2 +- internal/tenant-manager/operator/operator.go | 18 ++++++------ .../tenant-manager/operator/operator_test.go | 12 ++++---- internal/tenant-manager/operator/probe.go | 12 ++++---- .../tenant-manager/operator/probe_test.go | 12 ++++---- internal/testutils/api.go | 14 +++++----- internal/testutils/api_test.go | 2 +- internal/testutils/certificate.go | 4 +-- internal/testutils/certificate_test.go | 6 ++-- internal/testutils/db.go | 8 +++--- internal/testutils/db_error.go | 4 +-- internal/testutils/db_error_test.go | 2 +- internal/testutils/db_test.go | 4 +-- internal/testutils/grpc.go | 2 +- internal/testutils/model.go | 12 ++++---- internal/testutils/mutator_test.go | 2 +- internal/testutils/system.go | 2 +- internal/testutils/system_test.go | 4 +-- .../certificateissuer/main_test.go | 2 +- .../identitymanagement/main_test.go | 2 +- .../testutils/testplugins/keystoreop/main.go | 2 +- .../testplugins/keystoreop/main_test.go | 4 +-- .../testplugins/notification/main_test.go | 2 +- .../systeminformation/main_test.go | 2 +- internal/workflow/errors.go | 2 +- internal/workflow/key_actions.go | 8 +++--- internal/workflow/key_actions_test.go | 12 ++++---- .../workflow/key_configuration_actions.go | 2 +- .../key_configuration_actions_test.go | 10 +++---- internal/workflow/system_actions.go | 4 +-- internal/workflow/system_actions_test.go | 10 +++---- internal/workflow/workflow.go | 10 +++---- internal/workflow/workflow_test.go | 22 +++++++-------- providers/clients/aws/aws_options_test.go | 4 +-- providers/clients/aws/client.go | 8 +++--- providers/clients/aws/client_test.go | 8 +++--- providers/clients/dummy/transform/key/key.go | 6 ++-- .../dummy/transform/keyversion/keyversion.go | 6 ++-- providers/mock/client_mock.go | 2 +- providers/provider.go | 8 +++--- providers/provider_test.go | 8 +++--- test/async_test/certrotation_test.go | 14 +++++----- test/async_test/common_test.go | 24 ++++++++-------- test/async_test/hyoksync_test.go | 16 +++++------ test/async_test/keystorepool_test.go | 14 +++++----- test/async_test/systeminformation_test.go | 14 +++++----- test/aws_tests/kms_provider_aws_test.go | 6 ++-- test/event-processor/reconciliation_test.go | 26 ++++++++--------- .../identity_management_test.go | 4 +-- test/integration_utils/db.go | 2 +- test/integration_utils/plugin_test.go | 2 +- test/integration_utils/tenant_assertions.go | 10 +++---- .../kms_provider_local_test.go | 6 ++-- test/notification/notification_test.go | 8 +++--- test/psqlreplicatests/psqlreplica_test.go | 14 +++++----- test/registry_service/helpers_test.go | 2 +- test/registry_service/systems_test.go | 4 +-- .../systeminformation_test.go | 16 +++++------ .../tenant_provisioning_test.go | 16 +++++------ utils/base62/base62.go | 2 +- utils/base62/base62_test.go | 2 +- utils/bool/bool_test.go | 2 +- utils/cert/cert.go | 2 +- utils/cert/cert_test.go | 4 +-- utils/cert/mock/pemencoder.go | 2 +- utils/context/context.go | 2 +- utils/context/context_test.go | 4 +-- utils/crypto/crypto.go | 2 +- utils/crypto/crypto_test.go | 2 +- utils/must/must_test.go | 2 +- utils/oauth2/oauth2_test.go | 6 ++-- utils/oauth2/token_injector.go | 2 +- utils/oauth2/token_injector_test.go | 2 +- utils/odata/odata_test.go | 2 +- utils/protobuf/protobuf_test.go | 2 +- utils/ptr/ptr_test.go | 2 +- utils/slice/slice_test.go | 2 +- utils/structreader/structreader_test.go | 2 +- utils/tlsconfig/tlsconfig_test.go | 4 +-- utils/validator/validator.go | 2 +- utils/validator/validator_test.go | 2 +- 305 files changed, 1156 insertions(+), 1156 deletions(-) diff --git a/.golangci.yaml b/.golangci.yaml index 4894454f..c4f8e57a 100644 --- a/.golangci.yaml +++ b/.golangci.yaml @@ -70,7 +70,7 @@ formatters: sections: - standard - default - - prefix(github.com/openkcm/cmk) + - prefix(github.com/openkcm/cmk-core) - blank - dot - alias diff --git a/.release/release-metadata.hcl b/.release/release-metadata.hcl index 9361bf83..1d9c5e60 100644 --- a/.release/release-metadata.hcl +++ b/.release/release-metadata.hcl @@ -1,6 +1,6 @@ release { provider = "github" - url = "https://github.com/openkcm/cmk/releases" + url = "https://github.com/openkcm/cmk-core/releases" changelog = "CHANGELOG.md" tag_prefix = "v" release_name_template = "Release {{.Version}}" diff --git a/CHANGELOG.md b/CHANGELOG.md index f888fa54..54190018 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,10 +5,10 @@ ### Bug Fixes -* add all files for workflows ([#4](https://github.com/openkcm/cmk/issues/4)) ([013fc37](https://github.com/openkcm/cmk/commit/013fc3788665f6491c2bb0b5ce978a58b5863e9d)) -* set base versioning files ([a283c32](https://github.com/openkcm/cmk/commit/a283c32ec8cb84acc343f124edfc9d275de1c665)) +* add all files for workflows ([#4](https://github.com/openkcm/cmk-core/issues/4)) ([013fc37](https://github.com/openkcm/cmk-core/commit/013fc3788665f6491c2bb0b5ce978a58b5863e9d)) +* set base versioning files ([a283c32](https://github.com/openkcm/cmk-core/commit/a283c32ec8cb84acc343f124edfc9d275de1c665)) ### Miscellaneous Chores -* reset version to 0.0.1 ([bbe38ef](https://github.com/openkcm/cmk/commit/bbe38ef38ae5b81ca324161f3bfccb75e1352deb)) +* reset version to 0.0.1 ([bbe38ef](https://github.com/openkcm/cmk-core/commit/bbe38ef38ae5b81ca324161f3bfccb75e1352deb)) diff --git a/README.md b/README.md index 7e050adc..ab0b6645 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -[![REUSE status](https://api.reuse.software/badge/github.com/openkcm/cmk)](https://api.reuse.software/info/github.com/openkcm/cmk) +[![REUSE status](https://api.reuse.software/badge/github.com/openkcm/cmk-core)](https://api.reuse.software/info/github.com/openkcm/cmk-core) # Customer Managed Key (CMK) @@ -488,10 +488,10 @@ This allows for precise error handling when errors are wrapped or combined. ## Support, Feedback, Contributing -This project is open to feature requests/suggestions, bug reports etc. via [GitHub issues](https://github.com/openkcm/cmk/issues). Contribution and feedback are encouraged and always welcome. For more information about how to contribute, the project structure, as well as additional contribution information, see our [Contribution Guidelines](CONTRIBUTING.md). +This project is open to feature requests/suggestions, bug reports etc. via [GitHub issues](https://github.com/openkcm/cmk-core/issues). Contribution and feedback are encouraged and always welcome. For more information about how to contribute, the project structure, as well as additional contribution information, see our [Contribution Guidelines](CONTRIBUTING.md). ## Security / Disclosure -If you find any bug that may be a security problem, please follow our instructions at [in our security policy](https://github.com/openkcm/cmk/security/policy) on how to report it. Please do not create GitHub issues for security-related doubts or problems. +If you find any bug that may be a security problem, please follow our instructions at [in our security policy](https://github.com/openkcm/cmk-core/security/policy) on how to report it. Please do not create GitHub issues for security-related doubts or problems. ## Code of Conduct @@ -499,4 +499,4 @@ We as members, contributors, and leaders pledge to make participation in our com ## Licensing -Copyright 2025 SAP SE or an SAP affiliate company and cmk contributors. Please see our [LICENSE](LICENSE) for copyright and license information. Detailed information including third-party components and their licensing/copyright information is available [via the REUSE tool](https://api.reuse.software/info/github.com/openkcm/cmk). +Copyright 2025 SAP SE or an SAP affiliate company and cmk contributors. Please see our [LICENSE](LICENSE) for copyright and license information. Detailed information including third-party components and their licensing/copyright information is available [via the REUSE tool](https://api.reuse.software/info/github.com/openkcm/cmk-core). diff --git a/REUSE.toml b/REUSE.toml index 588d6114..865fe456 100644 --- a/REUSE.toml +++ b/REUSE.toml @@ -1,6 +1,6 @@ version = 1 SPDX-PackageName = "cmk" -SPDX-PackageDownloadLocation = "https://github.com/openkcm/cmk" +SPDX-PackageDownloadLocation = "https://github.com/openkcm/cmk-core" SPDX-PackageComment = "The code in this project may include calls to APIs (\"API Calls\") of\n SAP or third-party products or services developed outside of this project\n (\"External Products\").\n \"APIs\" means application programming interfaces, as well as their respective\n specifications and implementing code that allows software to communicate with\n other software.\n API Calls to External Products are not licensed under the open source license\n that governs this project. The use of such API Calls and related External\n Products are subject to applicable additional agreements with the relevant\n provider of the External Products. In no event shall the open source license\n that governs this project grant any rights in or to any External Products, or\n alter, expand or supersede any terms of the applicable additional agreements.\n If you have a valid license agreement with SAP for the use of a particular SAP\n External Product, then you may make use of any API Calls included in this\n project's code for that SAP External Product, subject to the terms of such\n license agreement. If you do not have a valid license agreement for the use of\n a particular SAP External Product, then you may only make use of any API Calls\n in this project for that SAP External Product for your internal, non-productive\n and non-commercial test and evaluation of such API Calls. Nothing herein grants\n you any rights to use or access any SAP External Product, or provide any third\n parties the right to use of access any SAP External Product, through API Calls." [[annotations]] diff --git a/Taskfile.yaml b/Taskfile.yaml index da6d7859..6324cf21 100644 --- a/Taskfile.yaml +++ b/Taskfile.yaml @@ -8,5 +8,5 @@ includes: vars: CODE_DIRS: '{{.ROOT_DIR}}/cmd/... {{.ROOT_DIR}}/internal/... {{.ROOT_DIR}}/apis/... {{.ROOT_DIR}}/providers/... {{.ROOT_DIR}}/test/... {{.ROOT_DIR}}/utils/...' COMPONENTS: 'core tenant-manager tenant-manager-cli' - REPO_URL: 'https://github.com/openkcm/cmk' + REPO_URL: 'https://github.com/openkcm/cmk-core' diff --git a/benchmark/system_model_test.go b/benchmark/system_model_test.go index d5af5987..fed5db83 100644 --- a/benchmark/system_model_test.go +++ b/benchmark/system_model_test.go @@ -12,11 +12,11 @@ import ( multitenancy "github.com/bartventer/gorm-multitenancy/v8" - "github.com/openkcm/cmk/internal/model" - "github.com/openkcm/cmk/internal/repo" - "github.com/openkcm/cmk/internal/repo/sql" - "github.com/openkcm/cmk/internal/testutils" - cmkcontext "github.com/openkcm/cmk/utils/context" + "github.com/openkcm/cmk-core/internal/model" + "github.com/openkcm/cmk-core/internal/repo" + "github.com/openkcm/cmk-core/internal/repo/sql" + "github.com/openkcm/cmk-core/internal/testutils" + cmkcontext "github.com/openkcm/cmk-core/utils/context" ) type SystemProperty struct { diff --git a/benchmark/total_lazyload_test.go b/benchmark/total_lazyload_test.go index 775567af..099d8f56 100644 --- a/benchmark/total_lazyload_test.go +++ b/benchmark/total_lazyload_test.go @@ -9,11 +9,11 @@ import ( "github.com/google/uuid" "github.com/stretchr/testify/assert" - "github.com/openkcm/cmk/internal/model" - "github.com/openkcm/cmk/internal/repo" - "github.com/openkcm/cmk/internal/repo/sql" - "github.com/openkcm/cmk/internal/testutils" - "github.com/openkcm/cmk/utils/ptr" + "github.com/openkcm/cmk-core/internal/model" + "github.com/openkcm/cmk-core/internal/repo" + "github.com/openkcm/cmk-core/internal/repo/sql" + "github.com/openkcm/cmk-core/internal/testutils" + "github.com/openkcm/cmk-core/utils/ptr" ) func WithTotalKeys(ctx context.Context, r repo.Repo) func(*model.KeyConfiguration) error { diff --git a/cmd/core/apiserver/command.go b/cmd/core/apiserver/command.go index c02ba682..233321a2 100644 --- a/cmd/core/apiserver/command.go +++ b/cmd/core/apiserver/command.go @@ -15,14 +15,14 @@ import ( "github.com/samber/oops" "github.com/spf13/cobra" - "github.com/openkcm/cmk/internal/config" - "github.com/openkcm/cmk/internal/constants" - "github.com/openkcm/cmk/internal/daemon" - "github.com/openkcm/cmk/internal/db" - "github.com/openkcm/cmk/internal/db/dsn" - "github.com/openkcm/cmk/internal/log" - "github.com/openkcm/cmk/internal/manager" - "github.com/openkcm/cmk/internal/repo/sql" + "github.com/openkcm/cmk-core/internal/config" + "github.com/openkcm/cmk-core/internal/constants" + "github.com/openkcm/cmk-core/internal/daemon" + "github.com/openkcm/cmk-core/internal/db" + "github.com/openkcm/cmk-core/internal/db/dsn" + "github.com/openkcm/cmk-core/internal/log" + "github.com/openkcm/cmk-core/internal/manager" + "github.com/openkcm/cmk-core/internal/repo/sql" ) const ( diff --git a/cmd/core/apiserver/command_test.go b/cmd/core/apiserver/command_test.go index 7fb81aba..87fb3406 100644 --- a/cmd/core/apiserver/command_test.go +++ b/cmd/core/apiserver/command_test.go @@ -8,8 +8,8 @@ import ( "github.com/openkcm/common-sdk/pkg/commoncfg" "github.com/stretchr/testify/require" - "github.com/openkcm/cmk/cmd/core/apiserver" - "github.com/openkcm/cmk/internal/config" + "github.com/openkcm/cmk-core/cmd/core/apiserver" + "github.com/openkcm/cmk-core/internal/config" ) func TestRun(t *testing.T) { diff --git a/cmd/core/main.go b/cmd/core/main.go index 12aee006..104e9819 100644 --- a/cmd/core/main.go +++ b/cmd/core/main.go @@ -14,9 +14,9 @@ import ( slogctx "github.com/veqryn/slog-context" - "github.com/openkcm/cmk/cmd/core/apiserver" - "github.com/openkcm/cmk/cmd/core/taskscheduler" - "github.com/openkcm/cmk/cmd/core/taskworker" + "github.com/openkcm/cmk-core/cmd/core/apiserver" + "github.com/openkcm/cmk-core/cmd/core/taskscheduler" + "github.com/openkcm/cmk-core/cmd/core/taskworker" ) var ( diff --git a/cmd/core/taskscheduler/command.go b/cmd/core/taskscheduler/command.go index 474107b6..a1ecc31b 100644 --- a/cmd/core/taskscheduler/command.go +++ b/cmd/core/taskscheduler/command.go @@ -6,10 +6,10 @@ import ( "github.com/samber/oops" "github.com/spf13/cobra" - "github.com/openkcm/cmk/internal/async" - "github.com/openkcm/cmk/internal/config" - "github.com/openkcm/cmk/internal/constants" - cmklog "github.com/openkcm/cmk/internal/log" + "github.com/openkcm/cmk-core/internal/async" + "github.com/openkcm/cmk-core/internal/config" + "github.com/openkcm/cmk-core/internal/constants" + cmklog "github.com/openkcm/cmk-core/internal/log" ) func Cmd(buildInfo string) *cobra.Command { diff --git a/cmd/core/taskworker/command.go b/cmd/core/taskworker/command.go index 5da82f4e..dea51a4a 100644 --- a/cmd/core/taskworker/command.go +++ b/cmd/core/taskworker/command.go @@ -6,10 +6,10 @@ import ( "github.com/samber/oops" "github.com/spf13/cobra" - "github.com/openkcm/cmk/internal/async" - "github.com/openkcm/cmk/internal/config" - "github.com/openkcm/cmk/internal/constants" - cmklog "github.com/openkcm/cmk/internal/log" + "github.com/openkcm/cmk-core/internal/async" + "github.com/openkcm/cmk-core/internal/config" + "github.com/openkcm/cmk-core/internal/constants" + cmklog "github.com/openkcm/cmk-core/internal/log" ) func Cmd(buildInfo string) *cobra.Command { diff --git a/cmd/tenant-manager-cli/command.go b/cmd/tenant-manager-cli/command.go index 9c455a6d..1815c053 100644 --- a/cmd/tenant-manager-cli/command.go +++ b/cmd/tenant-manager-cli/command.go @@ -14,7 +14,7 @@ import ( slogctx "github.com/veqryn/slog-context" - "github.com/openkcm/cmk/internal/tenant-manager/cli" + "github.com/openkcm/cmk-core/internal/tenant-manager/cli" ) var ( diff --git a/cmd/tenant-manager/command.go b/cmd/tenant-manager/command.go index 61a1fe66..33c39127 100644 --- a/cmd/tenant-manager/command.go +++ b/cmd/tenant-manager/command.go @@ -20,10 +20,10 @@ import ( slogctx "github.com/veqryn/slog-context" - "github.com/openkcm/cmk/internal/config" - "github.com/openkcm/cmk/internal/db/dsn" - "github.com/openkcm/cmk/internal/log" - "github.com/openkcm/cmk/internal/tenant-manager/business" + "github.com/openkcm/cmk-core/internal/config" + "github.com/openkcm/cmk-core/internal/db/dsn" + "github.com/openkcm/cmk-core/internal/log" + "github.com/openkcm/cmk-core/internal/tenant-manager/business" ) const ( diff --git a/go.mod b/go.mod index 54f850be..9e1ef8e4 100644 --- a/go.mod +++ b/go.mod @@ -1,4 +1,4 @@ -module github.com/openkcm/cmk +module github.com/openkcm/cmk-core go 1.25.1 diff --git a/internal/api/transform/clientcertificates/clientcertificates.go b/internal/api/transform/clientcertificates/clientcertificates.go index 4a815c4d..a32283d5 100644 --- a/internal/api/transform/clientcertificates/clientcertificates.go +++ b/internal/api/transform/clientcertificates/clientcertificates.go @@ -1,11 +1,11 @@ package clientcertificates import ( - "github.com/openkcm/cmk/internal/api/cmkapi" - "github.com/openkcm/cmk/internal/api/transform" - "github.com/openkcm/cmk/internal/manager" - "github.com/openkcm/cmk/internal/model" - "github.com/openkcm/cmk/utils/ptr" + "github.com/openkcm/cmk-core/internal/api/cmkapi" + "github.com/openkcm/cmk-core/internal/api/transform" + "github.com/openkcm/cmk-core/internal/manager" + "github.com/openkcm/cmk-core/internal/model" + "github.com/openkcm/cmk-core/utils/ptr" ) func transformTenantDefault(cc manager.ClientCertificate) (*cmkapi.TenantDefaultCertificate, error) { diff --git a/internal/api/transform/clientcertificates/clientcertificates_test.go b/internal/api/transform/clientcertificates/clientcertificates_test.go index 03d2798f..7cac3726 100644 --- a/internal/api/transform/clientcertificates/clientcertificates_test.go +++ b/internal/api/transform/clientcertificates/clientcertificates_test.go @@ -5,11 +5,11 @@ import ( "github.com/stretchr/testify/assert" - "github.com/openkcm/cmk/internal/api/cmkapi" - "github.com/openkcm/cmk/internal/api/transform/clientcertificates" - "github.com/openkcm/cmk/internal/manager" - "github.com/openkcm/cmk/internal/model" - "github.com/openkcm/cmk/utils/ptr" + "github.com/openkcm/cmk-core/internal/api/cmkapi" + "github.com/openkcm/cmk-core/internal/api/transform/clientcertificates" + "github.com/openkcm/cmk-core/internal/manager" + "github.com/openkcm/cmk-core/internal/model" + "github.com/openkcm/cmk-core/utils/ptr" ) func TestToAPI(t *testing.T) { diff --git a/internal/api/transform/group/group.go b/internal/api/transform/group/group.go index 324600a3..07ae7d43 100644 --- a/internal/api/transform/group/group.go +++ b/internal/api/transform/group/group.go @@ -3,10 +3,10 @@ package group import ( "github.com/google/uuid" - "github.com/openkcm/cmk/internal/api/cmkapi" - "github.com/openkcm/cmk/internal/constants" - "github.com/openkcm/cmk/internal/model" - "github.com/openkcm/cmk/utils/ptr" + "github.com/openkcm/cmk-core/internal/api/cmkapi" + "github.com/openkcm/cmk-core/internal/constants" + "github.com/openkcm/cmk-core/internal/model" + "github.com/openkcm/cmk-core/utils/ptr" ) func ToAPI(group model.Group) *cmkapi.Group { diff --git a/internal/api/transform/group/group_test.go b/internal/api/transform/group/group_test.go index 5295304a..025525d9 100644 --- a/internal/api/transform/group/group_test.go +++ b/internal/api/transform/group/group_test.go @@ -5,10 +5,10 @@ import ( "github.com/stretchr/testify/assert" - "github.com/openkcm/cmk/internal/api/cmkapi" - "github.com/openkcm/cmk/internal/api/transform/group" - "github.com/openkcm/cmk/internal/model" - "github.com/openkcm/cmk/utils/ptr" + "github.com/openkcm/cmk-core/internal/api/cmkapi" + "github.com/openkcm/cmk-core/internal/api/transform/group" + "github.com/openkcm/cmk-core/internal/model" + "github.com/openkcm/cmk-core/utils/ptr" ) func TestToAPI(t *testing.T) { diff --git a/internal/api/transform/importparams/importparams.go b/internal/api/transform/importparams/importparams.go index 83374735..10baaa7f 100644 --- a/internal/api/transform/importparams/importparams.go +++ b/internal/api/transform/importparams/importparams.go @@ -1,8 +1,8 @@ package importparams import ( - "github.com/openkcm/cmk/internal/api/cmkapi" - "github.com/openkcm/cmk/internal/model" + "github.com/openkcm/cmk-core/internal/api/cmkapi" + "github.com/openkcm/cmk-core/internal/model" ) func ToAPI(p model.ImportParams) *cmkapi.ImportParams { diff --git a/internal/api/transform/importparams/importparams_test.go b/internal/api/transform/importparams/importparams_test.go index 09c80f50..b3a02ce5 100644 --- a/internal/api/transform/importparams/importparams_test.go +++ b/internal/api/transform/importparams/importparams_test.go @@ -5,9 +5,9 @@ import ( "github.com/stretchr/testify/assert" - "github.com/openkcm/cmk/internal/api/cmkapi" - "github.com/openkcm/cmk/internal/api/transform/importparams" - "github.com/openkcm/cmk/internal/model" + "github.com/openkcm/cmk-core/internal/api/cmkapi" + "github.com/openkcm/cmk-core/internal/api/transform/importparams" + "github.com/openkcm/cmk-core/internal/model" ) func TestToAPI(t *testing.T) { diff --git a/internal/api/transform/key/hyokkey/hyokkey.go b/internal/api/transform/key/hyokkey/hyokkey.go index 2a78670b..a040df9d 100644 --- a/internal/api/transform/key/hyokkey/hyokkey.go +++ b/internal/api/transform/key/hyokkey/hyokkey.go @@ -4,12 +4,12 @@ import ( "context" "errors" - "github.com/openkcm/cmk/internal/api/cmkapi" - "github.com/openkcm/cmk/internal/api/transform" - "github.com/openkcm/cmk/internal/api/transform/key/keyshared" - "github.com/openkcm/cmk/internal/api/transform/key/transformer" - "github.com/openkcm/cmk/internal/errs" - "github.com/openkcm/cmk/internal/model" + "github.com/openkcm/cmk-core/internal/api/cmkapi" + "github.com/openkcm/cmk-core/internal/api/transform" + "github.com/openkcm/cmk-core/internal/api/transform/key/keyshared" + "github.com/openkcm/cmk-core/internal/api/transform/key/transformer" + "github.com/openkcm/cmk-core/internal/errs" + "github.com/openkcm/cmk-core/internal/model" ) var ( diff --git a/internal/api/transform/key/hyokkey/hyokkey_test.go b/internal/api/transform/key/hyokkey/hyokkey_test.go index 1f14b237..d4b49ae5 100644 --- a/internal/api/transform/key/hyokkey/hyokkey_test.go +++ b/internal/api/transform/key/hyokkey/hyokkey_test.go @@ -8,11 +8,11 @@ import ( "github.com/stretchr/testify/assert" - "github.com/openkcm/cmk/internal/api/cmkapi" - "github.com/openkcm/cmk/internal/api/transform/key/hyokkey" - "github.com/openkcm/cmk/internal/api/transform/key/transformer" - "github.com/openkcm/cmk/internal/model" - "github.com/openkcm/cmk/utils/ptr" + "github.com/openkcm/cmk-core/internal/api/cmkapi" + "github.com/openkcm/cmk-core/internal/api/transform/key/hyokkey" + "github.com/openkcm/cmk-core/internal/api/transform/key/transformer" + "github.com/openkcm/cmk-core/internal/model" + "github.com/openkcm/cmk-core/utils/ptr" ) var ( diff --git a/internal/api/transform/key/key.go b/internal/api/transform/key/key.go index f6858392..c721844b 100644 --- a/internal/api/transform/key/key.go +++ b/internal/api/transform/key/key.go @@ -8,17 +8,17 @@ import ( "github.com/google/uuid" - "github.com/openkcm/cmk/internal/api/cmkapi" - "github.com/openkcm/cmk/internal/api/transform" - "github.com/openkcm/cmk/internal/api/transform/key/hyokkey" - "github.com/openkcm/cmk/internal/api/transform/key/keyshared" - "github.com/openkcm/cmk/internal/api/transform/key/sysmr" - "github.com/openkcm/cmk/internal/api/transform/key/transformer" - "github.com/openkcm/cmk/internal/apierrors" - "github.com/openkcm/cmk/internal/constants" - "github.com/openkcm/cmk/internal/errs" - "github.com/openkcm/cmk/internal/model" - "github.com/openkcm/cmk/utils/ptr" + "github.com/openkcm/cmk-core/internal/api/cmkapi" + "github.com/openkcm/cmk-core/internal/api/transform" + "github.com/openkcm/cmk-core/internal/api/transform/key/hyokkey" + "github.com/openkcm/cmk-core/internal/api/transform/key/keyshared" + "github.com/openkcm/cmk-core/internal/api/transform/key/sysmr" + "github.com/openkcm/cmk-core/internal/api/transform/key/transformer" + "github.com/openkcm/cmk-core/internal/apierrors" + "github.com/openkcm/cmk-core/internal/constants" + "github.com/openkcm/cmk-core/internal/errs" + "github.com/openkcm/cmk-core/internal/model" + "github.com/openkcm/cmk-core/utils/ptr" ) var ( diff --git a/internal/api/transform/key/key_test.go b/internal/api/transform/key/key_test.go index 5db6d1c5..557c8752 100644 --- a/internal/api/transform/key/key_test.go +++ b/internal/api/transform/key/key_test.go @@ -9,16 +9,16 @@ import ( "github.com/google/uuid" "github.com/stretchr/testify/assert" - "github.com/openkcm/cmk/internal/api/cmkapi" - "github.com/openkcm/cmk/internal/api/transform" - "github.com/openkcm/cmk/internal/api/transform/key" - "github.com/openkcm/cmk/internal/api/transform/key/keyshared" - "github.com/openkcm/cmk/internal/api/transform/key/transformer" - "github.com/openkcm/cmk/internal/apierrors" - "github.com/openkcm/cmk/internal/errs" - "github.com/openkcm/cmk/internal/model" - "github.com/openkcm/cmk/internal/testutils" - "github.com/openkcm/cmk/utils/ptr" + "github.com/openkcm/cmk-core/internal/api/cmkapi" + "github.com/openkcm/cmk-core/internal/api/transform" + "github.com/openkcm/cmk-core/internal/api/transform/key" + "github.com/openkcm/cmk-core/internal/api/transform/key/keyshared" + "github.com/openkcm/cmk-core/internal/api/transform/key/transformer" + "github.com/openkcm/cmk-core/internal/apierrors" + "github.com/openkcm/cmk-core/internal/errs" + "github.com/openkcm/cmk-core/internal/model" + "github.com/openkcm/cmk-core/internal/testutils" + "github.com/openkcm/cmk-core/utils/ptr" ) const ( diff --git a/internal/api/transform/key/sysmr/mrkey.go b/internal/api/transform/key/sysmr/mrkey.go index f5974bb9..39142ff8 100644 --- a/internal/api/transform/key/sysmr/mrkey.go +++ b/internal/api/transform/key/sysmr/mrkey.go @@ -4,12 +4,12 @@ import ( "context" "errors" - "github.com/openkcm/cmk/internal/api/cmkapi" - "github.com/openkcm/cmk/internal/api/transform" - "github.com/openkcm/cmk/internal/api/transform/key/keyshared" - "github.com/openkcm/cmk/internal/api/transform/key/transformer" - "github.com/openkcm/cmk/internal/errs" - "github.com/openkcm/cmk/internal/model" + "github.com/openkcm/cmk-core/internal/api/cmkapi" + "github.com/openkcm/cmk-core/internal/api/transform" + "github.com/openkcm/cmk-core/internal/api/transform/key/keyshared" + "github.com/openkcm/cmk-core/internal/api/transform/key/transformer" + "github.com/openkcm/cmk-core/internal/errs" + "github.com/openkcm/cmk-core/internal/model" ) // FromCmkAPIKey propose to retrieve Managed key Request from CMK Api Key diff --git a/internal/api/transform/key/sysmr/mrkey_test.go b/internal/api/transform/key/sysmr/mrkey_test.go index a83b4542..84e8c168 100644 --- a/internal/api/transform/key/sysmr/mrkey_test.go +++ b/internal/api/transform/key/sysmr/mrkey_test.go @@ -7,11 +7,11 @@ import ( "github.com/stretchr/testify/assert" - "github.com/openkcm/cmk/internal/api/cmkapi" - "github.com/openkcm/cmk/internal/api/transform/key/sysmr" - "github.com/openkcm/cmk/internal/api/transform/key/transformer" - "github.com/openkcm/cmk/internal/model" - "github.com/openkcm/cmk/utils/ptr" + "github.com/openkcm/cmk-core/internal/api/cmkapi" + "github.com/openkcm/cmk-core/internal/api/transform/key/sysmr" + "github.com/openkcm/cmk-core/internal/api/transform/key/transformer" + "github.com/openkcm/cmk-core/internal/model" + "github.com/openkcm/cmk-core/utils/ptr" ) var ( diff --git a/internal/api/transform/key/transformer/transformer.go b/internal/api/transform/key/transformer/transformer.go index dff371d5..8b03a364 100644 --- a/internal/api/transform/key/transformer/transformer.go +++ b/internal/api/transform/key/transformer/transformer.go @@ -10,10 +10,10 @@ import ( keystoreopv1 "github.com/openkcm/plugin-sdk/proto/plugin/keystore/operations/v1" - "github.com/openkcm/cmk/internal/api/cmkapi" - "github.com/openkcm/cmk/internal/api/transform/key/keyshared" - "github.com/openkcm/cmk/internal/errs" - "github.com/openkcm/cmk/utils/protobuf" + "github.com/openkcm/cmk-core/internal/api/cmkapi" + "github.com/openkcm/cmk-core/internal/api/transform/key/keyshared" + "github.com/openkcm/cmk-core/internal/errs" + "github.com/openkcm/cmk-core/utils/protobuf" ) var ( diff --git a/internal/api/transform/key/transformer/transformer_test.go b/internal/api/transform/key/transformer/transformer_test.go index c237a7a7..a2b097b2 100644 --- a/internal/api/transform/key/transformer/transformer_test.go +++ b/internal/api/transform/key/transformer/transformer_test.go @@ -5,12 +5,12 @@ import ( "github.com/stretchr/testify/assert" - "github.com/openkcm/cmk/internal/api/cmkapi" - "github.com/openkcm/cmk/internal/api/transform/key/transformer" - "github.com/openkcm/cmk/internal/config" - "github.com/openkcm/cmk/internal/grpc/catalog" - "github.com/openkcm/cmk/internal/testutils" - "github.com/openkcm/cmk/utils/ptr" + "github.com/openkcm/cmk-core/internal/api/cmkapi" + "github.com/openkcm/cmk-core/internal/api/transform/key/transformer" + "github.com/openkcm/cmk-core/internal/config" + "github.com/openkcm/cmk-core/internal/grpc/catalog" + "github.com/openkcm/cmk-core/internal/testutils" + "github.com/openkcm/cmk-core/utils/ptr" ) func getPluginProviderTransformer(t *testing.T) *transformer.PluginProviderTransformer { diff --git a/internal/api/transform/keyconfiguration/keyconfiguration.go b/internal/api/transform/keyconfiguration/keyconfiguration.go index 16bc487a..3a1a4b1c 100644 --- a/internal/api/transform/keyconfiguration/keyconfiguration.go +++ b/internal/api/transform/keyconfiguration/keyconfiguration.go @@ -6,13 +6,13 @@ import ( "github.com/google/uuid" - "github.com/openkcm/cmk/internal/api/cmkapi" - "github.com/openkcm/cmk/internal/api/transform" - "github.com/openkcm/cmk/internal/api/transform/group" - "github.com/openkcm/cmk/internal/apierrors" - "github.com/openkcm/cmk/internal/errs" - "github.com/openkcm/cmk/internal/model" - "github.com/openkcm/cmk/utils/validator" + "github.com/openkcm/cmk-core/internal/api/cmkapi" + "github.com/openkcm/cmk-core/internal/api/transform" + "github.com/openkcm/cmk-core/internal/api/transform/group" + "github.com/openkcm/cmk-core/internal/apierrors" + "github.com/openkcm/cmk-core/internal/errs" + "github.com/openkcm/cmk-core/internal/model" + "github.com/openkcm/cmk-core/utils/validator" ) var ErrTransformKey = errors.New("err transform to key response") diff --git a/internal/api/transform/keyconfiguration/keyconfiguration_test.go b/internal/api/transform/keyconfiguration/keyconfiguration_test.go index 2626cf3a..911382c9 100644 --- a/internal/api/transform/keyconfiguration/keyconfiguration_test.go +++ b/internal/api/transform/keyconfiguration/keyconfiguration_test.go @@ -7,13 +7,13 @@ import ( "github.com/google/uuid" "github.com/stretchr/testify/assert" - "github.com/openkcm/cmk/internal/api/cmkapi" - "github.com/openkcm/cmk/internal/api/transform/keyconfiguration" - "github.com/openkcm/cmk/internal/apierrors" - "github.com/openkcm/cmk/internal/errs" - "github.com/openkcm/cmk/internal/model" - "github.com/openkcm/cmk/internal/testutils" - "github.com/openkcm/cmk/utils/ptr" + "github.com/openkcm/cmk-core/internal/api/cmkapi" + "github.com/openkcm/cmk-core/internal/api/transform/keyconfiguration" + "github.com/openkcm/cmk-core/internal/apierrors" + "github.com/openkcm/cmk-core/internal/errs" + "github.com/openkcm/cmk-core/internal/model" + "github.com/openkcm/cmk-core/internal/testutils" + "github.com/openkcm/cmk-core/utils/ptr" ) func TestTransformKeyConfiguration_FromAPI(t *testing.T) { diff --git a/internal/api/transform/keyversion/keyversion.go b/internal/api/transform/keyversion/keyversion.go index b5ccdcbf..5776a0f6 100644 --- a/internal/api/transform/keyversion/keyversion.go +++ b/internal/api/transform/keyversion/keyversion.go @@ -1,10 +1,10 @@ package keyversion import ( - "github.com/openkcm/cmk/internal/api/cmkapi" - "github.com/openkcm/cmk/internal/api/transform" - "github.com/openkcm/cmk/internal/model" - "github.com/openkcm/cmk/utils/ptr" + "github.com/openkcm/cmk-core/internal/api/cmkapi" + "github.com/openkcm/cmk-core/internal/api/transform" + "github.com/openkcm/cmk-core/internal/model" + "github.com/openkcm/cmk-core/utils/ptr" ) // ToAPI converts KeyVersion db model to a KeyVersion api model diff --git a/internal/api/transform/keyversion/keyversion_test.go b/internal/api/transform/keyversion/keyversion_test.go index fc786fe3..82b72998 100644 --- a/internal/api/transform/keyversion/keyversion_test.go +++ b/internal/api/transform/keyversion/keyversion_test.go @@ -7,12 +7,12 @@ import ( "github.com/google/uuid" "github.com/stretchr/testify/assert" - "github.com/openkcm/cmk/internal/api/cmkapi" - "github.com/openkcm/cmk/internal/api/transform" - "github.com/openkcm/cmk/internal/api/transform/keyversion" - "github.com/openkcm/cmk/internal/model" - "github.com/openkcm/cmk/internal/testutils" - "github.com/openkcm/cmk/utils/ptr" + "github.com/openkcm/cmk-core/internal/api/cmkapi" + "github.com/openkcm/cmk-core/internal/api/transform" + "github.com/openkcm/cmk-core/internal/api/transform/keyversion" + "github.com/openkcm/cmk-core/internal/model" + "github.com/openkcm/cmk-core/internal/testutils" + "github.com/openkcm/cmk-core/utils/ptr" ) func TestTransformKeyVersion_ToAPI(t *testing.T) { diff --git a/internal/api/transform/label/key_label.go b/internal/api/transform/label/key_label.go index 3104d828..70c7cd08 100644 --- a/internal/api/transform/label/key_label.go +++ b/internal/api/transform/label/key_label.go @@ -6,12 +6,12 @@ import ( "github.com/google/uuid" - "github.com/openkcm/cmk/internal/api/cmkapi" - "github.com/openkcm/cmk/internal/api/transform" - "github.com/openkcm/cmk/internal/apierrors" - "github.com/openkcm/cmk/internal/errs" - "github.com/openkcm/cmk/internal/model" - "github.com/openkcm/cmk/utils/ptr" + "github.com/openkcm/cmk-core/internal/api/cmkapi" + "github.com/openkcm/cmk-core/internal/api/transform" + "github.com/openkcm/cmk-core/internal/apierrors" + "github.com/openkcm/cmk-core/internal/errs" + "github.com/openkcm/cmk-core/internal/model" + "github.com/openkcm/cmk-core/utils/ptr" ) const ( diff --git a/internal/api/transform/label/key_label_test.go b/internal/api/transform/label/key_label_test.go index 40dff8e7..5d3299a7 100644 --- a/internal/api/transform/label/key_label_test.go +++ b/internal/api/transform/label/key_label_test.go @@ -8,13 +8,13 @@ import ( "github.com/google/uuid" "github.com/stretchr/testify/assert" - "github.com/openkcm/cmk/internal/api/cmkapi" - "github.com/openkcm/cmk/internal/api/transform" - "github.com/openkcm/cmk/internal/api/transform/label" - "github.com/openkcm/cmk/internal/apierrors" - "github.com/openkcm/cmk/internal/errs" - "github.com/openkcm/cmk/internal/model" - "github.com/openkcm/cmk/utils/ptr" + "github.com/openkcm/cmk-core/internal/api/cmkapi" + "github.com/openkcm/cmk-core/internal/api/transform" + "github.com/openkcm/cmk-core/internal/api/transform/label" + "github.com/openkcm/cmk-core/internal/apierrors" + "github.com/openkcm/cmk-core/internal/errs" + "github.com/openkcm/cmk-core/internal/model" + "github.com/openkcm/cmk-core/utils/ptr" ) type labelsTransformerTestCase struct { diff --git a/internal/api/transform/list_test.go b/internal/api/transform/list_test.go index 7728c41f..41dea2fa 100644 --- a/internal/api/transform/list_test.go +++ b/internal/api/transform/list_test.go @@ -6,8 +6,8 @@ import ( "github.com/stretchr/testify/assert" - "github.com/openkcm/cmk/internal/api/transform" - "github.com/openkcm/cmk/utils/ptr" + "github.com/openkcm/cmk-core/internal/api/transform" + "github.com/openkcm/cmk-core/utils/ptr" ) var ( diff --git a/internal/api/transform/system/system.go b/internal/api/transform/system/system.go index cba33aba..4e89049e 100644 --- a/internal/api/transform/system/system.go +++ b/internal/api/transform/system/system.go @@ -3,9 +3,9 @@ package system import ( "errors" - "github.com/openkcm/cmk/internal/api/cmkapi" - "github.com/openkcm/cmk/internal/config" - "github.com/openkcm/cmk/internal/model" + "github.com/openkcm/cmk-core/internal/api/cmkapi" + "github.com/openkcm/cmk-core/internal/config" + "github.com/openkcm/cmk-core/internal/model" ) var ErrFromAPI = errors.New("failed to transform system from API") diff --git a/internal/api/transform/system/system_test.go b/internal/api/transform/system/system_test.go index 908aa817..48c8be1d 100644 --- a/internal/api/transform/system/system_test.go +++ b/internal/api/transform/system/system_test.go @@ -6,11 +6,11 @@ import ( "github.com/google/uuid" "github.com/stretchr/testify/assert" - "github.com/openkcm/cmk/internal/api/cmkapi" - "github.com/openkcm/cmk/internal/api/transform/system" - "github.com/openkcm/cmk/internal/config" - "github.com/openkcm/cmk/internal/model" - "github.com/openkcm/cmk/utils/ptr" + "github.com/openkcm/cmk-core/internal/api/cmkapi" + "github.com/openkcm/cmk-core/internal/api/transform/system" + "github.com/openkcm/cmk-core/internal/config" + "github.com/openkcm/cmk-core/internal/model" + "github.com/openkcm/cmk-core/utils/ptr" ) func TestToAPI(t *testing.T) { diff --git a/internal/api/transform/tags/tags.go b/internal/api/transform/tags/tags.go index 28755169..411fe54f 100644 --- a/internal/api/transform/tags/tags.go +++ b/internal/api/transform/tags/tags.go @@ -3,9 +3,9 @@ package tags import ( "github.com/google/uuid" - "github.com/openkcm/cmk/internal/api/cmkapi" - "github.com/openkcm/cmk/internal/model" - "github.com/openkcm/cmk/utils/ptr" + "github.com/openkcm/cmk-core/internal/api/cmkapi" + "github.com/openkcm/cmk-core/internal/model" + "github.com/openkcm/cmk-core/utils/ptr" ) type TagSetter interface { diff --git a/internal/api/transform/tags/tags_test.go b/internal/api/transform/tags/tags_test.go index a9de99a9..c5fe23da 100644 --- a/internal/api/transform/tags/tags_test.go +++ b/internal/api/transform/tags/tags_test.go @@ -6,10 +6,10 @@ import ( "github.com/google/uuid" "github.com/stretchr/testify/assert" - "github.com/openkcm/cmk/internal/api/cmkapi" - "github.com/openkcm/cmk/internal/api/transform/tags" - "github.com/openkcm/cmk/internal/model" - "github.com/openkcm/cmk/utils/ptr" + "github.com/openkcm/cmk-core/internal/api/cmkapi" + "github.com/openkcm/cmk-core/internal/api/transform/tags" + "github.com/openkcm/cmk-core/internal/model" + "github.com/openkcm/cmk-core/utils/ptr" ) func TestFromAPI(t *testing.T) { diff --git a/internal/api/transform/tenant/tenant.go b/internal/api/transform/tenant/tenant.go index dbbb6ed5..69557ffe 100644 --- a/internal/api/transform/tenant/tenant.go +++ b/internal/api/transform/tenant/tenant.go @@ -1,8 +1,8 @@ package tenant import ( - "github.com/openkcm/cmk/internal/api/cmkapi" - "github.com/openkcm/cmk/internal/model" + "github.com/openkcm/cmk-core/internal/api/cmkapi" + "github.com/openkcm/cmk-core/internal/model" ) // ToAPI transforms a system model to an API system. diff --git a/internal/api/transform/tenantconfigs/keystore.go b/internal/api/transform/tenantconfigs/keystore.go index 78286b07..147d1116 100644 --- a/internal/api/transform/tenantconfigs/keystore.go +++ b/internal/api/transform/tenantconfigs/keystore.go @@ -1,8 +1,8 @@ package tenantconfigs import ( - "github.com/openkcm/cmk/internal/api/cmkapi" - "github.com/openkcm/cmk/internal/manager" + "github.com/openkcm/cmk-core/internal/api/cmkapi" + "github.com/openkcm/cmk-core/internal/manager" ) // ToAPI transforms a system model to an API system. diff --git a/internal/api/transform/tenantconfigs/keystore_test.go b/internal/api/transform/tenantconfigs/keystore_test.go index fffe2783..8d5b9f19 100644 --- a/internal/api/transform/tenantconfigs/keystore_test.go +++ b/internal/api/transform/tenantconfigs/keystore_test.go @@ -5,11 +5,11 @@ import ( "github.com/stretchr/testify/assert" - "github.com/openkcm/cmk/internal/api/cmkapi" - "github.com/openkcm/cmk/internal/api/transform/tenantconfigs" - "github.com/openkcm/cmk/internal/manager" - "github.com/openkcm/cmk/internal/model" - "github.com/openkcm/cmk/utils/ptr" + "github.com/openkcm/cmk-core/internal/api/cmkapi" + "github.com/openkcm/cmk-core/internal/api/transform/tenantconfigs" + "github.com/openkcm/cmk-core/internal/manager" + "github.com/openkcm/cmk-core/internal/model" + "github.com/openkcm/cmk-core/utils/ptr" ) func TestToAPI(t *testing.T) { diff --git a/internal/api/transform/workflow/workflow.go b/internal/api/transform/workflow/workflow.go index 8d5ad1d3..85339b1b 100644 --- a/internal/api/transform/workflow/workflow.go +++ b/internal/api/transform/workflow/workflow.go @@ -5,10 +5,10 @@ import ( "github.com/google/uuid" - "github.com/openkcm/cmk/internal/api/cmkapi" - "github.com/openkcm/cmk/internal/api/transform" - "github.com/openkcm/cmk/internal/model" - "github.com/openkcm/cmk/utils/ptr" + "github.com/openkcm/cmk-core/internal/api/cmkapi" + "github.com/openkcm/cmk-core/internal/api/transform" + "github.com/openkcm/cmk-core/internal/model" + "github.com/openkcm/cmk-core/utils/ptr" ) // ToAPI converts a workflow model to an API workflow presentation. diff --git a/internal/api/transform/workflow/workflow_test.go b/internal/api/transform/workflow/workflow_test.go index 36843bf7..2b9ee1aa 100644 --- a/internal/api/transform/workflow/workflow_test.go +++ b/internal/api/transform/workflow/workflow_test.go @@ -6,11 +6,11 @@ import ( "github.com/google/uuid" "github.com/stretchr/testify/assert" - "github.com/openkcm/cmk/internal/api/cmkapi" - "github.com/openkcm/cmk/internal/api/transform/workflow" - "github.com/openkcm/cmk/internal/model" - "github.com/openkcm/cmk/internal/testutils" - "github.com/openkcm/cmk/utils/ptr" + "github.com/openkcm/cmk-core/internal/api/cmkapi" + "github.com/openkcm/cmk-core/internal/api/transform/workflow" + "github.com/openkcm/cmk-core/internal/model" + "github.com/openkcm/cmk-core/internal/testutils" + "github.com/openkcm/cmk-core/utils/ptr" ) func TestWorkflow_ToAPI(t *testing.T) { diff --git a/internal/api/write/write.go b/internal/api/write/write.go index b0a3e925..6ee57ce3 100644 --- a/internal/api/write/write.go +++ b/internal/api/write/write.go @@ -5,9 +5,9 @@ import ( "encoding/json" "net/http" - "github.com/openkcm/cmk/internal/api/cmkapi" - "github.com/openkcm/cmk/internal/log" - cmkcontext "github.com/openkcm/cmk/utils/context" + "github.com/openkcm/cmk-core/internal/api/cmkapi" + "github.com/openkcm/cmk-core/internal/log" + cmkcontext "github.com/openkcm/cmk-core/utils/context" ) // ErrorResponse writes an error response to the client and logs the error diff --git a/internal/api/write/write_test.go b/internal/api/write/write_test.go index e243153b..59365322 100644 --- a/internal/api/write/write_test.go +++ b/internal/api/write/write_test.go @@ -7,10 +7,10 @@ import ( "github.com/stretchr/testify/assert" - "github.com/openkcm/cmk/internal/api/cmkapi" - "github.com/openkcm/cmk/internal/api/write" - "github.com/openkcm/cmk/internal/testutils" - cmkcontext "github.com/openkcm/cmk/utils/context" + "github.com/openkcm/cmk-core/internal/api/cmkapi" + "github.com/openkcm/cmk-core/internal/api/write" + "github.com/openkcm/cmk-core/internal/testutils" + cmkcontext "github.com/openkcm/cmk-core/utils/context" ) func TestWriteErrorResponse(t *testing.T) { diff --git a/internal/apierrors/base.go b/internal/apierrors/base.go index 59044582..724d58e5 100644 --- a/internal/apierrors/base.go +++ b/internal/apierrors/base.go @@ -3,7 +3,7 @@ package apierrors import ( "net/http" - "github.com/openkcm/cmk/internal/api/cmkapi" + "github.com/openkcm/cmk-core/internal/api/cmkapi" ) const ( diff --git a/internal/apierrors/base_test.go b/internal/apierrors/base_test.go index 7c95fb78..923c5502 100644 --- a/internal/apierrors/base_test.go +++ b/internal/apierrors/base_test.go @@ -6,8 +6,8 @@ import ( "github.com/stretchr/testify/assert" - "github.com/openkcm/cmk/internal/api/cmkapi" - "github.com/openkcm/cmk/internal/apierrors" + "github.com/openkcm/cmk-core/internal/api/cmkapi" + "github.com/openkcm/cmk-core/internal/apierrors" ) func TestInternalServerErrorMessage(t *testing.T) { diff --git a/internal/apierrors/default.go b/internal/apierrors/default.go index b8c24c4e..fb6e4cd3 100644 --- a/internal/apierrors/default.go +++ b/internal/apierrors/default.go @@ -5,8 +5,8 @@ import ( "errors" "net/http" - "github.com/openkcm/cmk/internal/api/cmkapi" - "github.com/openkcm/cmk/internal/repo" + "github.com/openkcm/cmk-core/internal/api/cmkapi" + "github.com/openkcm/cmk-core/internal/repo" ) const ( diff --git a/internal/apierrors/export_test.go b/internal/apierrors/export_test.go index 2ffaba15..45015f46 100644 --- a/internal/apierrors/export_test.go +++ b/internal/apierrors/export_test.go @@ -3,7 +3,7 @@ package apierrors import ( "context" - "github.com/openkcm/cmk/internal/api/cmkapi" + "github.com/openkcm/cmk-core/internal/api/cmkapi" ) var ( diff --git a/internal/apierrors/groups.go b/internal/apierrors/groups.go index e4f87e30..d04fb3fc 100644 --- a/internal/apierrors/groups.go +++ b/internal/apierrors/groups.go @@ -3,9 +3,9 @@ package apierrors import ( "net/http" - "github.com/openkcm/cmk/internal/api/cmkapi" - "github.com/openkcm/cmk/internal/manager" - "github.com/openkcm/cmk/internal/repo" + "github.com/openkcm/cmk-core/internal/api/cmkapi" + "github.com/openkcm/cmk-core/internal/manager" + "github.com/openkcm/cmk-core/internal/repo" ) var groups = []APIErrors{ diff --git a/internal/apierrors/key.go b/internal/apierrors/key.go index fb00e3a4..fdbb7514 100644 --- a/internal/apierrors/key.go +++ b/internal/apierrors/key.go @@ -6,12 +6,12 @@ import ( "gorm.io/gorm" - "github.com/openkcm/cmk/internal/api/cmkapi" - "github.com/openkcm/cmk/internal/api/transform" - "github.com/openkcm/cmk/internal/api/transform/key/hyokkey" - "github.com/openkcm/cmk/internal/api/transform/key/keyshared" - "github.com/openkcm/cmk/internal/manager" - "github.com/openkcm/cmk/internal/repo" + "github.com/openkcm/cmk-core/internal/api/cmkapi" + "github.com/openkcm/cmk-core/internal/api/transform" + "github.com/openkcm/cmk-core/internal/api/transform/key/hyokkey" + "github.com/openkcm/cmk-core/internal/api/transform/key/keyshared" + "github.com/openkcm/cmk-core/internal/manager" + "github.com/openkcm/cmk-core/internal/repo" ) var ( diff --git a/internal/apierrors/keyconfiguration.go b/internal/apierrors/keyconfiguration.go index d0b81500..77f4991b 100644 --- a/internal/apierrors/keyconfiguration.go +++ b/internal/apierrors/keyconfiguration.go @@ -4,9 +4,9 @@ import ( "errors" "net/http" - "github.com/openkcm/cmk/internal/api/cmkapi" - "github.com/openkcm/cmk/internal/manager" - "github.com/openkcm/cmk/internal/repo" + "github.com/openkcm/cmk-core/internal/api/cmkapi" + "github.com/openkcm/cmk-core/internal/manager" + "github.com/openkcm/cmk-core/internal/repo" ) var ( diff --git a/internal/apierrors/keyversion.go b/internal/apierrors/keyversion.go index 2d56aff3..76fff6cc 100644 --- a/internal/apierrors/keyversion.go +++ b/internal/apierrors/keyversion.go @@ -4,8 +4,8 @@ import ( "errors" "net/http" - "github.com/openkcm/cmk/internal/api/cmkapi" - "github.com/openkcm/cmk/internal/manager" + "github.com/openkcm/cmk-core/internal/api/cmkapi" + "github.com/openkcm/cmk-core/internal/manager" ) var ( diff --git a/internal/apierrors/labels.go b/internal/apierrors/labels.go index fe90bd25..0ee0f370 100644 --- a/internal/apierrors/labels.go +++ b/internal/apierrors/labels.go @@ -6,8 +6,8 @@ import ( "gorm.io/gorm" - "github.com/openkcm/cmk/internal/api/cmkapi" - "github.com/openkcm/cmk/internal/manager" + "github.com/openkcm/cmk-core/internal/api/cmkapi" + "github.com/openkcm/cmk-core/internal/manager" ) var ( diff --git a/internal/apierrors/mapping.go b/internal/apierrors/mapping.go index e0963cf6..961603d9 100644 --- a/internal/apierrors/mapping.go +++ b/internal/apierrors/mapping.go @@ -9,9 +9,9 @@ import ( slogctx "github.com/veqryn/slog-context" - "github.com/openkcm/cmk/internal/api/cmkapi" - "github.com/openkcm/cmk/internal/log" - "github.com/openkcm/cmk/utils/ptr" + "github.com/openkcm/cmk-core/internal/api/cmkapi" + "github.com/openkcm/cmk-core/internal/log" + "github.com/openkcm/cmk-core/utils/ptr" ) type APIErrorMapper struct { diff --git a/internal/apierrors/mapping_test.go b/internal/apierrors/mapping_test.go index 911431b3..0a0e2fe5 100644 --- a/internal/apierrors/mapping_test.go +++ b/internal/apierrors/mapping_test.go @@ -10,12 +10,12 @@ import ( "github.com/stretchr/testify/assert" "gorm.io/gorm" - "github.com/openkcm/cmk/internal/api/cmkapi" - "github.com/openkcm/cmk/internal/apierrors" - "github.com/openkcm/cmk/internal/errs" - "github.com/openkcm/cmk/internal/manager" - "github.com/openkcm/cmk/internal/repo" - "github.com/openkcm/cmk/utils/ptr" + "github.com/openkcm/cmk-core/internal/api/cmkapi" + "github.com/openkcm/cmk-core/internal/apierrors" + "github.com/openkcm/cmk-core/internal/errs" + "github.com/openkcm/cmk-core/internal/manager" + "github.com/openkcm/cmk-core/internal/repo" + "github.com/openkcm/cmk-core/utils/ptr" ) var ( diff --git a/internal/apierrors/priority.go b/internal/apierrors/priority.go index 300f0ccb..b922d25c 100644 --- a/internal/apierrors/priority.go +++ b/internal/apierrors/priority.go @@ -3,8 +3,8 @@ package apierrors import ( "net/http" - "github.com/openkcm/cmk/internal/api/cmkapi" - "github.com/openkcm/cmk/internal/repo" + "github.com/openkcm/cmk-core/internal/api/cmkapi" + "github.com/openkcm/cmk-core/internal/repo" ) const ( diff --git a/internal/apierrors/system.go b/internal/apierrors/system.go index 66bdd2ad..0d26879a 100644 --- a/internal/apierrors/system.go +++ b/internal/apierrors/system.go @@ -6,10 +6,10 @@ import ( "gorm.io/gorm" - "github.com/openkcm/cmk/internal/api/cmkapi" - registryClient "github.com/openkcm/cmk/internal/clients/registry/systems" - "github.com/openkcm/cmk/internal/manager" - "github.com/openkcm/cmk/internal/repo" + "github.com/openkcm/cmk-core/internal/api/cmkapi" + registryClient "github.com/openkcm/cmk-core/internal/clients/registry/systems" + "github.com/openkcm/cmk-core/internal/manager" + "github.com/openkcm/cmk-core/internal/repo" ) var ( diff --git a/internal/apierrors/tags.go b/internal/apierrors/tags.go index 5dea81fb..a4332d09 100644 --- a/internal/apierrors/tags.go +++ b/internal/apierrors/tags.go @@ -4,7 +4,7 @@ import ( "errors" "net/http" - "github.com/openkcm/cmk/internal/api/cmkapi" + "github.com/openkcm/cmk-core/internal/api/cmkapi" ) var ( diff --git a/internal/apierrors/tenant.go b/internal/apierrors/tenant.go index b9dddbef..3167e2c4 100644 --- a/internal/apierrors/tenant.go +++ b/internal/apierrors/tenant.go @@ -4,7 +4,7 @@ import ( "errors" "net/http" - "github.com/openkcm/cmk/internal/api/cmkapi" + "github.com/openkcm/cmk-core/internal/api/cmkapi" ) var ( diff --git a/internal/apierrors/tenantconfigs.go b/internal/apierrors/tenantconfigs.go index 449b1ba5..bc1d9f97 100644 --- a/internal/apierrors/tenantconfigs.go +++ b/internal/apierrors/tenantconfigs.go @@ -4,7 +4,7 @@ import ( "errors" "net/http" - "github.com/openkcm/cmk/internal/api/cmkapi" + "github.com/openkcm/cmk-core/internal/api/cmkapi" ) var ErrGetDefaultKeystore = errors.New("failed to get default keystore") diff --git a/internal/apierrors/workflow.go b/internal/apierrors/workflow.go index a2a28434..7ee17513 100644 --- a/internal/apierrors/workflow.go +++ b/internal/apierrors/workflow.go @@ -4,10 +4,10 @@ import ( "errors" "net/http" - "github.com/openkcm/cmk/internal/api/cmkapi" - "github.com/openkcm/cmk/internal/manager" - "github.com/openkcm/cmk/internal/repo" - workflowpkg "github.com/openkcm/cmk/internal/workflow" + "github.com/openkcm/cmk-core/internal/api/cmkapi" + "github.com/openkcm/cmk-core/internal/manager" + "github.com/openkcm/cmk-core/internal/repo" + workflowpkg "github.com/openkcm/cmk-core/internal/workflow" ) var ( diff --git a/internal/async/async.go b/internal/async/async.go index 192fce4a..d6374a36 100644 --- a/internal/async/async.go +++ b/internal/async/async.go @@ -12,15 +12,15 @@ import ( multitenancy "github.com/bartventer/gorm-multitenancy/v8" - "github.com/openkcm/cmk/internal/async/tasks" - conf "github.com/openkcm/cmk/internal/config" - "github.com/openkcm/cmk/internal/db" - "github.com/openkcm/cmk/internal/errs" - eventprocessor "github.com/openkcm/cmk/internal/event-processor" - "github.com/openkcm/cmk/internal/grpc/catalog" - "github.com/openkcm/cmk/internal/log" - "github.com/openkcm/cmk/internal/manager" - "github.com/openkcm/cmk/internal/repo/sql" + "github.com/openkcm/cmk-core/internal/async/tasks" + conf "github.com/openkcm/cmk-core/internal/config" + "github.com/openkcm/cmk-core/internal/db" + "github.com/openkcm/cmk-core/internal/errs" + eventprocessor "github.com/openkcm/cmk-core/internal/event-processor" + "github.com/openkcm/cmk-core/internal/grpc/catalog" + "github.com/openkcm/cmk-core/internal/log" + "github.com/openkcm/cmk-core/internal/manager" + "github.com/openkcm/cmk-core/internal/repo/sql" ) const ( diff --git a/internal/async/async_test.go b/internal/async/async_test.go index c253a25e..e9fdc923 100644 --- a/internal/async/async_test.go +++ b/internal/async/async_test.go @@ -8,9 +8,9 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/openkcm/cmk/internal/async" - conf "github.com/openkcm/cmk/internal/config" - "github.com/openkcm/cmk/internal/testutils" + "github.com/openkcm/cmk-core/internal/async" + conf "github.com/openkcm/cmk-core/internal/config" + "github.com/openkcm/cmk-core/internal/testutils" ) func defaultRedisConfig(tlsFiles testutils.TLSFiles) conf.Redis { diff --git a/internal/async/scheduler_task_config.go b/internal/async/scheduler_task_config.go index e4c16de1..ff5c712f 100644 --- a/internal/async/scheduler_task_config.go +++ b/internal/async/scheduler_task_config.go @@ -3,7 +3,7 @@ package async import ( "github.com/hibiken/asynq" - "github.com/openkcm/cmk/internal/config" + "github.com/openkcm/cmk-core/internal/config" ) // ScheduledTaskConfigProvider implements asynq PeriodicTaskConfigProvider interface. diff --git a/internal/async/scheduler_task_config_test.go b/internal/async/scheduler_task_config_test.go index 86a7168f..556b59c4 100644 --- a/internal/async/scheduler_task_config_test.go +++ b/internal/async/scheduler_task_config_test.go @@ -5,8 +5,8 @@ import ( "github.com/stretchr/testify/assert" - "github.com/openkcm/cmk/internal/async" - "github.com/openkcm/cmk/internal/config" + "github.com/openkcm/cmk-core/internal/async" + "github.com/openkcm/cmk-core/internal/config" ) func TestGetConfigs(t *testing.T) { diff --git a/internal/async/tasks/cert_rotation.go b/internal/async/tasks/cert_rotation.go index 7bc68cbd..1ee6a68a 100644 --- a/internal/async/tasks/cert_rotation.go +++ b/internal/async/tasks/cert_rotation.go @@ -7,13 +7,13 @@ import ( "github.com/hibiken/asynq" - "github.com/openkcm/cmk/internal/config" - "github.com/openkcm/cmk/internal/errs" - "github.com/openkcm/cmk/internal/log" - "github.com/openkcm/cmk/internal/manager" - "github.com/openkcm/cmk/internal/model" - "github.com/openkcm/cmk/internal/repo" - cmkcontext "github.com/openkcm/cmk/utils/context" + "github.com/openkcm/cmk-core/internal/config" + "github.com/openkcm/cmk-core/internal/errs" + "github.com/openkcm/cmk-core/internal/log" + "github.com/openkcm/cmk-core/internal/manager" + "github.com/openkcm/cmk-core/internal/model" + "github.com/openkcm/cmk-core/internal/repo" + cmkcontext "github.com/openkcm/cmk-core/utils/context" ) type CertUpdater interface { diff --git a/internal/async/tasks/cert_rotation_test.go b/internal/async/tasks/cert_rotation_test.go index 4cb65b01..9de6bf0f 100644 --- a/internal/async/tasks/cert_rotation_test.go +++ b/internal/async/tasks/cert_rotation_test.go @@ -8,11 +8,11 @@ import ( "github.com/bartventer/gorm-multitenancy/v8/pkg/driver" "github.com/stretchr/testify/assert" - "github.com/openkcm/cmk/internal/async/tasks" - "github.com/openkcm/cmk/internal/manager" - "github.com/openkcm/cmk/internal/model" - "github.com/openkcm/cmk/internal/repo/sql" - "github.com/openkcm/cmk/internal/testutils" + "github.com/openkcm/cmk-core/internal/async/tasks" + "github.com/openkcm/cmk-core/internal/manager" + "github.com/openkcm/cmk-core/internal/model" + "github.com/openkcm/cmk-core/internal/repo/sql" + "github.com/openkcm/cmk-core/internal/testutils" ) type CertUpdaterMock struct{} diff --git a/internal/async/tasks/hyok_sync.go b/internal/async/tasks/hyok_sync.go index 8cae1f4f..bec5f014 100644 --- a/internal/async/tasks/hyok_sync.go +++ b/internal/async/tasks/hyok_sync.go @@ -5,12 +5,12 @@ import ( "github.com/hibiken/asynq" - "github.com/openkcm/cmk/internal/config" - "github.com/openkcm/cmk/internal/errs" - "github.com/openkcm/cmk/internal/log" - "github.com/openkcm/cmk/internal/model" - "github.com/openkcm/cmk/internal/repo" - cmkcontext "github.com/openkcm/cmk/utils/context" + "github.com/openkcm/cmk-core/internal/config" + "github.com/openkcm/cmk-core/internal/errs" + "github.com/openkcm/cmk-core/internal/log" + "github.com/openkcm/cmk-core/internal/model" + "github.com/openkcm/cmk-core/internal/repo" + cmkcontext "github.com/openkcm/cmk-core/utils/context" ) type HYOKUpdater interface { diff --git a/internal/async/tasks/hyok_sync_test.go b/internal/async/tasks/hyok_sync_test.go index bff3d54c..10093c3d 100644 --- a/internal/async/tasks/hyok_sync_test.go +++ b/internal/async/tasks/hyok_sync_test.go @@ -8,10 +8,10 @@ import ( "github.com/bartventer/gorm-multitenancy/v8/pkg/driver" "github.com/stretchr/testify/assert" - "github.com/openkcm/cmk/internal/async/tasks" - "github.com/openkcm/cmk/internal/config" - "github.com/openkcm/cmk/internal/repo/sql" - "github.com/openkcm/cmk/internal/testutils" + "github.com/openkcm/cmk-core/internal/async/tasks" + "github.com/openkcm/cmk-core/internal/config" + "github.com/openkcm/cmk-core/internal/repo/sql" + "github.com/openkcm/cmk-core/internal/testutils" ) var errMockSyncHYOKClient = errors.New("error syncing hyok client") diff --git a/internal/async/tasks/keystore_pool.go b/internal/async/tasks/keystore_pool.go index 3e6eb334..d50441fd 100644 --- a/internal/async/tasks/keystore_pool.go +++ b/internal/async/tasks/keystore_pool.go @@ -5,9 +5,9 @@ import ( "github.com/hibiken/asynq" - "github.com/openkcm/cmk/internal/config" - "github.com/openkcm/cmk/internal/log" - "github.com/openkcm/cmk/internal/repo" + "github.com/openkcm/cmk-core/internal/config" + "github.com/openkcm/cmk-core/internal/log" + "github.com/openkcm/cmk-core/internal/repo" ) type KeystorePoolUpdater interface { diff --git a/internal/async/tasks/keystore_pool_test.go b/internal/async/tasks/keystore_pool_test.go index 02e430af..c51d946d 100644 --- a/internal/async/tasks/keystore_pool_test.go +++ b/internal/async/tasks/keystore_pool_test.go @@ -7,10 +7,10 @@ import ( "github.com/bartventer/gorm-multitenancy/v8/pkg/driver" "github.com/stretchr/testify/assert" - "github.com/openkcm/cmk/internal/async/tasks" - "github.com/openkcm/cmk/internal/config" - "github.com/openkcm/cmk/internal/repo/sql" - "github.com/openkcm/cmk/internal/testutils" + "github.com/openkcm/cmk-core/internal/async/tasks" + "github.com/openkcm/cmk-core/internal/config" + "github.com/openkcm/cmk-core/internal/repo/sql" + "github.com/openkcm/cmk-core/internal/testutils" ) type KeystorePoolFillerMock struct{} diff --git a/internal/async/tasks/system_refresh.go b/internal/async/tasks/system_refresh.go index c220c186..b2fb3df7 100644 --- a/internal/async/tasks/system_refresh.go +++ b/internal/async/tasks/system_refresh.go @@ -7,12 +7,12 @@ import ( "google.golang.org/grpc/codes" "google.golang.org/grpc/status" - "github.com/openkcm/cmk/internal/config" - "github.com/openkcm/cmk/internal/errs" - "github.com/openkcm/cmk/internal/log" - "github.com/openkcm/cmk/internal/model" - "github.com/openkcm/cmk/internal/repo" - cmkcontext "github.com/openkcm/cmk/utils/context" + "github.com/openkcm/cmk-core/internal/config" + "github.com/openkcm/cmk-core/internal/errs" + "github.com/openkcm/cmk-core/internal/log" + "github.com/openkcm/cmk-core/internal/model" + "github.com/openkcm/cmk-core/internal/repo" + cmkcontext "github.com/openkcm/cmk-core/utils/context" ) type SystemUpdater interface { diff --git a/internal/async/tasks/system_refresh_test.go b/internal/async/tasks/system_refresh_test.go index 06f4889a..51564847 100644 --- a/internal/async/tasks/system_refresh_test.go +++ b/internal/async/tasks/system_refresh_test.go @@ -9,9 +9,9 @@ import ( "google.golang.org/grpc/codes" "google.golang.org/grpc/status" - "github.com/openkcm/cmk/internal/async/tasks" - "github.com/openkcm/cmk/internal/repo/sql" - "github.com/openkcm/cmk/internal/testutils" + "github.com/openkcm/cmk-core/internal/async/tasks" + "github.com/openkcm/cmk-core/internal/repo/sql" + "github.com/openkcm/cmk-core/internal/testutils" ) type SystemUpdaterMock struct{} diff --git a/internal/auditor/auditor.go b/internal/auditor/auditor.go index d44d9fd3..699f0a98 100644 --- a/internal/auditor/auditor.go +++ b/internal/auditor/auditor.go @@ -8,10 +8,10 @@ import ( otlpaudit "github.com/openkcm/common-sdk/pkg/otlp/audit" - "github.com/openkcm/cmk/internal/config" - "github.com/openkcm/cmk/internal/errs" - "github.com/openkcm/cmk/internal/log" - cmkcontext "github.com/openkcm/cmk/utils/context" + "github.com/openkcm/cmk-core/internal/config" + "github.com/openkcm/cmk-core/internal/errs" + "github.com/openkcm/cmk-core/internal/log" + cmkcontext "github.com/openkcm/cmk-core/utils/context" ) var ( diff --git a/internal/auditor/auditor_test.go b/internal/auditor/auditor_test.go index 9cef3ef1..66617e2a 100644 --- a/internal/auditor/auditor_test.go +++ b/internal/auditor/auditor_test.go @@ -9,9 +9,9 @@ import ( otlpaudit "github.com/openkcm/common-sdk/pkg/otlp/audit" - "github.com/openkcm/cmk/internal/auditor" - "github.com/openkcm/cmk/internal/config" - cmkcontext "github.com/openkcm/cmk/utils/context" + "github.com/openkcm/cmk-core/internal/auditor" + "github.com/openkcm/cmk-core/internal/config" + cmkcontext "github.com/openkcm/cmk-core/utils/context" ) func createTestContext() context.Context { diff --git a/internal/auditor/key_test.go b/internal/auditor/key_test.go index 2ec066b5..13394510 100644 --- a/internal/auditor/key_test.go +++ b/internal/auditor/key_test.go @@ -10,8 +10,8 @@ import ( "github.com/openkcm/common-sdk/pkg/commoncfg" "github.com/stretchr/testify/assert" - "github.com/openkcm/cmk/internal/auditor" - "github.com/openkcm/cmk/internal/config" + "github.com/openkcm/cmk-core/internal/auditor" + "github.com/openkcm/cmk-core/internal/config" ) func createTestAuditor(endpoint string) *auditor.Auditor { diff --git a/internal/auditor/system_test.go b/internal/auditor/system_test.go index 06f5428a..c807b21e 100644 --- a/internal/auditor/system_test.go +++ b/internal/auditor/system_test.go @@ -10,7 +10,7 @@ import ( otlpaudit "github.com/openkcm/common-sdk/pkg/otlp/audit" - "github.com/openkcm/cmk/internal/auditor" + "github.com/openkcm/cmk-core/internal/auditor" ) func testCmkSystemAuditMethod( diff --git a/internal/authz/authorization.go b/internal/authz/authorization.go index df45e5dd..e123ecad 100644 --- a/internal/authz/authorization.go +++ b/internal/authz/authorization.go @@ -4,9 +4,9 @@ import ( "context" "errors" - "github.com/openkcm/cmk/internal/constants" - "github.com/openkcm/cmk/internal/errs" - cmkcontext "github.com/openkcm/cmk/utils/context" + "github.com/openkcm/cmk-core/internal/constants" + "github.com/openkcm/cmk-core/internal/errs" + cmkcontext "github.com/openkcm/cmk-core/utils/context" ) type UserGroup string diff --git a/internal/authz/authorization_data.go b/internal/authz/authorization_data.go index d085cddb..5ea1e3e6 100644 --- a/internal/authz/authorization_data.go +++ b/internal/authz/authorization_data.go @@ -3,7 +3,7 @@ package authz import ( "errors" - "github.com/openkcm/cmk/internal/errs" + "github.com/openkcm/cmk-core/internal/errs" ) type AuthorizationKey struct { diff --git a/internal/authz/authorization_test.go b/internal/authz/authorization_test.go index be04f172..1b27c119 100644 --- a/internal/authz/authorization_test.go +++ b/internal/authz/authorization_test.go @@ -4,9 +4,9 @@ import ( "fmt" "testing" - "github.com/openkcm/cmk/internal/authz" - "github.com/openkcm/cmk/internal/constants" - "github.com/openkcm/cmk/internal/testutils" + "github.com/openkcm/cmk-core/internal/authz" + "github.com/openkcm/cmk-core/internal/constants" + "github.com/openkcm/cmk-core/internal/testutils" ) // TestIsAllowed tests the IsAllowed function of the AuthorizationHandler diff --git a/internal/authz/authz_logging.go b/internal/authz/authz_logging.go index b9128ad8..c1019513 100644 --- a/internal/authz/authz_logging.go +++ b/internal/authz/authz_logging.go @@ -4,7 +4,7 @@ import ( "context" "log/slog" - "github.com/openkcm/cmk/internal/log" + "github.com/openkcm/cmk-core/internal/log" ) type Reason string diff --git a/internal/authz/policies.go b/internal/authz/policies.go index c849e5a4..bc3c4e57 100644 --- a/internal/authz/policies.go +++ b/internal/authz/policies.go @@ -1,6 +1,6 @@ package authz -import "github.com/openkcm/cmk/internal/constants" +import "github.com/openkcm/cmk-core/internal/constants" type ( ResourceTypeName string diff --git a/internal/authz/request.go b/internal/authz/request.go index a7c7b7c7..91e5e7f3 100644 --- a/internal/authz/request.go +++ b/internal/authz/request.go @@ -4,8 +4,8 @@ import ( "context" "errors" - "github.com/openkcm/cmk/internal/errs" - cmkcontext "github.com/openkcm/cmk/utils/context" + "github.com/openkcm/cmk-core/internal/errs" + cmkcontext "github.com/openkcm/cmk-core/utils/context" ) type User struct { diff --git a/internal/authz/request_test.go b/internal/authz/request_test.go index e6e3fd0c..07f40704 100644 --- a/internal/authz/request_test.go +++ b/internal/authz/request_test.go @@ -5,9 +5,9 @@ import ( "github.com/stretchr/testify/assert" - "github.com/openkcm/cmk/internal/authz" - "github.com/openkcm/cmk/internal/testutils" - cmkcontext "github.com/openkcm/cmk/utils/context" + "github.com/openkcm/cmk-core/internal/authz" + "github.com/openkcm/cmk-core/internal/testutils" + cmkcontext "github.com/openkcm/cmk-core/utils/context" ) func TestNewRequest_ValidCases(t *testing.T) { diff --git a/internal/clients/factory.go b/internal/clients/factory.go index 9e5e4b5a..a50d482e 100644 --- a/internal/clients/factory.go +++ b/internal/clients/factory.go @@ -3,8 +3,8 @@ package clients import ( "errors" - "github.com/openkcm/cmk/internal/clients/registry" - "github.com/openkcm/cmk/internal/config" + "github.com/openkcm/cmk-core/internal/clients/registry" + "github.com/openkcm/cmk-core/internal/config" ) type Factory struct { diff --git a/internal/clients/registry/registry.go b/internal/clients/registry/registry.go index 6394f87c..7c304662 100644 --- a/internal/clients/registry/registry.go +++ b/internal/clients/registry/registry.go @@ -8,7 +8,7 @@ import ( tenantgrpc "github.com/openkcm/api-sdk/proto/kms/api/cmk/registry/tenant/v1" - "github.com/openkcm/cmk/internal/clients/registry/systems" + "github.com/openkcm/cmk-core/internal/clients/registry/systems" ) const ( diff --git a/internal/clients/registry/systems/client.go b/internal/clients/registry/systems/client.go index b7d3688d..dbbc87a4 100644 --- a/internal/clients/registry/systems/client.go +++ b/internal/clients/registry/systems/client.go @@ -12,8 +12,8 @@ import ( systemgrpc "github.com/openkcm/api-sdk/proto/kms/api/cmk/registry/system/v1" - "github.com/openkcm/cmk/internal/errs" - "github.com/openkcm/cmk/internal/model" + "github.com/openkcm/cmk-core/internal/errs" + "github.com/openkcm/cmk-core/internal/model" ) const ( diff --git a/internal/clients/registry/systems/client_test.go b/internal/clients/registry/systems/client_test.go index 3612c499..a58a7f9c 100644 --- a/internal/clients/registry/systems/client_test.go +++ b/internal/clients/registry/systems/client_test.go @@ -12,8 +12,8 @@ import ( systemgrpc "github.com/openkcm/api-sdk/proto/kms/api/cmk/registry/system/v1" - "github.com/openkcm/cmk/internal/clients/registry/systems" - "github.com/openkcm/cmk/internal/testutils" + "github.com/openkcm/cmk-core/internal/clients/registry/systems" + "github.com/openkcm/cmk-core/internal/testutils" ) const ( diff --git a/internal/clients/registry/systems/fake_service.go b/internal/clients/registry/systems/fake_service.go index 890caaee..46e01617 100644 --- a/internal/clients/registry/systems/fake_service.go +++ b/internal/clients/registry/systems/fake_service.go @@ -9,7 +9,7 @@ import ( systemv1 "github.com/openkcm/api-sdk/proto/kms/api/cmk/registry/system/v1" - "github.com/openkcm/cmk/internal/errs" + "github.com/openkcm/cmk-core/internal/errs" ) type FakeService struct { diff --git a/internal/clients/registry/systems/helpers_test.go b/internal/clients/registry/systems/helpers_test.go index 12e1473d..c9da9a89 100644 --- a/internal/clients/registry/systems/helpers_test.go +++ b/internal/clients/registry/systems/helpers_test.go @@ -8,7 +8,7 @@ import ( systemgrpc "github.com/openkcm/api-sdk/proto/kms/api/cmk/registry/system/v1" regionpb "github.com/openkcm/api-sdk/proto/kms/api/cmk/types/v1" - "github.com/openkcm/cmk/internal/clients/registry/systems" + "github.com/openkcm/cmk-core/internal/clients/registry/systems" ) func randExternalID() string { diff --git a/internal/clients/registry/systems/mapper.go b/internal/clients/registry/systems/mapper.go index e5c1aec4..cb05e181 100644 --- a/internal/clients/registry/systems/mapper.go +++ b/internal/clients/registry/systems/mapper.go @@ -5,7 +5,7 @@ import ( systemgrpc "github.com/openkcm/api-sdk/proto/kms/api/cmk/registry/system/v1" - "github.com/openkcm/cmk/internal/model" + "github.com/openkcm/cmk-core/internal/model" ) func MapRegistrySystemsToCmkSystems(grpcSystems []*systemgrpc.System) ([]*model.System, error) { diff --git a/internal/clients/registry/systems/mapper_test.go b/internal/clients/registry/systems/mapper_test.go index f06f26c3..2f4df7ee 100644 --- a/internal/clients/registry/systems/mapper_test.go +++ b/internal/clients/registry/systems/mapper_test.go @@ -8,8 +8,8 @@ import ( systemgrpc "github.com/openkcm/api-sdk/proto/kms/api/cmk/registry/system/v1" v1 "github.com/openkcm/api-sdk/proto/kms/api/cmk/types/v1" - "github.com/openkcm/cmk/internal/clients/registry/systems" - "github.com/openkcm/cmk/internal/model" + "github.com/openkcm/cmk-core/internal/clients/registry/systems" + "github.com/openkcm/cmk-core/internal/model" ) func Test_MapRegistrySystemsToCmkSystems(t *testing.T) { diff --git a/internal/config/config.go b/internal/config/config.go index 331529f8..391dd60b 100644 --- a/internal/config/config.go +++ b/internal/config/config.go @@ -8,7 +8,7 @@ import ( plugincatalog "github.com/openkcm/plugin-sdk/pkg/catalog" - "github.com/openkcm/cmk/internal/errs" + "github.com/openkcm/cmk-core/internal/errs" ) var ( diff --git a/internal/config/config_test.go b/internal/config/config_test.go index 315fdcfb..63a5cda3 100644 --- a/internal/config/config_test.go +++ b/internal/config/config_test.go @@ -6,8 +6,8 @@ import ( "github.com/openkcm/common-sdk/pkg/commoncfg" "github.com/stretchr/testify/assert" - "github.com/openkcm/cmk/internal/config" - "github.com/openkcm/cmk/internal/testutils" + "github.com/openkcm/cmk-core/internal/config" + "github.com/openkcm/cmk-core/internal/testutils" ) func TestValidateCertificate(t *testing.T) { diff --git a/internal/constants/logging_test.go b/internal/constants/logging_test.go index 7500a04d..7d7b4d72 100644 --- a/internal/constants/logging_test.go +++ b/internal/constants/logging_test.go @@ -3,7 +3,7 @@ package constants_test import ( "testing" - "github.com/openkcm/cmk/internal/constants" + "github.com/openkcm/cmk-core/internal/constants" ) func TestLogLevel_String(t *testing.T) { diff --git a/internal/controllers/cmk/base_controller.go b/internal/controllers/cmk/base_controller.go index cb1cc5e2..f55a6a78 100644 --- a/internal/controllers/cmk/base_controller.go +++ b/internal/controllers/cmk/base_controller.go @@ -5,13 +5,13 @@ import ( plugincatalog "github.com/openkcm/plugin-sdk/pkg/catalog" - "github.com/openkcm/cmk/internal/clients" - "github.com/openkcm/cmk/internal/config" - eventprocessor "github.com/openkcm/cmk/internal/event-processor" - "github.com/openkcm/cmk/internal/grpc/catalog" - "github.com/openkcm/cmk/internal/log" - "github.com/openkcm/cmk/internal/manager" - "github.com/openkcm/cmk/internal/repo" + "github.com/openkcm/cmk-core/internal/clients" + "github.com/openkcm/cmk-core/internal/config" + eventprocessor "github.com/openkcm/cmk-core/internal/event-processor" + "github.com/openkcm/cmk-core/internal/grpc/catalog" + "github.com/openkcm/cmk-core/internal/log" + "github.com/openkcm/cmk-core/internal/manager" + "github.com/openkcm/cmk-core/internal/repo" ) // APIController handles API requests related to CMK (Customer Managed Keys). diff --git a/internal/controllers/cmk/group_controller.go b/internal/controllers/cmk/group_controller.go index bde3ec8a..3c346d91 100644 --- a/internal/controllers/cmk/group_controller.go +++ b/internal/controllers/cmk/group_controller.go @@ -3,16 +3,16 @@ package cmk import ( "context" - "github.com/openkcm/cmk/internal/api/cmkapi" - "github.com/openkcm/cmk/internal/api/transform" - tfGroup "github.com/openkcm/cmk/internal/api/transform/group" - "github.com/openkcm/cmk/internal/apierrors" - "github.com/openkcm/cmk/internal/constants" - "github.com/openkcm/cmk/internal/errs" - "github.com/openkcm/cmk/internal/manager" - "github.com/openkcm/cmk/internal/model" - cmkcontext "github.com/openkcm/cmk/utils/context" - "github.com/openkcm/cmk/utils/ptr" + "github.com/openkcm/cmk-core/internal/api/cmkapi" + "github.com/openkcm/cmk-core/internal/api/transform" + tfGroup "github.com/openkcm/cmk-core/internal/api/transform/group" + "github.com/openkcm/cmk-core/internal/apierrors" + "github.com/openkcm/cmk-core/internal/constants" + "github.com/openkcm/cmk-core/internal/errs" + "github.com/openkcm/cmk-core/internal/manager" + "github.com/openkcm/cmk-core/internal/model" + cmkcontext "github.com/openkcm/cmk-core/utils/context" + "github.com/openkcm/cmk-core/utils/ptr" ) func (c *APIController) GetGroups(ctx context.Context, diff --git a/internal/controllers/cmk/group_controller_test.go b/internal/controllers/cmk/group_controller_test.go index 57b9b069..65f38f84 100644 --- a/internal/controllers/cmk/group_controller_test.go +++ b/internal/controllers/cmk/group_controller_test.go @@ -12,12 +12,12 @@ import ( multitenancy "github.com/bartventer/gorm-multitenancy/v8" - "github.com/openkcm/cmk/internal/api/cmkapi" - "github.com/openkcm/cmk/internal/constants" - "github.com/openkcm/cmk/internal/model" - "github.com/openkcm/cmk/internal/repo/sql" - "github.com/openkcm/cmk/internal/testutils" - "github.com/openkcm/cmk/utils/ptr" + "github.com/openkcm/cmk-core/internal/api/cmkapi" + "github.com/openkcm/cmk-core/internal/constants" + "github.com/openkcm/cmk-core/internal/model" + "github.com/openkcm/cmk-core/internal/repo/sql" + "github.com/openkcm/cmk-core/internal/testutils" + "github.com/openkcm/cmk-core/utils/ptr" ) func startAPIGroups(t *testing.T) (*multitenancy.DB, *http.ServeMux, string) { diff --git a/internal/controllers/cmk/key_controller.go b/internal/controllers/cmk/key_controller.go index 72d13d88..361c8852 100644 --- a/internal/controllers/cmk/key_controller.go +++ b/internal/controllers/cmk/key_controller.go @@ -3,15 +3,15 @@ package cmk import ( "context" - "github.com/openkcm/cmk/internal/api/cmkapi" - "github.com/openkcm/cmk/internal/api/transform/importparams" - keyTransform "github.com/openkcm/cmk/internal/api/transform/key" - "github.com/openkcm/cmk/internal/api/transform/key/keyshared" - "github.com/openkcm/cmk/internal/api/transform/key/transformer" - "github.com/openkcm/cmk/internal/apierrors" - "github.com/openkcm/cmk/internal/constants" - "github.com/openkcm/cmk/internal/errs" - "github.com/openkcm/cmk/utils/ptr" + "github.com/openkcm/cmk-core/internal/api/cmkapi" + "github.com/openkcm/cmk-core/internal/api/transform/importparams" + keyTransform "github.com/openkcm/cmk-core/internal/api/transform/key" + "github.com/openkcm/cmk-core/internal/api/transform/key/keyshared" + "github.com/openkcm/cmk-core/internal/api/transform/key/transformer" + "github.com/openkcm/cmk-core/internal/apierrors" + "github.com/openkcm/cmk-core/internal/constants" + "github.com/openkcm/cmk-core/internal/errs" + "github.com/openkcm/cmk-core/utils/ptr" ) // PostKeys handles the creation of a new key diff --git a/internal/controllers/cmk/key_controller_test.go b/internal/controllers/cmk/key_controller_test.go index 7cc82585..08b5c1ef 100644 --- a/internal/controllers/cmk/key_controller_test.go +++ b/internal/controllers/cmk/key_controller_test.go @@ -17,13 +17,13 @@ import ( multitenancy "github.com/bartventer/gorm-multitenancy/v8" - "github.com/openkcm/cmk/internal/api/cmkapi" - "github.com/openkcm/cmk/internal/model" - "github.com/openkcm/cmk/internal/repo" - "github.com/openkcm/cmk/internal/repo/sql" - "github.com/openkcm/cmk/internal/testutils" - cmkcontext "github.com/openkcm/cmk/utils/context" - "github.com/openkcm/cmk/utils/ptr" + "github.com/openkcm/cmk-core/internal/api/cmkapi" + "github.com/openkcm/cmk-core/internal/model" + "github.com/openkcm/cmk-core/internal/repo" + "github.com/openkcm/cmk-core/internal/repo/sql" + "github.com/openkcm/cmk-core/internal/testutils" + cmkcontext "github.com/openkcm/cmk-core/utils/context" + "github.com/openkcm/cmk-core/utils/ptr" ) var ( diff --git a/internal/controllers/cmk/key_labels_controller.go b/internal/controllers/cmk/key_labels_controller.go index fed243a1..90610ce1 100644 --- a/internal/controllers/cmk/key_labels_controller.go +++ b/internal/controllers/cmk/key_labels_controller.go @@ -3,13 +3,13 @@ package cmk import ( "context" - "github.com/openkcm/cmk/internal/api/cmkapi" - keylabel "github.com/openkcm/cmk/internal/api/transform/label" - "github.com/openkcm/cmk/internal/apierrors" - "github.com/openkcm/cmk/internal/constants" - "github.com/openkcm/cmk/internal/errs" - "github.com/openkcm/cmk/internal/model" - "github.com/openkcm/cmk/utils/ptr" + "github.com/openkcm/cmk-core/internal/api/cmkapi" + keylabel "github.com/openkcm/cmk-core/internal/api/transform/label" + "github.com/openkcm/cmk-core/internal/apierrors" + "github.com/openkcm/cmk-core/internal/constants" + "github.com/openkcm/cmk-core/internal/errs" + "github.com/openkcm/cmk-core/internal/model" + "github.com/openkcm/cmk-core/utils/ptr" ) // GetKeyLabels handles fetching a list of all the labels attached to the key. diff --git a/internal/controllers/cmk/key_labels_controller_test.go b/internal/controllers/cmk/key_labels_controller_test.go index 8db9e737..a4d6c411 100644 --- a/internal/controllers/cmk/key_labels_controller_test.go +++ b/internal/controllers/cmk/key_labels_controller_test.go @@ -12,13 +12,13 @@ import ( multitenancy "github.com/bartventer/gorm-multitenancy/v8" - "github.com/openkcm/cmk/internal/api/cmkapi" - "github.com/openkcm/cmk/internal/model" - "github.com/openkcm/cmk/internal/repo" - "github.com/openkcm/cmk/internal/repo/sql" - "github.com/openkcm/cmk/internal/testutils" - cmkcontext "github.com/openkcm/cmk/utils/context" - "github.com/openkcm/cmk/utils/ptr" + "github.com/openkcm/cmk-core/internal/api/cmkapi" + "github.com/openkcm/cmk-core/internal/model" + "github.com/openkcm/cmk-core/internal/repo" + "github.com/openkcm/cmk-core/internal/repo/sql" + "github.com/openkcm/cmk-core/internal/testutils" + cmkcontext "github.com/openkcm/cmk-core/utils/context" + "github.com/openkcm/cmk-core/utils/ptr" ) const ( diff --git a/internal/controllers/cmk/keyconfiguration_controller.go b/internal/controllers/cmk/keyconfiguration_controller.go index 193093ef..4dd3408e 100644 --- a/internal/controllers/cmk/keyconfiguration_controller.go +++ b/internal/controllers/cmk/keyconfiguration_controller.go @@ -3,14 +3,14 @@ package cmk import ( "context" - "github.com/openkcm/cmk/internal/api/cmkapi" - "github.com/openkcm/cmk/internal/api/transform/clientcertificates" - "github.com/openkcm/cmk/internal/api/transform/keyconfiguration" - "github.com/openkcm/cmk/internal/apierrors" - "github.com/openkcm/cmk/internal/constants" - "github.com/openkcm/cmk/internal/errs" - "github.com/openkcm/cmk/internal/manager" - "github.com/openkcm/cmk/utils/ptr" + "github.com/openkcm/cmk-core/internal/api/cmkapi" + "github.com/openkcm/cmk-core/internal/api/transform/clientcertificates" + "github.com/openkcm/cmk-core/internal/api/transform/keyconfiguration" + "github.com/openkcm/cmk-core/internal/apierrors" + "github.com/openkcm/cmk-core/internal/constants" + "github.com/openkcm/cmk-core/internal/errs" + "github.com/openkcm/cmk-core/internal/manager" + "github.com/openkcm/cmk-core/utils/ptr" ) // GetKeyConfigurations returns the key configurations diff --git a/internal/controllers/cmk/keyconfiguration_controller_test.go b/internal/controllers/cmk/keyconfiguration_controller_test.go index 6cc49e02..77137e25 100644 --- a/internal/controllers/cmk/keyconfiguration_controller_test.go +++ b/internal/controllers/cmk/keyconfiguration_controller_test.go @@ -19,16 +19,16 @@ import ( multitenancy "github.com/bartventer/gorm-multitenancy/v8" - "github.com/openkcm/cmk/internal/api/cmkapi" - "github.com/openkcm/cmk/internal/config" - "github.com/openkcm/cmk/internal/manager" - "github.com/openkcm/cmk/internal/model" - "github.com/openkcm/cmk/internal/repo" - "github.com/openkcm/cmk/internal/repo/sql" - "github.com/openkcm/cmk/internal/testutils" - cmkcontext "github.com/openkcm/cmk/utils/context" - "github.com/openkcm/cmk/utils/crypto" - "github.com/openkcm/cmk/utils/ptr" + "github.com/openkcm/cmk-core/internal/api/cmkapi" + "github.com/openkcm/cmk-core/internal/config" + "github.com/openkcm/cmk-core/internal/manager" + "github.com/openkcm/cmk-core/internal/model" + "github.com/openkcm/cmk-core/internal/repo" + "github.com/openkcm/cmk-core/internal/repo/sql" + "github.com/openkcm/cmk-core/internal/testutils" + cmkcontext "github.com/openkcm/cmk-core/utils/context" + "github.com/openkcm/cmk-core/utils/crypto" + "github.com/openkcm/cmk-core/utils/ptr" ) // startAPIKeyConfig starts the API server for key configurations and returns a pointer to the database diff --git a/internal/controllers/cmk/keyconfiguration_tags_controller.go b/internal/controllers/cmk/keyconfiguration_tags_controller.go index 4834c4cd..75190656 100644 --- a/internal/controllers/cmk/keyconfiguration_tags_controller.go +++ b/internal/controllers/cmk/keyconfiguration_tags_controller.go @@ -3,12 +3,12 @@ package cmk import ( "context" - "github.com/openkcm/cmk/internal/api/cmkapi" - tags "github.com/openkcm/cmk/internal/api/transform/tags" - "github.com/openkcm/cmk/internal/apierrors" - "github.com/openkcm/cmk/internal/errs" - "github.com/openkcm/cmk/internal/model" - "github.com/openkcm/cmk/utils/ptr" + "github.com/openkcm/cmk-core/internal/api/cmkapi" + tags "github.com/openkcm/cmk-core/internal/api/transform/tags" + "github.com/openkcm/cmk-core/internal/apierrors" + "github.com/openkcm/cmk-core/internal/errs" + "github.com/openkcm/cmk-core/internal/model" + "github.com/openkcm/cmk-core/utils/ptr" ) // GetTagsForKeyConfiguration returns the tags for a key configuration diff --git a/internal/controllers/cmk/keyconfiguration_tags_controller_test.go b/internal/controllers/cmk/keyconfiguration_tags_controller_test.go index 0d1da033..0418b76a 100644 --- a/internal/controllers/cmk/keyconfiguration_tags_controller_test.go +++ b/internal/controllers/cmk/keyconfiguration_tags_controller_test.go @@ -11,12 +11,12 @@ import ( multitenancy "github.com/bartventer/gorm-multitenancy/v8" - "github.com/openkcm/cmk/internal/api/cmkapi" - "github.com/openkcm/cmk/internal/model" - "github.com/openkcm/cmk/internal/repo" - "github.com/openkcm/cmk/internal/repo/sql" - "github.com/openkcm/cmk/internal/testutils" - cmkcontext "github.com/openkcm/cmk/utils/context" + "github.com/openkcm/cmk-core/internal/api/cmkapi" + "github.com/openkcm/cmk-core/internal/model" + "github.com/openkcm/cmk-core/internal/repo" + "github.com/openkcm/cmk-core/internal/repo/sql" + "github.com/openkcm/cmk-core/internal/testutils" + cmkcontext "github.com/openkcm/cmk-core/utils/context" ) // startAPIKeyConfigTags starts the API server and returns a db connection and a mux for testing diff --git a/internal/controllers/cmk/keyversion_controller.go b/internal/controllers/cmk/keyversion_controller.go index f48825f8..c7a5a737 100644 --- a/internal/controllers/cmk/keyversion_controller.go +++ b/internal/controllers/cmk/keyversion_controller.go @@ -3,13 +3,13 @@ package cmk import ( "context" - "github.com/openkcm/cmk/internal/api/cmkapi" - "github.com/openkcm/cmk/internal/api/transform" - "github.com/openkcm/cmk/internal/api/transform/keyversion" - "github.com/openkcm/cmk/internal/apierrors" - "github.com/openkcm/cmk/internal/constants" - "github.com/openkcm/cmk/internal/errs" - "github.com/openkcm/cmk/utils/ptr" + "github.com/openkcm/cmk-core/internal/api/cmkapi" + "github.com/openkcm/cmk-core/internal/api/transform" + "github.com/openkcm/cmk-core/internal/api/transform/keyversion" + "github.com/openkcm/cmk-core/internal/apierrors" + "github.com/openkcm/cmk-core/internal/constants" + "github.com/openkcm/cmk-core/internal/errs" + "github.com/openkcm/cmk-core/utils/ptr" ) // GetKeyVersions returns a list of key version by L1 Key ID diff --git a/internal/controllers/cmk/keyversion_controller_test.go b/internal/controllers/cmk/keyversion_controller_test.go index 01f84a9a..d970aa7a 100644 --- a/internal/controllers/cmk/keyversion_controller_test.go +++ b/internal/controllers/cmk/keyversion_controller_test.go @@ -14,12 +14,12 @@ import ( multitenancy "github.com/bartventer/gorm-multitenancy/v8" - "github.com/openkcm/cmk/internal/api/cmkapi" - "github.com/openkcm/cmk/internal/model" - "github.com/openkcm/cmk/internal/repo/sql" - "github.com/openkcm/cmk/internal/testutils" - cmkcontext "github.com/openkcm/cmk/utils/context" - "github.com/openkcm/cmk/utils/ptr" + "github.com/openkcm/cmk-core/internal/api/cmkapi" + "github.com/openkcm/cmk-core/internal/model" + "github.com/openkcm/cmk-core/internal/repo/sql" + "github.com/openkcm/cmk-core/internal/testutils" + cmkcontext "github.com/openkcm/cmk-core/utils/context" + "github.com/openkcm/cmk-core/utils/ptr" ) func startAPIKeyVersion(t *testing.T, plugins ...testutils.MockPlugin) (*multitenancy.DB, *http.ServeMux, string) { diff --git a/internal/controllers/cmk/system_controller.go b/internal/controllers/cmk/system_controller.go index 6f36f3ec..8f09a470 100644 --- a/internal/controllers/cmk/system_controller.go +++ b/internal/controllers/cmk/system_controller.go @@ -3,11 +3,11 @@ package cmk import ( "context" - "github.com/openkcm/cmk/internal/api/cmkapi" - "github.com/openkcm/cmk/internal/api/transform/system" - "github.com/openkcm/cmk/internal/apierrors" - "github.com/openkcm/cmk/internal/errs" - "github.com/openkcm/cmk/utils/ptr" + "github.com/openkcm/cmk-core/internal/api/cmkapi" + "github.com/openkcm/cmk-core/internal/api/transform/system" + "github.com/openkcm/cmk-core/internal/apierrors" + "github.com/openkcm/cmk-core/internal/errs" + "github.com/openkcm/cmk-core/utils/ptr" ) func (c *APIController) GetAllSystems(ctx context.Context, diff --git a/internal/controllers/cmk/system_controller_test.go b/internal/controllers/cmk/system_controller_test.go index 8583a5bd..c857db17 100644 --- a/internal/controllers/cmk/system_controller_test.go +++ b/internal/controllers/cmk/system_controller_test.go @@ -15,16 +15,16 @@ import ( multitenancy "github.com/bartventer/gorm-multitenancy/v8" systemgrpc "github.com/openkcm/api-sdk/proto/kms/api/cmk/registry/system/v1" - "github.com/openkcm/cmk/internal/api/cmkapi" - "github.com/openkcm/cmk/internal/apierrors" - "github.com/openkcm/cmk/internal/clients/registry/systems" - "github.com/openkcm/cmk/internal/config" - "github.com/openkcm/cmk/internal/model" - "github.com/openkcm/cmk/internal/repo" - "github.com/openkcm/cmk/internal/repo/sql" - "github.com/openkcm/cmk/internal/testutils" - cmkcontext "github.com/openkcm/cmk/utils/context" - "github.com/openkcm/cmk/utils/ptr" + "github.com/openkcm/cmk-core/internal/api/cmkapi" + "github.com/openkcm/cmk-core/internal/apierrors" + "github.com/openkcm/cmk-core/internal/clients/registry/systems" + "github.com/openkcm/cmk-core/internal/config" + "github.com/openkcm/cmk-core/internal/model" + "github.com/openkcm/cmk-core/internal/repo" + "github.com/openkcm/cmk-core/internal/repo/sql" + "github.com/openkcm/cmk-core/internal/testutils" + cmkcontext "github.com/openkcm/cmk-core/utils/context" + "github.com/openkcm/cmk-core/utils/ptr" ) var ErrForced = errors.New("forced") diff --git a/internal/controllers/cmk/tenant_controller.go b/internal/controllers/cmk/tenant_controller.go index 7c03c6fe..e118168d 100644 --- a/internal/controllers/cmk/tenant_controller.go +++ b/internal/controllers/cmk/tenant_controller.go @@ -3,14 +3,14 @@ package cmk import ( "context" - "github.com/openkcm/cmk/internal/api/cmkapi" - "github.com/openkcm/cmk/internal/api/transform" - "github.com/openkcm/cmk/internal/api/transform/tenant" - "github.com/openkcm/cmk/internal/apierrors" - "github.com/openkcm/cmk/internal/constants" - "github.com/openkcm/cmk/internal/errs" - cmkcontext "github.com/openkcm/cmk/utils/context" - "github.com/openkcm/cmk/utils/ptr" + "github.com/openkcm/cmk-core/internal/api/cmkapi" + "github.com/openkcm/cmk-core/internal/api/transform" + "github.com/openkcm/cmk-core/internal/api/transform/tenant" + "github.com/openkcm/cmk-core/internal/apierrors" + "github.com/openkcm/cmk-core/internal/constants" + "github.com/openkcm/cmk-core/internal/errs" + cmkcontext "github.com/openkcm/cmk-core/utils/context" + "github.com/openkcm/cmk-core/utils/ptr" ) const ( diff --git a/internal/controllers/cmk/tenant_controller_test.go b/internal/controllers/cmk/tenant_controller_test.go index 7f9407f7..3cd26339 100644 --- a/internal/controllers/cmk/tenant_controller_test.go +++ b/internal/controllers/cmk/tenant_controller_test.go @@ -9,9 +9,9 @@ import ( multitenancy "github.com/bartventer/gorm-multitenancy/v8" - "github.com/openkcm/cmk/internal/api/cmkapi" - "github.com/openkcm/cmk/internal/model" - "github.com/openkcm/cmk/internal/testutils" + "github.com/openkcm/cmk-core/internal/api/cmkapi" + "github.com/openkcm/cmk-core/internal/model" + "github.com/openkcm/cmk-core/internal/testutils" ) func startAPITenant(t *testing.T) (*multitenancy.DB, *http.ServeMux) { diff --git a/internal/controllers/cmk/tenantconfigs_controller.go b/internal/controllers/cmk/tenantconfigs_controller.go index 7b96564d..10236458 100644 --- a/internal/controllers/cmk/tenantconfigs_controller.go +++ b/internal/controllers/cmk/tenantconfigs_controller.go @@ -3,10 +3,10 @@ package cmk import ( "context" - "github.com/openkcm/cmk/internal/api/cmkapi" - "github.com/openkcm/cmk/internal/api/transform/tenantconfigs" - "github.com/openkcm/cmk/internal/apierrors" - "github.com/openkcm/cmk/internal/errs" + "github.com/openkcm/cmk-core/internal/api/cmkapi" + "github.com/openkcm/cmk-core/internal/api/transform/tenantconfigs" + "github.com/openkcm/cmk-core/internal/apierrors" + "github.com/openkcm/cmk-core/internal/errs" ) func (c *APIController) GetTenantsKeystores( diff --git a/internal/controllers/cmk/tenantconfigs_controller_test.go b/internal/controllers/cmk/tenantconfigs_controller_test.go index 06f68bf6..f1410a8d 100644 --- a/internal/controllers/cmk/tenantconfigs_controller_test.go +++ b/internal/controllers/cmk/tenantconfigs_controller_test.go @@ -9,8 +9,8 @@ import ( multitenancy "github.com/bartventer/gorm-multitenancy/v8" - "github.com/openkcm/cmk/internal/model" - "github.com/openkcm/cmk/internal/testutils" + "github.com/openkcm/cmk-core/internal/model" + "github.com/openkcm/cmk-core/internal/testutils" ) // startAPIServerTenantConfig starts the API server for keys and returns a pointer to the database diff --git a/internal/controllers/cmk/workflow_controller.go b/internal/controllers/cmk/workflow_controller.go index 8cf4631c..fd4ecc9a 100644 --- a/internal/controllers/cmk/workflow_controller.go +++ b/internal/controllers/cmk/workflow_controller.go @@ -3,13 +3,13 @@ package cmk import ( "context" - "github.com/openkcm/cmk/internal/api/cmkapi" - wfTransform "github.com/openkcm/cmk/internal/api/transform/workflow" - "github.com/openkcm/cmk/internal/apierrors" - "github.com/openkcm/cmk/internal/constants" - "github.com/openkcm/cmk/internal/errs" - wfMechanism "github.com/openkcm/cmk/internal/workflow" - "github.com/openkcm/cmk/utils/ptr" + "github.com/openkcm/cmk-core/internal/api/cmkapi" + wfTransform "github.com/openkcm/cmk-core/internal/api/transform/workflow" + "github.com/openkcm/cmk-core/internal/apierrors" + "github.com/openkcm/cmk-core/internal/constants" + "github.com/openkcm/cmk-core/internal/errs" + wfMechanism "github.com/openkcm/cmk-core/internal/workflow" + "github.com/openkcm/cmk-core/utils/ptr" ) // GetWorkflows returns a list of workflows diff --git a/internal/controllers/cmk/workflow_controller_test.go b/internal/controllers/cmk/workflow_controller_test.go index 7af29663..3fcb75da 100644 --- a/internal/controllers/cmk/workflow_controller_test.go +++ b/internal/controllers/cmk/workflow_controller_test.go @@ -14,13 +14,13 @@ import ( multitenancy "github.com/bartventer/gorm-multitenancy/v8" - "github.com/openkcm/cmk/internal/api/cmkapi" - "github.com/openkcm/cmk/internal/model" - "github.com/openkcm/cmk/internal/repo" - cmksql "github.com/openkcm/cmk/internal/repo/sql" - "github.com/openkcm/cmk/internal/testutils" - wfMechanism "github.com/openkcm/cmk/internal/workflow" - cmkcontext "github.com/openkcm/cmk/utils/context" + "github.com/openkcm/cmk-core/internal/api/cmkapi" + "github.com/openkcm/cmk-core/internal/model" + "github.com/openkcm/cmk-core/internal/repo" + cmksql "github.com/openkcm/cmk-core/internal/repo/sql" + "github.com/openkcm/cmk-core/internal/testutils" + wfMechanism "github.com/openkcm/cmk-core/internal/workflow" + cmkcontext "github.com/openkcm/cmk-core/utils/context" ) var errMockInternalError = errors.New("internal error") diff --git a/internal/daemon/server.go b/internal/daemon/server.go index 50888cd7..3a0d144d 100644 --- a/internal/daemon/server.go +++ b/internal/daemon/server.go @@ -14,16 +14,16 @@ import ( "github.com/openkcm/common-sdk/pkg/storage/keyvalue" "github.com/samber/oops" - "github.com/openkcm/cmk/internal/api/cmkapi" - "github.com/openkcm/cmk/internal/clients" - "github.com/openkcm/cmk/internal/config" - "github.com/openkcm/cmk/internal/controllers/cmk" - "github.com/openkcm/cmk/internal/db" - "github.com/openkcm/cmk/internal/errs" - "github.com/openkcm/cmk/internal/handlers" - "github.com/openkcm/cmk/internal/log" - "github.com/openkcm/cmk/internal/middleware" - "github.com/openkcm/cmk/internal/repo/sql" + "github.com/openkcm/cmk-core/internal/api/cmkapi" + "github.com/openkcm/cmk-core/internal/clients" + "github.com/openkcm/cmk-core/internal/config" + "github.com/openkcm/cmk-core/internal/controllers/cmk" + "github.com/openkcm/cmk-core/internal/db" + "github.com/openkcm/cmk-core/internal/errs" + "github.com/openkcm/cmk-core/internal/handlers" + "github.com/openkcm/cmk-core/internal/log" + "github.com/openkcm/cmk-core/internal/middleware" + "github.com/openkcm/cmk-core/internal/repo/sql" ) const ( diff --git a/internal/daemon/server_test.go b/internal/daemon/server_test.go index 94494d53..199726de 100644 --- a/internal/daemon/server_test.go +++ b/internal/daemon/server_test.go @@ -6,8 +6,8 @@ import ( "github.com/openkcm/common-sdk/pkg/commoncfg" "github.com/stretchr/testify/assert" - "github.com/openkcm/cmk/internal/config" - "github.com/openkcm/cmk/internal/daemon" + "github.com/openkcm/cmk-core/internal/config" + "github.com/openkcm/cmk-core/internal/daemon" ) var conf = &config.Config{ diff --git a/internal/db/connection.go b/internal/db/connection.go index 0385800b..9b3101d2 100644 --- a/internal/db/connection.go +++ b/internal/db/connection.go @@ -8,10 +8,10 @@ import ( multitenancy "github.com/bartventer/gorm-multitenancy/v8" - "github.com/openkcm/cmk/internal/config" - "github.com/openkcm/cmk/internal/db/dialect" - "github.com/openkcm/cmk/internal/db/dsn" - "github.com/openkcm/cmk/internal/errs" + "github.com/openkcm/cmk-core/internal/config" + "github.com/openkcm/cmk-core/internal/db/dialect" + "github.com/openkcm/cmk-core/internal/db/dsn" + "github.com/openkcm/cmk-core/internal/errs" ) var ( diff --git a/internal/db/connection_test.go b/internal/db/connection_test.go index 65f634cc..112fada1 100644 --- a/internal/db/connection_test.go +++ b/internal/db/connection_test.go @@ -9,9 +9,9 @@ import ( "github.com/stretchr/testify/require" "gorm.io/gorm" - "github.com/openkcm/cmk/internal/config" - "github.com/openkcm/cmk/internal/db" - "github.com/openkcm/cmk/internal/testutils" + "github.com/openkcm/cmk-core/internal/config" + "github.com/openkcm/cmk-core/internal/db" + "github.com/openkcm/cmk-core/internal/testutils" ) var errForced = errors.New("forced error") diff --git a/internal/db/db.go b/internal/db/db.go index d5c4c221..f4137df6 100644 --- a/internal/db/db.go +++ b/internal/db/db.go @@ -12,10 +12,10 @@ import ( multitenancy "github.com/bartventer/gorm-multitenancy/v8" - "github.com/openkcm/cmk/internal/config" - "github.com/openkcm/cmk/internal/errs" - "github.com/openkcm/cmk/internal/log" - "github.com/openkcm/cmk/internal/model" + "github.com/openkcm/cmk-core/internal/config" + "github.com/openkcm/cmk-core/internal/errs" + "github.com/openkcm/cmk-core/internal/log" + "github.com/openkcm/cmk-core/internal/model" ) var ( diff --git a/internal/db/db_test.go b/internal/db/db_test.go index fb14e832..dc165280 100644 --- a/internal/db/db_test.go +++ b/internal/db/db_test.go @@ -8,10 +8,10 @@ import ( "github.com/bartventer/gorm-multitenancy/v8/pkg/driver" "github.com/stretchr/testify/assert" - "github.com/openkcm/cmk/internal/config" - "github.com/openkcm/cmk/internal/db" - "github.com/openkcm/cmk/internal/model" - "github.com/openkcm/cmk/internal/testutils" + "github.com/openkcm/cmk-core/internal/config" + "github.com/openkcm/cmk-core/internal/db" + "github.com/openkcm/cmk-core/internal/model" + "github.com/openkcm/cmk-core/internal/testutils" ) func TestStartDB(t *testing.T) { diff --git a/internal/db/dsn/postgres.go b/internal/db/dsn/postgres.go index d3e30594..df45dd7f 100644 --- a/internal/db/dsn/postgres.go +++ b/internal/db/dsn/postgres.go @@ -6,8 +6,8 @@ import ( "github.com/openkcm/common-sdk/pkg/commoncfg" - "github.com/openkcm/cmk/internal/config" - "github.com/openkcm/cmk/internal/errs" + "github.com/openkcm/cmk-core/internal/config" + "github.com/openkcm/cmk-core/internal/errs" ) var ( diff --git a/internal/event-processor/crypto.go b/internal/event-processor/crypto.go index f2754342..8e93da42 100644 --- a/internal/event-processor/crypto.go +++ b/internal/event-processor/crypto.go @@ -22,14 +22,14 @@ import ( keystoreopv1 "github.com/openkcm/plugin-sdk/proto/plugin/keystore/operations/v1" protoPkg "google.golang.org/protobuf/proto" - "github.com/openkcm/cmk/internal/api/cmkapi" - "github.com/openkcm/cmk/internal/config" - "github.com/openkcm/cmk/internal/db/dsn" - "github.com/openkcm/cmk/internal/errs" - "github.com/openkcm/cmk/internal/event-processor/proto" - "github.com/openkcm/cmk/internal/model" - "github.com/openkcm/cmk/internal/repo" - cmkcontext "github.com/openkcm/cmk/utils/context" + "github.com/openkcm/cmk-core/internal/api/cmkapi" + "github.com/openkcm/cmk-core/internal/config" + "github.com/openkcm/cmk-core/internal/db/dsn" + "github.com/openkcm/cmk-core/internal/errs" + "github.com/openkcm/cmk-core/internal/event-processor/proto" + "github.com/openkcm/cmk-core/internal/model" + "github.com/openkcm/cmk-core/internal/repo" + cmkcontext "github.com/openkcm/cmk-core/utils/context" ) const ( diff --git a/internal/event-processor/job_methods.go b/internal/event-processor/job_methods.go index f450e759..6d65cc89 100644 --- a/internal/event-processor/job_methods.go +++ b/internal/event-processor/job_methods.go @@ -6,8 +6,8 @@ import ( "github.com/openkcm/orbital" - "github.com/openkcm/cmk/internal/event-processor/proto" - cmkcontext "github.com/openkcm/cmk/utils/context" + "github.com/openkcm/cmk-core/internal/event-processor/proto" + cmkcontext "github.com/openkcm/cmk-core/utils/context" ) // KeyActionJobData contains the data needed for a key action orbital job. diff --git a/internal/event-processor/proto/task.pb.go b/internal/event-processor/proto/task.pb.go index 83e80afa..dfb02df0 100644 --- a/internal/event-processor/proto/task.pb.go +++ b/internal/event-processor/proto/task.pb.go @@ -385,7 +385,7 @@ const file_internal_event_processor_proto_task_proto_rawDesc = "" + "KEY_ROTATE\x10\x03\x12\x0f\n" + "\vSYSTEM_LINK\x10\x04\x12\x11\n" + "\rSYSTEM_UNLINK\x10\x05\x12\x11\n" + - "\rSYSTEM_SWITCH\x10\x06B=Z;github.com/openkcm/cmk/internal/event-processor/proto;protob\x06proto3" + "\rSYSTEM_SWITCH\x10\x06B=Z;github.com/openkcm/cmk-core/internal/event-processor/proto;protob\x06proto3" var ( file_internal_event_processor_proto_task_proto_rawDescOnce sync.Once diff --git a/internal/event-processor/proto/task.proto b/internal/event-processor/proto/task.proto index 97ac5989..eeecde6e 100644 --- a/internal/event-processor/proto/task.proto +++ b/internal/event-processor/proto/task.proto @@ -2,7 +2,7 @@ syntax = "proto3"; package proto; -option go_package = "github.com/openkcm/cmk/internal/event-processor/proto;proto"; +option go_package = "github.com/openkcm/cmk-core/internal/event-processor/proto;proto"; enum TaskType { KEY_ENABLE = 0; diff --git a/internal/grpc/catalog/catalog.go b/internal/grpc/catalog/catalog.go index a4cb470f..89b83a87 100644 --- a/internal/grpc/catalog/catalog.go +++ b/internal/grpc/catalog/catalog.go @@ -9,8 +9,8 @@ import ( plugincatalog "github.com/openkcm/plugin-sdk/pkg/catalog" - "github.com/openkcm/cmk/internal/config" - "github.com/openkcm/cmk/internal/plugins/builtin" + "github.com/openkcm/cmk-core/internal/config" + "github.com/openkcm/cmk-core/internal/plugins/builtin" ) // New creates a new instance of Catalog with the provided configuration. diff --git a/internal/grpc/catalog/catalog_test.go b/internal/grpc/catalog/catalog_test.go index 498d6382..a570b7f1 100644 --- a/internal/grpc/catalog/catalog_test.go +++ b/internal/grpc/catalog/catalog_test.go @@ -9,8 +9,8 @@ import ( plugincatalog "github.com/openkcm/plugin-sdk/pkg/catalog" keystoreopv1 "github.com/openkcm/plugin-sdk/proto/plugin/keystore/operations/v1" - "github.com/openkcm/cmk/internal/config" - "github.com/openkcm/cmk/internal/grpc/catalog" + "github.com/openkcm/cmk-core/internal/config" + "github.com/openkcm/cmk-core/internal/grpc/catalog" ) func TestNew(t *testing.T) { diff --git a/internal/handlers/handlers.go b/internal/handlers/handlers.go index b6d155aa..8407bb5c 100644 --- a/internal/handlers/handlers.go +++ b/internal/handlers/handlers.go @@ -9,11 +9,11 @@ import ( md "github.com/oapi-codegen/nethttp-middleware" slogctx "github.com/veqryn/slog-context" - "github.com/openkcm/cmk/internal/api/cmkapi" - "github.com/openkcm/cmk/internal/api/write" - "github.com/openkcm/cmk/internal/apierrors" - "github.com/openkcm/cmk/internal/log" - cmkcontext "github.com/openkcm/cmk/utils/context" + "github.com/openkcm/cmk-core/internal/api/cmkapi" + "github.com/openkcm/cmk-core/internal/api/write" + "github.com/openkcm/cmk-core/internal/apierrors" + "github.com/openkcm/cmk-core/internal/log" + cmkcontext "github.com/openkcm/cmk-core/utils/context" ) // OAPIValidatorHandler is called when OAPI Required fields are missing from Request diff --git a/internal/handlers/handlers_test.go b/internal/handlers/handlers_test.go index 88166965..7e9caa88 100644 --- a/internal/handlers/handlers_test.go +++ b/internal/handlers/handlers_test.go @@ -10,10 +10,10 @@ import ( "github.com/stretchr/testify/assert" - "github.com/openkcm/cmk/internal/api/cmkapi" - "github.com/openkcm/cmk/internal/api/write" - "github.com/openkcm/cmk/internal/handlers" - cmkcontext "github.com/openkcm/cmk/utils/context" + "github.com/openkcm/cmk-core/internal/api/cmkapi" + "github.com/openkcm/cmk-core/internal/api/write" + "github.com/openkcm/cmk-core/internal/handlers" + cmkcontext "github.com/openkcm/cmk-core/utils/context" ) var ( diff --git a/internal/log/log.go b/internal/log/log.go index 31b5a333..bc601a1d 100644 --- a/internal/log/log.go +++ b/internal/log/log.go @@ -9,8 +9,8 @@ import ( slogctx "github.com/veqryn/slog-context" - "github.com/openkcm/cmk/internal/model" - cmkcontext "github.com/openkcm/cmk/utils/context" + "github.com/openkcm/cmk-core/internal/model" + cmkcontext "github.com/openkcm/cmk-core/utils/context" ) func InjectRequest(ctx context.Context, r *http.Request) context.Context { diff --git a/internal/manager/authz.go b/internal/manager/authz.go index 490c0035..140c9798 100644 --- a/internal/manager/authz.go +++ b/internal/manager/authz.go @@ -4,13 +4,13 @@ import ( "context" "sync" - "github.com/openkcm/cmk/internal/authz" - "github.com/openkcm/cmk/internal/constants" - "github.com/openkcm/cmk/internal/errs" - "github.com/openkcm/cmk/internal/log" - "github.com/openkcm/cmk/internal/model" - "github.com/openkcm/cmk/internal/repo" - cmkcontext "github.com/openkcm/cmk/utils/context" + "github.com/openkcm/cmk-core/internal/authz" + "github.com/openkcm/cmk-core/internal/constants" + "github.com/openkcm/cmk-core/internal/errs" + "github.com/openkcm/cmk-core/internal/log" + "github.com/openkcm/cmk-core/internal/model" + "github.com/openkcm/cmk-core/internal/repo" + cmkcontext "github.com/openkcm/cmk-core/utils/context" ) type AuthzManager struct { diff --git a/internal/manager/authz_test.go b/internal/manager/authz_test.go index b7e72cea..7d2197c1 100644 --- a/internal/manager/authz_test.go +++ b/internal/manager/authz_test.go @@ -8,12 +8,12 @@ import ( multitenancy "github.com/bartventer/gorm-multitenancy/v8" - "github.com/openkcm/cmk/internal/authz" - "github.com/openkcm/cmk/internal/constants" - "github.com/openkcm/cmk/internal/manager" - "github.com/openkcm/cmk/internal/model" - repomock "github.com/openkcm/cmk/internal/repo/mock" - "github.com/openkcm/cmk/internal/testutils" + "github.com/openkcm/cmk-core/internal/authz" + "github.com/openkcm/cmk-core/internal/constants" + "github.com/openkcm/cmk-core/internal/manager" + "github.com/openkcm/cmk-core/internal/model" + repomock "github.com/openkcm/cmk-core/internal/repo/mock" + "github.com/openkcm/cmk-core/internal/testutils" ) func TestAuthzManager_LoadEntitiesInAllowList(t *testing.T) { diff --git a/internal/manager/base.go b/internal/manager/base.go index 0c8ea05b..647217e2 100644 --- a/internal/manager/base.go +++ b/internal/manager/base.go @@ -5,11 +5,11 @@ import ( plugincatalog "github.com/openkcm/plugin-sdk/pkg/catalog" - "github.com/openkcm/cmk/internal/auditor" - "github.com/openkcm/cmk/internal/clients" - "github.com/openkcm/cmk/internal/config" - eventprocessor "github.com/openkcm/cmk/internal/event-processor" - "github.com/openkcm/cmk/internal/repo" + "github.com/openkcm/cmk-core/internal/auditor" + "github.com/openkcm/cmk-core/internal/clients" + "github.com/openkcm/cmk-core/internal/config" + eventprocessor "github.com/openkcm/cmk-core/internal/event-processor" + "github.com/openkcm/cmk-core/internal/repo" ) type Manager struct { diff --git a/internal/manager/base_test.go b/internal/manager/base_test.go index 37b1f7e2..52bd0ba7 100644 --- a/internal/manager/base_test.go +++ b/internal/manager/base_test.go @@ -8,11 +8,11 @@ import ( plugincatalog "github.com/openkcm/plugin-sdk/pkg/catalog" - "github.com/openkcm/cmk/internal/clients" - "github.com/openkcm/cmk/internal/config" - "github.com/openkcm/cmk/internal/manager" - "github.com/openkcm/cmk/internal/repo/sql" - "github.com/openkcm/cmk/internal/testutils" + "github.com/openkcm/cmk-core/internal/clients" + "github.com/openkcm/cmk-core/internal/config" + "github.com/openkcm/cmk-core/internal/manager" + "github.com/openkcm/cmk-core/internal/repo/sql" + "github.com/openkcm/cmk-core/internal/testutils" ) const providerTest = "TEST" diff --git a/internal/manager/certificate.go b/internal/manager/certificate.go index 3d591bfc..7467fef2 100644 --- a/internal/manager/certificate.go +++ b/internal/manager/certificate.go @@ -16,13 +16,13 @@ import ( plugincatalog "github.com/openkcm/plugin-sdk/pkg/catalog" certissuerv1 "github.com/openkcm/plugin-sdk/proto/plugin/certificate_issuer/v1" - "github.com/openkcm/cmk/internal/config" - "github.com/openkcm/cmk/internal/errs" - "github.com/openkcm/cmk/internal/log" - "github.com/openkcm/cmk/internal/model" - "github.com/openkcm/cmk/internal/repo" - cmkcontext "github.com/openkcm/cmk/utils/context" - "github.com/openkcm/cmk/utils/crypto" + "github.com/openkcm/cmk-core/internal/config" + "github.com/openkcm/cmk-core/internal/errs" + "github.com/openkcm/cmk-core/internal/log" + "github.com/openkcm/cmk-core/internal/model" + "github.com/openkcm/cmk-core/internal/repo" + cmkcontext "github.com/openkcm/cmk-core/utils/context" + "github.com/openkcm/cmk-core/utils/crypto" ) var ( diff --git a/internal/manager/certificate_test.go b/internal/manager/certificate_test.go index d8130b83..5fe95232 100644 --- a/internal/manager/certificate_test.go +++ b/internal/manager/certificate_test.go @@ -17,14 +17,14 @@ import ( multitenancy "github.com/bartventer/gorm-multitenancy/v8" certificate_issuerv1 "github.com/openkcm/plugin-sdk/proto/plugin/certificate_issuer/v1" - "github.com/openkcm/cmk/internal/config" - "github.com/openkcm/cmk/internal/grpc/catalog" - "github.com/openkcm/cmk/internal/manager" - "github.com/openkcm/cmk/internal/model" - "github.com/openkcm/cmk/internal/repo/sql" - "github.com/openkcm/cmk/internal/testutils" - cmkcontext "github.com/openkcm/cmk/utils/context" - "github.com/openkcm/cmk/utils/crypto" + "github.com/openkcm/cmk-core/internal/config" + "github.com/openkcm/cmk-core/internal/grpc/catalog" + "github.com/openkcm/cmk-core/internal/manager" + "github.com/openkcm/cmk-core/internal/model" + "github.com/openkcm/cmk-core/internal/repo/sql" + "github.com/openkcm/cmk-core/internal/testutils" + cmkcontext "github.com/openkcm/cmk-core/utils/context" + "github.com/openkcm/cmk-core/utils/crypto" ) var ( diff --git a/internal/manager/export_test.go b/internal/manager/export_test.go index 745a5f68..723b2d86 100644 --- a/internal/manager/export_test.go +++ b/internal/manager/export_test.go @@ -8,8 +8,8 @@ import ( notificationv1 "github.com/openkcm/plugin-sdk/proto/plugin/notification/v1" systeminformationv1 "github.com/openkcm/plugin-sdk/proto/plugin/systeminformation/v1" - "github.com/openkcm/cmk/internal/clients/registry/systems" - "github.com/openkcm/cmk/internal/model" + "github.com/openkcm/cmk-core/internal/clients/registry/systems" + "github.com/openkcm/cmk-core/internal/model" ) var GetPluginAlgorithm = getPluginAlgorithm diff --git a/internal/manager/group.go b/internal/manager/group.go index 7e860e55..669659a9 100644 --- a/internal/manager/group.go +++ b/internal/manager/group.go @@ -6,13 +6,13 @@ import ( "github.com/google/uuid" - "github.com/openkcm/cmk/internal/api/cmkapi" - "github.com/openkcm/cmk/internal/constants" - "github.com/openkcm/cmk/internal/errs" - "github.com/openkcm/cmk/internal/model" - "github.com/openkcm/cmk/internal/repo" - cmkcontext "github.com/openkcm/cmk/utils/context" - "github.com/openkcm/cmk/utils/ptr" + "github.com/openkcm/cmk-core/internal/api/cmkapi" + "github.com/openkcm/cmk-core/internal/constants" + "github.com/openkcm/cmk-core/internal/errs" + "github.com/openkcm/cmk-core/internal/model" + "github.com/openkcm/cmk-core/internal/repo" + cmkcontext "github.com/openkcm/cmk-core/utils/context" + "github.com/openkcm/cmk-core/utils/ptr" ) var ErrGroupRole = errors.New("unsupported role for group creation") diff --git a/internal/manager/group_test.go b/internal/manager/group_test.go index 98dc0a56..b043c89e 100644 --- a/internal/manager/group_test.go +++ b/internal/manager/group_test.go @@ -9,14 +9,14 @@ import ( multitenancy "github.com/bartventer/gorm-multitenancy/v8" - "github.com/openkcm/cmk/internal/api/cmkapi" - "github.com/openkcm/cmk/internal/constants" - "github.com/openkcm/cmk/internal/manager" - "github.com/openkcm/cmk/internal/model" - "github.com/openkcm/cmk/internal/repo" - "github.com/openkcm/cmk/internal/repo/sql" - "github.com/openkcm/cmk/internal/testutils" - "github.com/openkcm/cmk/utils/ptr" + "github.com/openkcm/cmk-core/internal/api/cmkapi" + "github.com/openkcm/cmk-core/internal/constants" + "github.com/openkcm/cmk-core/internal/manager" + "github.com/openkcm/cmk-core/internal/model" + "github.com/openkcm/cmk-core/internal/repo" + "github.com/openkcm/cmk-core/internal/repo/sql" + "github.com/openkcm/cmk-core/internal/testutils" + "github.com/openkcm/cmk-core/utils/ptr" ) func SetupGroupManager(t *testing.T) (*manager.GroupManager, *multitenancy.DB, string) { diff --git a/internal/manager/importparams.go b/internal/manager/importparams.go index 2ababf18..070f67a4 100644 --- a/internal/manager/importparams.go +++ b/internal/manager/importparams.go @@ -6,9 +6,9 @@ import ( keystoreopv1 "github.com/openkcm/plugin-sdk/proto/plugin/keystore/operations/v1" - "github.com/openkcm/cmk/internal/errs" - "github.com/openkcm/cmk/internal/model" - "github.com/openkcm/cmk/utils/structreader" + "github.com/openkcm/cmk-core/internal/errs" + "github.com/openkcm/cmk-core/internal/model" + "github.com/openkcm/cmk-core/utils/structreader" ) // CommonImportFields contains fields that are common across all providers diff --git a/internal/manager/importparams_test.go b/internal/manager/importparams_test.go index a5d5e01a..a1a4223e 100644 --- a/internal/manager/importparams_test.go +++ b/internal/manager/importparams_test.go @@ -10,9 +10,9 @@ import ( keystoreopv1 "github.com/openkcm/plugin-sdk/proto/plugin/keystore/operations/v1" - "github.com/openkcm/cmk/internal/manager" - "github.com/openkcm/cmk/internal/model" - "github.com/openkcm/cmk/internal/testutils" + "github.com/openkcm/cmk-core/internal/manager" + "github.com/openkcm/cmk-core/internal/model" + "github.com/openkcm/cmk-core/internal/testutils" ) func TestBuildImportParams(t *testing.T) { diff --git a/internal/manager/key.go b/internal/manager/key.go index 3f6f2137..f33c83e8 100644 --- a/internal/manager/key.go +++ b/internal/manager/key.go @@ -17,15 +17,15 @@ import ( commonv1 "github.com/openkcm/plugin-sdk/proto/plugin/keystore/common/v1" keystoreopv1 "github.com/openkcm/plugin-sdk/proto/plugin/keystore/operations/v1" - "github.com/openkcm/cmk/internal/api/cmkapi" - "github.com/openkcm/cmk/internal/auditor" - "github.com/openkcm/cmk/internal/constants" - "github.com/openkcm/cmk/internal/errs" - eventprocessor "github.com/openkcm/cmk/internal/event-processor" - "github.com/openkcm/cmk/internal/log" - "github.com/openkcm/cmk/internal/model" - "github.com/openkcm/cmk/internal/repo" - "github.com/openkcm/cmk/utils/ptr" + "github.com/openkcm/cmk-core/internal/api/cmkapi" + "github.com/openkcm/cmk-core/internal/auditor" + "github.com/openkcm/cmk-core/internal/constants" + "github.com/openkcm/cmk-core/internal/errs" + eventprocessor "github.com/openkcm/cmk-core/internal/event-processor" + "github.com/openkcm/cmk-core/internal/log" + "github.com/openkcm/cmk-core/internal/model" + "github.com/openkcm/cmk-core/internal/repo" + "github.com/openkcm/cmk-core/utils/ptr" ) // BYOKAction constants represent the actions that can be performed on a BYOK key diff --git a/internal/manager/key_label.go b/internal/manager/key_label.go index 0f71a9f9..e0138fc4 100644 --- a/internal/manager/key_label.go +++ b/internal/manager/key_label.go @@ -6,9 +6,9 @@ import ( "github.com/google/uuid" - "github.com/openkcm/cmk/internal/errs" - "github.com/openkcm/cmk/internal/model" - "github.com/openkcm/cmk/internal/repo" + "github.com/openkcm/cmk-core/internal/errs" + "github.com/openkcm/cmk-core/internal/model" + "github.com/openkcm/cmk-core/internal/repo" ) type Label interface { diff --git a/internal/manager/key_label_test.go b/internal/manager/key_label_test.go index 7f31cbd6..e42c8fed 100644 --- a/internal/manager/key_label_test.go +++ b/internal/manager/key_label_test.go @@ -9,12 +9,12 @@ import ( multitenancy "github.com/bartventer/gorm-multitenancy/v8" - "github.com/openkcm/cmk/internal/manager" - "github.com/openkcm/cmk/internal/model" - "github.com/openkcm/cmk/internal/repo" - "github.com/openkcm/cmk/internal/repo/sql" - "github.com/openkcm/cmk/internal/testutils" - cmkcontext "github.com/openkcm/cmk/utils/context" + "github.com/openkcm/cmk-core/internal/manager" + "github.com/openkcm/cmk-core/internal/model" + "github.com/openkcm/cmk-core/internal/repo" + "github.com/openkcm/cmk-core/internal/repo/sql" + "github.com/openkcm/cmk-core/internal/testutils" + cmkcontext "github.com/openkcm/cmk-core/utils/context" ) func TestGetKeyLabels(t *testing.T) { diff --git a/internal/manager/key_test.go b/internal/manager/key_test.go index a7eedf91..8dd3fb2c 100644 --- a/internal/manager/key_test.go +++ b/internal/manager/key_test.go @@ -14,18 +14,18 @@ import ( multitenancy "github.com/bartventer/gorm-multitenancy/v8" keystoreopv1 "github.com/openkcm/plugin-sdk/proto/plugin/keystore/operations/v1" - "github.com/openkcm/cmk/internal/api/cmkapi" - "github.com/openkcm/cmk/internal/auditor" - "github.com/openkcm/cmk/internal/config" - "github.com/openkcm/cmk/internal/constants" - eventprocessor "github.com/openkcm/cmk/internal/event-processor" - "github.com/openkcm/cmk/internal/grpc/catalog" - "github.com/openkcm/cmk/internal/manager" - "github.com/openkcm/cmk/internal/model" - "github.com/openkcm/cmk/internal/repo" - "github.com/openkcm/cmk/internal/repo/sql" - "github.com/openkcm/cmk/internal/testutils" - "github.com/openkcm/cmk/utils/ptr" + "github.com/openkcm/cmk-core/internal/api/cmkapi" + "github.com/openkcm/cmk-core/internal/auditor" + "github.com/openkcm/cmk-core/internal/config" + "github.com/openkcm/cmk-core/internal/constants" + eventprocessor "github.com/openkcm/cmk-core/internal/event-processor" + "github.com/openkcm/cmk-core/internal/grpc/catalog" + "github.com/openkcm/cmk-core/internal/manager" + "github.com/openkcm/cmk-core/internal/model" + "github.com/openkcm/cmk-core/internal/repo" + "github.com/openkcm/cmk-core/internal/repo/sql" + "github.com/openkcm/cmk-core/internal/testutils" + "github.com/openkcm/cmk-core/utils/ptr" ) //nolint:containedctx diff --git a/internal/manager/keyconfiguration.go b/internal/manager/keyconfiguration.go index d0d99f2c..791c63cc 100644 --- a/internal/manager/keyconfiguration.go +++ b/internal/manager/keyconfiguration.go @@ -10,11 +10,11 @@ import ( "github.com/google/uuid" "github.com/openkcm/common-sdk/pkg/commoncfg" - "github.com/openkcm/cmk/internal/api/cmkapi" - "github.com/openkcm/cmk/internal/config" - "github.com/openkcm/cmk/internal/errs" - "github.com/openkcm/cmk/internal/model" - "github.com/openkcm/cmk/internal/repo" + "github.com/openkcm/cmk-core/internal/api/cmkapi" + "github.com/openkcm/cmk-core/internal/config" + "github.com/openkcm/cmk-core/internal/errs" + "github.com/openkcm/cmk-core/internal/model" + "github.com/openkcm/cmk-core/internal/repo" ) const ( diff --git a/internal/manager/keyconfiguration_tag.go b/internal/manager/keyconfiguration_tag.go index 10a6f905..a282aebc 100644 --- a/internal/manager/keyconfiguration_tag.go +++ b/internal/manager/keyconfiguration_tag.go @@ -5,8 +5,8 @@ import ( "github.com/google/uuid" - "github.com/openkcm/cmk/internal/model" - "github.com/openkcm/cmk/internal/repo" + "github.com/openkcm/cmk-core/internal/model" + "github.com/openkcm/cmk-core/internal/repo" ) type KeyConfigurationTag interface { diff --git a/internal/manager/keyconfiguration_tag_test.go b/internal/manager/keyconfiguration_tag_test.go index 50e74b1c..c4c39cac 100644 --- a/internal/manager/keyconfiguration_tag_test.go +++ b/internal/manager/keyconfiguration_tag_test.go @@ -9,13 +9,13 @@ import ( multitenancy "github.com/bartventer/gorm-multitenancy/v8" - "github.com/openkcm/cmk/internal/manager" - "github.com/openkcm/cmk/internal/model" - "github.com/openkcm/cmk/internal/repo" - "github.com/openkcm/cmk/internal/repo/sql" - "github.com/openkcm/cmk/internal/testutils" - cmkcontext "github.com/openkcm/cmk/utils/context" - "github.com/openkcm/cmk/utils/ptr" + "github.com/openkcm/cmk-core/internal/manager" + "github.com/openkcm/cmk-core/internal/model" + "github.com/openkcm/cmk-core/internal/repo" + "github.com/openkcm/cmk-core/internal/repo/sql" + "github.com/openkcm/cmk-core/internal/testutils" + cmkcontext "github.com/openkcm/cmk-core/utils/context" + "github.com/openkcm/cmk-core/utils/ptr" ) func SetupKeyConfigurationTagManager(t *testing.T) (*manager.KeyConfigurationTagManager, diff --git a/internal/manager/keyconfiguration_test.go b/internal/manager/keyconfiguration_test.go index 5b068923..1914865a 100644 --- a/internal/manager/keyconfiguration_test.go +++ b/internal/manager/keyconfiguration_test.go @@ -14,17 +14,17 @@ import ( multitenancy "github.com/bartventer/gorm-multitenancy/v8" - "github.com/openkcm/cmk/internal/api/cmkapi" - "github.com/openkcm/cmk/internal/config" - "github.com/openkcm/cmk/internal/constants" - "github.com/openkcm/cmk/internal/grpc/catalog" - "github.com/openkcm/cmk/internal/manager" - "github.com/openkcm/cmk/internal/model" - "github.com/openkcm/cmk/internal/repo/sql" - "github.com/openkcm/cmk/internal/testutils" - cmkcontext "github.com/openkcm/cmk/utils/context" - "github.com/openkcm/cmk/utils/crypto" - "github.com/openkcm/cmk/utils/ptr" + "github.com/openkcm/cmk-core/internal/api/cmkapi" + "github.com/openkcm/cmk-core/internal/config" + "github.com/openkcm/cmk-core/internal/constants" + "github.com/openkcm/cmk-core/internal/grpc/catalog" + "github.com/openkcm/cmk-core/internal/manager" + "github.com/openkcm/cmk-core/internal/model" + "github.com/openkcm/cmk-core/internal/repo/sql" + "github.com/openkcm/cmk-core/internal/testutils" + cmkcontext "github.com/openkcm/cmk-core/utils/context" + "github.com/openkcm/cmk-core/utils/crypto" + "github.com/openkcm/cmk-core/utils/ptr" ) var ( diff --git a/internal/manager/keystorepool.go b/internal/manager/keystorepool.go index 2ed44083..46fdc1cf 100644 --- a/internal/manager/keystorepool.go +++ b/internal/manager/keystorepool.go @@ -4,9 +4,9 @@ import ( "context" "sync" - "github.com/openkcm/cmk/internal/errs" - "github.com/openkcm/cmk/internal/model" - "github.com/openkcm/cmk/internal/repo" + "github.com/openkcm/cmk-core/internal/errs" + "github.com/openkcm/cmk-core/internal/model" + "github.com/openkcm/cmk-core/internal/repo" ) // Pool stores available configurations. diff --git a/internal/manager/keystorepool_test.go b/internal/manager/keystorepool_test.go index 7155ceb9..db9f5682 100644 --- a/internal/manager/keystorepool_test.go +++ b/internal/manager/keystorepool_test.go @@ -9,10 +9,10 @@ import ( "github.com/google/uuid" "github.com/stretchr/testify/require" - "github.com/openkcm/cmk/internal/manager" - "github.com/openkcm/cmk/internal/model" - "github.com/openkcm/cmk/internal/repo/sql" - "github.com/openkcm/cmk/internal/testutils" + "github.com/openkcm/cmk-core/internal/manager" + "github.com/openkcm/cmk-core/internal/model" + "github.com/openkcm/cmk-core/internal/repo/sql" + "github.com/openkcm/cmk-core/internal/testutils" ) var itemID = uuid.New() diff --git a/internal/manager/keyversion.go b/internal/manager/keyversion.go index 3f60e398..170b8675 100644 --- a/internal/manager/keyversion.go +++ b/internal/manager/keyversion.go @@ -12,13 +12,13 @@ import ( plugincatalog "github.com/openkcm/plugin-sdk/pkg/catalog" keystoreopv1 "github.com/openkcm/plugin-sdk/proto/plugin/keystore/operations/v1" - "github.com/openkcm/cmk/internal/api/cmkapi" - "github.com/openkcm/cmk/internal/auditor" - "github.com/openkcm/cmk/internal/errs" - "github.com/openkcm/cmk/internal/log" - "github.com/openkcm/cmk/internal/model" - "github.com/openkcm/cmk/internal/repo" - "github.com/openkcm/cmk/utils/ptr" + "github.com/openkcm/cmk-core/internal/api/cmkapi" + "github.com/openkcm/cmk-core/internal/auditor" + "github.com/openkcm/cmk-core/internal/errs" + "github.com/openkcm/cmk-core/internal/log" + "github.com/openkcm/cmk-core/internal/model" + "github.com/openkcm/cmk-core/internal/repo" + "github.com/openkcm/cmk-core/utils/ptr" ) type KeyVersion interface { diff --git a/internal/manager/keyversion_test.go b/internal/manager/keyversion_test.go index 6dd48224..99f431e9 100644 --- a/internal/manager/keyversion_test.go +++ b/internal/manager/keyversion_test.go @@ -9,15 +9,15 @@ import ( "github.com/google/uuid" "github.com/stretchr/testify/suite" - "github.com/openkcm/cmk/internal/auditor" - "github.com/openkcm/cmk/internal/config" - "github.com/openkcm/cmk/internal/constants" - "github.com/openkcm/cmk/internal/grpc/catalog" - "github.com/openkcm/cmk/internal/manager" - "github.com/openkcm/cmk/internal/model" - "github.com/openkcm/cmk/internal/repo" - "github.com/openkcm/cmk/internal/repo/sql" - "github.com/openkcm/cmk/internal/testutils" + "github.com/openkcm/cmk-core/internal/auditor" + "github.com/openkcm/cmk-core/internal/config" + "github.com/openkcm/cmk-core/internal/constants" + "github.com/openkcm/cmk-core/internal/grpc/catalog" + "github.com/openkcm/cmk-core/internal/manager" + "github.com/openkcm/cmk-core/internal/model" + "github.com/openkcm/cmk-core/internal/repo" + "github.com/openkcm/cmk-core/internal/repo/sql" + "github.com/openkcm/cmk-core/internal/testutils" ) var ( diff --git a/internal/manager/notification.go b/internal/manager/notification.go index 280e191b..7a160f9c 100644 --- a/internal/manager/notification.go +++ b/internal/manager/notification.go @@ -6,7 +6,7 @@ import ( plugincatalog "github.com/openkcm/plugin-sdk/pkg/catalog" notificationv1 "github.com/openkcm/plugin-sdk/proto/plugin/notification/v1" - "github.com/openkcm/cmk/internal/log" + "github.com/openkcm/cmk-core/internal/log" ) const ( diff --git a/internal/manager/notification_test.go b/internal/manager/notification_test.go index b81e8446..b3bb3022 100644 --- a/internal/manager/notification_test.go +++ b/internal/manager/notification_test.go @@ -9,10 +9,10 @@ import ( notificationv1 "github.com/openkcm/plugin-sdk/proto/plugin/notification/v1" - "github.com/openkcm/cmk/internal/config" - "github.com/openkcm/cmk/internal/grpc/catalog" - "github.com/openkcm/cmk/internal/manager" - "github.com/openkcm/cmk/internal/testutils" + "github.com/openkcm/cmk-core/internal/config" + "github.com/openkcm/cmk-core/internal/grpc/catalog" + "github.com/openkcm/cmk-core/internal/manager" + "github.com/openkcm/cmk-core/internal/testutils" ) type NotificationServiceMock struct { diff --git a/internal/manager/providerconfigmanager.go b/internal/manager/providerconfigmanager.go index 72191ea9..312d18ee 100644 --- a/internal/manager/providerconfigmanager.go +++ b/internal/manager/providerconfigmanager.go @@ -17,14 +17,14 @@ import ( keystoremanagerv1 "github.com/openkcm/plugin-sdk/proto/plugin/keystore/management/v1" keystoreopv1 "github.com/openkcm/plugin-sdk/proto/plugin/keystore/operations/v1" - "github.com/openkcm/cmk/internal/constants" - "github.com/openkcm/cmk/internal/errs" - "github.com/openkcm/cmk/internal/log" - "github.com/openkcm/cmk/internal/model" - "github.com/openkcm/cmk/internal/repo" - cmkcontext "github.com/openkcm/cmk/utils/context" - pluginHelpers "github.com/openkcm/cmk/utils/plugins" - "github.com/openkcm/cmk/utils/ptr" + "github.com/openkcm/cmk-core/internal/constants" + "github.com/openkcm/cmk-core/internal/errs" + "github.com/openkcm/cmk-core/internal/log" + "github.com/openkcm/cmk-core/internal/model" + "github.com/openkcm/cmk-core/internal/repo" + cmkcontext "github.com/openkcm/cmk-core/utils/context" + pluginHelpers "github.com/openkcm/cmk-core/utils/plugins" + "github.com/openkcm/cmk-core/utils/ptr" ) const ( diff --git a/internal/manager/system.go b/internal/manager/system.go index c606da8b..545f0458 100644 --- a/internal/manager/system.go +++ b/internal/manager/system.go @@ -12,20 +12,20 @@ import ( plugincatalog "github.com/openkcm/plugin-sdk/pkg/catalog" slogctx "github.com/veqryn/slog-context" - "github.com/openkcm/cmk/internal/api/cmkapi" - "github.com/openkcm/cmk/internal/auditor" - "github.com/openkcm/cmk/internal/clients" - "github.com/openkcm/cmk/internal/clients/registry" - "github.com/openkcm/cmk/internal/clients/registry/systems" - "github.com/openkcm/cmk/internal/config" - "github.com/openkcm/cmk/internal/constants" - "github.com/openkcm/cmk/internal/errs" - eventprocessor "github.com/openkcm/cmk/internal/event-processor" - "github.com/openkcm/cmk/internal/log" - "github.com/openkcm/cmk/internal/model" - "github.com/openkcm/cmk/internal/repo" - cmkcontext "github.com/openkcm/cmk/utils/context" - "github.com/openkcm/cmk/utils/ptr" + "github.com/openkcm/cmk-core/internal/api/cmkapi" + "github.com/openkcm/cmk-core/internal/auditor" + "github.com/openkcm/cmk-core/internal/clients" + "github.com/openkcm/cmk-core/internal/clients/registry" + "github.com/openkcm/cmk-core/internal/clients/registry/systems" + "github.com/openkcm/cmk-core/internal/config" + "github.com/openkcm/cmk-core/internal/constants" + "github.com/openkcm/cmk-core/internal/errs" + eventprocessor "github.com/openkcm/cmk-core/internal/event-processor" + "github.com/openkcm/cmk-core/internal/log" + "github.com/openkcm/cmk-core/internal/model" + "github.com/openkcm/cmk-core/internal/repo" + cmkcontext "github.com/openkcm/cmk-core/utils/context" + "github.com/openkcm/cmk-core/utils/ptr" ) type System interface { diff --git a/internal/manager/system_test.go b/internal/manager/system_test.go index e99e04b7..a1ebe80f 100644 --- a/internal/manager/system_test.go +++ b/internal/manager/system_test.go @@ -15,20 +15,20 @@ import ( systemgrpc "github.com/openkcm/api-sdk/proto/kms/api/cmk/registry/system/v1" regionpb "github.com/openkcm/api-sdk/proto/kms/api/cmk/types/v1" - "github.com/openkcm/cmk/internal/api/cmkapi" - "github.com/openkcm/cmk/internal/auditor" - "github.com/openkcm/cmk/internal/clients" - "github.com/openkcm/cmk/internal/clients/registry/systems" - "github.com/openkcm/cmk/internal/config" - "github.com/openkcm/cmk/internal/constants" - eventprocessor "github.com/openkcm/cmk/internal/event-processor" - "github.com/openkcm/cmk/internal/grpc/catalog" - "github.com/openkcm/cmk/internal/manager" - "github.com/openkcm/cmk/internal/model" - "github.com/openkcm/cmk/internal/repo" - "github.com/openkcm/cmk/internal/repo/sql" - "github.com/openkcm/cmk/internal/testutils" - "github.com/openkcm/cmk/utils/ptr" + "github.com/openkcm/cmk-core/internal/api/cmkapi" + "github.com/openkcm/cmk-core/internal/auditor" + "github.com/openkcm/cmk-core/internal/clients" + "github.com/openkcm/cmk-core/internal/clients/registry/systems" + "github.com/openkcm/cmk-core/internal/config" + "github.com/openkcm/cmk-core/internal/constants" + eventprocessor "github.com/openkcm/cmk-core/internal/event-processor" + "github.com/openkcm/cmk-core/internal/grpc/catalog" + "github.com/openkcm/cmk-core/internal/manager" + "github.com/openkcm/cmk-core/internal/model" + "github.com/openkcm/cmk-core/internal/repo" + "github.com/openkcm/cmk-core/internal/repo/sql" + "github.com/openkcm/cmk-core/internal/testutils" + "github.com/openkcm/cmk-core/utils/ptr" ) func SetupSystemManager(t *testing.T, clientsFactory *clients.Factory) ( diff --git a/internal/manager/systeminformation.go b/internal/manager/systeminformation.go index 44440b6f..664b0742 100644 --- a/internal/manager/systeminformation.go +++ b/internal/manager/systeminformation.go @@ -10,12 +10,12 @@ import ( plugincatalog "github.com/openkcm/plugin-sdk/pkg/catalog" systeminformationv1 "github.com/openkcm/plugin-sdk/proto/plugin/systeminformation/v1" - "github.com/openkcm/cmk/internal/clients/registry/systems" - "github.com/openkcm/cmk/internal/config" - "github.com/openkcm/cmk/internal/errs" - "github.com/openkcm/cmk/internal/log" - "github.com/openkcm/cmk/internal/model" - "github.com/openkcm/cmk/internal/repo" + "github.com/openkcm/cmk-core/internal/clients/registry/systems" + "github.com/openkcm/cmk-core/internal/config" + "github.com/openkcm/cmk-core/internal/errs" + "github.com/openkcm/cmk-core/internal/log" + "github.com/openkcm/cmk-core/internal/model" + "github.com/openkcm/cmk-core/internal/repo" ) var ( diff --git a/internal/manager/systeminformation_test.go b/internal/manager/systeminformation_test.go index d08a2f76..8e4ef05d 100644 --- a/internal/manager/systeminformation_test.go +++ b/internal/manager/systeminformation_test.go @@ -13,13 +13,13 @@ import ( multitenancy "github.com/bartventer/gorm-multitenancy/v8" systeminformationv1 "github.com/openkcm/plugin-sdk/proto/plugin/systeminformation/v1" - "github.com/openkcm/cmk/internal/config" - "github.com/openkcm/cmk/internal/grpc/catalog" - "github.com/openkcm/cmk/internal/manager" - "github.com/openkcm/cmk/internal/model" - "github.com/openkcm/cmk/internal/repo" - "github.com/openkcm/cmk/internal/repo/sql" - "github.com/openkcm/cmk/internal/testutils" + "github.com/openkcm/cmk-core/internal/config" + "github.com/openkcm/cmk-core/internal/grpc/catalog" + "github.com/openkcm/cmk-core/internal/manager" + "github.com/openkcm/cmk-core/internal/model" + "github.com/openkcm/cmk-core/internal/repo" + "github.com/openkcm/cmk-core/internal/repo/sql" + "github.com/openkcm/cmk-core/internal/testutils" ) const ( diff --git a/internal/manager/tag.go b/internal/manager/tag.go index be703ca0..27267527 100644 --- a/internal/manager/tag.go +++ b/internal/manager/tag.go @@ -6,8 +6,8 @@ import ( "github.com/google/uuid" - "github.com/openkcm/cmk/internal/errs" - "github.com/openkcm/cmk/internal/repo" + "github.com/openkcm/cmk-core/internal/errs" + "github.com/openkcm/cmk-core/internal/repo" ) var ( diff --git a/internal/manager/tenant.go b/internal/manager/tenant.go index 731dc6f9..10784768 100644 --- a/internal/manager/tenant.go +++ b/internal/manager/tenant.go @@ -3,9 +3,9 @@ package manager import ( "context" - "github.com/openkcm/cmk/internal/model" - "github.com/openkcm/cmk/internal/repo" - cmkcontext "github.com/openkcm/cmk/utils/context" + "github.com/openkcm/cmk-core/internal/model" + "github.com/openkcm/cmk-core/internal/repo" + cmkcontext "github.com/openkcm/cmk-core/utils/context" ) type Tenant interface { diff --git a/internal/manager/tenant_test.go b/internal/manager/tenant_test.go index 36e67b62..fce319e8 100644 --- a/internal/manager/tenant_test.go +++ b/internal/manager/tenant_test.go @@ -6,9 +6,9 @@ import ( "github.com/bartventer/gorm-multitenancy/v8/pkg/driver" "github.com/stretchr/testify/assert" - "github.com/openkcm/cmk/internal/manager" - "github.com/openkcm/cmk/internal/repo/sql" - "github.com/openkcm/cmk/internal/testutils" + "github.com/openkcm/cmk-core/internal/manager" + "github.com/openkcm/cmk-core/internal/repo/sql" + "github.com/openkcm/cmk-core/internal/testutils" ) func TestTenantManager(t *testing.T) { diff --git a/internal/manager/tenantconfigs.go b/internal/manager/tenantconfigs.go index 4aa1cbae..9204aa26 100644 --- a/internal/manager/tenantconfigs.go +++ b/internal/manager/tenantconfigs.go @@ -7,11 +7,11 @@ import ( plugincatalog "github.com/openkcm/plugin-sdk/pkg/catalog" keystoreopv1 "github.com/openkcm/plugin-sdk/proto/plugin/keystore/operations/v1" - "github.com/openkcm/cmk/internal/constants" - "github.com/openkcm/cmk/internal/errs" - "github.com/openkcm/cmk/internal/model" - "github.com/openkcm/cmk/internal/repo" - pluginHelpers "github.com/openkcm/cmk/utils/plugins" + "github.com/openkcm/cmk-core/internal/constants" + "github.com/openkcm/cmk-core/internal/errs" + "github.com/openkcm/cmk-core/internal/model" + "github.com/openkcm/cmk-core/internal/repo" + pluginHelpers "github.com/openkcm/cmk-core/utils/plugins" ) type TenantConfigManager struct { diff --git a/internal/manager/tenantconfigs_test.go b/internal/manager/tenantconfigs_test.go index a3c98e28..35bbcc35 100644 --- a/internal/manager/tenantconfigs_test.go +++ b/internal/manager/tenantconfigs_test.go @@ -11,13 +11,13 @@ import ( multitenancy "github.com/bartventer/gorm-multitenancy/v8" - "github.com/openkcm/cmk/internal/config" - "github.com/openkcm/cmk/internal/constants" - "github.com/openkcm/cmk/internal/grpc/catalog" - "github.com/openkcm/cmk/internal/manager" - "github.com/openkcm/cmk/internal/model" - "github.com/openkcm/cmk/internal/repo/sql" - "github.com/openkcm/cmk/internal/testutils" + "github.com/openkcm/cmk-core/internal/config" + "github.com/openkcm/cmk-core/internal/constants" + "github.com/openkcm/cmk-core/internal/grpc/catalog" + "github.com/openkcm/cmk-core/internal/manager" + "github.com/openkcm/cmk-core/internal/model" + "github.com/openkcm/cmk-core/internal/repo/sql" + "github.com/openkcm/cmk-core/internal/testutils" ) var ErrForced = errors.New("forced") diff --git a/internal/manager/workflow.go b/internal/manager/workflow.go index b9060544..9f5f85ff 100644 --- a/internal/manager/workflow.go +++ b/internal/manager/workflow.go @@ -9,14 +9,14 @@ import ( "github.com/google/uuid" - "github.com/openkcm/cmk/internal/api/cmkapi" - "github.com/openkcm/cmk/internal/config" - "github.com/openkcm/cmk/internal/constants" - "github.com/openkcm/cmk/internal/errs" - "github.com/openkcm/cmk/internal/model" - "github.com/openkcm/cmk/internal/repo" - wf "github.com/openkcm/cmk/internal/workflow" - "github.com/openkcm/cmk/utils/ptr" + "github.com/openkcm/cmk-core/internal/api/cmkapi" + "github.com/openkcm/cmk-core/internal/config" + "github.com/openkcm/cmk-core/internal/constants" + "github.com/openkcm/cmk-core/internal/errs" + "github.com/openkcm/cmk-core/internal/model" + "github.com/openkcm/cmk-core/internal/repo" + wf "github.com/openkcm/cmk-core/internal/workflow" + "github.com/openkcm/cmk-core/utils/ptr" ) var ErrWorkflowApproverDecision = errors.New("workflow approver decision") diff --git a/internal/manager/workflow_test.go b/internal/manager/workflow_test.go index 0f221847..a0ef43a2 100644 --- a/internal/manager/workflow_test.go +++ b/internal/manager/workflow_test.go @@ -8,19 +8,19 @@ import ( "github.com/google/uuid" "github.com/stretchr/testify/assert" - "github.com/openkcm/cmk/internal/api/cmkapi" - "github.com/openkcm/cmk/internal/auditor" - "github.com/openkcm/cmk/internal/clients" - "github.com/openkcm/cmk/internal/config" - "github.com/openkcm/cmk/internal/constants" - "github.com/openkcm/cmk/internal/errs" - "github.com/openkcm/cmk/internal/grpc/catalog" - "github.com/openkcm/cmk/internal/manager" - "github.com/openkcm/cmk/internal/model" - "github.com/openkcm/cmk/internal/repo" - "github.com/openkcm/cmk/internal/repo/sql" - "github.com/openkcm/cmk/internal/testutils" - "github.com/openkcm/cmk/internal/workflow" + "github.com/openkcm/cmk-core/internal/api/cmkapi" + "github.com/openkcm/cmk-core/internal/auditor" + "github.com/openkcm/cmk-core/internal/clients" + "github.com/openkcm/cmk-core/internal/config" + "github.com/openkcm/cmk-core/internal/constants" + "github.com/openkcm/cmk-core/internal/errs" + "github.com/openkcm/cmk-core/internal/grpc/catalog" + "github.com/openkcm/cmk-core/internal/manager" + "github.com/openkcm/cmk-core/internal/model" + "github.com/openkcm/cmk-core/internal/repo" + "github.com/openkcm/cmk-core/internal/repo/sql" + "github.com/openkcm/cmk-core/internal/testutils" + "github.com/openkcm/cmk-core/internal/workflow" ) func SetupWorkflowManager(t *testing.T) (*manager.WorkflowManager, diff --git a/internal/middleware/clientdata.go b/internal/middleware/clientdata.go index 66d0744d..90a587ec 100644 --- a/internal/middleware/clientdata.go +++ b/internal/middleware/clientdata.go @@ -12,8 +12,8 @@ import ( "github.com/openkcm/common-sdk/pkg/commoncfg" "github.com/openkcm/common-sdk/pkg/storage/keyvalue" - "github.com/openkcm/cmk/internal/flags" - "github.com/openkcm/cmk/internal/log" + "github.com/openkcm/cmk-core/internal/flags" + "github.com/openkcm/cmk-core/internal/log" ) type clientDataContextKey string diff --git a/internal/middleware/clientdata_test.go b/internal/middleware/clientdata_test.go index 01234502..9cab9168 100644 --- a/internal/middleware/clientdata_test.go +++ b/internal/middleware/clientdata_test.go @@ -22,9 +22,9 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/openkcm/cmk/internal/config" - "github.com/openkcm/cmk/internal/flags" - "github.com/openkcm/cmk/internal/middleware" + "github.com/openkcm/cmk-core/internal/config" + "github.com/openkcm/cmk-core/internal/flags" + "github.com/openkcm/cmk-core/internal/middleware" ) // testData holds test setup data diff --git a/internal/middleware/context.go b/internal/middleware/context.go index 6f3e97f1..9f80b78a 100644 --- a/internal/middleware/context.go +++ b/internal/middleware/context.go @@ -3,7 +3,7 @@ package middleware import ( "net/http" - cmkcontext "github.com/openkcm/cmk/utils/context" + cmkcontext "github.com/openkcm/cmk-core/utils/context" ) // InjectRequestID injects a RequestID into the context to be used by other middlewares diff --git a/internal/middleware/logging.go b/internal/middleware/logging.go index 4a7932bd..11bc3a94 100644 --- a/internal/middleware/logging.go +++ b/internal/middleware/logging.go @@ -5,7 +5,7 @@ import ( "net/http" "time" - "github.com/openkcm/cmk/internal/log" + "github.com/openkcm/cmk-core/internal/log" ) // LoggingMiddleware logs the start and end of each request, along with the duration and status code. diff --git a/internal/middleware/logging_test.go b/internal/middleware/logging_test.go index 7176a93a..4a3d8c00 100644 --- a/internal/middleware/logging_test.go +++ b/internal/middleware/logging_test.go @@ -10,7 +10,7 @@ import ( "github.com/stretchr/testify/assert" - "github.com/openkcm/cmk/internal/middleware" + "github.com/openkcm/cmk-core/internal/middleware" ) // TestLoggingMiddleware tests the logging middleware diff --git a/internal/middleware/multitenancy_test.go b/internal/middleware/multitenancy_test.go index 4f034939..8f3e2ee1 100644 --- a/internal/middleware/multitenancy_test.go +++ b/internal/middleware/multitenancy_test.go @@ -10,7 +10,7 @@ import ( multitenancyMiddleware "github.com/bartventer/gorm-multitenancy/middleware/nethttp/v8" - "github.com/openkcm/cmk/internal/middleware" + "github.com/openkcm/cmk-core/internal/middleware" ) func TestMultiTenancyMiddleware(t *testing.T) { diff --git a/internal/middleware/oapi_validator.go b/internal/middleware/oapi_validator.go index 99570ede..5e9f2417 100644 --- a/internal/middleware/oapi_validator.go +++ b/internal/middleware/oapi_validator.go @@ -8,7 +8,7 @@ import ( md "github.com/oapi-codegen/nethttp-middleware" - "github.com/openkcm/cmk/internal/handlers" + "github.com/openkcm/cmk-core/internal/handlers" ) // OAPIMiddleware validates a Request against the OpenAPI Spec diff --git a/internal/middleware/panic.go b/internal/middleware/panic.go index 70d35dfd..de9cf0c2 100644 --- a/internal/middleware/panic.go +++ b/internal/middleware/panic.go @@ -7,9 +7,9 @@ import ( "net/http" "runtime/debug" - "github.com/openkcm/cmk/internal/api/write" - "github.com/openkcm/cmk/internal/apierrors" - "github.com/openkcm/cmk/internal/log" + "github.com/openkcm/cmk-core/internal/api/write" + "github.com/openkcm/cmk-core/internal/apierrors" + "github.com/openkcm/cmk-core/internal/log" ) // PanicRecoveryMiddleware is a middleware that recovers from panics and logs them. diff --git a/internal/middleware/panic_test.go b/internal/middleware/panic_test.go index 04401ab1..03a2337b 100644 --- a/internal/middleware/panic_test.go +++ b/internal/middleware/panic_test.go @@ -7,7 +7,7 @@ import ( "github.com/stretchr/testify/assert" - "github.com/openkcm/cmk/internal/middleware" + "github.com/openkcm/cmk-core/internal/middleware" ) func TestPanicRecoveryMiddleware(t *testing.T) { diff --git a/internal/model/certificate_test.go b/internal/model/certificate_test.go index cf1a3d83..537a0608 100644 --- a/internal/model/certificate_test.go +++ b/internal/model/certificate_test.go @@ -5,7 +5,7 @@ import ( "github.com/stretchr/testify/assert" - "github.com/openkcm/cmk/internal/model" + "github.com/openkcm/cmk-core/internal/model" ) func TestCertificateTable(t *testing.T) { diff --git a/internal/model/group.go b/internal/model/group.go index ac4ac10e..592425a0 100644 --- a/internal/model/group.go +++ b/internal/model/group.go @@ -5,7 +5,7 @@ import ( "github.com/google/uuid" - "github.com/openkcm/cmk/internal/constants" + "github.com/openkcm/cmk-core/internal/constants" ) type Group struct { diff --git a/internal/model/group_test.go b/internal/model/group_test.go index 652f9697..0fe998e1 100644 --- a/internal/model/group_test.go +++ b/internal/model/group_test.go @@ -5,7 +5,7 @@ import ( "github.com/stretchr/testify/assert" - "github.com/openkcm/cmk/internal/model" + "github.com/openkcm/cmk-core/internal/model" ) func TestGroupTable(t *testing.T) { diff --git a/internal/model/importparams_test.go b/internal/model/importparams_test.go index d5af50cb..29d184fb 100644 --- a/internal/model/importparams_test.go +++ b/internal/model/importparams_test.go @@ -6,7 +6,7 @@ import ( "github.com/stretchr/testify/assert" - "github.com/openkcm/cmk/internal/model" + "github.com/openkcm/cmk-core/internal/model" ) func TestImportParamsTable(t *testing.T) { diff --git a/internal/model/key_test.go b/internal/model/key_test.go index 69929988..ebb6f6aa 100644 --- a/internal/model/key_test.go +++ b/internal/model/key_test.go @@ -5,7 +5,7 @@ import ( "github.com/stretchr/testify/assert" - "github.com/openkcm/cmk/internal/model" + "github.com/openkcm/cmk-core/internal/model" ) func TestKeyTable(t *testing.T) { diff --git a/internal/model/keyconfiguration_test.go b/internal/model/keyconfiguration_test.go index 932dede3..3e4503b0 100644 --- a/internal/model/keyconfiguration_test.go +++ b/internal/model/keyconfiguration_test.go @@ -5,7 +5,7 @@ import ( "github.com/stretchr/testify/assert" - "github.com/openkcm/cmk/internal/model" + "github.com/openkcm/cmk-core/internal/model" ) func TestKeyConfiguration(t *testing.T) { diff --git a/internal/model/keystore_config.go b/internal/model/keystore_config.go index 5e181062..b460d0f7 100644 --- a/internal/model/keystore_config.go +++ b/internal/model/keystore_config.go @@ -5,7 +5,7 @@ import ( "github.com/google/uuid" - "github.com/openkcm/cmk/internal/config" + "github.com/openkcm/cmk-core/internal/config" ) // KeystoreConfiguration is an internal entity of pool item that should be persisted. diff --git a/internal/model/keystore_config_test.go b/internal/model/keystore_config_test.go index 897f312a..688cb81e 100644 --- a/internal/model/keystore_config_test.go +++ b/internal/model/keystore_config_test.go @@ -5,7 +5,7 @@ import ( "github.com/stretchr/testify/assert" - "github.com/openkcm/cmk/internal/model" + "github.com/openkcm/cmk-core/internal/model" ) func TestKeystoreConfigTable(t *testing.T) { diff --git a/internal/model/keyversion_test.go b/internal/model/keyversion_test.go index 08f957e7..06c8f49d 100644 --- a/internal/model/keyversion_test.go +++ b/internal/model/keyversion_test.go @@ -5,7 +5,7 @@ import ( "github.com/stretchr/testify/assert" - "github.com/openkcm/cmk/internal/model" + "github.com/openkcm/cmk-core/internal/model" ) func TestKeyVersionTable(t *testing.T) { diff --git a/internal/model/label_test.go b/internal/model/label_test.go index 4c01ee86..12cb61ec 100644 --- a/internal/model/label_test.go +++ b/internal/model/label_test.go @@ -5,7 +5,7 @@ import ( "github.com/stretchr/testify/assert" - "github.com/openkcm/cmk/internal/model" + "github.com/openkcm/cmk-core/internal/model" ) func TestKeyLabelsTable(t *testing.T) { diff --git a/internal/model/system.go b/internal/model/system.go index ab2d1e27..e1c2d0b1 100644 --- a/internal/model/system.go +++ b/internal/model/system.go @@ -4,8 +4,8 @@ import ( "github.com/google/uuid" "gorm.io/gorm" - "github.com/openkcm/cmk/internal/api/cmkapi" - "github.com/openkcm/cmk/internal/config" + "github.com/openkcm/cmk-core/internal/api/cmkapi" + "github.com/openkcm/cmk-core/internal/config" ) //nolint:recvcheck diff --git a/internal/model/system_test.go b/internal/model/system_test.go index f4b5adad..f223e897 100644 --- a/internal/model/system_test.go +++ b/internal/model/system_test.go @@ -5,7 +5,7 @@ import ( "github.com/stretchr/testify/assert" - "github.com/openkcm/cmk/internal/model" + "github.com/openkcm/cmk-core/internal/model" ) func TestSystem(t *testing.T) { diff --git a/internal/model/tag_test.go b/internal/model/tag_test.go index 92bc3f34..1429f0b9 100644 --- a/internal/model/tag_test.go +++ b/internal/model/tag_test.go @@ -5,7 +5,7 @@ import ( "github.com/stretchr/testify/assert" - "github.com/openkcm/cmk/internal/model" + "github.com/openkcm/cmk-core/internal/model" ) func TestTagsTable(t *testing.T) { diff --git a/internal/model/tenant_status_test.go b/internal/model/tenant_status_test.go index 0acb6fae..ca2e0e27 100644 --- a/internal/model/tenant_status_test.go +++ b/internal/model/tenant_status_test.go @@ -7,7 +7,7 @@ import ( pb "github.com/openkcm/api-sdk/proto/kms/api/cmk/registry/tenant/v1" - "github.com/openkcm/cmk/internal/model" + "github.com/openkcm/cmk-core/internal/model" ) func TestTenantStatusValidation(t *testing.T) { diff --git a/internal/model/tenant_test.go b/internal/model/tenant_test.go index 319c1e9e..9bdc2fdf 100644 --- a/internal/model/tenant_test.go +++ b/internal/model/tenant_test.go @@ -8,9 +8,9 @@ import ( multitenancy "github.com/bartventer/gorm-multitenancy/v8" - "github.com/openkcm/cmk/internal/model" - "github.com/openkcm/cmk/internal/repo/sql" - "github.com/openkcm/cmk/internal/testutils" + "github.com/openkcm/cmk-core/internal/model" + "github.com/openkcm/cmk-core/internal/repo/sql" + "github.com/openkcm/cmk-core/internal/testutils" ) func TestTenantsTable(t *testing.T) { diff --git a/internal/model/workflow_test.go b/internal/model/workflow_test.go index 6f1b6d45..5df597f4 100644 --- a/internal/model/workflow_test.go +++ b/internal/model/workflow_test.go @@ -5,7 +5,7 @@ import ( "github.com/stretchr/testify/assert" - "github.com/openkcm/cmk/internal/model" + "github.com/openkcm/cmk-core/internal/model" ) func TestWorkflowTable(t *testing.T) { diff --git a/internal/plugins/builtin/builtin.go b/internal/plugins/builtin/builtin.go index acc457b7..86a56c4e 100644 --- a/internal/plugins/builtin/builtin.go +++ b/internal/plugins/builtin/builtin.go @@ -3,12 +3,12 @@ package builtin import ( "github.com/openkcm/plugin-sdk/pkg/catalog" - "github.com/openkcm/cmk/internal/plugins/builtin/certificateissuer" - "github.com/openkcm/cmk/internal/plugins/builtin/identitymanagement" - keystoreman "github.com/openkcm/cmk/internal/plugins/builtin/keystore/management" - keystoreop "github.com/openkcm/cmk/internal/plugins/builtin/keystore/operations" - "github.com/openkcm/cmk/internal/plugins/builtin/notification" - "github.com/openkcm/cmk/internal/plugins/builtin/systeminformation" + "github.com/openkcm/cmk-core/internal/plugins/builtin/certificateissuer" + "github.com/openkcm/cmk-core/internal/plugins/builtin/identitymanagement" + keystoreman "github.com/openkcm/cmk-core/internal/plugins/builtin/keystore/management" + keystoreop "github.com/openkcm/cmk-core/internal/plugins/builtin/keystore/operations" + "github.com/openkcm/cmk-core/internal/plugins/builtin/notification" + "github.com/openkcm/cmk-core/internal/plugins/builtin/systeminformation" ) func BuiltIns() []catalog.BuiltIn { diff --git a/internal/repo/mock/db.go b/internal/repo/mock/db.go index 06332c87..331515d4 100644 --- a/internal/repo/mock/db.go +++ b/internal/repo/mock/db.go @@ -6,9 +6,9 @@ import ( "github.com/google/uuid" - "github.com/openkcm/cmk/internal/errs" - "github.com/openkcm/cmk/internal/model" - "github.com/openkcm/cmk/internal/repo" + "github.com/openkcm/cmk-core/internal/errs" + "github.com/openkcm/cmk-core/internal/model" + "github.com/openkcm/cmk-core/internal/repo" ) type ModelInfo struct { diff --git a/internal/repo/mock/db_test.go b/internal/repo/mock/db_test.go index 44ef6f58..e7492751 100644 --- a/internal/repo/mock/db_test.go +++ b/internal/repo/mock/db_test.go @@ -7,9 +7,9 @@ import ( "github.com/google/uuid" "github.com/stretchr/testify/assert" - "github.com/openkcm/cmk/internal/model" - "github.com/openkcm/cmk/internal/repo" - "github.com/openkcm/cmk/internal/repo/mock" + "github.com/openkcm/cmk-core/internal/model" + "github.com/openkcm/cmk-core/internal/repo" + "github.com/openkcm/cmk-core/internal/repo/mock" ) func TestCreate(t *testing.T) { diff --git a/internal/repo/mock/multitenancydb_test.go b/internal/repo/mock/multitenancydb_test.go index 6a3e4531..3402c3f9 100644 --- a/internal/repo/mock/multitenancydb_test.go +++ b/internal/repo/mock/multitenancydb_test.go @@ -6,8 +6,8 @@ import ( "github.com/google/uuid" "github.com/stretchr/testify/assert" - "github.com/openkcm/cmk/internal/model" - "github.com/openkcm/cmk/internal/repo/mock" + "github.com/openkcm/cmk-core/internal/model" + "github.com/openkcm/cmk-core/internal/repo/mock" ) func TestInMemoryMultitenancyDB_CreateDB(t *testing.T) { diff --git a/internal/repo/mock/repo.go b/internal/repo/mock/repo.go index 4ed3a553..367fedcc 100644 --- a/internal/repo/mock/repo.go +++ b/internal/repo/mock/repo.go @@ -6,9 +6,9 @@ import ( "github.com/bartventer/gorm-multitenancy/middleware/nethttp/v8" - "github.com/openkcm/cmk/internal/errs" - "github.com/openkcm/cmk/internal/repo" - cmkcontext "github.com/openkcm/cmk/utils/context" + "github.com/openkcm/cmk-core/internal/errs" + "github.com/openkcm/cmk-core/internal/repo" + cmkcontext "github.com/openkcm/cmk-core/utils/context" ) // InMemoryRepository represents the repository for managing mock Resource data. diff --git a/internal/repo/mock/repo_test.go b/internal/repo/mock/repo_test.go index cae860e6..48eb6711 100644 --- a/internal/repo/mock/repo_test.go +++ b/internal/repo/mock/repo_test.go @@ -7,10 +7,10 @@ import ( "github.com/google/uuid" "github.com/stretchr/testify/assert" - "github.com/openkcm/cmk/internal/model" - "github.com/openkcm/cmk/internal/repo" - "github.com/openkcm/cmk/internal/repo/mock" - "github.com/openkcm/cmk/internal/testutils" + "github.com/openkcm/cmk-core/internal/model" + "github.com/openkcm/cmk-core/internal/repo" + "github.com/openkcm/cmk-core/internal/repo/mock" + "github.com/openkcm/cmk-core/internal/testutils" ) func TestInMemoryRepository_Create(t *testing.T) { diff --git a/internal/repo/query_test.go b/internal/repo/query_test.go index 31806857..b8ee6e0d 100644 --- a/internal/repo/query_test.go +++ b/internal/repo/query_test.go @@ -6,8 +6,8 @@ import ( "github.com/stretchr/testify/assert" - "github.com/openkcm/cmk/internal/model" - "github.com/openkcm/cmk/internal/repo" + "github.com/openkcm/cmk-core/internal/model" + "github.com/openkcm/cmk-core/internal/repo" ) func TestQuery_Join(t *testing.T) { diff --git a/internal/repo/repository.go b/internal/repo/repository.go index cc68e661..047ab079 100644 --- a/internal/repo/repository.go +++ b/internal/repo/repository.go @@ -10,8 +10,8 @@ import ( "github.com/google/uuid" - "github.com/openkcm/cmk/internal/errs" - "github.com/openkcm/cmk/internal/model" + "github.com/openkcm/cmk-core/internal/errs" + "github.com/openkcm/cmk-core/internal/model" ) // TransactionFunc is func signature for ExecTransaction. diff --git a/internal/repo/repository_test.go b/internal/repo/repository_test.go index c9e5df91..97b6b96d 100644 --- a/internal/repo/repository_test.go +++ b/internal/repo/repository_test.go @@ -8,9 +8,9 @@ import ( "github.com/google/uuid" "github.com/stretchr/testify/assert" - "github.com/openkcm/cmk/internal/repo" - "github.com/openkcm/cmk/internal/repo/sql" - "github.com/openkcm/cmk/internal/testutils" + "github.com/openkcm/cmk-core/internal/repo" + "github.com/openkcm/cmk-core/internal/repo/sql" + "github.com/openkcm/cmk-core/internal/testutils" ) func TestConcurrency(t *testing.T) { diff --git a/internal/repo/sql/repo.go b/internal/repo/sql/repo.go index 68170d65..b053f66e 100644 --- a/internal/repo/sql/repo.go +++ b/internal/repo/sql/repo.go @@ -13,12 +13,12 @@ import ( multitenancy "github.com/bartventer/gorm-multitenancy/v8" - "github.com/openkcm/cmk/internal/errs" - "github.com/openkcm/cmk/internal/log" - "github.com/openkcm/cmk/internal/model" - "github.com/openkcm/cmk/internal/repo" - "github.com/openkcm/cmk/internal/repo/violations" - cmkcontext "github.com/openkcm/cmk/utils/context" + "github.com/openkcm/cmk-core/internal/errs" + "github.com/openkcm/cmk-core/internal/log" + "github.com/openkcm/cmk-core/internal/model" + "github.com/openkcm/cmk-core/internal/repo" + "github.com/openkcm/cmk-core/internal/repo/violations" + cmkcontext "github.com/openkcm/cmk-core/utils/context" ) const ( diff --git a/internal/repo/sql/repo_test.go b/internal/repo/sql/repo_test.go index cc0e7baa..dd734d20 100644 --- a/internal/repo/sql/repo_test.go +++ b/internal/repo/sql/repo_test.go @@ -13,10 +13,10 @@ import ( multitenancy "github.com/bartventer/gorm-multitenancy/v8" - "github.com/openkcm/cmk/internal/model" - "github.com/openkcm/cmk/internal/repo" - "github.com/openkcm/cmk/internal/repo/sql" - "github.com/openkcm/cmk/internal/testutils" + "github.com/openkcm/cmk-core/internal/model" + "github.com/openkcm/cmk-core/internal/repo" + "github.com/openkcm/cmk-core/internal/repo/sql" + "github.com/openkcm/cmk-core/internal/testutils" ) func TestRepo_WithTenant(t *testing.T) { diff --git a/internal/repo/violations/postgres_test.go b/internal/repo/violations/postgres_test.go index 9d7b035a..740d8c49 100644 --- a/internal/repo/violations/postgres_test.go +++ b/internal/repo/violations/postgres_test.go @@ -7,7 +7,7 @@ import ( "github.com/jackc/pgx/v5/pgconn" "github.com/stretchr/testify/require" - "github.com/openkcm/cmk/internal/repo/violations" + "github.com/openkcm/cmk-core/internal/repo/violations" ) var errNotPostgres = errors.New("not postgres") diff --git a/internal/tenant-manager/business/business.go b/internal/tenant-manager/business/business.go index 23d0264c..d88a97b5 100644 --- a/internal/tenant-manager/business/business.go +++ b/internal/tenant-manager/business/business.go @@ -8,11 +8,11 @@ import ( "github.com/openkcm/orbital/codec" "github.com/samber/oops" - "github.com/openkcm/cmk/internal/clients" - "github.com/openkcm/cmk/internal/config" - "github.com/openkcm/cmk/internal/db" - "github.com/openkcm/cmk/internal/log" - "github.com/openkcm/cmk/internal/tenant-manager/operator" + "github.com/openkcm/cmk-core/internal/clients" + "github.com/openkcm/cmk-core/internal/config" + "github.com/openkcm/cmk-core/internal/db" + "github.com/openkcm/cmk-core/internal/log" + "github.com/openkcm/cmk-core/internal/tenant-manager/operator" ) const logDomain = "business" diff --git a/internal/tenant-manager/business/business_test.go b/internal/tenant-manager/business/business_test.go index d4e460da..d14555b9 100644 --- a/internal/tenant-manager/business/business_test.go +++ b/internal/tenant-manager/business/business_test.go @@ -7,9 +7,9 @@ import ( "github.com/stretchr/testify/assert" - "github.com/openkcm/cmk/internal/config" - "github.com/openkcm/cmk/internal/tenant-manager/business" - "github.com/openkcm/cmk/internal/testutils" + "github.com/openkcm/cmk-core/internal/config" + "github.com/openkcm/cmk-core/internal/tenant-manager/business" + "github.com/openkcm/cmk-core/internal/testutils" ) func TestBusinessMain(t *testing.T) { diff --git a/internal/tenant-manager/cli/cli_test.go b/internal/tenant-manager/cli/cli_test.go index c6fd141e..9b8647c1 100644 --- a/internal/tenant-manager/cli/cli_test.go +++ b/internal/tenant-manager/cli/cli_test.go @@ -15,12 +15,12 @@ import ( multitenancy "github.com/bartventer/gorm-multitenancy/v8" tenantgrpc "github.com/openkcm/api-sdk/proto/kms/api/cmk/registry/tenant/v1" - "github.com/openkcm/cmk/internal/model" - "github.com/openkcm/cmk/internal/tenant-manager/cli" - tmdb "github.com/openkcm/cmk/internal/tenant-manager/db" - "github.com/openkcm/cmk/internal/testutils" - integrationutils "github.com/openkcm/cmk/test/integration_utils" - "github.com/openkcm/cmk/utils/base62" + "github.com/openkcm/cmk-core/internal/model" + "github.com/openkcm/cmk-core/internal/tenant-manager/cli" + tmdb "github.com/openkcm/cmk-core/internal/tenant-manager/db" + "github.com/openkcm/cmk-core/internal/testutils" + integrationutils "github.com/openkcm/cmk-core/test/integration_utils" + "github.com/openkcm/cmk-core/utils/base62" ) type CLISuite struct { diff --git a/internal/tenant-manager/cli/command.go b/internal/tenant-manager/cli/command.go index 0cf0a231..b6dcf2b4 100644 --- a/internal/tenant-manager/cli/command.go +++ b/internal/tenant-manager/cli/command.go @@ -13,9 +13,9 @@ import ( multitenancy "github.com/bartventer/gorm-multitenancy/v8" - "github.com/openkcm/cmk/internal/config" - "github.com/openkcm/cmk/internal/constants" - "github.com/openkcm/cmk/internal/db" + "github.com/openkcm/cmk-core/internal/config" + "github.com/openkcm/cmk-core/internal/constants" + "github.com/openkcm/cmk-core/internal/db" ) const ( diff --git a/internal/tenant-manager/cli/creategroupscmd.go b/internal/tenant-manager/cli/creategroupscmd.go index 60c7d98f..9642d2ab 100644 --- a/internal/tenant-manager/cli/creategroupscmd.go +++ b/internal/tenant-manager/cli/creategroupscmd.go @@ -5,8 +5,8 @@ import ( "github.com/spf13/cobra" - "github.com/openkcm/cmk/internal/repo/sql" - tmdb "github.com/openkcm/cmk/internal/tenant-manager/db" + "github.com/openkcm/cmk-core/internal/repo/sql" + tmdb "github.com/openkcm/cmk-core/internal/tenant-manager/db" ) func (f *CommandFactory) NewCreateGroupsCmd() *cobra.Command { diff --git a/internal/tenant-manager/cli/createtenantcmd.go b/internal/tenant-manager/cli/createtenantcmd.go index 4255ca95..bc0c0123 100644 --- a/internal/tenant-manager/cli/createtenantcmd.go +++ b/internal/tenant-manager/cli/createtenantcmd.go @@ -7,9 +7,9 @@ import ( multitenancy "github.com/bartventer/gorm-multitenancy/v8" - "github.com/openkcm/cmk/internal/model" - tmdb "github.com/openkcm/cmk/internal/tenant-manager/db" - "github.com/openkcm/cmk/utils/base62" + "github.com/openkcm/cmk-core/internal/model" + tmdb "github.com/openkcm/cmk-core/internal/tenant-manager/db" + "github.com/openkcm/cmk-core/utils/base62" ) //nolint:funlen diff --git a/internal/tenant-manager/cli/db_test.go b/internal/tenant-manager/cli/db_test.go index 3580a040..1f6acc82 100644 --- a/internal/tenant-manager/cli/db_test.go +++ b/internal/tenant-manager/cli/db_test.go @@ -16,12 +16,12 @@ import ( multitenancy "github.com/bartventer/gorm-multitenancy/v8" - "github.com/openkcm/cmk/internal/model" - sqlRepo "github.com/openkcm/cmk/internal/repo/sql" - tmdb "github.com/openkcm/cmk/internal/tenant-manager/db" - "github.com/openkcm/cmk/internal/testutils" - integrationutils "github.com/openkcm/cmk/test/integration_utils" - "github.com/openkcm/cmk/utils/base62" + "github.com/openkcm/cmk-core/internal/model" + sqlRepo "github.com/openkcm/cmk-core/internal/repo/sql" + tmdb "github.com/openkcm/cmk-core/internal/tenant-manager/db" + "github.com/openkcm/cmk-core/internal/testutils" + integrationutils "github.com/openkcm/cmk-core/test/integration_utils" + "github.com/openkcm/cmk-core/utils/base62" ) type DBSuite struct { diff --git a/internal/tenant-manager/cli/deletetenantcmd.go b/internal/tenant-manager/cli/deletetenantcmd.go index c18fd586..e968c481 100644 --- a/internal/tenant-manager/cli/deletetenantcmd.go +++ b/internal/tenant-manager/cli/deletetenantcmd.go @@ -7,9 +7,9 @@ import ( multitenancy "github.com/bartventer/gorm-multitenancy/v8" - "github.com/openkcm/cmk/internal/model" - "github.com/openkcm/cmk/internal/repo" - "github.com/openkcm/cmk/internal/repo/sql" + "github.com/openkcm/cmk-core/internal/model" + "github.com/openkcm/cmk-core/internal/repo" + "github.com/openkcm/cmk-core/internal/repo/sql" ) func (f *CommandFactory) NewDeleteTenantCmd() *cobra.Command { diff --git a/internal/tenant-manager/cli/gettenantcmd.go b/internal/tenant-manager/cli/gettenantcmd.go index a6675923..d6417a73 100644 --- a/internal/tenant-manager/cli/gettenantcmd.go +++ b/internal/tenant-manager/cli/gettenantcmd.go @@ -5,7 +5,7 @@ import ( "github.com/spf13/cobra" - "github.com/openkcm/cmk/internal/repo/sql" + "github.com/openkcm/cmk-core/internal/repo/sql" ) func (f *CommandFactory) NewGetTenantCmd() *cobra.Command { diff --git a/internal/tenant-manager/cli/listtenantscmd.go b/internal/tenant-manager/cli/listtenantscmd.go index 764b339a..454ecdd4 100644 --- a/internal/tenant-manager/cli/listtenantscmd.go +++ b/internal/tenant-manager/cli/listtenantscmd.go @@ -3,9 +3,9 @@ package cli import ( "github.com/spf13/cobra" - "github.com/openkcm/cmk/internal/model" - "github.com/openkcm/cmk/internal/repo" - "github.com/openkcm/cmk/internal/repo/sql" + "github.com/openkcm/cmk-core/internal/model" + "github.com/openkcm/cmk-core/internal/repo" + "github.com/openkcm/cmk-core/internal/repo/sql" ) func (f *CommandFactory) NewListTenantsCmd() *cobra.Command { diff --git a/internal/tenant-manager/cli/updatetenantcmd.go b/internal/tenant-manager/cli/updatetenantcmd.go index 3a96bfdf..f2bc0cd4 100644 --- a/internal/tenant-manager/cli/updatetenantcmd.go +++ b/internal/tenant-manager/cli/updatetenantcmd.go @@ -3,9 +3,9 @@ package cli import ( "github.com/spf13/cobra" - "github.com/openkcm/cmk/internal/model" - "github.com/openkcm/cmk/internal/repo" - "github.com/openkcm/cmk/internal/repo/sql" + "github.com/openkcm/cmk-core/internal/model" + "github.com/openkcm/cmk-core/internal/repo" + "github.com/openkcm/cmk-core/internal/repo/sql" ) func (f *CommandFactory) NewUpdateTenantCmd() *cobra.Command { diff --git a/internal/tenant-manager/cli/utils.go b/internal/tenant-manager/cli/utils.go index e54bbdbc..179cf20b 100644 --- a/internal/tenant-manager/cli/utils.go +++ b/internal/tenant-manager/cli/utils.go @@ -6,8 +6,8 @@ import ( "github.com/spf13/cobra" - "github.com/openkcm/cmk/internal/model" - "github.com/openkcm/cmk/internal/repo" + "github.com/openkcm/cmk-core/internal/model" + "github.com/openkcm/cmk-core/internal/repo" ) func FindTenant(ctx context.Context, cmd *cobra.Command, id string, r repo.Repo) *model.Tenant { diff --git a/internal/tenant-manager/db/db.go b/internal/tenant-manager/db/db.go index 1b190afb..fb7f0722 100644 --- a/internal/tenant-manager/db/db.go +++ b/internal/tenant-manager/db/db.go @@ -11,13 +11,13 @@ import ( multitenancy "github.com/bartventer/gorm-multitenancy/v8" slogctx "github.com/veqryn/slog-context" - "github.com/openkcm/cmk/internal/constants" - "github.com/openkcm/cmk/internal/errs" - "github.com/openkcm/cmk/internal/log" - "github.com/openkcm/cmk/internal/model" - "github.com/openkcm/cmk/internal/repo" - sqlRepo "github.com/openkcm/cmk/internal/repo/sql" - cmkcontext "github.com/openkcm/cmk/utils/context" + "github.com/openkcm/cmk-core/internal/constants" + "github.com/openkcm/cmk-core/internal/errs" + "github.com/openkcm/cmk-core/internal/log" + "github.com/openkcm/cmk-core/internal/model" + "github.com/openkcm/cmk-core/internal/repo" + sqlRepo "github.com/openkcm/cmk-core/internal/repo/sql" + cmkcontext "github.com/openkcm/cmk-core/utils/context" ) var _ slogctx.Handler diff --git a/internal/tenant-manager/db/db_test.go b/internal/tenant-manager/db/db_test.go index c97e34c2..87b1c047 100644 --- a/internal/tenant-manager/db/db_test.go +++ b/internal/tenant-manager/db/db_test.go @@ -10,12 +10,12 @@ import ( "github.com/stretchr/testify/require" "gorm.io/gorm" - "github.com/openkcm/cmk/internal/constants" - "github.com/openkcm/cmk/internal/model" - "github.com/openkcm/cmk/internal/tenant-manager/db" - "github.com/openkcm/cmk/internal/testutils" - integrationutils "github.com/openkcm/cmk/test/integration_utils" - "github.com/openkcm/cmk/utils/base62" + "github.com/openkcm/cmk-core/internal/constants" + "github.com/openkcm/cmk-core/internal/model" + "github.com/openkcm/cmk-core/internal/tenant-manager/db" + "github.com/openkcm/cmk-core/internal/testutils" + integrationutils "github.com/openkcm/cmk-core/test/integration_utils" + "github.com/openkcm/cmk-core/utils/base62" ) var ( diff --git a/internal/tenant-manager/operator/export_test.go b/internal/tenant-manager/operator/export_test.go index 90c2333e..ef3f3567 100644 --- a/internal/tenant-manager/operator/export_test.go +++ b/internal/tenant-manager/operator/export_test.go @@ -7,7 +7,7 @@ import ( multitenancy "github.com/bartventer/gorm-multitenancy/v8" - "github.com/openkcm/cmk/internal/repo" + "github.com/openkcm/cmk-core/internal/repo" ) func (o *TenantOperator) HandleCreateTenant(ctx context.Context, req orbital.HandlerRequest) ( diff --git a/internal/tenant-manager/operator/operator.go b/internal/tenant-manager/operator/operator.go index 5f7bca82..9c14154c 100644 --- a/internal/tenant-manager/operator/operator.go +++ b/internal/tenant-manager/operator/operator.go @@ -16,15 +16,15 @@ import ( multitenancy "github.com/bartventer/gorm-multitenancy/v8" tenantgrpc "github.com/openkcm/api-sdk/proto/kms/api/cmk/registry/tenant/v1" - "github.com/openkcm/cmk/internal/config" - "github.com/openkcm/cmk/internal/constants" - "github.com/openkcm/cmk/internal/errs" - "github.com/openkcm/cmk/internal/log" - "github.com/openkcm/cmk/internal/model" - "github.com/openkcm/cmk/internal/repo" - "github.com/openkcm/cmk/internal/repo/sql" - tmdb "github.com/openkcm/cmk/internal/tenant-manager/db" - "github.com/openkcm/cmk/utils/base62" + "github.com/openkcm/cmk-core/internal/config" + "github.com/openkcm/cmk-core/internal/constants" + "github.com/openkcm/cmk-core/internal/errs" + "github.com/openkcm/cmk-core/internal/log" + "github.com/openkcm/cmk-core/internal/model" + "github.com/openkcm/cmk-core/internal/repo" + "github.com/openkcm/cmk-core/internal/repo/sql" + tmdb "github.com/openkcm/cmk-core/internal/tenant-manager/db" + "github.com/openkcm/cmk-core/utils/base62" ) const ( diff --git a/internal/tenant-manager/operator/operator_test.go b/internal/tenant-manager/operator/operator_test.go index 7d348395..06d749b8 100644 --- a/internal/tenant-manager/operator/operator_test.go +++ b/internal/tenant-manager/operator/operator_test.go @@ -22,12 +22,12 @@ import ( tenantgrpc "github.com/openkcm/api-sdk/proto/kms/api/cmk/registry/tenant/v1" slogctx "github.com/veqryn/slog-context" - "github.com/openkcm/cmk/internal/clients/registry/tenants" - "github.com/openkcm/cmk/internal/model" - "github.com/openkcm/cmk/internal/tenant-manager/operator" - "github.com/openkcm/cmk/internal/testutils" - integrationutils "github.com/openkcm/cmk/test/integration_utils" - tmdb "github.com/openkcm/cmk/utils/base62" + "github.com/openkcm/cmk-core/internal/clients/registry/tenants" + "github.com/openkcm/cmk-core/internal/model" + "github.com/openkcm/cmk-core/internal/tenant-manager/operator" + "github.com/openkcm/cmk-core/internal/testutils" + integrationutils "github.com/openkcm/cmk-core/test/integration_utils" + tmdb "github.com/openkcm/cmk-core/utils/base62" ) const ( diff --git a/internal/tenant-manager/operator/probe.go b/internal/tenant-manager/operator/probe.go index 2257fddf..953f4e81 100644 --- a/internal/tenant-manager/operator/probe.go +++ b/internal/tenant-manager/operator/probe.go @@ -9,12 +9,12 @@ import ( multitenancy "github.com/bartventer/gorm-multitenancy/v8" - "github.com/openkcm/cmk/internal/constants" - "github.com/openkcm/cmk/internal/errs" - "github.com/openkcm/cmk/internal/log" - "github.com/openkcm/cmk/internal/model" - "github.com/openkcm/cmk/internal/repo" - cmkcontext "github.com/openkcm/cmk/utils/context" + "github.com/openkcm/cmk-core/internal/constants" + "github.com/openkcm/cmk-core/internal/errs" + "github.com/openkcm/cmk-core/internal/log" + "github.com/openkcm/cmk-core/internal/model" + "github.com/openkcm/cmk-core/internal/repo" + cmkcontext "github.com/openkcm/cmk-core/utils/context" ) const ( diff --git a/internal/tenant-manager/operator/probe_test.go b/internal/tenant-manager/operator/probe_test.go index 74a66a27..d58e1aac 100644 --- a/internal/tenant-manager/operator/probe_test.go +++ b/internal/tenant-manager/operator/probe_test.go @@ -10,12 +10,12 @@ import ( multitenancy "github.com/bartventer/gorm-multitenancy/v8" - "github.com/openkcm/cmk/internal/constants" - "github.com/openkcm/cmk/internal/model" - "github.com/openkcm/cmk/internal/repo/sql" - "github.com/openkcm/cmk/internal/tenant-manager/db" - "github.com/openkcm/cmk/internal/tenant-manager/operator" - "github.com/openkcm/cmk/internal/testutils" + "github.com/openkcm/cmk-core/internal/constants" + "github.com/openkcm/cmk-core/internal/model" + "github.com/openkcm/cmk-core/internal/repo/sql" + "github.com/openkcm/cmk-core/internal/tenant-manager/db" + "github.com/openkcm/cmk-core/internal/tenant-manager/operator" + "github.com/openkcm/cmk-core/internal/testutils" ) const ( diff --git a/internal/testutils/api.go b/internal/testutils/api.go index 69fef098..c4b2f0ef 100644 --- a/internal/testutils/api.go +++ b/internal/testutils/api.go @@ -18,13 +18,13 @@ import ( multitenancy "github.com/bartventer/gorm-multitenancy/v8" md "github.com/oapi-codegen/nethttp-middleware" - "github.com/openkcm/cmk/internal/api/cmkapi" - "github.com/openkcm/cmk/internal/clients" - "github.com/openkcm/cmk/internal/config" - "github.com/openkcm/cmk/internal/controllers/cmk" - "github.com/openkcm/cmk/internal/handlers" - "github.com/openkcm/cmk/internal/middleware" - "github.com/openkcm/cmk/internal/repo/sql" + "github.com/openkcm/cmk-core/internal/api/cmkapi" + "github.com/openkcm/cmk-core/internal/clients" + "github.com/openkcm/cmk-core/internal/config" + "github.com/openkcm/cmk-core/internal/controllers/cmk" + "github.com/openkcm/cmk-core/internal/handlers" + "github.com/openkcm/cmk-core/internal/middleware" + "github.com/openkcm/cmk-core/internal/repo/sql" ) const TestCertURL = "https://aia.pki.co.test.com/aia/TEST%20Cloud%20Root%20CA.crt" diff --git a/internal/testutils/api_test.go b/internal/testutils/api_test.go index 29bf7cdc..6efb0b7b 100644 --- a/internal/testutils/api_test.go +++ b/internal/testutils/api_test.go @@ -8,7 +8,7 @@ import ( multitenancy "github.com/bartventer/gorm-multitenancy/v8" - "github.com/openkcm/cmk/internal/testutils" + "github.com/openkcm/cmk-core/internal/testutils" ) // TestStartAPIServerReturnsServeMux tests if StartAPIServer returns a ServeMux diff --git a/internal/testutils/certificate.go b/internal/testutils/certificate.go index 6702b11f..6e5e7ea2 100644 --- a/internal/testutils/certificate.go +++ b/internal/testutils/certificate.go @@ -13,8 +13,8 @@ import ( "github.com/fullsailor/pkcs7" "github.com/stretchr/testify/assert" - "github.com/openkcm/cmk/internal/manager" - "github.com/openkcm/cmk/utils/crypto" + "github.com/openkcm/cmk-core/internal/manager" + "github.com/openkcm/cmk-core/utils/crypto" ) func CreateCertificateChain( diff --git a/internal/testutils/certificate_test.go b/internal/testutils/certificate_test.go index 801c41ec..fe270fb9 100644 --- a/internal/testutils/certificate_test.go +++ b/internal/testutils/certificate_test.go @@ -5,9 +5,9 @@ import ( "github.com/stretchr/testify/assert" - "github.com/openkcm/cmk/internal/manager" - "github.com/openkcm/cmk/internal/model" - "github.com/openkcm/cmk/internal/testutils" + "github.com/openkcm/cmk-core/internal/manager" + "github.com/openkcm/cmk-core/internal/model" + "github.com/openkcm/cmk-core/internal/testutils" ) func TestCreateTestCertificate(t *testing.T) { diff --git a/internal/testutils/db.go b/internal/testutils/db.go index ec55c8a9..eba0317e 100644 --- a/internal/testutils/db.go +++ b/internal/testutils/db.go @@ -17,10 +17,10 @@ import ( multitenancy "github.com/bartventer/gorm-multitenancy/v8" - "github.com/openkcm/cmk/internal/config" - "github.com/openkcm/cmk/internal/db" - "github.com/openkcm/cmk/internal/model" - "github.com/openkcm/cmk/internal/repo" + "github.com/openkcm/cmk-core/internal/config" + "github.com/openkcm/cmk-core/internal/db" + "github.com/openkcm/cmk-core/internal/model" + "github.com/openkcm/cmk-core/internal/repo" ) const ( diff --git a/internal/testutils/db_error.go b/internal/testutils/db_error.go index b1764331..8bb5c55b 100644 --- a/internal/testutils/db_error.go +++ b/internal/testutils/db_error.go @@ -10,8 +10,8 @@ import ( multitenancy "github.com/bartventer/gorm-multitenancy/v8" - "github.com/openkcm/cmk/internal/errs" - "github.com/openkcm/cmk/internal/model" + "github.com/openkcm/cmk-core/internal/errs" + "github.com/openkcm/cmk-core/internal/model" ) // callbackError - the error callback name. diff --git a/internal/testutils/db_error_test.go b/internal/testutils/db_error_test.go index 91a5890a..d28f19e2 100644 --- a/internal/testutils/db_error_test.go +++ b/internal/testutils/db_error_test.go @@ -6,7 +6,7 @@ import ( "github.com/stretchr/testify/assert" - "github.com/openkcm/cmk/internal/testutils" + "github.com/openkcm/cmk-core/internal/testutils" ) var ErrForced = errors.New("forced error") diff --git a/internal/testutils/db_test.go b/internal/testutils/db_test.go index b462ef93..489a3ac7 100644 --- a/internal/testutils/db_test.go +++ b/internal/testutils/db_test.go @@ -6,8 +6,8 @@ import ( "github.com/bartventer/gorm-multitenancy/v8/pkg/driver" "github.com/stretchr/testify/assert" - "github.com/openkcm/cmk/internal/model" - "github.com/openkcm/cmk/internal/testutils" + "github.com/openkcm/cmk-core/internal/model" + "github.com/openkcm/cmk-core/internal/testutils" ) // TestRelatedModel represents a model for testing preload functionality diff --git a/internal/testutils/grpc.go b/internal/testutils/grpc.go index b6e2621f..2d1aa214 100644 --- a/internal/testutils/grpc.go +++ b/internal/testutils/grpc.go @@ -13,7 +13,7 @@ import ( "github.com/stretchr/testify/assert" "google.golang.org/grpc" - "github.com/openkcm/cmk/internal/clients" + "github.com/openkcm/cmk-core/internal/clients" ) const ( diff --git a/internal/testutils/model.go b/internal/testutils/model.go index fe8ceb31..abc2a3a6 100644 --- a/internal/testutils/model.go +++ b/internal/testutils/model.go @@ -9,12 +9,12 @@ import ( multitenancy "github.com/bartventer/gorm-multitenancy/v8" - "github.com/openkcm/cmk/internal/config" - "github.com/openkcm/cmk/internal/constants" - "github.com/openkcm/cmk/internal/manager" - "github.com/openkcm/cmk/internal/model" - wfMechanism "github.com/openkcm/cmk/internal/workflow" - "github.com/openkcm/cmk/utils/ptr" + "github.com/openkcm/cmk-core/internal/config" + "github.com/openkcm/cmk-core/internal/constants" + "github.com/openkcm/cmk-core/internal/manager" + "github.com/openkcm/cmk-core/internal/model" + wfMechanism "github.com/openkcm/cmk-core/internal/workflow" + "github.com/openkcm/cmk-core/utils/ptr" ) const ( diff --git a/internal/testutils/mutator_test.go b/internal/testutils/mutator_test.go index fc350c21..ed49c05e 100644 --- a/internal/testutils/mutator_test.go +++ b/internal/testutils/mutator_test.go @@ -5,7 +5,7 @@ import ( "github.com/stretchr/testify/assert" - "github.com/openkcm/cmk/internal/testutils" + "github.com/openkcm/cmk-core/internal/testutils" ) type TestStruct struct { diff --git a/internal/testutils/system.go b/internal/testutils/system.go index d79c7daf..8d0b8933 100644 --- a/internal/testutils/system.go +++ b/internal/testutils/system.go @@ -3,7 +3,7 @@ package testutils import ( "github.com/google/uuid" - "github.com/openkcm/cmk/internal/model" + "github.com/openkcm/cmk-core/internal/model" ) // SystemMutator provides a base System for testing diff --git a/internal/testutils/system_test.go b/internal/testutils/system_test.go index 0620db73..7ee127bb 100644 --- a/internal/testutils/system_test.go +++ b/internal/testutils/system_test.go @@ -5,8 +5,8 @@ import ( "github.com/stretchr/testify/assert" - "github.com/openkcm/cmk/internal/model" - "github.com/openkcm/cmk/internal/testutils" + "github.com/openkcm/cmk-core/internal/model" + "github.com/openkcm/cmk-core/internal/testutils" ) func TestCreateTestSystem(t *testing.T) { diff --git a/internal/testutils/testplugins/certificateissuer/main_test.go b/internal/testutils/testplugins/certificateissuer/main_test.go index decec98e..c1bce825 100644 --- a/internal/testutils/testplugins/certificateissuer/main_test.go +++ b/internal/testutils/testplugins/certificateissuer/main_test.go @@ -9,7 +9,7 @@ import ( certificate_issuerv1 "github.com/openkcm/plugin-sdk/proto/plugin/certificate_issuer/v1" configv1 "github.com/openkcm/plugin-sdk/proto/service/common/config/v1" - tp "github.com/openkcm/cmk/internal/testutils/testplugins/certificateissuer" + tp "github.com/openkcm/cmk-core/internal/testutils/testplugins/certificateissuer" ) func TestConfigureReturnsEmptyResponse(t *testing.T) { diff --git a/internal/testutils/testplugins/identitymanagement/main_test.go b/internal/testutils/testplugins/identitymanagement/main_test.go index 249abfb5..10cd1680 100644 --- a/internal/testutils/testplugins/identitymanagement/main_test.go +++ b/internal/testutils/testplugins/identitymanagement/main_test.go @@ -9,7 +9,7 @@ import ( idmangv1 "github.com/openkcm/plugin-sdk/proto/plugin/identity_management/v1" configv1 "github.com/openkcm/plugin-sdk/proto/service/common/config/v1" - tp "github.com/openkcm/cmk/internal/testutils/testplugins/identitymanagement" + tp "github.com/openkcm/cmk-core/internal/testutils/testplugins/identitymanagement" ) func TestConfigureReturnsEmptyResponse(t *testing.T) { diff --git a/internal/testutils/testplugins/keystoreop/main.go b/internal/testutils/testplugins/keystoreop/main.go index 591ca69e..8535e524 100644 --- a/internal/testutils/testplugins/keystoreop/main.go +++ b/internal/testutils/testplugins/keystoreop/main.go @@ -16,7 +16,7 @@ import ( keyopv1 "github.com/openkcm/plugin-sdk/proto/plugin/keystore/operations/v1" configv1 "github.com/openkcm/plugin-sdk/proto/service/common/config/v1" - "github.com/openkcm/cmk/internal/testutils" + "github.com/openkcm/cmk-core/internal/testutils" ) const importParamsValidityHours = 24 diff --git a/internal/testutils/testplugins/keystoreop/main_test.go b/internal/testutils/testplugins/keystoreop/main_test.go index e41a05ee..34ef5737 100644 --- a/internal/testutils/testplugins/keystoreop/main_test.go +++ b/internal/testutils/testplugins/keystoreop/main_test.go @@ -11,8 +11,8 @@ import ( keyopv1 "github.com/openkcm/plugin-sdk/proto/plugin/keystore/operations/v1" - tp "github.com/openkcm/cmk/internal/testutils/testplugins/keystoreop" - "github.com/openkcm/cmk/utils/ptr" + tp "github.com/openkcm/cmk-core/internal/testutils/testplugins/keystoreop" + "github.com/openkcm/cmk-core/utils/ptr" ) func setupTest() *tp.TestPlugin { diff --git a/internal/testutils/testplugins/notification/main_test.go b/internal/testutils/testplugins/notification/main_test.go index 17e38665..4a186a55 100644 --- a/internal/testutils/testplugins/notification/main_test.go +++ b/internal/testutils/testplugins/notification/main_test.go @@ -9,7 +9,7 @@ import ( notificationv1 "github.com/openkcm/plugin-sdk/proto/plugin/notification/v1" configv1 "github.com/openkcm/plugin-sdk/proto/service/common/config/v1" - tp "github.com/openkcm/cmk/internal/testutils/testplugins/notification" + tp "github.com/openkcm/cmk-core/internal/testutils/testplugins/notification" ) func TestConfigureReturnsEmptyResponse(t *testing.T) { diff --git a/internal/testutils/testplugins/systeminformation/main_test.go b/internal/testutils/testplugins/systeminformation/main_test.go index f808ceeb..c1df6ef0 100644 --- a/internal/testutils/testplugins/systeminformation/main_test.go +++ b/internal/testutils/testplugins/systeminformation/main_test.go @@ -9,7 +9,7 @@ import ( systeminformationv1 "github.com/openkcm/plugin-sdk/proto/plugin/systeminformation/v1" configv1 "github.com/openkcm/plugin-sdk/proto/service/common/config/v1" - tp "github.com/openkcm/cmk/internal/testutils/testplugins/systeminformation" + tp "github.com/openkcm/cmk-core/internal/testutils/testplugins/systeminformation" ) func TestConfigureReturnsEmptyResponse(t *testing.T) { diff --git a/internal/workflow/errors.go b/internal/workflow/errors.go index fc43a51f..5663a86e 100644 --- a/internal/workflow/errors.go +++ b/internal/workflow/errors.go @@ -6,7 +6,7 @@ import ( "github.com/google/uuid" - "github.com/openkcm/cmk/internal/errs" + "github.com/openkcm/cmk-core/internal/errs" ) var ( diff --git a/internal/workflow/key_actions.go b/internal/workflow/key_actions.go index 66a08071..1af0e2c8 100644 --- a/internal/workflow/key_actions.go +++ b/internal/workflow/key_actions.go @@ -5,10 +5,10 @@ import ( "github.com/google/uuid" - "github.com/openkcm/cmk/internal/api/cmkapi" - "github.com/openkcm/cmk/internal/errs" - "github.com/openkcm/cmk/internal/model" - "github.com/openkcm/cmk/utils/ptr" + "github.com/openkcm/cmk-core/internal/api/cmkapi" + "github.com/openkcm/cmk-core/internal/errs" + "github.com/openkcm/cmk-core/internal/model" + "github.com/openkcm/cmk-core/utils/ptr" ) type KeyActions interface { diff --git a/internal/workflow/key_actions_test.go b/internal/workflow/key_actions_test.go index 86ce3f66..24a0eb69 100644 --- a/internal/workflow/key_actions_test.go +++ b/internal/workflow/key_actions_test.go @@ -6,12 +6,12 @@ import ( "github.com/google/uuid" "github.com/stretchr/testify/assert" - "github.com/openkcm/cmk/internal/constants" - "github.com/openkcm/cmk/internal/model" - "github.com/openkcm/cmk/internal/repo" - sqlRepo "github.com/openkcm/cmk/internal/repo/sql" - "github.com/openkcm/cmk/internal/testutils" - "github.com/openkcm/cmk/internal/workflow" + "github.com/openkcm/cmk-core/internal/constants" + "github.com/openkcm/cmk-core/internal/model" + "github.com/openkcm/cmk-core/internal/repo" + sqlRepo "github.com/openkcm/cmk-core/internal/repo/sql" + "github.com/openkcm/cmk-core/internal/testutils" + "github.com/openkcm/cmk-core/internal/workflow" ) func TestKeyActionPrimary(t *testing.T) { diff --git a/internal/workflow/key_configuration_actions.go b/internal/workflow/key_configuration_actions.go index 3b850b00..6bc08755 100644 --- a/internal/workflow/key_configuration_actions.go +++ b/internal/workflow/key_configuration_actions.go @@ -5,7 +5,7 @@ import ( "github.com/google/uuid" - "github.com/openkcm/cmk/internal/errs" + "github.com/openkcm/cmk-core/internal/errs" ) type KeyConfigurationActions interface { diff --git a/internal/workflow/key_configuration_actions_test.go b/internal/workflow/key_configuration_actions_test.go index b443052b..49bd2e59 100644 --- a/internal/workflow/key_configuration_actions_test.go +++ b/internal/workflow/key_configuration_actions_test.go @@ -6,11 +6,11 @@ import ( "github.com/google/uuid" "github.com/stretchr/testify/assert" - "github.com/openkcm/cmk/internal/model" - "github.com/openkcm/cmk/internal/repo" - sqlRepo "github.com/openkcm/cmk/internal/repo/sql" - "github.com/openkcm/cmk/internal/testutils" - "github.com/openkcm/cmk/internal/workflow" + "github.com/openkcm/cmk-core/internal/model" + "github.com/openkcm/cmk-core/internal/repo" + sqlRepo "github.com/openkcm/cmk-core/internal/repo/sql" + "github.com/openkcm/cmk-core/internal/testutils" + "github.com/openkcm/cmk-core/internal/workflow" ) var ( diff --git a/internal/workflow/system_actions.go b/internal/workflow/system_actions.go index 1fc87bbc..5e81d8be 100644 --- a/internal/workflow/system_actions.go +++ b/internal/workflow/system_actions.go @@ -5,8 +5,8 @@ import ( "github.com/google/uuid" - "github.com/openkcm/cmk/internal/errs" - "github.com/openkcm/cmk/internal/model" + "github.com/openkcm/cmk-core/internal/errs" + "github.com/openkcm/cmk-core/internal/model" ) type SystemActions interface { diff --git a/internal/workflow/system_actions_test.go b/internal/workflow/system_actions_test.go index 9d6936a6..f76652ed 100644 --- a/internal/workflow/system_actions_test.go +++ b/internal/workflow/system_actions_test.go @@ -6,11 +6,11 @@ import ( "github.com/google/uuid" "github.com/stretchr/testify/assert" - "github.com/openkcm/cmk/internal/model" - "github.com/openkcm/cmk/internal/repo" - sqlRepo "github.com/openkcm/cmk/internal/repo/sql" - "github.com/openkcm/cmk/internal/testutils" - "github.com/openkcm/cmk/internal/workflow" + "github.com/openkcm/cmk-core/internal/model" + "github.com/openkcm/cmk-core/internal/repo" + sqlRepo "github.com/openkcm/cmk-core/internal/repo/sql" + "github.com/openkcm/cmk-core/internal/testutils" + "github.com/openkcm/cmk-core/internal/workflow" ) var ( diff --git a/internal/workflow/workflow.go b/internal/workflow/workflow.go index cfdab042..5f99c03a 100644 --- a/internal/workflow/workflow.go +++ b/internal/workflow/workflow.go @@ -7,11 +7,11 @@ import ( "github.com/google/uuid" "github.com/looplab/fsm" - "github.com/openkcm/cmk/internal/constants" - "github.com/openkcm/cmk/internal/errs" - "github.com/openkcm/cmk/internal/log" - "github.com/openkcm/cmk/internal/model" - "github.com/openkcm/cmk/internal/repo" + "github.com/openkcm/cmk-core/internal/constants" + "github.com/openkcm/cmk-core/internal/errs" + "github.com/openkcm/cmk-core/internal/log" + "github.com/openkcm/cmk-core/internal/model" + "github.com/openkcm/cmk-core/internal/repo" ) var SystemUserID = uuid.MustParse("ffffffff-ffff-ffff-ffff-ffffffffffff") diff --git a/internal/workflow/workflow_test.go b/internal/workflow/workflow_test.go index d77bbb93..20d7c7c8 100644 --- a/internal/workflow/workflow_test.go +++ b/internal/workflow/workflow_test.go @@ -13,17 +13,17 @@ import ( multitenancy "github.com/bartventer/gorm-multitenancy/v8" systemgrpc "github.com/openkcm/api-sdk/proto/kms/api/cmk/registry/system/v1" - "github.com/openkcm/cmk/internal/clients" - "github.com/openkcm/cmk/internal/clients/registry/systems" - "github.com/openkcm/cmk/internal/config" - eventprocessor "github.com/openkcm/cmk/internal/event-processor" - "github.com/openkcm/cmk/internal/grpc/catalog" - "github.com/openkcm/cmk/internal/manager" - "github.com/openkcm/cmk/internal/model" - "github.com/openkcm/cmk/internal/repo" - sqlRepo "github.com/openkcm/cmk/internal/repo/sql" - "github.com/openkcm/cmk/internal/testutils" - "github.com/openkcm/cmk/internal/workflow" + "github.com/openkcm/cmk-core/internal/clients" + "github.com/openkcm/cmk-core/internal/clients/registry/systems" + "github.com/openkcm/cmk-core/internal/config" + eventprocessor "github.com/openkcm/cmk-core/internal/event-processor" + "github.com/openkcm/cmk-core/internal/grpc/catalog" + "github.com/openkcm/cmk-core/internal/manager" + "github.com/openkcm/cmk-core/internal/model" + "github.com/openkcm/cmk-core/internal/repo" + sqlRepo "github.com/openkcm/cmk-core/internal/repo/sql" + "github.com/openkcm/cmk-core/internal/testutils" + "github.com/openkcm/cmk-core/internal/workflow" ) var ( diff --git a/providers/clients/aws/aws_options_test.go b/providers/clients/aws/aws_options_test.go index c853fafa..66bca908 100644 --- a/providers/clients/aws/aws_options_test.go +++ b/providers/clients/aws/aws_options_test.go @@ -7,8 +7,8 @@ import ( "github.com/aws/aws-sdk-go-v2/service/kms" "github.com/stretchr/testify/assert" - "github.com/openkcm/cmk/providers/clients/aws" - "github.com/openkcm/cmk/providers/clients/aws/mock" + "github.com/openkcm/cmk-core/providers/clients/aws" + "github.com/openkcm/cmk-core/providers/clients/aws/mock" ) func TestOptions(t *testing.T) { diff --git a/providers/clients/aws/client.go b/providers/clients/aws/client.go index 9ea60416..6488cd78 100644 --- a/providers/clients/aws/client.go +++ b/providers/clients/aws/client.go @@ -11,10 +11,10 @@ import ( "github.com/aws/aws-sdk-go-v2/service/kms" "github.com/aws/aws-sdk-go-v2/service/kms/types" - "github.com/openkcm/cmk/internal/errs" - "github.com/openkcm/cmk/providers" - "github.com/openkcm/cmk/utils/must" - "github.com/openkcm/cmk/utils/ptr" + "github.com/openkcm/cmk-core/internal/errs" + "github.com/openkcm/cmk-core/providers" + "github.com/openkcm/cmk-core/utils/must" + "github.com/openkcm/cmk-core/utils/ptr" ) // kmsClient defines the methods of the AWS KMS client that we use. diff --git a/providers/clients/aws/client_test.go b/providers/clients/aws/client_test.go index 773f7428..f9fbbf82 100644 --- a/providers/clients/aws/client_test.go +++ b/providers/clients/aws/client_test.go @@ -13,10 +13,10 @@ import ( "github.com/google/uuid" "github.com/stretchr/testify/assert" - "github.com/openkcm/cmk/providers" - "github.com/openkcm/cmk/providers/clients/aws" - "github.com/openkcm/cmk/providers/clients/aws/mock" - "github.com/openkcm/cmk/utils/ptr" + "github.com/openkcm/cmk-core/providers" + "github.com/openkcm/cmk-core/providers/clients/aws" + "github.com/openkcm/cmk-core/providers/clients/aws/mock" + "github.com/openkcm/cmk-core/utils/ptr" ) var ( diff --git a/providers/clients/dummy/transform/key/key.go b/providers/clients/dummy/transform/key/key.go index 5c957563..2e53b913 100644 --- a/providers/clients/dummy/transform/key/key.go +++ b/providers/clients/dummy/transform/key/key.go @@ -1,9 +1,9 @@ package key import ( - "github.com/openkcm/cmk/internal/model" - "github.com/openkcm/cmk/providers" - "github.com/openkcm/cmk/utils/ptr" + "github.com/openkcm/cmk-core/internal/model" + "github.com/openkcm/cmk-core/providers" + "github.com/openkcm/cmk-core/utils/ptr" ) // ToProvider converts a model.Key and array of providers.KeyVersion to a providers.Key. diff --git a/providers/clients/dummy/transform/keyversion/keyversion.go b/providers/clients/dummy/transform/keyversion/keyversion.go index fe57f8f8..563abc29 100644 --- a/providers/clients/dummy/transform/keyversion/keyversion.go +++ b/providers/clients/dummy/transform/keyversion/keyversion.go @@ -3,9 +3,9 @@ package keyversion import ( "time" - "github.com/openkcm/cmk/internal/model" - "github.com/openkcm/cmk/providers" - "github.com/openkcm/cmk/utils/ptr" + "github.com/openkcm/cmk-core/internal/model" + "github.com/openkcm/cmk-core/providers" + "github.com/openkcm/cmk-core/utils/ptr" ) // FromProvider converts a providers.KeyVersion and model.Key to a model.KeyVersion. diff --git a/providers/mock/client_mock.go b/providers/mock/client_mock.go index 0ca1d993..00fd21c9 100644 --- a/providers/mock/client_mock.go +++ b/providers/mock/client_mock.go @@ -3,7 +3,7 @@ package mock import ( "context" - "github.com/openkcm/cmk/providers" + "github.com/openkcm/cmk-core/providers" ) // Type definitions for the functions used in Client diff --git a/providers/provider.go b/providers/provider.go index 8f2b548e..faab433f 100644 --- a/providers/provider.go +++ b/providers/provider.go @@ -7,10 +7,10 @@ import ( "log/slog" "time" - "github.com/openkcm/cmk/internal/errs" - "github.com/openkcm/cmk/internal/log" - "github.com/openkcm/cmk/utils/ptr" - "github.com/openkcm/cmk/utils/slice" + "github.com/openkcm/cmk-core/internal/errs" + "github.com/openkcm/cmk-core/internal/log" + "github.com/openkcm/cmk-core/utils/ptr" + "github.com/openkcm/cmk-core/utils/slice" ) // Errs defines the errors that can be returned by the provider diff --git a/providers/provider_test.go b/providers/provider_test.go index eface6c0..e51ab583 100644 --- a/providers/provider_test.go +++ b/providers/provider_test.go @@ -9,10 +9,10 @@ import ( "github.com/google/uuid" "github.com/stretchr/testify/assert" - "github.com/openkcm/cmk/providers" - "github.com/openkcm/cmk/providers/mock" - "github.com/openkcm/cmk/utils/ptr" - "github.com/openkcm/cmk/utils/slice" + "github.com/openkcm/cmk-core/providers" + "github.com/openkcm/cmk-core/providers/mock" + "github.com/openkcm/cmk-core/utils/ptr" + "github.com/openkcm/cmk-core/utils/slice" ) var ( diff --git a/test/async_test/certrotation_test.go b/test/async_test/certrotation_test.go index a00e6d91..1d7d7eff 100644 --- a/test/async_test/certrotation_test.go +++ b/test/async_test/certrotation_test.go @@ -8,13 +8,13 @@ import ( "github.com/bartventer/gorm-multitenancy/v8/pkg/driver" "github.com/stretchr/testify/assert" - "github.com/openkcm/cmk/internal/async" - "github.com/openkcm/cmk/internal/config" - "github.com/openkcm/cmk/internal/model" - "github.com/openkcm/cmk/internal/repo" - "github.com/openkcm/cmk/internal/repo/sql" - "github.com/openkcm/cmk/internal/testutils" - integrationutils "github.com/openkcm/cmk/test/integration_utils" + "github.com/openkcm/cmk-core/internal/async" + "github.com/openkcm/cmk-core/internal/config" + "github.com/openkcm/cmk-core/internal/model" + "github.com/openkcm/cmk-core/internal/repo" + "github.com/openkcm/cmk-core/internal/repo/sql" + "github.com/openkcm/cmk-core/internal/testutils" + integrationutils "github.com/openkcm/cmk-core/test/integration_utils" ) func TestCertRotation(t *testing.T) { diff --git a/test/async_test/common_test.go b/test/async_test/common_test.go index 7e1e80f3..ef95e16e 100644 --- a/test/async_test/common_test.go +++ b/test/async_test/common_test.go @@ -16,18 +16,18 @@ import ( multitenancy "github.com/bartventer/gorm-multitenancy/v8" plugincatalog "github.com/openkcm/plugin-sdk/pkg/catalog" - "github.com/openkcm/cmk/internal/async" - "github.com/openkcm/cmk/internal/config" - "github.com/openkcm/cmk/internal/constants" - eventprocessor "github.com/openkcm/cmk/internal/event-processor" - "github.com/openkcm/cmk/internal/grpc/catalog" - "github.com/openkcm/cmk/internal/manager" - "github.com/openkcm/cmk/internal/model" - "github.com/openkcm/cmk/internal/repo" - "github.com/openkcm/cmk/internal/repo/sql" - "github.com/openkcm/cmk/internal/testutils" - integrationutils "github.com/openkcm/cmk/test/integration_utils" - "github.com/openkcm/cmk/utils/crypto" + "github.com/openkcm/cmk-core/internal/async" + "github.com/openkcm/cmk-core/internal/config" + "github.com/openkcm/cmk-core/internal/constants" + eventprocessor "github.com/openkcm/cmk-core/internal/event-processor" + "github.com/openkcm/cmk-core/internal/grpc/catalog" + "github.com/openkcm/cmk-core/internal/manager" + "github.com/openkcm/cmk-core/internal/model" + "github.com/openkcm/cmk-core/internal/repo" + "github.com/openkcm/cmk-core/internal/repo/sql" + "github.com/openkcm/cmk-core/internal/testutils" + integrationutils "github.com/openkcm/cmk-core/test/integration_utils" + "github.com/openkcm/cmk-core/utils/crypto" ) // There is no PKI mock, so credentials for this must be added below diff --git a/test/async_test/hyoksync_test.go b/test/async_test/hyoksync_test.go index 7051c220..be84db6a 100644 --- a/test/async_test/hyoksync_test.go +++ b/test/async_test/hyoksync_test.go @@ -8,14 +8,14 @@ import ( "github.com/bartventer/gorm-multitenancy/v8/pkg/driver" "github.com/stretchr/testify/assert" - "github.com/openkcm/cmk/internal/async" - "github.com/openkcm/cmk/internal/config" - "github.com/openkcm/cmk/internal/log" - "github.com/openkcm/cmk/internal/model" - "github.com/openkcm/cmk/internal/repo" - "github.com/openkcm/cmk/internal/repo/sql" - "github.com/openkcm/cmk/internal/testutils" - integrationutils "github.com/openkcm/cmk/test/integration_utils" + "github.com/openkcm/cmk-core/internal/async" + "github.com/openkcm/cmk-core/internal/config" + "github.com/openkcm/cmk-core/internal/log" + "github.com/openkcm/cmk-core/internal/model" + "github.com/openkcm/cmk-core/internal/repo" + "github.com/openkcm/cmk-core/internal/repo/sql" + "github.com/openkcm/cmk-core/internal/testutils" + integrationutils "github.com/openkcm/cmk-core/test/integration_utils" ) func TestSchedulerHYOKSync(t *testing.T) { diff --git a/test/async_test/keystorepool_test.go b/test/async_test/keystorepool_test.go index eb133bb9..25cde9cf 100644 --- a/test/async_test/keystorepool_test.go +++ b/test/async_test/keystorepool_test.go @@ -8,13 +8,13 @@ import ( "github.com/bartventer/gorm-multitenancy/v8/pkg/driver" "github.com/stretchr/testify/assert" - "github.com/openkcm/cmk/internal/async" - "github.com/openkcm/cmk/internal/config" - "github.com/openkcm/cmk/internal/model" - "github.com/openkcm/cmk/internal/repo" - "github.com/openkcm/cmk/internal/repo/sql" - "github.com/openkcm/cmk/internal/testutils" - integrationutils "github.com/openkcm/cmk/test/integration_utils" + "github.com/openkcm/cmk-core/internal/async" + "github.com/openkcm/cmk-core/internal/config" + "github.com/openkcm/cmk-core/internal/model" + "github.com/openkcm/cmk-core/internal/repo" + "github.com/openkcm/cmk-core/internal/repo/sql" + "github.com/openkcm/cmk-core/internal/testutils" + integrationutils "github.com/openkcm/cmk-core/test/integration_utils" ) func TestKeystorePoolFilling(t *testing.T) { diff --git a/test/async_test/systeminformation_test.go b/test/async_test/systeminformation_test.go index 3c13794b..b28c59c6 100644 --- a/test/async_test/systeminformation_test.go +++ b/test/async_test/systeminformation_test.go @@ -8,13 +8,13 @@ import ( "github.com/bartventer/gorm-multitenancy/v8/pkg/driver" "github.com/stretchr/testify/assert" - "github.com/openkcm/cmk/internal/async" - "github.com/openkcm/cmk/internal/config" - "github.com/openkcm/cmk/internal/model" - "github.com/openkcm/cmk/internal/repo" - "github.com/openkcm/cmk/internal/repo/sql" - "github.com/openkcm/cmk/internal/testutils" - integrationutils "github.com/openkcm/cmk/test/integration_utils" + "github.com/openkcm/cmk-core/internal/async" + "github.com/openkcm/cmk-core/internal/config" + "github.com/openkcm/cmk-core/internal/model" + "github.com/openkcm/cmk-core/internal/repo" + "github.com/openkcm/cmk-core/internal/repo/sql" + "github.com/openkcm/cmk-core/internal/testutils" + integrationutils "github.com/openkcm/cmk-core/test/integration_utils" ) var ( diff --git a/test/aws_tests/kms_provider_aws_test.go b/test/aws_tests/kms_provider_aws_test.go index 0710d51b..cbe39b94 100644 --- a/test/aws_tests/kms_provider_aws_test.go +++ b/test/aws_tests/kms_provider_aws_test.go @@ -14,9 +14,9 @@ import ( "github.com/google/uuid" "github.com/stretchr/testify/assert" - "github.com/openkcm/cmk/providers" - "github.com/openkcm/cmk/providers/clients/aws" - "github.com/openkcm/cmk/utils/ptr" + "github.com/openkcm/cmk-core/providers" + "github.com/openkcm/cmk-core/providers/clients/aws" + "github.com/openkcm/cmk-core/utils/ptr" ) const ( diff --git a/test/event-processor/reconciliation_test.go b/test/event-processor/reconciliation_test.go index c2fc3237..9251a1a3 100644 --- a/test/event-processor/reconciliation_test.go +++ b/test/event-processor/reconciliation_test.go @@ -21,19 +21,19 @@ import ( multitenancy "github.com/bartventer/gorm-multitenancy/v8" - "github.com/openkcm/cmk/internal/api/cmkapi" - "github.com/openkcm/cmk/internal/config" - eventprocessor "github.com/openkcm/cmk/internal/event-processor" - eventProto "github.com/openkcm/cmk/internal/event-processor/proto" - "github.com/openkcm/cmk/internal/grpc/catalog" - "github.com/openkcm/cmk/internal/manager" - "github.com/openkcm/cmk/internal/model" - "github.com/openkcm/cmk/internal/repo" - sqlPkg "github.com/openkcm/cmk/internal/repo/sql" - "github.com/openkcm/cmk/internal/testutils" - integrationutils "github.com/openkcm/cmk/test/integration_utils" - cmkcontext "github.com/openkcm/cmk/utils/context" - "github.com/openkcm/cmk/utils/ptr" + "github.com/openkcm/cmk-core/internal/api/cmkapi" + "github.com/openkcm/cmk-core/internal/config" + eventprocessor "github.com/openkcm/cmk-core/internal/event-processor" + eventProto "github.com/openkcm/cmk-core/internal/event-processor/proto" + "github.com/openkcm/cmk-core/internal/grpc/catalog" + "github.com/openkcm/cmk-core/internal/manager" + "github.com/openkcm/cmk-core/internal/model" + "github.com/openkcm/cmk-core/internal/repo" + sqlPkg "github.com/openkcm/cmk-core/internal/repo/sql" + "github.com/openkcm/cmk-core/internal/testutils" + integrationutils "github.com/openkcm/cmk-core/test/integration_utils" + cmkcontext "github.com/openkcm/cmk-core/utils/context" + "github.com/openkcm/cmk-core/utils/ptr" ) type TestSuite struct { diff --git a/test/identity_management/identity_management_test.go b/test/identity_management/identity_management_test.go index 7c0db4e6..140ab68e 100644 --- a/test/identity_management/identity_management_test.go +++ b/test/identity_management/identity_management_test.go @@ -11,8 +11,8 @@ import ( plugincatalog "github.com/openkcm/plugin-sdk/pkg/catalog" idmangv1 "github.com/openkcm/plugin-sdk/proto/plugin/identity_management/v1" - "github.com/openkcm/cmk/internal/config" - "github.com/openkcm/cmk/internal/grpc/catalog" + "github.com/openkcm/cmk-core/internal/config" + "github.com/openkcm/cmk-core/internal/grpc/catalog" ) var ( diff --git a/test/integration_utils/db.go b/test/integration_utils/db.go index 0312a88e..db2404fc 100644 --- a/test/integration_utils/db.go +++ b/test/integration_utils/db.go @@ -3,7 +3,7 @@ package integrationutils import ( "github.com/openkcm/common-sdk/pkg/commoncfg" - "github.com/openkcm/cmk/internal/config" + "github.com/openkcm/cmk-core/internal/config" ) var DB = config.Database{ diff --git a/test/integration_utils/plugin_test.go b/test/integration_utils/plugin_test.go index 3257a4bf..09a667c3 100644 --- a/test/integration_utils/plugin_test.go +++ b/test/integration_utils/plugin_test.go @@ -5,7 +5,7 @@ import ( "github.com/stretchr/testify/assert" - integrationutils "github.com/openkcm/cmk/test/integration_utils" + integrationutils "github.com/openkcm/cmk-core/test/integration_utils" ) func TestPlugins(t *testing.T) { diff --git a/test/integration_utils/tenant_assertions.go b/test/integration_utils/tenant_assertions.go index 761db1df..e5d3f0d2 100644 --- a/test/integration_utils/tenant_assertions.go +++ b/test/integration_utils/tenant_assertions.go @@ -10,11 +10,11 @@ import ( multitenancy "github.com/bartventer/gorm-multitenancy/v8" - "github.com/openkcm/cmk/internal/constants" - "github.com/openkcm/cmk/internal/model" - "github.com/openkcm/cmk/internal/repo" - "github.com/openkcm/cmk/internal/repo/sql" - cmkcontext "github.com/openkcm/cmk/utils/context" + "github.com/openkcm/cmk-core/internal/constants" + "github.com/openkcm/cmk-core/internal/model" + "github.com/openkcm/cmk-core/internal/repo" + "github.com/openkcm/cmk-core/internal/repo/sql" + cmkcontext "github.com/openkcm/cmk-core/utils/context" ) type TableInfo struct { diff --git a/test/local_aws_tests/kms_provider_local_test.go b/test/local_aws_tests/kms_provider_local_test.go index 94093fe8..a83c423b 100644 --- a/test/local_aws_tests/kms_provider_local_test.go +++ b/test/local_aws_tests/kms_provider_local_test.go @@ -9,9 +9,9 @@ import ( "github.com/google/uuid" "github.com/stretchr/testify/assert" - "github.com/openkcm/cmk/providers" - "github.com/openkcm/cmk/providers/clients/aws" - "github.com/openkcm/cmk/utils/ptr" + "github.com/openkcm/cmk-core/providers" + "github.com/openkcm/cmk-core/providers/clients/aws" + "github.com/openkcm/cmk-core/utils/ptr" ) // Local KMS variables diff --git a/test/notification/notification_test.go b/test/notification/notification_test.go index 49954af0..6a506c0b 100644 --- a/test/notification/notification_test.go +++ b/test/notification/notification_test.go @@ -9,10 +9,10 @@ import ( plugincatalog "github.com/openkcm/plugin-sdk/pkg/catalog" - "github.com/openkcm/cmk/internal/config" - "github.com/openkcm/cmk/internal/grpc/catalog" - "github.com/openkcm/cmk/internal/manager" - integrationutils "github.com/openkcm/cmk/test/integration_utils" + "github.com/openkcm/cmk-core/internal/config" + "github.com/openkcm/cmk-core/internal/grpc/catalog" + "github.com/openkcm/cmk-core/internal/manager" + integrationutils "github.com/openkcm/cmk-core/test/integration_utils" ) var ansPath string diff --git a/test/psqlreplicatests/psqlreplica_test.go b/test/psqlreplicatests/psqlreplica_test.go index 55060c6d..1ee1d4e3 100644 --- a/test/psqlreplicatests/psqlreplica_test.go +++ b/test/psqlreplicatests/psqlreplica_test.go @@ -7,13 +7,13 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/openkcm/cmk/internal/config" - "github.com/openkcm/cmk/internal/db" - "github.com/openkcm/cmk/internal/model" - "github.com/openkcm/cmk/internal/repo" - "github.com/openkcm/cmk/internal/repo/sql" - "github.com/openkcm/cmk/internal/testutils" - integrationutils "github.com/openkcm/cmk/test/integration_utils" + "github.com/openkcm/cmk-core/internal/config" + "github.com/openkcm/cmk-core/internal/db" + "github.com/openkcm/cmk-core/internal/model" + "github.com/openkcm/cmk-core/internal/repo" + "github.com/openkcm/cmk-core/internal/repo/sql" + "github.com/openkcm/cmk-core/internal/testutils" + integrationutils "github.com/openkcm/cmk-core/test/integration_utils" ) func TestConnectToPsqlWithReplica(t *testing.T) { diff --git a/test/registry_service/helpers_test.go b/test/registry_service/helpers_test.go index b640058b..fa9a9516 100644 --- a/test/registry_service/helpers_test.go +++ b/test/registry_service/helpers_test.go @@ -11,7 +11,7 @@ import ( tenantgrpc "github.com/openkcm/api-sdk/proto/kms/api/cmk/registry/tenant/v1" regionpb "github.com/openkcm/api-sdk/proto/kms/api/cmk/types/v1" - "github.com/openkcm/cmk/internal/errs" + "github.com/openkcm/cmk-core/internal/errs" ) var ErrUnknownClient = errors.New("client is unknown") diff --git a/test/registry_service/systems_test.go b/test/registry_service/systems_test.go index a515fe61..dbdbf426 100644 --- a/test/registry_service/systems_test.go +++ b/test/registry_service/systems_test.go @@ -13,8 +13,8 @@ import ( systemgrpc "github.com/openkcm/api-sdk/proto/kms/api/cmk/registry/system/v1" - "github.com/openkcm/cmk/internal/clients/registry/systems" - "github.com/openkcm/cmk/internal/testutils" + "github.com/openkcm/cmk-core/internal/clients/registry/systems" + "github.com/openkcm/cmk-core/internal/testutils" ) const ( diff --git a/test/systeminformation_tests/systeminformation_test.go b/test/systeminformation_tests/systeminformation_test.go index 909dec07..7fb4ff59 100644 --- a/test/systeminformation_tests/systeminformation_test.go +++ b/test/systeminformation_tests/systeminformation_test.go @@ -11,14 +11,14 @@ import ( plugincatalog "github.com/openkcm/plugin-sdk/pkg/catalog" - "github.com/openkcm/cmk/internal/config" - "github.com/openkcm/cmk/internal/grpc/catalog" - "github.com/openkcm/cmk/internal/manager" - "github.com/openkcm/cmk/internal/model" - "github.com/openkcm/cmk/internal/repo" - "github.com/openkcm/cmk/internal/repo/sql" - "github.com/openkcm/cmk/internal/testutils" - integrationutils "github.com/openkcm/cmk/test/integration_utils" + "github.com/openkcm/cmk-core/internal/config" + "github.com/openkcm/cmk-core/internal/grpc/catalog" + "github.com/openkcm/cmk-core/internal/manager" + "github.com/openkcm/cmk-core/internal/model" + "github.com/openkcm/cmk-core/internal/repo" + "github.com/openkcm/cmk-core/internal/repo/sql" + "github.com/openkcm/cmk-core/internal/testutils" + integrationutils "github.com/openkcm/cmk-core/test/integration_utils" ) const ( diff --git a/test/tenant-manager/tenant_provisioning_test.go b/test/tenant-manager/tenant_provisioning_test.go index 1946f810..1231173b 100644 --- a/test/tenant-manager/tenant_provisioning_test.go +++ b/test/tenant-manager/tenant_provisioning_test.go @@ -13,14 +13,14 @@ import ( multitenancy "github.com/bartventer/gorm-multitenancy/v8" tenantgrpc "github.com/openkcm/api-sdk/proto/kms/api/cmk/registry/tenant/v1" - "github.com/openkcm/cmk/internal/clients" - "github.com/openkcm/cmk/internal/config" - "github.com/openkcm/cmk/internal/constants" - "github.com/openkcm/cmk/internal/model" - "github.com/openkcm/cmk/internal/repo/sql" - "github.com/openkcm/cmk/internal/testutils" - integrationutils "github.com/openkcm/cmk/test/integration_utils" - "github.com/openkcm/cmk/utils/base62" + "github.com/openkcm/cmk-core/internal/clients" + "github.com/openkcm/cmk-core/internal/config" + "github.com/openkcm/cmk-core/internal/constants" + "github.com/openkcm/cmk-core/internal/model" + "github.com/openkcm/cmk-core/internal/repo/sql" + "github.com/openkcm/cmk-core/internal/testutils" + integrationutils "github.com/openkcm/cmk-core/test/integration_utils" + "github.com/openkcm/cmk-core/utils/base62" ) func TestRegistryTenantManagerIntegration(t *testing.T) { diff --git a/utils/base62/base62.go b/utils/base62/base62.go index 717f91c7..ea0bbe09 100644 --- a/utils/base62/base62.go +++ b/utils/base62/base62.go @@ -6,7 +6,7 @@ import ( "github.com/jxskiss/base62" - "github.com/openkcm/cmk/internal/errs" + "github.com/openkcm/cmk-core/internal/errs" ) const ( diff --git a/utils/base62/base62_test.go b/utils/base62/base62_test.go index 9c376297..392843a6 100644 --- a/utils/base62/base62_test.go +++ b/utils/base62/base62_test.go @@ -8,7 +8,7 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/openkcm/cmk/utils/base62" + "github.com/openkcm/cmk-core/utils/base62" ) func TestSchemaName(t *testing.T) { diff --git a/utils/bool/bool_test.go b/utils/bool/bool_test.go index c7bcf382..86fbb4db 100644 --- a/utils/bool/bool_test.go +++ b/utils/bool/bool_test.go @@ -5,7 +5,7 @@ import ( "github.com/stretchr/testify/require" - boolutil "github.com/openkcm/cmk/utils/bool" + boolutil "github.com/openkcm/cmk-core/utils/bool" ) func TestAnyTrue(t *testing.T) { diff --git a/utils/cert/cert.go b/utils/cert/cert.go index a0d23275..07e67f9c 100644 --- a/utils/cert/cert.go +++ b/utils/cert/cert.go @@ -21,7 +21,7 @@ import ( "os" "time" - "github.com/openkcm/cmk/internal/errs" + "github.com/openkcm/cmk-core/internal/errs" ) // Error definitions for various failure scenarios in certificate and key generation. diff --git a/utils/cert/cert_test.go b/utils/cert/cert_test.go index 33b16d35..7a174832 100644 --- a/utils/cert/cert_test.go +++ b/utils/cert/cert_test.go @@ -10,8 +10,8 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/openkcm/cmk/utils/cert" - "github.com/openkcm/cmk/utils/cert/mock" + "github.com/openkcm/cmk-core/utils/cert" + "github.com/openkcm/cmk-core/utils/cert/mock" ) var ( diff --git a/utils/cert/mock/pemencoder.go b/utils/cert/mock/pemencoder.go index cf52194e..2744ef00 100644 --- a/utils/cert/mock/pemencoder.go +++ b/utils/cert/mock/pemencoder.go @@ -4,7 +4,7 @@ import ( "encoding/pem" "io" - "github.com/openkcm/cmk/internal/errs" + "github.com/openkcm/cmk-core/internal/errs" ) // PEMEncoder is a mock implementation of the PEMEncoder interface. diff --git a/utils/context/context.go b/utils/context/context.go index 54d85fd9..06f9c68d 100644 --- a/utils/context/context.go +++ b/utils/context/context.go @@ -7,7 +7,7 @@ import ( "github.com/bartventer/gorm-multitenancy/middleware/nethttp/v8" "github.com/google/uuid" - "github.com/openkcm/cmk/internal/errs" + "github.com/openkcm/cmk-core/internal/errs" ) var ( diff --git a/utils/context/context_test.go b/utils/context/context_test.go index 95de57c2..70586e78 100644 --- a/utils/context/context_test.go +++ b/utils/context/context_test.go @@ -7,8 +7,8 @@ import ( "github.com/stretchr/testify/assert" - "github.com/openkcm/cmk/internal/testutils" - cmkcontext "github.com/openkcm/cmk/utils/context" + "github.com/openkcm/cmk-core/internal/testutils" + cmkcontext "github.com/openkcm/cmk-core/utils/context" ) func TestExtractTenantID(t *testing.T) { diff --git a/utils/crypto/crypto.go b/utils/crypto/crypto.go index 77ecc93b..0abb36ee 100644 --- a/utils/crypto/crypto.go +++ b/utils/crypto/crypto.go @@ -11,7 +11,7 @@ import ( "encoding/pem" "errors" - "github.com/openkcm/cmk/internal/errs" + "github.com/openkcm/cmk-core/internal/errs" ) const ( diff --git a/utils/crypto/crypto_test.go b/utils/crypto/crypto_test.go index f46ab716..c7e2e1da 100644 --- a/utils/crypto/crypto_test.go +++ b/utils/crypto/crypto_test.go @@ -17,7 +17,7 @@ import ( "github.com/stretchr/testify/assert" - cryptoUtils "github.com/openkcm/cmk/utils/crypto" + cryptoUtils "github.com/openkcm/cmk-core/utils/crypto" ) var ( diff --git a/utils/must/must_test.go b/utils/must/must_test.go index c15ad28e..bcd9f1d9 100644 --- a/utils/must/must_test.go +++ b/utils/must/must_test.go @@ -6,7 +6,7 @@ import ( "github.com/stretchr/testify/assert" - "github.com/openkcm/cmk/utils/must" + "github.com/openkcm/cmk-core/utils/must" ) var ( diff --git a/utils/oauth2/oauth2_test.go b/utils/oauth2/oauth2_test.go index 90516237..bb59a897 100644 --- a/utils/oauth2/oauth2_test.go +++ b/utils/oauth2/oauth2_test.go @@ -6,9 +6,9 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/openkcm/cmk/utils/cert" - "github.com/openkcm/cmk/utils/oauth2" - "github.com/openkcm/cmk/utils/tlsconfig" + "github.com/openkcm/cmk-core/utils/cert" + "github.com/openkcm/cmk-core/utils/oauth2" + "github.com/openkcm/cmk-core/utils/tlsconfig" ) func TestNewClient(t *testing.T) { diff --git a/utils/oauth2/token_injector.go b/utils/oauth2/token_injector.go index 657e9093..661141fe 100644 --- a/utils/oauth2/token_injector.go +++ b/utils/oauth2/token_injector.go @@ -8,7 +8,7 @@ import ( "golang.org/x/oauth2" "golang.org/x/oauth2/clientcredentials" - "github.com/openkcm/cmk/internal/errs" + "github.com/openkcm/cmk-core/internal/errs" ) var ( diff --git a/utils/oauth2/token_injector_test.go b/utils/oauth2/token_injector_test.go index 2079053a..82cc96c0 100644 --- a/utils/oauth2/token_injector_test.go +++ b/utils/oauth2/token_injector_test.go @@ -13,7 +13,7 @@ import ( "golang.org/x/oauth2" "golang.org/x/oauth2/clientcredentials" - oauth2injector "github.com/openkcm/cmk/utils/oauth2" + oauth2injector "github.com/openkcm/cmk-core/utils/oauth2" ) var ErrForced = errors.New("forced error") diff --git a/utils/odata/odata_test.go b/utils/odata/odata_test.go index 5b58f2d8..f5b9e059 100644 --- a/utils/odata/odata_test.go +++ b/utils/odata/odata_test.go @@ -5,7 +5,7 @@ import ( "github.com/stretchr/testify/assert" - "github.com/openkcm/cmk/utils/odata" + "github.com/openkcm/cmk-core/utils/odata" ) // TestQuery tests the Query struct diff --git a/utils/protobuf/protobuf_test.go b/utils/protobuf/protobuf_test.go index 698a4b46..9d01d0e7 100644 --- a/utils/protobuf/protobuf_test.go +++ b/utils/protobuf/protobuf_test.go @@ -6,7 +6,7 @@ import ( "github.com/stretchr/testify/assert" "google.golang.org/protobuf/types/known/structpb" - "github.com/openkcm/cmk/utils/protobuf" + "github.com/openkcm/cmk-core/utils/protobuf" ) func TestStructToProtobuf(t *testing.T) { diff --git a/utils/ptr/ptr_test.go b/utils/ptr/ptr_test.go index 4ccc0136..3edfb05b 100644 --- a/utils/ptr/ptr_test.go +++ b/utils/ptr/ptr_test.go @@ -8,7 +8,7 @@ import ( "github.com/google/uuid" "github.com/stretchr/testify/assert" - "github.com/openkcm/cmk/utils/ptr" + "github.com/openkcm/cmk-core/utils/ptr" ) func TestPanicIfDifferent(t *testing.T) { diff --git a/utils/slice/slice_test.go b/utils/slice/slice_test.go index 7a82437a..9f9d7540 100644 --- a/utils/slice/slice_test.go +++ b/utils/slice/slice_test.go @@ -5,7 +5,7 @@ import ( "github.com/stretchr/testify/assert" - "github.com/openkcm/cmk/utils/slice" + "github.com/openkcm/cmk-core/utils/slice" ) func TestContains(t *testing.T) { diff --git a/utils/structreader/structreader_test.go b/utils/structreader/structreader_test.go index cb64bd18..70bd98f7 100644 --- a/utils/structreader/structreader_test.go +++ b/utils/structreader/structreader_test.go @@ -6,7 +6,7 @@ import ( "github.com/stretchr/testify/assert" "google.golang.org/protobuf/types/known/structpb" - "github.com/openkcm/cmk/utils/structreader" + "github.com/openkcm/cmk-core/utils/structreader" ) func TestNewConfigReader(t *testing.T) { diff --git a/utils/tlsconfig/tlsconfig_test.go b/utils/tlsconfig/tlsconfig_test.go index c5d2a91e..6aaf68ad 100644 --- a/utils/tlsconfig/tlsconfig_test.go +++ b/utils/tlsconfig/tlsconfig_test.go @@ -8,8 +8,8 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/openkcm/cmk/utils/cert" - "github.com/openkcm/cmk/utils/tlsconfig" + "github.com/openkcm/cmk-core/utils/cert" + "github.com/openkcm/cmk-core/utils/tlsconfig" ) func TestCustomCertPool(t *testing.T) { diff --git a/utils/validator/validator.go b/utils/validator/validator.go index bcab8e43..0b3ae014 100644 --- a/utils/validator/validator.go +++ b/utils/validator/validator.go @@ -5,7 +5,7 @@ import ( "github.com/google/uuid" - "github.com/openkcm/cmk/internal/errs" + "github.com/openkcm/cmk-core/internal/errs" ) var ( diff --git a/utils/validator/validator_test.go b/utils/validator/validator_test.go index 5fe21c6c..8efb00ee 100644 --- a/utils/validator/validator_test.go +++ b/utils/validator/validator_test.go @@ -3,7 +3,7 @@ package validator_test import ( "testing" - "github.com/openkcm/cmk/utils/validator" + "github.com/openkcm/cmk-core/utils/validator" ) func TestValidateUUID(t *testing.T) { From 38d3105fd22cc99d0a00e0c8ad84a8b0ff6e23be Mon Sep 17 00:00:00 2001 From: Nicolae Nicora Date: Fri, 24 Oct 2025 19:18:10 +0200 Subject: [PATCH 13/14] Revert "fix: renaming of repo name" This reverts commit 8e189abd86b27239830247ecae018b24f98353b7. --- .golangci.yaml | 2 +- .release/release-metadata.hcl | 2 +- CHANGELOG.md | 6 ++-- README.md | 8 +++--- REUSE.toml | 2 +- Taskfile.yaml | 2 +- benchmark/system_model_test.go | 10 +++---- benchmark/total_lazyload_test.go | 10 +++---- cmd/core/apiserver/command.go | 16 +++++------ cmd/core/apiserver/command_test.go | 4 +-- cmd/core/main.go | 6 ++-- cmd/core/taskscheduler/command.go | 8 +++--- cmd/core/taskworker/command.go | 8 +++--- cmd/tenant-manager-cli/command.go | 2 +- cmd/tenant-manager/command.go | 8 +++--- go.mod | 2 +- .../clientcertificates/clientcertificates.go | 10 +++---- .../clientcertificates_test.go | 10 +++---- internal/api/transform/group/group.go | 8 +++--- internal/api/transform/group/group_test.go | 8 +++--- .../transform/importparams/importparams.go | 4 +-- .../importparams/importparams_test.go | 6 ++-- internal/api/transform/key/hyokkey/hyokkey.go | 12 ++++---- .../api/transform/key/hyokkey/hyokkey_test.go | 10 +++---- internal/api/transform/key/key.go | 22 +++++++-------- internal/api/transform/key/key_test.go | 20 ++++++------- internal/api/transform/key/sysmr/mrkey.go | 12 ++++---- .../api/transform/key/sysmr/mrkey_test.go | 10 +++---- .../transform/key/transformer/transformer.go | 8 +++--- .../key/transformer/transformer_test.go | 12 ++++---- .../keyconfiguration/keyconfiguration.go | 14 +++++----- .../keyconfiguration/keyconfiguration_test.go | 14 +++++----- .../api/transform/keyversion/keyversion.go | 8 +++--- .../transform/keyversion/keyversion_test.go | 12 ++++---- internal/api/transform/label/key_label.go | 12 ++++---- .../api/transform/label/key_label_test.go | 14 +++++----- internal/api/transform/list_test.go | 4 +-- internal/api/transform/system/system.go | 6 ++-- internal/api/transform/system/system_test.go | 10 +++---- internal/api/transform/tags/tags.go | 6 ++-- internal/api/transform/tags/tags_test.go | 8 +++--- internal/api/transform/tenant/tenant.go | 4 +-- .../api/transform/tenantconfigs/keystore.go | 4 +-- .../transform/tenantconfigs/keystore_test.go | 10 +++---- internal/api/transform/workflow/workflow.go | 8 +++--- .../api/transform/workflow/workflow_test.go | 10 +++---- internal/api/write/write.go | 6 ++-- internal/api/write/write_test.go | 8 +++--- internal/apierrors/base.go | 2 +- internal/apierrors/base_test.go | 4 +-- internal/apierrors/default.go | 4 +-- internal/apierrors/export_test.go | 2 +- internal/apierrors/groups.go | 6 ++-- internal/apierrors/key.go | 12 ++++---- internal/apierrors/keyconfiguration.go | 6 ++-- internal/apierrors/keyversion.go | 4 +-- internal/apierrors/labels.go | 4 +-- internal/apierrors/mapping.go | 6 ++-- internal/apierrors/mapping_test.go | 12 ++++---- internal/apierrors/priority.go | 4 +-- internal/apierrors/system.go | 8 +++--- internal/apierrors/tags.go | 2 +- internal/apierrors/tenant.go | 2 +- internal/apierrors/tenantconfigs.go | 2 +- internal/apierrors/workflow.go | 8 +++--- internal/async/async.go | 18 ++++++------ internal/async/async_test.go | 6 ++-- internal/async/scheduler_task_config.go | 2 +- internal/async/scheduler_task_config_test.go | 4 +-- internal/async/tasks/cert_rotation.go | 14 +++++----- internal/async/tasks/cert_rotation_test.go | 10 +++---- internal/async/tasks/hyok_sync.go | 12 ++++---- internal/async/tasks/hyok_sync_test.go | 8 +++--- internal/async/tasks/keystore_pool.go | 6 ++-- internal/async/tasks/keystore_pool_test.go | 8 +++--- internal/async/tasks/system_refresh.go | 12 ++++---- internal/async/tasks/system_refresh_test.go | 6 ++-- internal/auditor/auditor.go | 8 +++--- internal/auditor/auditor_test.go | 6 ++-- internal/auditor/key_test.go | 4 +-- internal/auditor/system_test.go | 2 +- internal/authz/authorization.go | 6 ++-- internal/authz/authorization_data.go | 2 +- internal/authz/authorization_test.go | 6 ++-- internal/authz/authz_logging.go | 2 +- internal/authz/policies.go | 2 +- internal/authz/request.go | 4 +-- internal/authz/request_test.go | 6 ++-- internal/clients/factory.go | 4 +-- internal/clients/registry/registry.go | 2 +- internal/clients/registry/systems/client.go | 4 +-- .../clients/registry/systems/client_test.go | 4 +-- .../clients/registry/systems/fake_service.go | 2 +- .../clients/registry/systems/helpers_test.go | 2 +- internal/clients/registry/systems/mapper.go | 2 +- .../clients/registry/systems/mapper_test.go | 4 +-- internal/config/config.go | 2 +- internal/config/config_test.go | 4 +-- internal/constants/logging_test.go | 2 +- internal/controllers/cmk/base_controller.go | 14 +++++----- internal/controllers/cmk/group_controller.go | 20 ++++++------- .../controllers/cmk/group_controller_test.go | 12 ++++---- internal/controllers/cmk/key_controller.go | 18 ++++++------ .../controllers/cmk/key_controller_test.go | 14 +++++----- .../controllers/cmk/key_labels_controller.go | 14 +++++----- .../cmk/key_labels_controller_test.go | 14 +++++----- .../cmk/keyconfiguration_controller.go | 16 +++++------ .../cmk/keyconfiguration_controller_test.go | 20 ++++++------- .../cmk/keyconfiguration_tags_controller.go | 12 ++++---- .../keyconfiguration_tags_controller_test.go | 12 ++++---- .../controllers/cmk/keyversion_controller.go | 14 +++++----- .../cmk/keyversion_controller_test.go | 12 ++++---- internal/controllers/cmk/system_controller.go | 10 +++---- .../controllers/cmk/system_controller_test.go | 20 ++++++------- internal/controllers/cmk/tenant_controller.go | 16 +++++------ .../controllers/cmk/tenant_controller_test.go | 6 ++-- .../cmk/tenantconfigs_controller.go | 8 +++--- .../cmk/tenantconfigs_controller_test.go | 4 +-- .../controllers/cmk/workflow_controller.go | 14 +++++----- .../cmk/workflow_controller_test.go | 14 +++++----- internal/daemon/server.go | 20 ++++++------- internal/daemon/server_test.go | 4 +-- internal/db/connection.go | 8 +++--- internal/db/connection_test.go | 6 ++-- internal/db/db.go | 8 +++--- internal/db/db_test.go | 8 +++--- internal/db/dsn/postgres.go | 4 +-- internal/event-processor/crypto.go | 16 +++++------ internal/event-processor/job_methods.go | 4 +-- internal/event-processor/proto/task.pb.go | 2 +- internal/event-processor/proto/task.proto | 2 +- internal/grpc/catalog/catalog.go | 4 +-- internal/grpc/catalog/catalog_test.go | 4 +-- internal/handlers/handlers.go | 10 +++---- internal/handlers/handlers_test.go | 8 +++--- internal/log/log.go | 4 +-- internal/manager/authz.go | 14 +++++----- internal/manager/authz_test.go | 12 ++++---- internal/manager/base.go | 10 +++---- internal/manager/base_test.go | 10 +++---- internal/manager/certificate.go | 14 +++++----- internal/manager/certificate_test.go | 16 +++++------ internal/manager/export_test.go | 4 +-- internal/manager/group.go | 14 +++++----- internal/manager/group_test.go | 16 +++++------ internal/manager/importparams.go | 6 ++-- internal/manager/importparams_test.go | 6 ++-- internal/manager/key.go | 18 ++++++------ internal/manager/key_label.go | 6 ++-- internal/manager/key_label_test.go | 12 ++++---- internal/manager/key_test.go | 24 ++++++++-------- internal/manager/keyconfiguration.go | 10 +++---- internal/manager/keyconfiguration_tag.go | 4 +-- internal/manager/keyconfiguration_tag_test.go | 14 +++++----- internal/manager/keyconfiguration_test.go | 22 +++++++-------- internal/manager/keystorepool.go | 6 ++-- internal/manager/keystorepool_test.go | 8 +++--- internal/manager/keyversion.go | 14 +++++----- internal/manager/keyversion_test.go | 18 ++++++------ internal/manager/notification.go | 2 +- internal/manager/notification_test.go | 8 +++--- internal/manager/providerconfigmanager.go | 16 +++++------ internal/manager/system.go | 28 +++++++++---------- internal/manager/system_test.go | 28 +++++++++---------- internal/manager/systeminformation.go | 12 ++++---- internal/manager/systeminformation_test.go | 14 +++++----- internal/manager/tag.go | 4 +-- internal/manager/tenant.go | 6 ++-- internal/manager/tenant_test.go | 6 ++-- internal/manager/tenantconfigs.go | 10 +++---- internal/manager/tenantconfigs_test.go | 14 +++++----- internal/manager/workflow.go | 16 +++++------ internal/manager/workflow_test.go | 26 ++++++++--------- internal/middleware/clientdata.go | 4 +-- internal/middleware/clientdata_test.go | 6 ++-- internal/middleware/context.go | 2 +- internal/middleware/logging.go | 2 +- internal/middleware/logging_test.go | 2 +- internal/middleware/multitenancy_test.go | 2 +- internal/middleware/oapi_validator.go | 2 +- internal/middleware/panic.go | 6 ++-- internal/middleware/panic_test.go | 2 +- internal/model/certificate_test.go | 2 +- internal/model/group.go | 2 +- internal/model/group_test.go | 2 +- internal/model/importparams_test.go | 2 +- internal/model/key_test.go | 2 +- internal/model/keyconfiguration_test.go | 2 +- internal/model/keystore_config.go | 2 +- internal/model/keystore_config_test.go | 2 +- internal/model/keyversion_test.go | 2 +- internal/model/label_test.go | 2 +- internal/model/system.go | 4 +-- internal/model/system_test.go | 2 +- internal/model/tag_test.go | 2 +- internal/model/tenant_status_test.go | 2 +- internal/model/tenant_test.go | 6 ++-- internal/model/workflow_test.go | 2 +- internal/plugins/builtin/builtin.go | 12 ++++---- internal/repo/mock/db.go | 6 ++-- internal/repo/mock/db_test.go | 6 ++-- internal/repo/mock/multitenancydb_test.go | 4 +-- internal/repo/mock/repo.go | 6 ++-- internal/repo/mock/repo_test.go | 8 +++--- internal/repo/query_test.go | 4 +-- internal/repo/repository.go | 4 +-- internal/repo/repository_test.go | 6 ++-- internal/repo/sql/repo.go | 12 ++++---- internal/repo/sql/repo_test.go | 8 +++--- internal/repo/violations/postgres_test.go | 2 +- internal/tenant-manager/business/business.go | 10 +++---- .../tenant-manager/business/business_test.go | 6 ++-- internal/tenant-manager/cli/cli_test.go | 12 ++++---- internal/tenant-manager/cli/command.go | 6 ++-- .../tenant-manager/cli/creategroupscmd.go | 4 +-- .../tenant-manager/cli/createtenantcmd.go | 6 ++-- internal/tenant-manager/cli/db_test.go | 12 ++++---- .../tenant-manager/cli/deletetenantcmd.go | 6 ++-- internal/tenant-manager/cli/gettenantcmd.go | 2 +- internal/tenant-manager/cli/listtenantscmd.go | 6 ++-- .../tenant-manager/cli/updatetenantcmd.go | 6 ++-- internal/tenant-manager/cli/utils.go | 4 +-- internal/tenant-manager/db/db.go | 14 +++++----- internal/tenant-manager/db/db_test.go | 12 ++++---- .../tenant-manager/operator/export_test.go | 2 +- internal/tenant-manager/operator/operator.go | 18 ++++++------ .../tenant-manager/operator/operator_test.go | 12 ++++---- internal/tenant-manager/operator/probe.go | 12 ++++---- .../tenant-manager/operator/probe_test.go | 12 ++++---- internal/testutils/api.go | 14 +++++----- internal/testutils/api_test.go | 2 +- internal/testutils/certificate.go | 4 +-- internal/testutils/certificate_test.go | 6 ++-- internal/testutils/db.go | 8 +++--- internal/testutils/db_error.go | 4 +-- internal/testutils/db_error_test.go | 2 +- internal/testutils/db_test.go | 4 +-- internal/testutils/grpc.go | 2 +- internal/testutils/model.go | 12 ++++---- internal/testutils/mutator_test.go | 2 +- internal/testutils/system.go | 2 +- internal/testutils/system_test.go | 4 +-- .../certificateissuer/main_test.go | 2 +- .../identitymanagement/main_test.go | 2 +- .../testutils/testplugins/keystoreop/main.go | 2 +- .../testplugins/keystoreop/main_test.go | 4 +-- .../testplugins/notification/main_test.go | 2 +- .../systeminformation/main_test.go | 2 +- internal/workflow/errors.go | 2 +- internal/workflow/key_actions.go | 8 +++--- internal/workflow/key_actions_test.go | 12 ++++---- .../workflow/key_configuration_actions.go | 2 +- .../key_configuration_actions_test.go | 10 +++---- internal/workflow/system_actions.go | 4 +-- internal/workflow/system_actions_test.go | 10 +++---- internal/workflow/workflow.go | 10 +++---- internal/workflow/workflow_test.go | 22 +++++++-------- providers/clients/aws/aws_options_test.go | 4 +-- providers/clients/aws/client.go | 8 +++--- providers/clients/aws/client_test.go | 8 +++--- providers/clients/dummy/transform/key/key.go | 6 ++-- .../dummy/transform/keyversion/keyversion.go | 6 ++-- providers/mock/client_mock.go | 2 +- providers/provider.go | 8 +++--- providers/provider_test.go | 8 +++--- test/async_test/certrotation_test.go | 14 +++++----- test/async_test/common_test.go | 24 ++++++++-------- test/async_test/hyoksync_test.go | 16 +++++------ test/async_test/keystorepool_test.go | 14 +++++----- test/async_test/systeminformation_test.go | 14 +++++----- test/aws_tests/kms_provider_aws_test.go | 6 ++-- test/event-processor/reconciliation_test.go | 26 ++++++++--------- .../identity_management_test.go | 4 +-- test/integration_utils/db.go | 2 +- test/integration_utils/plugin_test.go | 2 +- test/integration_utils/tenant_assertions.go | 10 +++---- .../kms_provider_local_test.go | 6 ++-- test/notification/notification_test.go | 8 +++--- test/psqlreplicatests/psqlreplica_test.go | 14 +++++----- test/registry_service/helpers_test.go | 2 +- test/registry_service/systems_test.go | 4 +-- .../systeminformation_test.go | 16 +++++------ .../tenant_provisioning_test.go | 16 +++++------ utils/base62/base62.go | 2 +- utils/base62/base62_test.go | 2 +- utils/bool/bool_test.go | 2 +- utils/cert/cert.go | 2 +- utils/cert/cert_test.go | 4 +-- utils/cert/mock/pemencoder.go | 2 +- utils/context/context.go | 2 +- utils/context/context_test.go | 4 +-- utils/crypto/crypto.go | 2 +- utils/crypto/crypto_test.go | 2 +- utils/must/must_test.go | 2 +- utils/oauth2/oauth2_test.go | 6 ++-- utils/oauth2/token_injector.go | 2 +- utils/oauth2/token_injector_test.go | 2 +- utils/odata/odata_test.go | 2 +- utils/protobuf/protobuf_test.go | 2 +- utils/ptr/ptr_test.go | 2 +- utils/slice/slice_test.go | 2 +- utils/structreader/structreader_test.go | 2 +- utils/tlsconfig/tlsconfig_test.go | 4 +-- utils/validator/validator.go | 2 +- utils/validator/validator_test.go | 2 +- 305 files changed, 1156 insertions(+), 1156 deletions(-) diff --git a/.golangci.yaml b/.golangci.yaml index c4f8e57a..4894454f 100644 --- a/.golangci.yaml +++ b/.golangci.yaml @@ -70,7 +70,7 @@ formatters: sections: - standard - default - - prefix(github.com/openkcm/cmk-core) + - prefix(github.com/openkcm/cmk) - blank - dot - alias diff --git a/.release/release-metadata.hcl b/.release/release-metadata.hcl index 1d9c5e60..9361bf83 100644 --- a/.release/release-metadata.hcl +++ b/.release/release-metadata.hcl @@ -1,6 +1,6 @@ release { provider = "github" - url = "https://github.com/openkcm/cmk-core/releases" + url = "https://github.com/openkcm/cmk/releases" changelog = "CHANGELOG.md" tag_prefix = "v" release_name_template = "Release {{.Version}}" diff --git a/CHANGELOG.md b/CHANGELOG.md index 54190018..f888fa54 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,10 +5,10 @@ ### Bug Fixes -* add all files for workflows ([#4](https://github.com/openkcm/cmk-core/issues/4)) ([013fc37](https://github.com/openkcm/cmk-core/commit/013fc3788665f6491c2bb0b5ce978a58b5863e9d)) -* set base versioning files ([a283c32](https://github.com/openkcm/cmk-core/commit/a283c32ec8cb84acc343f124edfc9d275de1c665)) +* add all files for workflows ([#4](https://github.com/openkcm/cmk/issues/4)) ([013fc37](https://github.com/openkcm/cmk/commit/013fc3788665f6491c2bb0b5ce978a58b5863e9d)) +* set base versioning files ([a283c32](https://github.com/openkcm/cmk/commit/a283c32ec8cb84acc343f124edfc9d275de1c665)) ### Miscellaneous Chores -* reset version to 0.0.1 ([bbe38ef](https://github.com/openkcm/cmk-core/commit/bbe38ef38ae5b81ca324161f3bfccb75e1352deb)) +* reset version to 0.0.1 ([bbe38ef](https://github.com/openkcm/cmk/commit/bbe38ef38ae5b81ca324161f3bfccb75e1352deb)) diff --git a/README.md b/README.md index ab0b6645..7e050adc 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -[![REUSE status](https://api.reuse.software/badge/github.com/openkcm/cmk-core)](https://api.reuse.software/info/github.com/openkcm/cmk-core) +[![REUSE status](https://api.reuse.software/badge/github.com/openkcm/cmk)](https://api.reuse.software/info/github.com/openkcm/cmk) # Customer Managed Key (CMK) @@ -488,10 +488,10 @@ This allows for precise error handling when errors are wrapped or combined. ## Support, Feedback, Contributing -This project is open to feature requests/suggestions, bug reports etc. via [GitHub issues](https://github.com/openkcm/cmk-core/issues). Contribution and feedback are encouraged and always welcome. For more information about how to contribute, the project structure, as well as additional contribution information, see our [Contribution Guidelines](CONTRIBUTING.md). +This project is open to feature requests/suggestions, bug reports etc. via [GitHub issues](https://github.com/openkcm/cmk/issues). Contribution and feedback are encouraged and always welcome. For more information about how to contribute, the project structure, as well as additional contribution information, see our [Contribution Guidelines](CONTRIBUTING.md). ## Security / Disclosure -If you find any bug that may be a security problem, please follow our instructions at [in our security policy](https://github.com/openkcm/cmk-core/security/policy) on how to report it. Please do not create GitHub issues for security-related doubts or problems. +If you find any bug that may be a security problem, please follow our instructions at [in our security policy](https://github.com/openkcm/cmk/security/policy) on how to report it. Please do not create GitHub issues for security-related doubts or problems. ## Code of Conduct @@ -499,4 +499,4 @@ We as members, contributors, and leaders pledge to make participation in our com ## Licensing -Copyright 2025 SAP SE or an SAP affiliate company and cmk contributors. Please see our [LICENSE](LICENSE) for copyright and license information. Detailed information including third-party components and their licensing/copyright information is available [via the REUSE tool](https://api.reuse.software/info/github.com/openkcm/cmk-core). +Copyright 2025 SAP SE or an SAP affiliate company and cmk contributors. Please see our [LICENSE](LICENSE) for copyright and license information. Detailed information including third-party components and their licensing/copyright information is available [via the REUSE tool](https://api.reuse.software/info/github.com/openkcm/cmk). diff --git a/REUSE.toml b/REUSE.toml index 865fe456..588d6114 100644 --- a/REUSE.toml +++ b/REUSE.toml @@ -1,6 +1,6 @@ version = 1 SPDX-PackageName = "cmk" -SPDX-PackageDownloadLocation = "https://github.com/openkcm/cmk-core" +SPDX-PackageDownloadLocation = "https://github.com/openkcm/cmk" SPDX-PackageComment = "The code in this project may include calls to APIs (\"API Calls\") of\n SAP or third-party products or services developed outside of this project\n (\"External Products\").\n \"APIs\" means application programming interfaces, as well as their respective\n specifications and implementing code that allows software to communicate with\n other software.\n API Calls to External Products are not licensed under the open source license\n that governs this project. The use of such API Calls and related External\n Products are subject to applicable additional agreements with the relevant\n provider of the External Products. In no event shall the open source license\n that governs this project grant any rights in or to any External Products, or\n alter, expand or supersede any terms of the applicable additional agreements.\n If you have a valid license agreement with SAP for the use of a particular SAP\n External Product, then you may make use of any API Calls included in this\n project's code for that SAP External Product, subject to the terms of such\n license agreement. If you do not have a valid license agreement for the use of\n a particular SAP External Product, then you may only make use of any API Calls\n in this project for that SAP External Product for your internal, non-productive\n and non-commercial test and evaluation of such API Calls. Nothing herein grants\n you any rights to use or access any SAP External Product, or provide any third\n parties the right to use of access any SAP External Product, through API Calls." [[annotations]] diff --git a/Taskfile.yaml b/Taskfile.yaml index 6324cf21..da6d7859 100644 --- a/Taskfile.yaml +++ b/Taskfile.yaml @@ -8,5 +8,5 @@ includes: vars: CODE_DIRS: '{{.ROOT_DIR}}/cmd/... {{.ROOT_DIR}}/internal/... {{.ROOT_DIR}}/apis/... {{.ROOT_DIR}}/providers/... {{.ROOT_DIR}}/test/... {{.ROOT_DIR}}/utils/...' COMPONENTS: 'core tenant-manager tenant-manager-cli' - REPO_URL: 'https://github.com/openkcm/cmk-core' + REPO_URL: 'https://github.com/openkcm/cmk' diff --git a/benchmark/system_model_test.go b/benchmark/system_model_test.go index fed5db83..d5af5987 100644 --- a/benchmark/system_model_test.go +++ b/benchmark/system_model_test.go @@ -12,11 +12,11 @@ import ( multitenancy "github.com/bartventer/gorm-multitenancy/v8" - "github.com/openkcm/cmk-core/internal/model" - "github.com/openkcm/cmk-core/internal/repo" - "github.com/openkcm/cmk-core/internal/repo/sql" - "github.com/openkcm/cmk-core/internal/testutils" - cmkcontext "github.com/openkcm/cmk-core/utils/context" + "github.com/openkcm/cmk/internal/model" + "github.com/openkcm/cmk/internal/repo" + "github.com/openkcm/cmk/internal/repo/sql" + "github.com/openkcm/cmk/internal/testutils" + cmkcontext "github.com/openkcm/cmk/utils/context" ) type SystemProperty struct { diff --git a/benchmark/total_lazyload_test.go b/benchmark/total_lazyload_test.go index 099d8f56..775567af 100644 --- a/benchmark/total_lazyload_test.go +++ b/benchmark/total_lazyload_test.go @@ -9,11 +9,11 @@ import ( "github.com/google/uuid" "github.com/stretchr/testify/assert" - "github.com/openkcm/cmk-core/internal/model" - "github.com/openkcm/cmk-core/internal/repo" - "github.com/openkcm/cmk-core/internal/repo/sql" - "github.com/openkcm/cmk-core/internal/testutils" - "github.com/openkcm/cmk-core/utils/ptr" + "github.com/openkcm/cmk/internal/model" + "github.com/openkcm/cmk/internal/repo" + "github.com/openkcm/cmk/internal/repo/sql" + "github.com/openkcm/cmk/internal/testutils" + "github.com/openkcm/cmk/utils/ptr" ) func WithTotalKeys(ctx context.Context, r repo.Repo) func(*model.KeyConfiguration) error { diff --git a/cmd/core/apiserver/command.go b/cmd/core/apiserver/command.go index 233321a2..c02ba682 100644 --- a/cmd/core/apiserver/command.go +++ b/cmd/core/apiserver/command.go @@ -15,14 +15,14 @@ import ( "github.com/samber/oops" "github.com/spf13/cobra" - "github.com/openkcm/cmk-core/internal/config" - "github.com/openkcm/cmk-core/internal/constants" - "github.com/openkcm/cmk-core/internal/daemon" - "github.com/openkcm/cmk-core/internal/db" - "github.com/openkcm/cmk-core/internal/db/dsn" - "github.com/openkcm/cmk-core/internal/log" - "github.com/openkcm/cmk-core/internal/manager" - "github.com/openkcm/cmk-core/internal/repo/sql" + "github.com/openkcm/cmk/internal/config" + "github.com/openkcm/cmk/internal/constants" + "github.com/openkcm/cmk/internal/daemon" + "github.com/openkcm/cmk/internal/db" + "github.com/openkcm/cmk/internal/db/dsn" + "github.com/openkcm/cmk/internal/log" + "github.com/openkcm/cmk/internal/manager" + "github.com/openkcm/cmk/internal/repo/sql" ) const ( diff --git a/cmd/core/apiserver/command_test.go b/cmd/core/apiserver/command_test.go index 87fb3406..7fb81aba 100644 --- a/cmd/core/apiserver/command_test.go +++ b/cmd/core/apiserver/command_test.go @@ -8,8 +8,8 @@ import ( "github.com/openkcm/common-sdk/pkg/commoncfg" "github.com/stretchr/testify/require" - "github.com/openkcm/cmk-core/cmd/core/apiserver" - "github.com/openkcm/cmk-core/internal/config" + "github.com/openkcm/cmk/cmd/core/apiserver" + "github.com/openkcm/cmk/internal/config" ) func TestRun(t *testing.T) { diff --git a/cmd/core/main.go b/cmd/core/main.go index 104e9819..12aee006 100644 --- a/cmd/core/main.go +++ b/cmd/core/main.go @@ -14,9 +14,9 @@ import ( slogctx "github.com/veqryn/slog-context" - "github.com/openkcm/cmk-core/cmd/core/apiserver" - "github.com/openkcm/cmk-core/cmd/core/taskscheduler" - "github.com/openkcm/cmk-core/cmd/core/taskworker" + "github.com/openkcm/cmk/cmd/core/apiserver" + "github.com/openkcm/cmk/cmd/core/taskscheduler" + "github.com/openkcm/cmk/cmd/core/taskworker" ) var ( diff --git a/cmd/core/taskscheduler/command.go b/cmd/core/taskscheduler/command.go index a1ecc31b..474107b6 100644 --- a/cmd/core/taskscheduler/command.go +++ b/cmd/core/taskscheduler/command.go @@ -6,10 +6,10 @@ import ( "github.com/samber/oops" "github.com/spf13/cobra" - "github.com/openkcm/cmk-core/internal/async" - "github.com/openkcm/cmk-core/internal/config" - "github.com/openkcm/cmk-core/internal/constants" - cmklog "github.com/openkcm/cmk-core/internal/log" + "github.com/openkcm/cmk/internal/async" + "github.com/openkcm/cmk/internal/config" + "github.com/openkcm/cmk/internal/constants" + cmklog "github.com/openkcm/cmk/internal/log" ) func Cmd(buildInfo string) *cobra.Command { diff --git a/cmd/core/taskworker/command.go b/cmd/core/taskworker/command.go index dea51a4a..5da82f4e 100644 --- a/cmd/core/taskworker/command.go +++ b/cmd/core/taskworker/command.go @@ -6,10 +6,10 @@ import ( "github.com/samber/oops" "github.com/spf13/cobra" - "github.com/openkcm/cmk-core/internal/async" - "github.com/openkcm/cmk-core/internal/config" - "github.com/openkcm/cmk-core/internal/constants" - cmklog "github.com/openkcm/cmk-core/internal/log" + "github.com/openkcm/cmk/internal/async" + "github.com/openkcm/cmk/internal/config" + "github.com/openkcm/cmk/internal/constants" + cmklog "github.com/openkcm/cmk/internal/log" ) func Cmd(buildInfo string) *cobra.Command { diff --git a/cmd/tenant-manager-cli/command.go b/cmd/tenant-manager-cli/command.go index 1815c053..9c455a6d 100644 --- a/cmd/tenant-manager-cli/command.go +++ b/cmd/tenant-manager-cli/command.go @@ -14,7 +14,7 @@ import ( slogctx "github.com/veqryn/slog-context" - "github.com/openkcm/cmk-core/internal/tenant-manager/cli" + "github.com/openkcm/cmk/internal/tenant-manager/cli" ) var ( diff --git a/cmd/tenant-manager/command.go b/cmd/tenant-manager/command.go index 33c39127..61a1fe66 100644 --- a/cmd/tenant-manager/command.go +++ b/cmd/tenant-manager/command.go @@ -20,10 +20,10 @@ import ( slogctx "github.com/veqryn/slog-context" - "github.com/openkcm/cmk-core/internal/config" - "github.com/openkcm/cmk-core/internal/db/dsn" - "github.com/openkcm/cmk-core/internal/log" - "github.com/openkcm/cmk-core/internal/tenant-manager/business" + "github.com/openkcm/cmk/internal/config" + "github.com/openkcm/cmk/internal/db/dsn" + "github.com/openkcm/cmk/internal/log" + "github.com/openkcm/cmk/internal/tenant-manager/business" ) const ( diff --git a/go.mod b/go.mod index 9e1ef8e4..54f850be 100644 --- a/go.mod +++ b/go.mod @@ -1,4 +1,4 @@ -module github.com/openkcm/cmk-core +module github.com/openkcm/cmk go 1.25.1 diff --git a/internal/api/transform/clientcertificates/clientcertificates.go b/internal/api/transform/clientcertificates/clientcertificates.go index a32283d5..4a815c4d 100644 --- a/internal/api/transform/clientcertificates/clientcertificates.go +++ b/internal/api/transform/clientcertificates/clientcertificates.go @@ -1,11 +1,11 @@ package clientcertificates import ( - "github.com/openkcm/cmk-core/internal/api/cmkapi" - "github.com/openkcm/cmk-core/internal/api/transform" - "github.com/openkcm/cmk-core/internal/manager" - "github.com/openkcm/cmk-core/internal/model" - "github.com/openkcm/cmk-core/utils/ptr" + "github.com/openkcm/cmk/internal/api/cmkapi" + "github.com/openkcm/cmk/internal/api/transform" + "github.com/openkcm/cmk/internal/manager" + "github.com/openkcm/cmk/internal/model" + "github.com/openkcm/cmk/utils/ptr" ) func transformTenantDefault(cc manager.ClientCertificate) (*cmkapi.TenantDefaultCertificate, error) { diff --git a/internal/api/transform/clientcertificates/clientcertificates_test.go b/internal/api/transform/clientcertificates/clientcertificates_test.go index 7cac3726..03d2798f 100644 --- a/internal/api/transform/clientcertificates/clientcertificates_test.go +++ b/internal/api/transform/clientcertificates/clientcertificates_test.go @@ -5,11 +5,11 @@ import ( "github.com/stretchr/testify/assert" - "github.com/openkcm/cmk-core/internal/api/cmkapi" - "github.com/openkcm/cmk-core/internal/api/transform/clientcertificates" - "github.com/openkcm/cmk-core/internal/manager" - "github.com/openkcm/cmk-core/internal/model" - "github.com/openkcm/cmk-core/utils/ptr" + "github.com/openkcm/cmk/internal/api/cmkapi" + "github.com/openkcm/cmk/internal/api/transform/clientcertificates" + "github.com/openkcm/cmk/internal/manager" + "github.com/openkcm/cmk/internal/model" + "github.com/openkcm/cmk/utils/ptr" ) func TestToAPI(t *testing.T) { diff --git a/internal/api/transform/group/group.go b/internal/api/transform/group/group.go index 07ae7d43..324600a3 100644 --- a/internal/api/transform/group/group.go +++ b/internal/api/transform/group/group.go @@ -3,10 +3,10 @@ package group import ( "github.com/google/uuid" - "github.com/openkcm/cmk-core/internal/api/cmkapi" - "github.com/openkcm/cmk-core/internal/constants" - "github.com/openkcm/cmk-core/internal/model" - "github.com/openkcm/cmk-core/utils/ptr" + "github.com/openkcm/cmk/internal/api/cmkapi" + "github.com/openkcm/cmk/internal/constants" + "github.com/openkcm/cmk/internal/model" + "github.com/openkcm/cmk/utils/ptr" ) func ToAPI(group model.Group) *cmkapi.Group { diff --git a/internal/api/transform/group/group_test.go b/internal/api/transform/group/group_test.go index 025525d9..5295304a 100644 --- a/internal/api/transform/group/group_test.go +++ b/internal/api/transform/group/group_test.go @@ -5,10 +5,10 @@ import ( "github.com/stretchr/testify/assert" - "github.com/openkcm/cmk-core/internal/api/cmkapi" - "github.com/openkcm/cmk-core/internal/api/transform/group" - "github.com/openkcm/cmk-core/internal/model" - "github.com/openkcm/cmk-core/utils/ptr" + "github.com/openkcm/cmk/internal/api/cmkapi" + "github.com/openkcm/cmk/internal/api/transform/group" + "github.com/openkcm/cmk/internal/model" + "github.com/openkcm/cmk/utils/ptr" ) func TestToAPI(t *testing.T) { diff --git a/internal/api/transform/importparams/importparams.go b/internal/api/transform/importparams/importparams.go index 10baaa7f..83374735 100644 --- a/internal/api/transform/importparams/importparams.go +++ b/internal/api/transform/importparams/importparams.go @@ -1,8 +1,8 @@ package importparams import ( - "github.com/openkcm/cmk-core/internal/api/cmkapi" - "github.com/openkcm/cmk-core/internal/model" + "github.com/openkcm/cmk/internal/api/cmkapi" + "github.com/openkcm/cmk/internal/model" ) func ToAPI(p model.ImportParams) *cmkapi.ImportParams { diff --git a/internal/api/transform/importparams/importparams_test.go b/internal/api/transform/importparams/importparams_test.go index b3a02ce5..09c80f50 100644 --- a/internal/api/transform/importparams/importparams_test.go +++ b/internal/api/transform/importparams/importparams_test.go @@ -5,9 +5,9 @@ import ( "github.com/stretchr/testify/assert" - "github.com/openkcm/cmk-core/internal/api/cmkapi" - "github.com/openkcm/cmk-core/internal/api/transform/importparams" - "github.com/openkcm/cmk-core/internal/model" + "github.com/openkcm/cmk/internal/api/cmkapi" + "github.com/openkcm/cmk/internal/api/transform/importparams" + "github.com/openkcm/cmk/internal/model" ) func TestToAPI(t *testing.T) { diff --git a/internal/api/transform/key/hyokkey/hyokkey.go b/internal/api/transform/key/hyokkey/hyokkey.go index a040df9d..2a78670b 100644 --- a/internal/api/transform/key/hyokkey/hyokkey.go +++ b/internal/api/transform/key/hyokkey/hyokkey.go @@ -4,12 +4,12 @@ import ( "context" "errors" - "github.com/openkcm/cmk-core/internal/api/cmkapi" - "github.com/openkcm/cmk-core/internal/api/transform" - "github.com/openkcm/cmk-core/internal/api/transform/key/keyshared" - "github.com/openkcm/cmk-core/internal/api/transform/key/transformer" - "github.com/openkcm/cmk-core/internal/errs" - "github.com/openkcm/cmk-core/internal/model" + "github.com/openkcm/cmk/internal/api/cmkapi" + "github.com/openkcm/cmk/internal/api/transform" + "github.com/openkcm/cmk/internal/api/transform/key/keyshared" + "github.com/openkcm/cmk/internal/api/transform/key/transformer" + "github.com/openkcm/cmk/internal/errs" + "github.com/openkcm/cmk/internal/model" ) var ( diff --git a/internal/api/transform/key/hyokkey/hyokkey_test.go b/internal/api/transform/key/hyokkey/hyokkey_test.go index d4b49ae5..1f14b237 100644 --- a/internal/api/transform/key/hyokkey/hyokkey_test.go +++ b/internal/api/transform/key/hyokkey/hyokkey_test.go @@ -8,11 +8,11 @@ import ( "github.com/stretchr/testify/assert" - "github.com/openkcm/cmk-core/internal/api/cmkapi" - "github.com/openkcm/cmk-core/internal/api/transform/key/hyokkey" - "github.com/openkcm/cmk-core/internal/api/transform/key/transformer" - "github.com/openkcm/cmk-core/internal/model" - "github.com/openkcm/cmk-core/utils/ptr" + "github.com/openkcm/cmk/internal/api/cmkapi" + "github.com/openkcm/cmk/internal/api/transform/key/hyokkey" + "github.com/openkcm/cmk/internal/api/transform/key/transformer" + "github.com/openkcm/cmk/internal/model" + "github.com/openkcm/cmk/utils/ptr" ) var ( diff --git a/internal/api/transform/key/key.go b/internal/api/transform/key/key.go index c721844b..f6858392 100644 --- a/internal/api/transform/key/key.go +++ b/internal/api/transform/key/key.go @@ -8,17 +8,17 @@ import ( "github.com/google/uuid" - "github.com/openkcm/cmk-core/internal/api/cmkapi" - "github.com/openkcm/cmk-core/internal/api/transform" - "github.com/openkcm/cmk-core/internal/api/transform/key/hyokkey" - "github.com/openkcm/cmk-core/internal/api/transform/key/keyshared" - "github.com/openkcm/cmk-core/internal/api/transform/key/sysmr" - "github.com/openkcm/cmk-core/internal/api/transform/key/transformer" - "github.com/openkcm/cmk-core/internal/apierrors" - "github.com/openkcm/cmk-core/internal/constants" - "github.com/openkcm/cmk-core/internal/errs" - "github.com/openkcm/cmk-core/internal/model" - "github.com/openkcm/cmk-core/utils/ptr" + "github.com/openkcm/cmk/internal/api/cmkapi" + "github.com/openkcm/cmk/internal/api/transform" + "github.com/openkcm/cmk/internal/api/transform/key/hyokkey" + "github.com/openkcm/cmk/internal/api/transform/key/keyshared" + "github.com/openkcm/cmk/internal/api/transform/key/sysmr" + "github.com/openkcm/cmk/internal/api/transform/key/transformer" + "github.com/openkcm/cmk/internal/apierrors" + "github.com/openkcm/cmk/internal/constants" + "github.com/openkcm/cmk/internal/errs" + "github.com/openkcm/cmk/internal/model" + "github.com/openkcm/cmk/utils/ptr" ) var ( diff --git a/internal/api/transform/key/key_test.go b/internal/api/transform/key/key_test.go index 557c8752..5db6d1c5 100644 --- a/internal/api/transform/key/key_test.go +++ b/internal/api/transform/key/key_test.go @@ -9,16 +9,16 @@ import ( "github.com/google/uuid" "github.com/stretchr/testify/assert" - "github.com/openkcm/cmk-core/internal/api/cmkapi" - "github.com/openkcm/cmk-core/internal/api/transform" - "github.com/openkcm/cmk-core/internal/api/transform/key" - "github.com/openkcm/cmk-core/internal/api/transform/key/keyshared" - "github.com/openkcm/cmk-core/internal/api/transform/key/transformer" - "github.com/openkcm/cmk-core/internal/apierrors" - "github.com/openkcm/cmk-core/internal/errs" - "github.com/openkcm/cmk-core/internal/model" - "github.com/openkcm/cmk-core/internal/testutils" - "github.com/openkcm/cmk-core/utils/ptr" + "github.com/openkcm/cmk/internal/api/cmkapi" + "github.com/openkcm/cmk/internal/api/transform" + "github.com/openkcm/cmk/internal/api/transform/key" + "github.com/openkcm/cmk/internal/api/transform/key/keyshared" + "github.com/openkcm/cmk/internal/api/transform/key/transformer" + "github.com/openkcm/cmk/internal/apierrors" + "github.com/openkcm/cmk/internal/errs" + "github.com/openkcm/cmk/internal/model" + "github.com/openkcm/cmk/internal/testutils" + "github.com/openkcm/cmk/utils/ptr" ) const ( diff --git a/internal/api/transform/key/sysmr/mrkey.go b/internal/api/transform/key/sysmr/mrkey.go index 39142ff8..f5974bb9 100644 --- a/internal/api/transform/key/sysmr/mrkey.go +++ b/internal/api/transform/key/sysmr/mrkey.go @@ -4,12 +4,12 @@ import ( "context" "errors" - "github.com/openkcm/cmk-core/internal/api/cmkapi" - "github.com/openkcm/cmk-core/internal/api/transform" - "github.com/openkcm/cmk-core/internal/api/transform/key/keyshared" - "github.com/openkcm/cmk-core/internal/api/transform/key/transformer" - "github.com/openkcm/cmk-core/internal/errs" - "github.com/openkcm/cmk-core/internal/model" + "github.com/openkcm/cmk/internal/api/cmkapi" + "github.com/openkcm/cmk/internal/api/transform" + "github.com/openkcm/cmk/internal/api/transform/key/keyshared" + "github.com/openkcm/cmk/internal/api/transform/key/transformer" + "github.com/openkcm/cmk/internal/errs" + "github.com/openkcm/cmk/internal/model" ) // FromCmkAPIKey propose to retrieve Managed key Request from CMK Api Key diff --git a/internal/api/transform/key/sysmr/mrkey_test.go b/internal/api/transform/key/sysmr/mrkey_test.go index 84e8c168..a83b4542 100644 --- a/internal/api/transform/key/sysmr/mrkey_test.go +++ b/internal/api/transform/key/sysmr/mrkey_test.go @@ -7,11 +7,11 @@ import ( "github.com/stretchr/testify/assert" - "github.com/openkcm/cmk-core/internal/api/cmkapi" - "github.com/openkcm/cmk-core/internal/api/transform/key/sysmr" - "github.com/openkcm/cmk-core/internal/api/transform/key/transformer" - "github.com/openkcm/cmk-core/internal/model" - "github.com/openkcm/cmk-core/utils/ptr" + "github.com/openkcm/cmk/internal/api/cmkapi" + "github.com/openkcm/cmk/internal/api/transform/key/sysmr" + "github.com/openkcm/cmk/internal/api/transform/key/transformer" + "github.com/openkcm/cmk/internal/model" + "github.com/openkcm/cmk/utils/ptr" ) var ( diff --git a/internal/api/transform/key/transformer/transformer.go b/internal/api/transform/key/transformer/transformer.go index 8b03a364..dff371d5 100644 --- a/internal/api/transform/key/transformer/transformer.go +++ b/internal/api/transform/key/transformer/transformer.go @@ -10,10 +10,10 @@ import ( keystoreopv1 "github.com/openkcm/plugin-sdk/proto/plugin/keystore/operations/v1" - "github.com/openkcm/cmk-core/internal/api/cmkapi" - "github.com/openkcm/cmk-core/internal/api/transform/key/keyshared" - "github.com/openkcm/cmk-core/internal/errs" - "github.com/openkcm/cmk-core/utils/protobuf" + "github.com/openkcm/cmk/internal/api/cmkapi" + "github.com/openkcm/cmk/internal/api/transform/key/keyshared" + "github.com/openkcm/cmk/internal/errs" + "github.com/openkcm/cmk/utils/protobuf" ) var ( diff --git a/internal/api/transform/key/transformer/transformer_test.go b/internal/api/transform/key/transformer/transformer_test.go index a2b097b2..c237a7a7 100644 --- a/internal/api/transform/key/transformer/transformer_test.go +++ b/internal/api/transform/key/transformer/transformer_test.go @@ -5,12 +5,12 @@ import ( "github.com/stretchr/testify/assert" - "github.com/openkcm/cmk-core/internal/api/cmkapi" - "github.com/openkcm/cmk-core/internal/api/transform/key/transformer" - "github.com/openkcm/cmk-core/internal/config" - "github.com/openkcm/cmk-core/internal/grpc/catalog" - "github.com/openkcm/cmk-core/internal/testutils" - "github.com/openkcm/cmk-core/utils/ptr" + "github.com/openkcm/cmk/internal/api/cmkapi" + "github.com/openkcm/cmk/internal/api/transform/key/transformer" + "github.com/openkcm/cmk/internal/config" + "github.com/openkcm/cmk/internal/grpc/catalog" + "github.com/openkcm/cmk/internal/testutils" + "github.com/openkcm/cmk/utils/ptr" ) func getPluginProviderTransformer(t *testing.T) *transformer.PluginProviderTransformer { diff --git a/internal/api/transform/keyconfiguration/keyconfiguration.go b/internal/api/transform/keyconfiguration/keyconfiguration.go index 3a1a4b1c..16bc487a 100644 --- a/internal/api/transform/keyconfiguration/keyconfiguration.go +++ b/internal/api/transform/keyconfiguration/keyconfiguration.go @@ -6,13 +6,13 @@ import ( "github.com/google/uuid" - "github.com/openkcm/cmk-core/internal/api/cmkapi" - "github.com/openkcm/cmk-core/internal/api/transform" - "github.com/openkcm/cmk-core/internal/api/transform/group" - "github.com/openkcm/cmk-core/internal/apierrors" - "github.com/openkcm/cmk-core/internal/errs" - "github.com/openkcm/cmk-core/internal/model" - "github.com/openkcm/cmk-core/utils/validator" + "github.com/openkcm/cmk/internal/api/cmkapi" + "github.com/openkcm/cmk/internal/api/transform" + "github.com/openkcm/cmk/internal/api/transform/group" + "github.com/openkcm/cmk/internal/apierrors" + "github.com/openkcm/cmk/internal/errs" + "github.com/openkcm/cmk/internal/model" + "github.com/openkcm/cmk/utils/validator" ) var ErrTransformKey = errors.New("err transform to key response") diff --git a/internal/api/transform/keyconfiguration/keyconfiguration_test.go b/internal/api/transform/keyconfiguration/keyconfiguration_test.go index 911382c9..2626cf3a 100644 --- a/internal/api/transform/keyconfiguration/keyconfiguration_test.go +++ b/internal/api/transform/keyconfiguration/keyconfiguration_test.go @@ -7,13 +7,13 @@ import ( "github.com/google/uuid" "github.com/stretchr/testify/assert" - "github.com/openkcm/cmk-core/internal/api/cmkapi" - "github.com/openkcm/cmk-core/internal/api/transform/keyconfiguration" - "github.com/openkcm/cmk-core/internal/apierrors" - "github.com/openkcm/cmk-core/internal/errs" - "github.com/openkcm/cmk-core/internal/model" - "github.com/openkcm/cmk-core/internal/testutils" - "github.com/openkcm/cmk-core/utils/ptr" + "github.com/openkcm/cmk/internal/api/cmkapi" + "github.com/openkcm/cmk/internal/api/transform/keyconfiguration" + "github.com/openkcm/cmk/internal/apierrors" + "github.com/openkcm/cmk/internal/errs" + "github.com/openkcm/cmk/internal/model" + "github.com/openkcm/cmk/internal/testutils" + "github.com/openkcm/cmk/utils/ptr" ) func TestTransformKeyConfiguration_FromAPI(t *testing.T) { diff --git a/internal/api/transform/keyversion/keyversion.go b/internal/api/transform/keyversion/keyversion.go index 5776a0f6..b5ccdcbf 100644 --- a/internal/api/transform/keyversion/keyversion.go +++ b/internal/api/transform/keyversion/keyversion.go @@ -1,10 +1,10 @@ package keyversion import ( - "github.com/openkcm/cmk-core/internal/api/cmkapi" - "github.com/openkcm/cmk-core/internal/api/transform" - "github.com/openkcm/cmk-core/internal/model" - "github.com/openkcm/cmk-core/utils/ptr" + "github.com/openkcm/cmk/internal/api/cmkapi" + "github.com/openkcm/cmk/internal/api/transform" + "github.com/openkcm/cmk/internal/model" + "github.com/openkcm/cmk/utils/ptr" ) // ToAPI converts KeyVersion db model to a KeyVersion api model diff --git a/internal/api/transform/keyversion/keyversion_test.go b/internal/api/transform/keyversion/keyversion_test.go index 82b72998..fc786fe3 100644 --- a/internal/api/transform/keyversion/keyversion_test.go +++ b/internal/api/transform/keyversion/keyversion_test.go @@ -7,12 +7,12 @@ import ( "github.com/google/uuid" "github.com/stretchr/testify/assert" - "github.com/openkcm/cmk-core/internal/api/cmkapi" - "github.com/openkcm/cmk-core/internal/api/transform" - "github.com/openkcm/cmk-core/internal/api/transform/keyversion" - "github.com/openkcm/cmk-core/internal/model" - "github.com/openkcm/cmk-core/internal/testutils" - "github.com/openkcm/cmk-core/utils/ptr" + "github.com/openkcm/cmk/internal/api/cmkapi" + "github.com/openkcm/cmk/internal/api/transform" + "github.com/openkcm/cmk/internal/api/transform/keyversion" + "github.com/openkcm/cmk/internal/model" + "github.com/openkcm/cmk/internal/testutils" + "github.com/openkcm/cmk/utils/ptr" ) func TestTransformKeyVersion_ToAPI(t *testing.T) { diff --git a/internal/api/transform/label/key_label.go b/internal/api/transform/label/key_label.go index 70c7cd08..3104d828 100644 --- a/internal/api/transform/label/key_label.go +++ b/internal/api/transform/label/key_label.go @@ -6,12 +6,12 @@ import ( "github.com/google/uuid" - "github.com/openkcm/cmk-core/internal/api/cmkapi" - "github.com/openkcm/cmk-core/internal/api/transform" - "github.com/openkcm/cmk-core/internal/apierrors" - "github.com/openkcm/cmk-core/internal/errs" - "github.com/openkcm/cmk-core/internal/model" - "github.com/openkcm/cmk-core/utils/ptr" + "github.com/openkcm/cmk/internal/api/cmkapi" + "github.com/openkcm/cmk/internal/api/transform" + "github.com/openkcm/cmk/internal/apierrors" + "github.com/openkcm/cmk/internal/errs" + "github.com/openkcm/cmk/internal/model" + "github.com/openkcm/cmk/utils/ptr" ) const ( diff --git a/internal/api/transform/label/key_label_test.go b/internal/api/transform/label/key_label_test.go index 5d3299a7..40dff8e7 100644 --- a/internal/api/transform/label/key_label_test.go +++ b/internal/api/transform/label/key_label_test.go @@ -8,13 +8,13 @@ import ( "github.com/google/uuid" "github.com/stretchr/testify/assert" - "github.com/openkcm/cmk-core/internal/api/cmkapi" - "github.com/openkcm/cmk-core/internal/api/transform" - "github.com/openkcm/cmk-core/internal/api/transform/label" - "github.com/openkcm/cmk-core/internal/apierrors" - "github.com/openkcm/cmk-core/internal/errs" - "github.com/openkcm/cmk-core/internal/model" - "github.com/openkcm/cmk-core/utils/ptr" + "github.com/openkcm/cmk/internal/api/cmkapi" + "github.com/openkcm/cmk/internal/api/transform" + "github.com/openkcm/cmk/internal/api/transform/label" + "github.com/openkcm/cmk/internal/apierrors" + "github.com/openkcm/cmk/internal/errs" + "github.com/openkcm/cmk/internal/model" + "github.com/openkcm/cmk/utils/ptr" ) type labelsTransformerTestCase struct { diff --git a/internal/api/transform/list_test.go b/internal/api/transform/list_test.go index 41dea2fa..7728c41f 100644 --- a/internal/api/transform/list_test.go +++ b/internal/api/transform/list_test.go @@ -6,8 +6,8 @@ import ( "github.com/stretchr/testify/assert" - "github.com/openkcm/cmk-core/internal/api/transform" - "github.com/openkcm/cmk-core/utils/ptr" + "github.com/openkcm/cmk/internal/api/transform" + "github.com/openkcm/cmk/utils/ptr" ) var ( diff --git a/internal/api/transform/system/system.go b/internal/api/transform/system/system.go index 4e89049e..cba33aba 100644 --- a/internal/api/transform/system/system.go +++ b/internal/api/transform/system/system.go @@ -3,9 +3,9 @@ package system import ( "errors" - "github.com/openkcm/cmk-core/internal/api/cmkapi" - "github.com/openkcm/cmk-core/internal/config" - "github.com/openkcm/cmk-core/internal/model" + "github.com/openkcm/cmk/internal/api/cmkapi" + "github.com/openkcm/cmk/internal/config" + "github.com/openkcm/cmk/internal/model" ) var ErrFromAPI = errors.New("failed to transform system from API") diff --git a/internal/api/transform/system/system_test.go b/internal/api/transform/system/system_test.go index 48c8be1d..908aa817 100644 --- a/internal/api/transform/system/system_test.go +++ b/internal/api/transform/system/system_test.go @@ -6,11 +6,11 @@ import ( "github.com/google/uuid" "github.com/stretchr/testify/assert" - "github.com/openkcm/cmk-core/internal/api/cmkapi" - "github.com/openkcm/cmk-core/internal/api/transform/system" - "github.com/openkcm/cmk-core/internal/config" - "github.com/openkcm/cmk-core/internal/model" - "github.com/openkcm/cmk-core/utils/ptr" + "github.com/openkcm/cmk/internal/api/cmkapi" + "github.com/openkcm/cmk/internal/api/transform/system" + "github.com/openkcm/cmk/internal/config" + "github.com/openkcm/cmk/internal/model" + "github.com/openkcm/cmk/utils/ptr" ) func TestToAPI(t *testing.T) { diff --git a/internal/api/transform/tags/tags.go b/internal/api/transform/tags/tags.go index 411fe54f..28755169 100644 --- a/internal/api/transform/tags/tags.go +++ b/internal/api/transform/tags/tags.go @@ -3,9 +3,9 @@ package tags import ( "github.com/google/uuid" - "github.com/openkcm/cmk-core/internal/api/cmkapi" - "github.com/openkcm/cmk-core/internal/model" - "github.com/openkcm/cmk-core/utils/ptr" + "github.com/openkcm/cmk/internal/api/cmkapi" + "github.com/openkcm/cmk/internal/model" + "github.com/openkcm/cmk/utils/ptr" ) type TagSetter interface { diff --git a/internal/api/transform/tags/tags_test.go b/internal/api/transform/tags/tags_test.go index c5fe23da..a9de99a9 100644 --- a/internal/api/transform/tags/tags_test.go +++ b/internal/api/transform/tags/tags_test.go @@ -6,10 +6,10 @@ import ( "github.com/google/uuid" "github.com/stretchr/testify/assert" - "github.com/openkcm/cmk-core/internal/api/cmkapi" - "github.com/openkcm/cmk-core/internal/api/transform/tags" - "github.com/openkcm/cmk-core/internal/model" - "github.com/openkcm/cmk-core/utils/ptr" + "github.com/openkcm/cmk/internal/api/cmkapi" + "github.com/openkcm/cmk/internal/api/transform/tags" + "github.com/openkcm/cmk/internal/model" + "github.com/openkcm/cmk/utils/ptr" ) func TestFromAPI(t *testing.T) { diff --git a/internal/api/transform/tenant/tenant.go b/internal/api/transform/tenant/tenant.go index 69557ffe..dbbb6ed5 100644 --- a/internal/api/transform/tenant/tenant.go +++ b/internal/api/transform/tenant/tenant.go @@ -1,8 +1,8 @@ package tenant import ( - "github.com/openkcm/cmk-core/internal/api/cmkapi" - "github.com/openkcm/cmk-core/internal/model" + "github.com/openkcm/cmk/internal/api/cmkapi" + "github.com/openkcm/cmk/internal/model" ) // ToAPI transforms a system model to an API system. diff --git a/internal/api/transform/tenantconfigs/keystore.go b/internal/api/transform/tenantconfigs/keystore.go index 147d1116..78286b07 100644 --- a/internal/api/transform/tenantconfigs/keystore.go +++ b/internal/api/transform/tenantconfigs/keystore.go @@ -1,8 +1,8 @@ package tenantconfigs import ( - "github.com/openkcm/cmk-core/internal/api/cmkapi" - "github.com/openkcm/cmk-core/internal/manager" + "github.com/openkcm/cmk/internal/api/cmkapi" + "github.com/openkcm/cmk/internal/manager" ) // ToAPI transforms a system model to an API system. diff --git a/internal/api/transform/tenantconfigs/keystore_test.go b/internal/api/transform/tenantconfigs/keystore_test.go index 8d5b9f19..fffe2783 100644 --- a/internal/api/transform/tenantconfigs/keystore_test.go +++ b/internal/api/transform/tenantconfigs/keystore_test.go @@ -5,11 +5,11 @@ import ( "github.com/stretchr/testify/assert" - "github.com/openkcm/cmk-core/internal/api/cmkapi" - "github.com/openkcm/cmk-core/internal/api/transform/tenantconfigs" - "github.com/openkcm/cmk-core/internal/manager" - "github.com/openkcm/cmk-core/internal/model" - "github.com/openkcm/cmk-core/utils/ptr" + "github.com/openkcm/cmk/internal/api/cmkapi" + "github.com/openkcm/cmk/internal/api/transform/tenantconfigs" + "github.com/openkcm/cmk/internal/manager" + "github.com/openkcm/cmk/internal/model" + "github.com/openkcm/cmk/utils/ptr" ) func TestToAPI(t *testing.T) { diff --git a/internal/api/transform/workflow/workflow.go b/internal/api/transform/workflow/workflow.go index 85339b1b..8d5ad1d3 100644 --- a/internal/api/transform/workflow/workflow.go +++ b/internal/api/transform/workflow/workflow.go @@ -5,10 +5,10 @@ import ( "github.com/google/uuid" - "github.com/openkcm/cmk-core/internal/api/cmkapi" - "github.com/openkcm/cmk-core/internal/api/transform" - "github.com/openkcm/cmk-core/internal/model" - "github.com/openkcm/cmk-core/utils/ptr" + "github.com/openkcm/cmk/internal/api/cmkapi" + "github.com/openkcm/cmk/internal/api/transform" + "github.com/openkcm/cmk/internal/model" + "github.com/openkcm/cmk/utils/ptr" ) // ToAPI converts a workflow model to an API workflow presentation. diff --git a/internal/api/transform/workflow/workflow_test.go b/internal/api/transform/workflow/workflow_test.go index 2b9ee1aa..36843bf7 100644 --- a/internal/api/transform/workflow/workflow_test.go +++ b/internal/api/transform/workflow/workflow_test.go @@ -6,11 +6,11 @@ import ( "github.com/google/uuid" "github.com/stretchr/testify/assert" - "github.com/openkcm/cmk-core/internal/api/cmkapi" - "github.com/openkcm/cmk-core/internal/api/transform/workflow" - "github.com/openkcm/cmk-core/internal/model" - "github.com/openkcm/cmk-core/internal/testutils" - "github.com/openkcm/cmk-core/utils/ptr" + "github.com/openkcm/cmk/internal/api/cmkapi" + "github.com/openkcm/cmk/internal/api/transform/workflow" + "github.com/openkcm/cmk/internal/model" + "github.com/openkcm/cmk/internal/testutils" + "github.com/openkcm/cmk/utils/ptr" ) func TestWorkflow_ToAPI(t *testing.T) { diff --git a/internal/api/write/write.go b/internal/api/write/write.go index 6ee57ce3..b0a3e925 100644 --- a/internal/api/write/write.go +++ b/internal/api/write/write.go @@ -5,9 +5,9 @@ import ( "encoding/json" "net/http" - "github.com/openkcm/cmk-core/internal/api/cmkapi" - "github.com/openkcm/cmk-core/internal/log" - cmkcontext "github.com/openkcm/cmk-core/utils/context" + "github.com/openkcm/cmk/internal/api/cmkapi" + "github.com/openkcm/cmk/internal/log" + cmkcontext "github.com/openkcm/cmk/utils/context" ) // ErrorResponse writes an error response to the client and logs the error diff --git a/internal/api/write/write_test.go b/internal/api/write/write_test.go index 59365322..e243153b 100644 --- a/internal/api/write/write_test.go +++ b/internal/api/write/write_test.go @@ -7,10 +7,10 @@ import ( "github.com/stretchr/testify/assert" - "github.com/openkcm/cmk-core/internal/api/cmkapi" - "github.com/openkcm/cmk-core/internal/api/write" - "github.com/openkcm/cmk-core/internal/testutils" - cmkcontext "github.com/openkcm/cmk-core/utils/context" + "github.com/openkcm/cmk/internal/api/cmkapi" + "github.com/openkcm/cmk/internal/api/write" + "github.com/openkcm/cmk/internal/testutils" + cmkcontext "github.com/openkcm/cmk/utils/context" ) func TestWriteErrorResponse(t *testing.T) { diff --git a/internal/apierrors/base.go b/internal/apierrors/base.go index 724d58e5..59044582 100644 --- a/internal/apierrors/base.go +++ b/internal/apierrors/base.go @@ -3,7 +3,7 @@ package apierrors import ( "net/http" - "github.com/openkcm/cmk-core/internal/api/cmkapi" + "github.com/openkcm/cmk/internal/api/cmkapi" ) const ( diff --git a/internal/apierrors/base_test.go b/internal/apierrors/base_test.go index 923c5502..7c95fb78 100644 --- a/internal/apierrors/base_test.go +++ b/internal/apierrors/base_test.go @@ -6,8 +6,8 @@ import ( "github.com/stretchr/testify/assert" - "github.com/openkcm/cmk-core/internal/api/cmkapi" - "github.com/openkcm/cmk-core/internal/apierrors" + "github.com/openkcm/cmk/internal/api/cmkapi" + "github.com/openkcm/cmk/internal/apierrors" ) func TestInternalServerErrorMessage(t *testing.T) { diff --git a/internal/apierrors/default.go b/internal/apierrors/default.go index fb6e4cd3..b8c24c4e 100644 --- a/internal/apierrors/default.go +++ b/internal/apierrors/default.go @@ -5,8 +5,8 @@ import ( "errors" "net/http" - "github.com/openkcm/cmk-core/internal/api/cmkapi" - "github.com/openkcm/cmk-core/internal/repo" + "github.com/openkcm/cmk/internal/api/cmkapi" + "github.com/openkcm/cmk/internal/repo" ) const ( diff --git a/internal/apierrors/export_test.go b/internal/apierrors/export_test.go index 45015f46..2ffaba15 100644 --- a/internal/apierrors/export_test.go +++ b/internal/apierrors/export_test.go @@ -3,7 +3,7 @@ package apierrors import ( "context" - "github.com/openkcm/cmk-core/internal/api/cmkapi" + "github.com/openkcm/cmk/internal/api/cmkapi" ) var ( diff --git a/internal/apierrors/groups.go b/internal/apierrors/groups.go index d04fb3fc..e4f87e30 100644 --- a/internal/apierrors/groups.go +++ b/internal/apierrors/groups.go @@ -3,9 +3,9 @@ package apierrors import ( "net/http" - "github.com/openkcm/cmk-core/internal/api/cmkapi" - "github.com/openkcm/cmk-core/internal/manager" - "github.com/openkcm/cmk-core/internal/repo" + "github.com/openkcm/cmk/internal/api/cmkapi" + "github.com/openkcm/cmk/internal/manager" + "github.com/openkcm/cmk/internal/repo" ) var groups = []APIErrors{ diff --git a/internal/apierrors/key.go b/internal/apierrors/key.go index fdbb7514..fb00e3a4 100644 --- a/internal/apierrors/key.go +++ b/internal/apierrors/key.go @@ -6,12 +6,12 @@ import ( "gorm.io/gorm" - "github.com/openkcm/cmk-core/internal/api/cmkapi" - "github.com/openkcm/cmk-core/internal/api/transform" - "github.com/openkcm/cmk-core/internal/api/transform/key/hyokkey" - "github.com/openkcm/cmk-core/internal/api/transform/key/keyshared" - "github.com/openkcm/cmk-core/internal/manager" - "github.com/openkcm/cmk-core/internal/repo" + "github.com/openkcm/cmk/internal/api/cmkapi" + "github.com/openkcm/cmk/internal/api/transform" + "github.com/openkcm/cmk/internal/api/transform/key/hyokkey" + "github.com/openkcm/cmk/internal/api/transform/key/keyshared" + "github.com/openkcm/cmk/internal/manager" + "github.com/openkcm/cmk/internal/repo" ) var ( diff --git a/internal/apierrors/keyconfiguration.go b/internal/apierrors/keyconfiguration.go index 77f4991b..d0b81500 100644 --- a/internal/apierrors/keyconfiguration.go +++ b/internal/apierrors/keyconfiguration.go @@ -4,9 +4,9 @@ import ( "errors" "net/http" - "github.com/openkcm/cmk-core/internal/api/cmkapi" - "github.com/openkcm/cmk-core/internal/manager" - "github.com/openkcm/cmk-core/internal/repo" + "github.com/openkcm/cmk/internal/api/cmkapi" + "github.com/openkcm/cmk/internal/manager" + "github.com/openkcm/cmk/internal/repo" ) var ( diff --git a/internal/apierrors/keyversion.go b/internal/apierrors/keyversion.go index 76fff6cc..2d56aff3 100644 --- a/internal/apierrors/keyversion.go +++ b/internal/apierrors/keyversion.go @@ -4,8 +4,8 @@ import ( "errors" "net/http" - "github.com/openkcm/cmk-core/internal/api/cmkapi" - "github.com/openkcm/cmk-core/internal/manager" + "github.com/openkcm/cmk/internal/api/cmkapi" + "github.com/openkcm/cmk/internal/manager" ) var ( diff --git a/internal/apierrors/labels.go b/internal/apierrors/labels.go index 0ee0f370..fe90bd25 100644 --- a/internal/apierrors/labels.go +++ b/internal/apierrors/labels.go @@ -6,8 +6,8 @@ import ( "gorm.io/gorm" - "github.com/openkcm/cmk-core/internal/api/cmkapi" - "github.com/openkcm/cmk-core/internal/manager" + "github.com/openkcm/cmk/internal/api/cmkapi" + "github.com/openkcm/cmk/internal/manager" ) var ( diff --git a/internal/apierrors/mapping.go b/internal/apierrors/mapping.go index 961603d9..e0963cf6 100644 --- a/internal/apierrors/mapping.go +++ b/internal/apierrors/mapping.go @@ -9,9 +9,9 @@ import ( slogctx "github.com/veqryn/slog-context" - "github.com/openkcm/cmk-core/internal/api/cmkapi" - "github.com/openkcm/cmk-core/internal/log" - "github.com/openkcm/cmk-core/utils/ptr" + "github.com/openkcm/cmk/internal/api/cmkapi" + "github.com/openkcm/cmk/internal/log" + "github.com/openkcm/cmk/utils/ptr" ) type APIErrorMapper struct { diff --git a/internal/apierrors/mapping_test.go b/internal/apierrors/mapping_test.go index 0a0e2fe5..911431b3 100644 --- a/internal/apierrors/mapping_test.go +++ b/internal/apierrors/mapping_test.go @@ -10,12 +10,12 @@ import ( "github.com/stretchr/testify/assert" "gorm.io/gorm" - "github.com/openkcm/cmk-core/internal/api/cmkapi" - "github.com/openkcm/cmk-core/internal/apierrors" - "github.com/openkcm/cmk-core/internal/errs" - "github.com/openkcm/cmk-core/internal/manager" - "github.com/openkcm/cmk-core/internal/repo" - "github.com/openkcm/cmk-core/utils/ptr" + "github.com/openkcm/cmk/internal/api/cmkapi" + "github.com/openkcm/cmk/internal/apierrors" + "github.com/openkcm/cmk/internal/errs" + "github.com/openkcm/cmk/internal/manager" + "github.com/openkcm/cmk/internal/repo" + "github.com/openkcm/cmk/utils/ptr" ) var ( diff --git a/internal/apierrors/priority.go b/internal/apierrors/priority.go index b922d25c..300f0ccb 100644 --- a/internal/apierrors/priority.go +++ b/internal/apierrors/priority.go @@ -3,8 +3,8 @@ package apierrors import ( "net/http" - "github.com/openkcm/cmk-core/internal/api/cmkapi" - "github.com/openkcm/cmk-core/internal/repo" + "github.com/openkcm/cmk/internal/api/cmkapi" + "github.com/openkcm/cmk/internal/repo" ) const ( diff --git a/internal/apierrors/system.go b/internal/apierrors/system.go index 0d26879a..66bdd2ad 100644 --- a/internal/apierrors/system.go +++ b/internal/apierrors/system.go @@ -6,10 +6,10 @@ import ( "gorm.io/gorm" - "github.com/openkcm/cmk-core/internal/api/cmkapi" - registryClient "github.com/openkcm/cmk-core/internal/clients/registry/systems" - "github.com/openkcm/cmk-core/internal/manager" - "github.com/openkcm/cmk-core/internal/repo" + "github.com/openkcm/cmk/internal/api/cmkapi" + registryClient "github.com/openkcm/cmk/internal/clients/registry/systems" + "github.com/openkcm/cmk/internal/manager" + "github.com/openkcm/cmk/internal/repo" ) var ( diff --git a/internal/apierrors/tags.go b/internal/apierrors/tags.go index a4332d09..5dea81fb 100644 --- a/internal/apierrors/tags.go +++ b/internal/apierrors/tags.go @@ -4,7 +4,7 @@ import ( "errors" "net/http" - "github.com/openkcm/cmk-core/internal/api/cmkapi" + "github.com/openkcm/cmk/internal/api/cmkapi" ) var ( diff --git a/internal/apierrors/tenant.go b/internal/apierrors/tenant.go index 3167e2c4..b9dddbef 100644 --- a/internal/apierrors/tenant.go +++ b/internal/apierrors/tenant.go @@ -4,7 +4,7 @@ import ( "errors" "net/http" - "github.com/openkcm/cmk-core/internal/api/cmkapi" + "github.com/openkcm/cmk/internal/api/cmkapi" ) var ( diff --git a/internal/apierrors/tenantconfigs.go b/internal/apierrors/tenantconfigs.go index bc1d9f97..449b1ba5 100644 --- a/internal/apierrors/tenantconfigs.go +++ b/internal/apierrors/tenantconfigs.go @@ -4,7 +4,7 @@ import ( "errors" "net/http" - "github.com/openkcm/cmk-core/internal/api/cmkapi" + "github.com/openkcm/cmk/internal/api/cmkapi" ) var ErrGetDefaultKeystore = errors.New("failed to get default keystore") diff --git a/internal/apierrors/workflow.go b/internal/apierrors/workflow.go index 7ee17513..a2a28434 100644 --- a/internal/apierrors/workflow.go +++ b/internal/apierrors/workflow.go @@ -4,10 +4,10 @@ import ( "errors" "net/http" - "github.com/openkcm/cmk-core/internal/api/cmkapi" - "github.com/openkcm/cmk-core/internal/manager" - "github.com/openkcm/cmk-core/internal/repo" - workflowpkg "github.com/openkcm/cmk-core/internal/workflow" + "github.com/openkcm/cmk/internal/api/cmkapi" + "github.com/openkcm/cmk/internal/manager" + "github.com/openkcm/cmk/internal/repo" + workflowpkg "github.com/openkcm/cmk/internal/workflow" ) var ( diff --git a/internal/async/async.go b/internal/async/async.go index d6374a36..192fce4a 100644 --- a/internal/async/async.go +++ b/internal/async/async.go @@ -12,15 +12,15 @@ import ( multitenancy "github.com/bartventer/gorm-multitenancy/v8" - "github.com/openkcm/cmk-core/internal/async/tasks" - conf "github.com/openkcm/cmk-core/internal/config" - "github.com/openkcm/cmk-core/internal/db" - "github.com/openkcm/cmk-core/internal/errs" - eventprocessor "github.com/openkcm/cmk-core/internal/event-processor" - "github.com/openkcm/cmk-core/internal/grpc/catalog" - "github.com/openkcm/cmk-core/internal/log" - "github.com/openkcm/cmk-core/internal/manager" - "github.com/openkcm/cmk-core/internal/repo/sql" + "github.com/openkcm/cmk/internal/async/tasks" + conf "github.com/openkcm/cmk/internal/config" + "github.com/openkcm/cmk/internal/db" + "github.com/openkcm/cmk/internal/errs" + eventprocessor "github.com/openkcm/cmk/internal/event-processor" + "github.com/openkcm/cmk/internal/grpc/catalog" + "github.com/openkcm/cmk/internal/log" + "github.com/openkcm/cmk/internal/manager" + "github.com/openkcm/cmk/internal/repo/sql" ) const ( diff --git a/internal/async/async_test.go b/internal/async/async_test.go index e9fdc923..c253a25e 100644 --- a/internal/async/async_test.go +++ b/internal/async/async_test.go @@ -8,9 +8,9 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/openkcm/cmk-core/internal/async" - conf "github.com/openkcm/cmk-core/internal/config" - "github.com/openkcm/cmk-core/internal/testutils" + "github.com/openkcm/cmk/internal/async" + conf "github.com/openkcm/cmk/internal/config" + "github.com/openkcm/cmk/internal/testutils" ) func defaultRedisConfig(tlsFiles testutils.TLSFiles) conf.Redis { diff --git a/internal/async/scheduler_task_config.go b/internal/async/scheduler_task_config.go index ff5c712f..e4c16de1 100644 --- a/internal/async/scheduler_task_config.go +++ b/internal/async/scheduler_task_config.go @@ -3,7 +3,7 @@ package async import ( "github.com/hibiken/asynq" - "github.com/openkcm/cmk-core/internal/config" + "github.com/openkcm/cmk/internal/config" ) // ScheduledTaskConfigProvider implements asynq PeriodicTaskConfigProvider interface. diff --git a/internal/async/scheduler_task_config_test.go b/internal/async/scheduler_task_config_test.go index 556b59c4..86a7168f 100644 --- a/internal/async/scheduler_task_config_test.go +++ b/internal/async/scheduler_task_config_test.go @@ -5,8 +5,8 @@ import ( "github.com/stretchr/testify/assert" - "github.com/openkcm/cmk-core/internal/async" - "github.com/openkcm/cmk-core/internal/config" + "github.com/openkcm/cmk/internal/async" + "github.com/openkcm/cmk/internal/config" ) func TestGetConfigs(t *testing.T) { diff --git a/internal/async/tasks/cert_rotation.go b/internal/async/tasks/cert_rotation.go index 1ee6a68a..7bc68cbd 100644 --- a/internal/async/tasks/cert_rotation.go +++ b/internal/async/tasks/cert_rotation.go @@ -7,13 +7,13 @@ import ( "github.com/hibiken/asynq" - "github.com/openkcm/cmk-core/internal/config" - "github.com/openkcm/cmk-core/internal/errs" - "github.com/openkcm/cmk-core/internal/log" - "github.com/openkcm/cmk-core/internal/manager" - "github.com/openkcm/cmk-core/internal/model" - "github.com/openkcm/cmk-core/internal/repo" - cmkcontext "github.com/openkcm/cmk-core/utils/context" + "github.com/openkcm/cmk/internal/config" + "github.com/openkcm/cmk/internal/errs" + "github.com/openkcm/cmk/internal/log" + "github.com/openkcm/cmk/internal/manager" + "github.com/openkcm/cmk/internal/model" + "github.com/openkcm/cmk/internal/repo" + cmkcontext "github.com/openkcm/cmk/utils/context" ) type CertUpdater interface { diff --git a/internal/async/tasks/cert_rotation_test.go b/internal/async/tasks/cert_rotation_test.go index 9de6bf0f..4cb65b01 100644 --- a/internal/async/tasks/cert_rotation_test.go +++ b/internal/async/tasks/cert_rotation_test.go @@ -8,11 +8,11 @@ import ( "github.com/bartventer/gorm-multitenancy/v8/pkg/driver" "github.com/stretchr/testify/assert" - "github.com/openkcm/cmk-core/internal/async/tasks" - "github.com/openkcm/cmk-core/internal/manager" - "github.com/openkcm/cmk-core/internal/model" - "github.com/openkcm/cmk-core/internal/repo/sql" - "github.com/openkcm/cmk-core/internal/testutils" + "github.com/openkcm/cmk/internal/async/tasks" + "github.com/openkcm/cmk/internal/manager" + "github.com/openkcm/cmk/internal/model" + "github.com/openkcm/cmk/internal/repo/sql" + "github.com/openkcm/cmk/internal/testutils" ) type CertUpdaterMock struct{} diff --git a/internal/async/tasks/hyok_sync.go b/internal/async/tasks/hyok_sync.go index bec5f014..8cae1f4f 100644 --- a/internal/async/tasks/hyok_sync.go +++ b/internal/async/tasks/hyok_sync.go @@ -5,12 +5,12 @@ import ( "github.com/hibiken/asynq" - "github.com/openkcm/cmk-core/internal/config" - "github.com/openkcm/cmk-core/internal/errs" - "github.com/openkcm/cmk-core/internal/log" - "github.com/openkcm/cmk-core/internal/model" - "github.com/openkcm/cmk-core/internal/repo" - cmkcontext "github.com/openkcm/cmk-core/utils/context" + "github.com/openkcm/cmk/internal/config" + "github.com/openkcm/cmk/internal/errs" + "github.com/openkcm/cmk/internal/log" + "github.com/openkcm/cmk/internal/model" + "github.com/openkcm/cmk/internal/repo" + cmkcontext "github.com/openkcm/cmk/utils/context" ) type HYOKUpdater interface { diff --git a/internal/async/tasks/hyok_sync_test.go b/internal/async/tasks/hyok_sync_test.go index 10093c3d..bff3d54c 100644 --- a/internal/async/tasks/hyok_sync_test.go +++ b/internal/async/tasks/hyok_sync_test.go @@ -8,10 +8,10 @@ import ( "github.com/bartventer/gorm-multitenancy/v8/pkg/driver" "github.com/stretchr/testify/assert" - "github.com/openkcm/cmk-core/internal/async/tasks" - "github.com/openkcm/cmk-core/internal/config" - "github.com/openkcm/cmk-core/internal/repo/sql" - "github.com/openkcm/cmk-core/internal/testutils" + "github.com/openkcm/cmk/internal/async/tasks" + "github.com/openkcm/cmk/internal/config" + "github.com/openkcm/cmk/internal/repo/sql" + "github.com/openkcm/cmk/internal/testutils" ) var errMockSyncHYOKClient = errors.New("error syncing hyok client") diff --git a/internal/async/tasks/keystore_pool.go b/internal/async/tasks/keystore_pool.go index d50441fd..3e6eb334 100644 --- a/internal/async/tasks/keystore_pool.go +++ b/internal/async/tasks/keystore_pool.go @@ -5,9 +5,9 @@ import ( "github.com/hibiken/asynq" - "github.com/openkcm/cmk-core/internal/config" - "github.com/openkcm/cmk-core/internal/log" - "github.com/openkcm/cmk-core/internal/repo" + "github.com/openkcm/cmk/internal/config" + "github.com/openkcm/cmk/internal/log" + "github.com/openkcm/cmk/internal/repo" ) type KeystorePoolUpdater interface { diff --git a/internal/async/tasks/keystore_pool_test.go b/internal/async/tasks/keystore_pool_test.go index c51d946d..02e430af 100644 --- a/internal/async/tasks/keystore_pool_test.go +++ b/internal/async/tasks/keystore_pool_test.go @@ -7,10 +7,10 @@ import ( "github.com/bartventer/gorm-multitenancy/v8/pkg/driver" "github.com/stretchr/testify/assert" - "github.com/openkcm/cmk-core/internal/async/tasks" - "github.com/openkcm/cmk-core/internal/config" - "github.com/openkcm/cmk-core/internal/repo/sql" - "github.com/openkcm/cmk-core/internal/testutils" + "github.com/openkcm/cmk/internal/async/tasks" + "github.com/openkcm/cmk/internal/config" + "github.com/openkcm/cmk/internal/repo/sql" + "github.com/openkcm/cmk/internal/testutils" ) type KeystorePoolFillerMock struct{} diff --git a/internal/async/tasks/system_refresh.go b/internal/async/tasks/system_refresh.go index b2fb3df7..c220c186 100644 --- a/internal/async/tasks/system_refresh.go +++ b/internal/async/tasks/system_refresh.go @@ -7,12 +7,12 @@ import ( "google.golang.org/grpc/codes" "google.golang.org/grpc/status" - "github.com/openkcm/cmk-core/internal/config" - "github.com/openkcm/cmk-core/internal/errs" - "github.com/openkcm/cmk-core/internal/log" - "github.com/openkcm/cmk-core/internal/model" - "github.com/openkcm/cmk-core/internal/repo" - cmkcontext "github.com/openkcm/cmk-core/utils/context" + "github.com/openkcm/cmk/internal/config" + "github.com/openkcm/cmk/internal/errs" + "github.com/openkcm/cmk/internal/log" + "github.com/openkcm/cmk/internal/model" + "github.com/openkcm/cmk/internal/repo" + cmkcontext "github.com/openkcm/cmk/utils/context" ) type SystemUpdater interface { diff --git a/internal/async/tasks/system_refresh_test.go b/internal/async/tasks/system_refresh_test.go index 51564847..06f4889a 100644 --- a/internal/async/tasks/system_refresh_test.go +++ b/internal/async/tasks/system_refresh_test.go @@ -9,9 +9,9 @@ import ( "google.golang.org/grpc/codes" "google.golang.org/grpc/status" - "github.com/openkcm/cmk-core/internal/async/tasks" - "github.com/openkcm/cmk-core/internal/repo/sql" - "github.com/openkcm/cmk-core/internal/testutils" + "github.com/openkcm/cmk/internal/async/tasks" + "github.com/openkcm/cmk/internal/repo/sql" + "github.com/openkcm/cmk/internal/testutils" ) type SystemUpdaterMock struct{} diff --git a/internal/auditor/auditor.go b/internal/auditor/auditor.go index 699f0a98..d44d9fd3 100644 --- a/internal/auditor/auditor.go +++ b/internal/auditor/auditor.go @@ -8,10 +8,10 @@ import ( otlpaudit "github.com/openkcm/common-sdk/pkg/otlp/audit" - "github.com/openkcm/cmk-core/internal/config" - "github.com/openkcm/cmk-core/internal/errs" - "github.com/openkcm/cmk-core/internal/log" - cmkcontext "github.com/openkcm/cmk-core/utils/context" + "github.com/openkcm/cmk/internal/config" + "github.com/openkcm/cmk/internal/errs" + "github.com/openkcm/cmk/internal/log" + cmkcontext "github.com/openkcm/cmk/utils/context" ) var ( diff --git a/internal/auditor/auditor_test.go b/internal/auditor/auditor_test.go index 66617e2a..9cef3ef1 100644 --- a/internal/auditor/auditor_test.go +++ b/internal/auditor/auditor_test.go @@ -9,9 +9,9 @@ import ( otlpaudit "github.com/openkcm/common-sdk/pkg/otlp/audit" - "github.com/openkcm/cmk-core/internal/auditor" - "github.com/openkcm/cmk-core/internal/config" - cmkcontext "github.com/openkcm/cmk-core/utils/context" + "github.com/openkcm/cmk/internal/auditor" + "github.com/openkcm/cmk/internal/config" + cmkcontext "github.com/openkcm/cmk/utils/context" ) func createTestContext() context.Context { diff --git a/internal/auditor/key_test.go b/internal/auditor/key_test.go index 13394510..2ec066b5 100644 --- a/internal/auditor/key_test.go +++ b/internal/auditor/key_test.go @@ -10,8 +10,8 @@ import ( "github.com/openkcm/common-sdk/pkg/commoncfg" "github.com/stretchr/testify/assert" - "github.com/openkcm/cmk-core/internal/auditor" - "github.com/openkcm/cmk-core/internal/config" + "github.com/openkcm/cmk/internal/auditor" + "github.com/openkcm/cmk/internal/config" ) func createTestAuditor(endpoint string) *auditor.Auditor { diff --git a/internal/auditor/system_test.go b/internal/auditor/system_test.go index c807b21e..06f5428a 100644 --- a/internal/auditor/system_test.go +++ b/internal/auditor/system_test.go @@ -10,7 +10,7 @@ import ( otlpaudit "github.com/openkcm/common-sdk/pkg/otlp/audit" - "github.com/openkcm/cmk-core/internal/auditor" + "github.com/openkcm/cmk/internal/auditor" ) func testCmkSystemAuditMethod( diff --git a/internal/authz/authorization.go b/internal/authz/authorization.go index e123ecad..df45e5dd 100644 --- a/internal/authz/authorization.go +++ b/internal/authz/authorization.go @@ -4,9 +4,9 @@ import ( "context" "errors" - "github.com/openkcm/cmk-core/internal/constants" - "github.com/openkcm/cmk-core/internal/errs" - cmkcontext "github.com/openkcm/cmk-core/utils/context" + "github.com/openkcm/cmk/internal/constants" + "github.com/openkcm/cmk/internal/errs" + cmkcontext "github.com/openkcm/cmk/utils/context" ) type UserGroup string diff --git a/internal/authz/authorization_data.go b/internal/authz/authorization_data.go index 5ea1e3e6..d085cddb 100644 --- a/internal/authz/authorization_data.go +++ b/internal/authz/authorization_data.go @@ -3,7 +3,7 @@ package authz import ( "errors" - "github.com/openkcm/cmk-core/internal/errs" + "github.com/openkcm/cmk/internal/errs" ) type AuthorizationKey struct { diff --git a/internal/authz/authorization_test.go b/internal/authz/authorization_test.go index 1b27c119..be04f172 100644 --- a/internal/authz/authorization_test.go +++ b/internal/authz/authorization_test.go @@ -4,9 +4,9 @@ import ( "fmt" "testing" - "github.com/openkcm/cmk-core/internal/authz" - "github.com/openkcm/cmk-core/internal/constants" - "github.com/openkcm/cmk-core/internal/testutils" + "github.com/openkcm/cmk/internal/authz" + "github.com/openkcm/cmk/internal/constants" + "github.com/openkcm/cmk/internal/testutils" ) // TestIsAllowed tests the IsAllowed function of the AuthorizationHandler diff --git a/internal/authz/authz_logging.go b/internal/authz/authz_logging.go index c1019513..b9128ad8 100644 --- a/internal/authz/authz_logging.go +++ b/internal/authz/authz_logging.go @@ -4,7 +4,7 @@ import ( "context" "log/slog" - "github.com/openkcm/cmk-core/internal/log" + "github.com/openkcm/cmk/internal/log" ) type Reason string diff --git a/internal/authz/policies.go b/internal/authz/policies.go index bc3c4e57..c849e5a4 100644 --- a/internal/authz/policies.go +++ b/internal/authz/policies.go @@ -1,6 +1,6 @@ package authz -import "github.com/openkcm/cmk-core/internal/constants" +import "github.com/openkcm/cmk/internal/constants" type ( ResourceTypeName string diff --git a/internal/authz/request.go b/internal/authz/request.go index 91e5e7f3..a7c7b7c7 100644 --- a/internal/authz/request.go +++ b/internal/authz/request.go @@ -4,8 +4,8 @@ import ( "context" "errors" - "github.com/openkcm/cmk-core/internal/errs" - cmkcontext "github.com/openkcm/cmk-core/utils/context" + "github.com/openkcm/cmk/internal/errs" + cmkcontext "github.com/openkcm/cmk/utils/context" ) type User struct { diff --git a/internal/authz/request_test.go b/internal/authz/request_test.go index 07f40704..e6e3fd0c 100644 --- a/internal/authz/request_test.go +++ b/internal/authz/request_test.go @@ -5,9 +5,9 @@ import ( "github.com/stretchr/testify/assert" - "github.com/openkcm/cmk-core/internal/authz" - "github.com/openkcm/cmk-core/internal/testutils" - cmkcontext "github.com/openkcm/cmk-core/utils/context" + "github.com/openkcm/cmk/internal/authz" + "github.com/openkcm/cmk/internal/testutils" + cmkcontext "github.com/openkcm/cmk/utils/context" ) func TestNewRequest_ValidCases(t *testing.T) { diff --git a/internal/clients/factory.go b/internal/clients/factory.go index a50d482e..9e5e4b5a 100644 --- a/internal/clients/factory.go +++ b/internal/clients/factory.go @@ -3,8 +3,8 @@ package clients import ( "errors" - "github.com/openkcm/cmk-core/internal/clients/registry" - "github.com/openkcm/cmk-core/internal/config" + "github.com/openkcm/cmk/internal/clients/registry" + "github.com/openkcm/cmk/internal/config" ) type Factory struct { diff --git a/internal/clients/registry/registry.go b/internal/clients/registry/registry.go index 7c304662..6394f87c 100644 --- a/internal/clients/registry/registry.go +++ b/internal/clients/registry/registry.go @@ -8,7 +8,7 @@ import ( tenantgrpc "github.com/openkcm/api-sdk/proto/kms/api/cmk/registry/tenant/v1" - "github.com/openkcm/cmk-core/internal/clients/registry/systems" + "github.com/openkcm/cmk/internal/clients/registry/systems" ) const ( diff --git a/internal/clients/registry/systems/client.go b/internal/clients/registry/systems/client.go index dbbc87a4..b7d3688d 100644 --- a/internal/clients/registry/systems/client.go +++ b/internal/clients/registry/systems/client.go @@ -12,8 +12,8 @@ import ( systemgrpc "github.com/openkcm/api-sdk/proto/kms/api/cmk/registry/system/v1" - "github.com/openkcm/cmk-core/internal/errs" - "github.com/openkcm/cmk-core/internal/model" + "github.com/openkcm/cmk/internal/errs" + "github.com/openkcm/cmk/internal/model" ) const ( diff --git a/internal/clients/registry/systems/client_test.go b/internal/clients/registry/systems/client_test.go index a58a7f9c..3612c499 100644 --- a/internal/clients/registry/systems/client_test.go +++ b/internal/clients/registry/systems/client_test.go @@ -12,8 +12,8 @@ import ( systemgrpc "github.com/openkcm/api-sdk/proto/kms/api/cmk/registry/system/v1" - "github.com/openkcm/cmk-core/internal/clients/registry/systems" - "github.com/openkcm/cmk-core/internal/testutils" + "github.com/openkcm/cmk/internal/clients/registry/systems" + "github.com/openkcm/cmk/internal/testutils" ) const ( diff --git a/internal/clients/registry/systems/fake_service.go b/internal/clients/registry/systems/fake_service.go index 46e01617..890caaee 100644 --- a/internal/clients/registry/systems/fake_service.go +++ b/internal/clients/registry/systems/fake_service.go @@ -9,7 +9,7 @@ import ( systemv1 "github.com/openkcm/api-sdk/proto/kms/api/cmk/registry/system/v1" - "github.com/openkcm/cmk-core/internal/errs" + "github.com/openkcm/cmk/internal/errs" ) type FakeService struct { diff --git a/internal/clients/registry/systems/helpers_test.go b/internal/clients/registry/systems/helpers_test.go index c9da9a89..12e1473d 100644 --- a/internal/clients/registry/systems/helpers_test.go +++ b/internal/clients/registry/systems/helpers_test.go @@ -8,7 +8,7 @@ import ( systemgrpc "github.com/openkcm/api-sdk/proto/kms/api/cmk/registry/system/v1" regionpb "github.com/openkcm/api-sdk/proto/kms/api/cmk/types/v1" - "github.com/openkcm/cmk-core/internal/clients/registry/systems" + "github.com/openkcm/cmk/internal/clients/registry/systems" ) func randExternalID() string { diff --git a/internal/clients/registry/systems/mapper.go b/internal/clients/registry/systems/mapper.go index cb05e181..e5c1aec4 100644 --- a/internal/clients/registry/systems/mapper.go +++ b/internal/clients/registry/systems/mapper.go @@ -5,7 +5,7 @@ import ( systemgrpc "github.com/openkcm/api-sdk/proto/kms/api/cmk/registry/system/v1" - "github.com/openkcm/cmk-core/internal/model" + "github.com/openkcm/cmk/internal/model" ) func MapRegistrySystemsToCmkSystems(grpcSystems []*systemgrpc.System) ([]*model.System, error) { diff --git a/internal/clients/registry/systems/mapper_test.go b/internal/clients/registry/systems/mapper_test.go index 2f4df7ee..f06f26c3 100644 --- a/internal/clients/registry/systems/mapper_test.go +++ b/internal/clients/registry/systems/mapper_test.go @@ -8,8 +8,8 @@ import ( systemgrpc "github.com/openkcm/api-sdk/proto/kms/api/cmk/registry/system/v1" v1 "github.com/openkcm/api-sdk/proto/kms/api/cmk/types/v1" - "github.com/openkcm/cmk-core/internal/clients/registry/systems" - "github.com/openkcm/cmk-core/internal/model" + "github.com/openkcm/cmk/internal/clients/registry/systems" + "github.com/openkcm/cmk/internal/model" ) func Test_MapRegistrySystemsToCmkSystems(t *testing.T) { diff --git a/internal/config/config.go b/internal/config/config.go index 391dd60b..331529f8 100644 --- a/internal/config/config.go +++ b/internal/config/config.go @@ -8,7 +8,7 @@ import ( plugincatalog "github.com/openkcm/plugin-sdk/pkg/catalog" - "github.com/openkcm/cmk-core/internal/errs" + "github.com/openkcm/cmk/internal/errs" ) var ( diff --git a/internal/config/config_test.go b/internal/config/config_test.go index 63a5cda3..315fdcfb 100644 --- a/internal/config/config_test.go +++ b/internal/config/config_test.go @@ -6,8 +6,8 @@ import ( "github.com/openkcm/common-sdk/pkg/commoncfg" "github.com/stretchr/testify/assert" - "github.com/openkcm/cmk-core/internal/config" - "github.com/openkcm/cmk-core/internal/testutils" + "github.com/openkcm/cmk/internal/config" + "github.com/openkcm/cmk/internal/testutils" ) func TestValidateCertificate(t *testing.T) { diff --git a/internal/constants/logging_test.go b/internal/constants/logging_test.go index 7d7b4d72..7500a04d 100644 --- a/internal/constants/logging_test.go +++ b/internal/constants/logging_test.go @@ -3,7 +3,7 @@ package constants_test import ( "testing" - "github.com/openkcm/cmk-core/internal/constants" + "github.com/openkcm/cmk/internal/constants" ) func TestLogLevel_String(t *testing.T) { diff --git a/internal/controllers/cmk/base_controller.go b/internal/controllers/cmk/base_controller.go index f55a6a78..cb1cc5e2 100644 --- a/internal/controllers/cmk/base_controller.go +++ b/internal/controllers/cmk/base_controller.go @@ -5,13 +5,13 @@ import ( plugincatalog "github.com/openkcm/plugin-sdk/pkg/catalog" - "github.com/openkcm/cmk-core/internal/clients" - "github.com/openkcm/cmk-core/internal/config" - eventprocessor "github.com/openkcm/cmk-core/internal/event-processor" - "github.com/openkcm/cmk-core/internal/grpc/catalog" - "github.com/openkcm/cmk-core/internal/log" - "github.com/openkcm/cmk-core/internal/manager" - "github.com/openkcm/cmk-core/internal/repo" + "github.com/openkcm/cmk/internal/clients" + "github.com/openkcm/cmk/internal/config" + eventprocessor "github.com/openkcm/cmk/internal/event-processor" + "github.com/openkcm/cmk/internal/grpc/catalog" + "github.com/openkcm/cmk/internal/log" + "github.com/openkcm/cmk/internal/manager" + "github.com/openkcm/cmk/internal/repo" ) // APIController handles API requests related to CMK (Customer Managed Keys). diff --git a/internal/controllers/cmk/group_controller.go b/internal/controllers/cmk/group_controller.go index 3c346d91..bde3ec8a 100644 --- a/internal/controllers/cmk/group_controller.go +++ b/internal/controllers/cmk/group_controller.go @@ -3,16 +3,16 @@ package cmk import ( "context" - "github.com/openkcm/cmk-core/internal/api/cmkapi" - "github.com/openkcm/cmk-core/internal/api/transform" - tfGroup "github.com/openkcm/cmk-core/internal/api/transform/group" - "github.com/openkcm/cmk-core/internal/apierrors" - "github.com/openkcm/cmk-core/internal/constants" - "github.com/openkcm/cmk-core/internal/errs" - "github.com/openkcm/cmk-core/internal/manager" - "github.com/openkcm/cmk-core/internal/model" - cmkcontext "github.com/openkcm/cmk-core/utils/context" - "github.com/openkcm/cmk-core/utils/ptr" + "github.com/openkcm/cmk/internal/api/cmkapi" + "github.com/openkcm/cmk/internal/api/transform" + tfGroup "github.com/openkcm/cmk/internal/api/transform/group" + "github.com/openkcm/cmk/internal/apierrors" + "github.com/openkcm/cmk/internal/constants" + "github.com/openkcm/cmk/internal/errs" + "github.com/openkcm/cmk/internal/manager" + "github.com/openkcm/cmk/internal/model" + cmkcontext "github.com/openkcm/cmk/utils/context" + "github.com/openkcm/cmk/utils/ptr" ) func (c *APIController) GetGroups(ctx context.Context, diff --git a/internal/controllers/cmk/group_controller_test.go b/internal/controllers/cmk/group_controller_test.go index 65f38f84..57b9b069 100644 --- a/internal/controllers/cmk/group_controller_test.go +++ b/internal/controllers/cmk/group_controller_test.go @@ -12,12 +12,12 @@ import ( multitenancy "github.com/bartventer/gorm-multitenancy/v8" - "github.com/openkcm/cmk-core/internal/api/cmkapi" - "github.com/openkcm/cmk-core/internal/constants" - "github.com/openkcm/cmk-core/internal/model" - "github.com/openkcm/cmk-core/internal/repo/sql" - "github.com/openkcm/cmk-core/internal/testutils" - "github.com/openkcm/cmk-core/utils/ptr" + "github.com/openkcm/cmk/internal/api/cmkapi" + "github.com/openkcm/cmk/internal/constants" + "github.com/openkcm/cmk/internal/model" + "github.com/openkcm/cmk/internal/repo/sql" + "github.com/openkcm/cmk/internal/testutils" + "github.com/openkcm/cmk/utils/ptr" ) func startAPIGroups(t *testing.T) (*multitenancy.DB, *http.ServeMux, string) { diff --git a/internal/controllers/cmk/key_controller.go b/internal/controllers/cmk/key_controller.go index 361c8852..72d13d88 100644 --- a/internal/controllers/cmk/key_controller.go +++ b/internal/controllers/cmk/key_controller.go @@ -3,15 +3,15 @@ package cmk import ( "context" - "github.com/openkcm/cmk-core/internal/api/cmkapi" - "github.com/openkcm/cmk-core/internal/api/transform/importparams" - keyTransform "github.com/openkcm/cmk-core/internal/api/transform/key" - "github.com/openkcm/cmk-core/internal/api/transform/key/keyshared" - "github.com/openkcm/cmk-core/internal/api/transform/key/transformer" - "github.com/openkcm/cmk-core/internal/apierrors" - "github.com/openkcm/cmk-core/internal/constants" - "github.com/openkcm/cmk-core/internal/errs" - "github.com/openkcm/cmk-core/utils/ptr" + "github.com/openkcm/cmk/internal/api/cmkapi" + "github.com/openkcm/cmk/internal/api/transform/importparams" + keyTransform "github.com/openkcm/cmk/internal/api/transform/key" + "github.com/openkcm/cmk/internal/api/transform/key/keyshared" + "github.com/openkcm/cmk/internal/api/transform/key/transformer" + "github.com/openkcm/cmk/internal/apierrors" + "github.com/openkcm/cmk/internal/constants" + "github.com/openkcm/cmk/internal/errs" + "github.com/openkcm/cmk/utils/ptr" ) // PostKeys handles the creation of a new key diff --git a/internal/controllers/cmk/key_controller_test.go b/internal/controllers/cmk/key_controller_test.go index 08b5c1ef..7cc82585 100644 --- a/internal/controllers/cmk/key_controller_test.go +++ b/internal/controllers/cmk/key_controller_test.go @@ -17,13 +17,13 @@ import ( multitenancy "github.com/bartventer/gorm-multitenancy/v8" - "github.com/openkcm/cmk-core/internal/api/cmkapi" - "github.com/openkcm/cmk-core/internal/model" - "github.com/openkcm/cmk-core/internal/repo" - "github.com/openkcm/cmk-core/internal/repo/sql" - "github.com/openkcm/cmk-core/internal/testutils" - cmkcontext "github.com/openkcm/cmk-core/utils/context" - "github.com/openkcm/cmk-core/utils/ptr" + "github.com/openkcm/cmk/internal/api/cmkapi" + "github.com/openkcm/cmk/internal/model" + "github.com/openkcm/cmk/internal/repo" + "github.com/openkcm/cmk/internal/repo/sql" + "github.com/openkcm/cmk/internal/testutils" + cmkcontext "github.com/openkcm/cmk/utils/context" + "github.com/openkcm/cmk/utils/ptr" ) var ( diff --git a/internal/controllers/cmk/key_labels_controller.go b/internal/controllers/cmk/key_labels_controller.go index 90610ce1..fed243a1 100644 --- a/internal/controllers/cmk/key_labels_controller.go +++ b/internal/controllers/cmk/key_labels_controller.go @@ -3,13 +3,13 @@ package cmk import ( "context" - "github.com/openkcm/cmk-core/internal/api/cmkapi" - keylabel "github.com/openkcm/cmk-core/internal/api/transform/label" - "github.com/openkcm/cmk-core/internal/apierrors" - "github.com/openkcm/cmk-core/internal/constants" - "github.com/openkcm/cmk-core/internal/errs" - "github.com/openkcm/cmk-core/internal/model" - "github.com/openkcm/cmk-core/utils/ptr" + "github.com/openkcm/cmk/internal/api/cmkapi" + keylabel "github.com/openkcm/cmk/internal/api/transform/label" + "github.com/openkcm/cmk/internal/apierrors" + "github.com/openkcm/cmk/internal/constants" + "github.com/openkcm/cmk/internal/errs" + "github.com/openkcm/cmk/internal/model" + "github.com/openkcm/cmk/utils/ptr" ) // GetKeyLabels handles fetching a list of all the labels attached to the key. diff --git a/internal/controllers/cmk/key_labels_controller_test.go b/internal/controllers/cmk/key_labels_controller_test.go index a4d6c411..8db9e737 100644 --- a/internal/controllers/cmk/key_labels_controller_test.go +++ b/internal/controllers/cmk/key_labels_controller_test.go @@ -12,13 +12,13 @@ import ( multitenancy "github.com/bartventer/gorm-multitenancy/v8" - "github.com/openkcm/cmk-core/internal/api/cmkapi" - "github.com/openkcm/cmk-core/internal/model" - "github.com/openkcm/cmk-core/internal/repo" - "github.com/openkcm/cmk-core/internal/repo/sql" - "github.com/openkcm/cmk-core/internal/testutils" - cmkcontext "github.com/openkcm/cmk-core/utils/context" - "github.com/openkcm/cmk-core/utils/ptr" + "github.com/openkcm/cmk/internal/api/cmkapi" + "github.com/openkcm/cmk/internal/model" + "github.com/openkcm/cmk/internal/repo" + "github.com/openkcm/cmk/internal/repo/sql" + "github.com/openkcm/cmk/internal/testutils" + cmkcontext "github.com/openkcm/cmk/utils/context" + "github.com/openkcm/cmk/utils/ptr" ) const ( diff --git a/internal/controllers/cmk/keyconfiguration_controller.go b/internal/controllers/cmk/keyconfiguration_controller.go index 4dd3408e..193093ef 100644 --- a/internal/controllers/cmk/keyconfiguration_controller.go +++ b/internal/controllers/cmk/keyconfiguration_controller.go @@ -3,14 +3,14 @@ package cmk import ( "context" - "github.com/openkcm/cmk-core/internal/api/cmkapi" - "github.com/openkcm/cmk-core/internal/api/transform/clientcertificates" - "github.com/openkcm/cmk-core/internal/api/transform/keyconfiguration" - "github.com/openkcm/cmk-core/internal/apierrors" - "github.com/openkcm/cmk-core/internal/constants" - "github.com/openkcm/cmk-core/internal/errs" - "github.com/openkcm/cmk-core/internal/manager" - "github.com/openkcm/cmk-core/utils/ptr" + "github.com/openkcm/cmk/internal/api/cmkapi" + "github.com/openkcm/cmk/internal/api/transform/clientcertificates" + "github.com/openkcm/cmk/internal/api/transform/keyconfiguration" + "github.com/openkcm/cmk/internal/apierrors" + "github.com/openkcm/cmk/internal/constants" + "github.com/openkcm/cmk/internal/errs" + "github.com/openkcm/cmk/internal/manager" + "github.com/openkcm/cmk/utils/ptr" ) // GetKeyConfigurations returns the key configurations diff --git a/internal/controllers/cmk/keyconfiguration_controller_test.go b/internal/controllers/cmk/keyconfiguration_controller_test.go index 77137e25..6cc49e02 100644 --- a/internal/controllers/cmk/keyconfiguration_controller_test.go +++ b/internal/controllers/cmk/keyconfiguration_controller_test.go @@ -19,16 +19,16 @@ import ( multitenancy "github.com/bartventer/gorm-multitenancy/v8" - "github.com/openkcm/cmk-core/internal/api/cmkapi" - "github.com/openkcm/cmk-core/internal/config" - "github.com/openkcm/cmk-core/internal/manager" - "github.com/openkcm/cmk-core/internal/model" - "github.com/openkcm/cmk-core/internal/repo" - "github.com/openkcm/cmk-core/internal/repo/sql" - "github.com/openkcm/cmk-core/internal/testutils" - cmkcontext "github.com/openkcm/cmk-core/utils/context" - "github.com/openkcm/cmk-core/utils/crypto" - "github.com/openkcm/cmk-core/utils/ptr" + "github.com/openkcm/cmk/internal/api/cmkapi" + "github.com/openkcm/cmk/internal/config" + "github.com/openkcm/cmk/internal/manager" + "github.com/openkcm/cmk/internal/model" + "github.com/openkcm/cmk/internal/repo" + "github.com/openkcm/cmk/internal/repo/sql" + "github.com/openkcm/cmk/internal/testutils" + cmkcontext "github.com/openkcm/cmk/utils/context" + "github.com/openkcm/cmk/utils/crypto" + "github.com/openkcm/cmk/utils/ptr" ) // startAPIKeyConfig starts the API server for key configurations and returns a pointer to the database diff --git a/internal/controllers/cmk/keyconfiguration_tags_controller.go b/internal/controllers/cmk/keyconfiguration_tags_controller.go index 75190656..4834c4cd 100644 --- a/internal/controllers/cmk/keyconfiguration_tags_controller.go +++ b/internal/controllers/cmk/keyconfiguration_tags_controller.go @@ -3,12 +3,12 @@ package cmk import ( "context" - "github.com/openkcm/cmk-core/internal/api/cmkapi" - tags "github.com/openkcm/cmk-core/internal/api/transform/tags" - "github.com/openkcm/cmk-core/internal/apierrors" - "github.com/openkcm/cmk-core/internal/errs" - "github.com/openkcm/cmk-core/internal/model" - "github.com/openkcm/cmk-core/utils/ptr" + "github.com/openkcm/cmk/internal/api/cmkapi" + tags "github.com/openkcm/cmk/internal/api/transform/tags" + "github.com/openkcm/cmk/internal/apierrors" + "github.com/openkcm/cmk/internal/errs" + "github.com/openkcm/cmk/internal/model" + "github.com/openkcm/cmk/utils/ptr" ) // GetTagsForKeyConfiguration returns the tags for a key configuration diff --git a/internal/controllers/cmk/keyconfiguration_tags_controller_test.go b/internal/controllers/cmk/keyconfiguration_tags_controller_test.go index 0418b76a..0d1da033 100644 --- a/internal/controllers/cmk/keyconfiguration_tags_controller_test.go +++ b/internal/controllers/cmk/keyconfiguration_tags_controller_test.go @@ -11,12 +11,12 @@ import ( multitenancy "github.com/bartventer/gorm-multitenancy/v8" - "github.com/openkcm/cmk-core/internal/api/cmkapi" - "github.com/openkcm/cmk-core/internal/model" - "github.com/openkcm/cmk-core/internal/repo" - "github.com/openkcm/cmk-core/internal/repo/sql" - "github.com/openkcm/cmk-core/internal/testutils" - cmkcontext "github.com/openkcm/cmk-core/utils/context" + "github.com/openkcm/cmk/internal/api/cmkapi" + "github.com/openkcm/cmk/internal/model" + "github.com/openkcm/cmk/internal/repo" + "github.com/openkcm/cmk/internal/repo/sql" + "github.com/openkcm/cmk/internal/testutils" + cmkcontext "github.com/openkcm/cmk/utils/context" ) // startAPIKeyConfigTags starts the API server and returns a db connection and a mux for testing diff --git a/internal/controllers/cmk/keyversion_controller.go b/internal/controllers/cmk/keyversion_controller.go index c7a5a737..f48825f8 100644 --- a/internal/controllers/cmk/keyversion_controller.go +++ b/internal/controllers/cmk/keyversion_controller.go @@ -3,13 +3,13 @@ package cmk import ( "context" - "github.com/openkcm/cmk-core/internal/api/cmkapi" - "github.com/openkcm/cmk-core/internal/api/transform" - "github.com/openkcm/cmk-core/internal/api/transform/keyversion" - "github.com/openkcm/cmk-core/internal/apierrors" - "github.com/openkcm/cmk-core/internal/constants" - "github.com/openkcm/cmk-core/internal/errs" - "github.com/openkcm/cmk-core/utils/ptr" + "github.com/openkcm/cmk/internal/api/cmkapi" + "github.com/openkcm/cmk/internal/api/transform" + "github.com/openkcm/cmk/internal/api/transform/keyversion" + "github.com/openkcm/cmk/internal/apierrors" + "github.com/openkcm/cmk/internal/constants" + "github.com/openkcm/cmk/internal/errs" + "github.com/openkcm/cmk/utils/ptr" ) // GetKeyVersions returns a list of key version by L1 Key ID diff --git a/internal/controllers/cmk/keyversion_controller_test.go b/internal/controllers/cmk/keyversion_controller_test.go index d970aa7a..01f84a9a 100644 --- a/internal/controllers/cmk/keyversion_controller_test.go +++ b/internal/controllers/cmk/keyversion_controller_test.go @@ -14,12 +14,12 @@ import ( multitenancy "github.com/bartventer/gorm-multitenancy/v8" - "github.com/openkcm/cmk-core/internal/api/cmkapi" - "github.com/openkcm/cmk-core/internal/model" - "github.com/openkcm/cmk-core/internal/repo/sql" - "github.com/openkcm/cmk-core/internal/testutils" - cmkcontext "github.com/openkcm/cmk-core/utils/context" - "github.com/openkcm/cmk-core/utils/ptr" + "github.com/openkcm/cmk/internal/api/cmkapi" + "github.com/openkcm/cmk/internal/model" + "github.com/openkcm/cmk/internal/repo/sql" + "github.com/openkcm/cmk/internal/testutils" + cmkcontext "github.com/openkcm/cmk/utils/context" + "github.com/openkcm/cmk/utils/ptr" ) func startAPIKeyVersion(t *testing.T, plugins ...testutils.MockPlugin) (*multitenancy.DB, *http.ServeMux, string) { diff --git a/internal/controllers/cmk/system_controller.go b/internal/controllers/cmk/system_controller.go index 8f09a470..6f36f3ec 100644 --- a/internal/controllers/cmk/system_controller.go +++ b/internal/controllers/cmk/system_controller.go @@ -3,11 +3,11 @@ package cmk import ( "context" - "github.com/openkcm/cmk-core/internal/api/cmkapi" - "github.com/openkcm/cmk-core/internal/api/transform/system" - "github.com/openkcm/cmk-core/internal/apierrors" - "github.com/openkcm/cmk-core/internal/errs" - "github.com/openkcm/cmk-core/utils/ptr" + "github.com/openkcm/cmk/internal/api/cmkapi" + "github.com/openkcm/cmk/internal/api/transform/system" + "github.com/openkcm/cmk/internal/apierrors" + "github.com/openkcm/cmk/internal/errs" + "github.com/openkcm/cmk/utils/ptr" ) func (c *APIController) GetAllSystems(ctx context.Context, diff --git a/internal/controllers/cmk/system_controller_test.go b/internal/controllers/cmk/system_controller_test.go index c857db17..8583a5bd 100644 --- a/internal/controllers/cmk/system_controller_test.go +++ b/internal/controllers/cmk/system_controller_test.go @@ -15,16 +15,16 @@ import ( multitenancy "github.com/bartventer/gorm-multitenancy/v8" systemgrpc "github.com/openkcm/api-sdk/proto/kms/api/cmk/registry/system/v1" - "github.com/openkcm/cmk-core/internal/api/cmkapi" - "github.com/openkcm/cmk-core/internal/apierrors" - "github.com/openkcm/cmk-core/internal/clients/registry/systems" - "github.com/openkcm/cmk-core/internal/config" - "github.com/openkcm/cmk-core/internal/model" - "github.com/openkcm/cmk-core/internal/repo" - "github.com/openkcm/cmk-core/internal/repo/sql" - "github.com/openkcm/cmk-core/internal/testutils" - cmkcontext "github.com/openkcm/cmk-core/utils/context" - "github.com/openkcm/cmk-core/utils/ptr" + "github.com/openkcm/cmk/internal/api/cmkapi" + "github.com/openkcm/cmk/internal/apierrors" + "github.com/openkcm/cmk/internal/clients/registry/systems" + "github.com/openkcm/cmk/internal/config" + "github.com/openkcm/cmk/internal/model" + "github.com/openkcm/cmk/internal/repo" + "github.com/openkcm/cmk/internal/repo/sql" + "github.com/openkcm/cmk/internal/testutils" + cmkcontext "github.com/openkcm/cmk/utils/context" + "github.com/openkcm/cmk/utils/ptr" ) var ErrForced = errors.New("forced") diff --git a/internal/controllers/cmk/tenant_controller.go b/internal/controllers/cmk/tenant_controller.go index e118168d..7c03c6fe 100644 --- a/internal/controllers/cmk/tenant_controller.go +++ b/internal/controllers/cmk/tenant_controller.go @@ -3,14 +3,14 @@ package cmk import ( "context" - "github.com/openkcm/cmk-core/internal/api/cmkapi" - "github.com/openkcm/cmk-core/internal/api/transform" - "github.com/openkcm/cmk-core/internal/api/transform/tenant" - "github.com/openkcm/cmk-core/internal/apierrors" - "github.com/openkcm/cmk-core/internal/constants" - "github.com/openkcm/cmk-core/internal/errs" - cmkcontext "github.com/openkcm/cmk-core/utils/context" - "github.com/openkcm/cmk-core/utils/ptr" + "github.com/openkcm/cmk/internal/api/cmkapi" + "github.com/openkcm/cmk/internal/api/transform" + "github.com/openkcm/cmk/internal/api/transform/tenant" + "github.com/openkcm/cmk/internal/apierrors" + "github.com/openkcm/cmk/internal/constants" + "github.com/openkcm/cmk/internal/errs" + cmkcontext "github.com/openkcm/cmk/utils/context" + "github.com/openkcm/cmk/utils/ptr" ) const ( diff --git a/internal/controllers/cmk/tenant_controller_test.go b/internal/controllers/cmk/tenant_controller_test.go index 3cd26339..7f9407f7 100644 --- a/internal/controllers/cmk/tenant_controller_test.go +++ b/internal/controllers/cmk/tenant_controller_test.go @@ -9,9 +9,9 @@ import ( multitenancy "github.com/bartventer/gorm-multitenancy/v8" - "github.com/openkcm/cmk-core/internal/api/cmkapi" - "github.com/openkcm/cmk-core/internal/model" - "github.com/openkcm/cmk-core/internal/testutils" + "github.com/openkcm/cmk/internal/api/cmkapi" + "github.com/openkcm/cmk/internal/model" + "github.com/openkcm/cmk/internal/testutils" ) func startAPITenant(t *testing.T) (*multitenancy.DB, *http.ServeMux) { diff --git a/internal/controllers/cmk/tenantconfigs_controller.go b/internal/controllers/cmk/tenantconfigs_controller.go index 10236458..7b96564d 100644 --- a/internal/controllers/cmk/tenantconfigs_controller.go +++ b/internal/controllers/cmk/tenantconfigs_controller.go @@ -3,10 +3,10 @@ package cmk import ( "context" - "github.com/openkcm/cmk-core/internal/api/cmkapi" - "github.com/openkcm/cmk-core/internal/api/transform/tenantconfigs" - "github.com/openkcm/cmk-core/internal/apierrors" - "github.com/openkcm/cmk-core/internal/errs" + "github.com/openkcm/cmk/internal/api/cmkapi" + "github.com/openkcm/cmk/internal/api/transform/tenantconfigs" + "github.com/openkcm/cmk/internal/apierrors" + "github.com/openkcm/cmk/internal/errs" ) func (c *APIController) GetTenantsKeystores( diff --git a/internal/controllers/cmk/tenantconfigs_controller_test.go b/internal/controllers/cmk/tenantconfigs_controller_test.go index f1410a8d..06f68bf6 100644 --- a/internal/controllers/cmk/tenantconfigs_controller_test.go +++ b/internal/controllers/cmk/tenantconfigs_controller_test.go @@ -9,8 +9,8 @@ import ( multitenancy "github.com/bartventer/gorm-multitenancy/v8" - "github.com/openkcm/cmk-core/internal/model" - "github.com/openkcm/cmk-core/internal/testutils" + "github.com/openkcm/cmk/internal/model" + "github.com/openkcm/cmk/internal/testutils" ) // startAPIServerTenantConfig starts the API server for keys and returns a pointer to the database diff --git a/internal/controllers/cmk/workflow_controller.go b/internal/controllers/cmk/workflow_controller.go index fd4ecc9a..8cf4631c 100644 --- a/internal/controllers/cmk/workflow_controller.go +++ b/internal/controllers/cmk/workflow_controller.go @@ -3,13 +3,13 @@ package cmk import ( "context" - "github.com/openkcm/cmk-core/internal/api/cmkapi" - wfTransform "github.com/openkcm/cmk-core/internal/api/transform/workflow" - "github.com/openkcm/cmk-core/internal/apierrors" - "github.com/openkcm/cmk-core/internal/constants" - "github.com/openkcm/cmk-core/internal/errs" - wfMechanism "github.com/openkcm/cmk-core/internal/workflow" - "github.com/openkcm/cmk-core/utils/ptr" + "github.com/openkcm/cmk/internal/api/cmkapi" + wfTransform "github.com/openkcm/cmk/internal/api/transform/workflow" + "github.com/openkcm/cmk/internal/apierrors" + "github.com/openkcm/cmk/internal/constants" + "github.com/openkcm/cmk/internal/errs" + wfMechanism "github.com/openkcm/cmk/internal/workflow" + "github.com/openkcm/cmk/utils/ptr" ) // GetWorkflows returns a list of workflows diff --git a/internal/controllers/cmk/workflow_controller_test.go b/internal/controllers/cmk/workflow_controller_test.go index 3fcb75da..7af29663 100644 --- a/internal/controllers/cmk/workflow_controller_test.go +++ b/internal/controllers/cmk/workflow_controller_test.go @@ -14,13 +14,13 @@ import ( multitenancy "github.com/bartventer/gorm-multitenancy/v8" - "github.com/openkcm/cmk-core/internal/api/cmkapi" - "github.com/openkcm/cmk-core/internal/model" - "github.com/openkcm/cmk-core/internal/repo" - cmksql "github.com/openkcm/cmk-core/internal/repo/sql" - "github.com/openkcm/cmk-core/internal/testutils" - wfMechanism "github.com/openkcm/cmk-core/internal/workflow" - cmkcontext "github.com/openkcm/cmk-core/utils/context" + "github.com/openkcm/cmk/internal/api/cmkapi" + "github.com/openkcm/cmk/internal/model" + "github.com/openkcm/cmk/internal/repo" + cmksql "github.com/openkcm/cmk/internal/repo/sql" + "github.com/openkcm/cmk/internal/testutils" + wfMechanism "github.com/openkcm/cmk/internal/workflow" + cmkcontext "github.com/openkcm/cmk/utils/context" ) var errMockInternalError = errors.New("internal error") diff --git a/internal/daemon/server.go b/internal/daemon/server.go index 3a0d144d..50888cd7 100644 --- a/internal/daemon/server.go +++ b/internal/daemon/server.go @@ -14,16 +14,16 @@ import ( "github.com/openkcm/common-sdk/pkg/storage/keyvalue" "github.com/samber/oops" - "github.com/openkcm/cmk-core/internal/api/cmkapi" - "github.com/openkcm/cmk-core/internal/clients" - "github.com/openkcm/cmk-core/internal/config" - "github.com/openkcm/cmk-core/internal/controllers/cmk" - "github.com/openkcm/cmk-core/internal/db" - "github.com/openkcm/cmk-core/internal/errs" - "github.com/openkcm/cmk-core/internal/handlers" - "github.com/openkcm/cmk-core/internal/log" - "github.com/openkcm/cmk-core/internal/middleware" - "github.com/openkcm/cmk-core/internal/repo/sql" + "github.com/openkcm/cmk/internal/api/cmkapi" + "github.com/openkcm/cmk/internal/clients" + "github.com/openkcm/cmk/internal/config" + "github.com/openkcm/cmk/internal/controllers/cmk" + "github.com/openkcm/cmk/internal/db" + "github.com/openkcm/cmk/internal/errs" + "github.com/openkcm/cmk/internal/handlers" + "github.com/openkcm/cmk/internal/log" + "github.com/openkcm/cmk/internal/middleware" + "github.com/openkcm/cmk/internal/repo/sql" ) const ( diff --git a/internal/daemon/server_test.go b/internal/daemon/server_test.go index 199726de..94494d53 100644 --- a/internal/daemon/server_test.go +++ b/internal/daemon/server_test.go @@ -6,8 +6,8 @@ import ( "github.com/openkcm/common-sdk/pkg/commoncfg" "github.com/stretchr/testify/assert" - "github.com/openkcm/cmk-core/internal/config" - "github.com/openkcm/cmk-core/internal/daemon" + "github.com/openkcm/cmk/internal/config" + "github.com/openkcm/cmk/internal/daemon" ) var conf = &config.Config{ diff --git a/internal/db/connection.go b/internal/db/connection.go index 9b3101d2..0385800b 100644 --- a/internal/db/connection.go +++ b/internal/db/connection.go @@ -8,10 +8,10 @@ import ( multitenancy "github.com/bartventer/gorm-multitenancy/v8" - "github.com/openkcm/cmk-core/internal/config" - "github.com/openkcm/cmk-core/internal/db/dialect" - "github.com/openkcm/cmk-core/internal/db/dsn" - "github.com/openkcm/cmk-core/internal/errs" + "github.com/openkcm/cmk/internal/config" + "github.com/openkcm/cmk/internal/db/dialect" + "github.com/openkcm/cmk/internal/db/dsn" + "github.com/openkcm/cmk/internal/errs" ) var ( diff --git a/internal/db/connection_test.go b/internal/db/connection_test.go index 112fada1..65f634cc 100644 --- a/internal/db/connection_test.go +++ b/internal/db/connection_test.go @@ -9,9 +9,9 @@ import ( "github.com/stretchr/testify/require" "gorm.io/gorm" - "github.com/openkcm/cmk-core/internal/config" - "github.com/openkcm/cmk-core/internal/db" - "github.com/openkcm/cmk-core/internal/testutils" + "github.com/openkcm/cmk/internal/config" + "github.com/openkcm/cmk/internal/db" + "github.com/openkcm/cmk/internal/testutils" ) var errForced = errors.New("forced error") diff --git a/internal/db/db.go b/internal/db/db.go index f4137df6..d5c4c221 100644 --- a/internal/db/db.go +++ b/internal/db/db.go @@ -12,10 +12,10 @@ import ( multitenancy "github.com/bartventer/gorm-multitenancy/v8" - "github.com/openkcm/cmk-core/internal/config" - "github.com/openkcm/cmk-core/internal/errs" - "github.com/openkcm/cmk-core/internal/log" - "github.com/openkcm/cmk-core/internal/model" + "github.com/openkcm/cmk/internal/config" + "github.com/openkcm/cmk/internal/errs" + "github.com/openkcm/cmk/internal/log" + "github.com/openkcm/cmk/internal/model" ) var ( diff --git a/internal/db/db_test.go b/internal/db/db_test.go index dc165280..fb14e832 100644 --- a/internal/db/db_test.go +++ b/internal/db/db_test.go @@ -8,10 +8,10 @@ import ( "github.com/bartventer/gorm-multitenancy/v8/pkg/driver" "github.com/stretchr/testify/assert" - "github.com/openkcm/cmk-core/internal/config" - "github.com/openkcm/cmk-core/internal/db" - "github.com/openkcm/cmk-core/internal/model" - "github.com/openkcm/cmk-core/internal/testutils" + "github.com/openkcm/cmk/internal/config" + "github.com/openkcm/cmk/internal/db" + "github.com/openkcm/cmk/internal/model" + "github.com/openkcm/cmk/internal/testutils" ) func TestStartDB(t *testing.T) { diff --git a/internal/db/dsn/postgres.go b/internal/db/dsn/postgres.go index df45dd7f..d3e30594 100644 --- a/internal/db/dsn/postgres.go +++ b/internal/db/dsn/postgres.go @@ -6,8 +6,8 @@ import ( "github.com/openkcm/common-sdk/pkg/commoncfg" - "github.com/openkcm/cmk-core/internal/config" - "github.com/openkcm/cmk-core/internal/errs" + "github.com/openkcm/cmk/internal/config" + "github.com/openkcm/cmk/internal/errs" ) var ( diff --git a/internal/event-processor/crypto.go b/internal/event-processor/crypto.go index 8e93da42..f2754342 100644 --- a/internal/event-processor/crypto.go +++ b/internal/event-processor/crypto.go @@ -22,14 +22,14 @@ import ( keystoreopv1 "github.com/openkcm/plugin-sdk/proto/plugin/keystore/operations/v1" protoPkg "google.golang.org/protobuf/proto" - "github.com/openkcm/cmk-core/internal/api/cmkapi" - "github.com/openkcm/cmk-core/internal/config" - "github.com/openkcm/cmk-core/internal/db/dsn" - "github.com/openkcm/cmk-core/internal/errs" - "github.com/openkcm/cmk-core/internal/event-processor/proto" - "github.com/openkcm/cmk-core/internal/model" - "github.com/openkcm/cmk-core/internal/repo" - cmkcontext "github.com/openkcm/cmk-core/utils/context" + "github.com/openkcm/cmk/internal/api/cmkapi" + "github.com/openkcm/cmk/internal/config" + "github.com/openkcm/cmk/internal/db/dsn" + "github.com/openkcm/cmk/internal/errs" + "github.com/openkcm/cmk/internal/event-processor/proto" + "github.com/openkcm/cmk/internal/model" + "github.com/openkcm/cmk/internal/repo" + cmkcontext "github.com/openkcm/cmk/utils/context" ) const ( diff --git a/internal/event-processor/job_methods.go b/internal/event-processor/job_methods.go index 6d65cc89..f450e759 100644 --- a/internal/event-processor/job_methods.go +++ b/internal/event-processor/job_methods.go @@ -6,8 +6,8 @@ import ( "github.com/openkcm/orbital" - "github.com/openkcm/cmk-core/internal/event-processor/proto" - cmkcontext "github.com/openkcm/cmk-core/utils/context" + "github.com/openkcm/cmk/internal/event-processor/proto" + cmkcontext "github.com/openkcm/cmk/utils/context" ) // KeyActionJobData contains the data needed for a key action orbital job. diff --git a/internal/event-processor/proto/task.pb.go b/internal/event-processor/proto/task.pb.go index dfb02df0..83e80afa 100644 --- a/internal/event-processor/proto/task.pb.go +++ b/internal/event-processor/proto/task.pb.go @@ -385,7 +385,7 @@ const file_internal_event_processor_proto_task_proto_rawDesc = "" + "KEY_ROTATE\x10\x03\x12\x0f\n" + "\vSYSTEM_LINK\x10\x04\x12\x11\n" + "\rSYSTEM_UNLINK\x10\x05\x12\x11\n" + - "\rSYSTEM_SWITCH\x10\x06B=Z;github.com/openkcm/cmk-core/internal/event-processor/proto;protob\x06proto3" + "\rSYSTEM_SWITCH\x10\x06B=Z;github.com/openkcm/cmk/internal/event-processor/proto;protob\x06proto3" var ( file_internal_event_processor_proto_task_proto_rawDescOnce sync.Once diff --git a/internal/event-processor/proto/task.proto b/internal/event-processor/proto/task.proto index eeecde6e..97ac5989 100644 --- a/internal/event-processor/proto/task.proto +++ b/internal/event-processor/proto/task.proto @@ -2,7 +2,7 @@ syntax = "proto3"; package proto; -option go_package = "github.com/openkcm/cmk-core/internal/event-processor/proto;proto"; +option go_package = "github.com/openkcm/cmk/internal/event-processor/proto;proto"; enum TaskType { KEY_ENABLE = 0; diff --git a/internal/grpc/catalog/catalog.go b/internal/grpc/catalog/catalog.go index 89b83a87..a4cb470f 100644 --- a/internal/grpc/catalog/catalog.go +++ b/internal/grpc/catalog/catalog.go @@ -9,8 +9,8 @@ import ( plugincatalog "github.com/openkcm/plugin-sdk/pkg/catalog" - "github.com/openkcm/cmk-core/internal/config" - "github.com/openkcm/cmk-core/internal/plugins/builtin" + "github.com/openkcm/cmk/internal/config" + "github.com/openkcm/cmk/internal/plugins/builtin" ) // New creates a new instance of Catalog with the provided configuration. diff --git a/internal/grpc/catalog/catalog_test.go b/internal/grpc/catalog/catalog_test.go index a570b7f1..498d6382 100644 --- a/internal/grpc/catalog/catalog_test.go +++ b/internal/grpc/catalog/catalog_test.go @@ -9,8 +9,8 @@ import ( plugincatalog "github.com/openkcm/plugin-sdk/pkg/catalog" keystoreopv1 "github.com/openkcm/plugin-sdk/proto/plugin/keystore/operations/v1" - "github.com/openkcm/cmk-core/internal/config" - "github.com/openkcm/cmk-core/internal/grpc/catalog" + "github.com/openkcm/cmk/internal/config" + "github.com/openkcm/cmk/internal/grpc/catalog" ) func TestNew(t *testing.T) { diff --git a/internal/handlers/handlers.go b/internal/handlers/handlers.go index 8407bb5c..b6d155aa 100644 --- a/internal/handlers/handlers.go +++ b/internal/handlers/handlers.go @@ -9,11 +9,11 @@ import ( md "github.com/oapi-codegen/nethttp-middleware" slogctx "github.com/veqryn/slog-context" - "github.com/openkcm/cmk-core/internal/api/cmkapi" - "github.com/openkcm/cmk-core/internal/api/write" - "github.com/openkcm/cmk-core/internal/apierrors" - "github.com/openkcm/cmk-core/internal/log" - cmkcontext "github.com/openkcm/cmk-core/utils/context" + "github.com/openkcm/cmk/internal/api/cmkapi" + "github.com/openkcm/cmk/internal/api/write" + "github.com/openkcm/cmk/internal/apierrors" + "github.com/openkcm/cmk/internal/log" + cmkcontext "github.com/openkcm/cmk/utils/context" ) // OAPIValidatorHandler is called when OAPI Required fields are missing from Request diff --git a/internal/handlers/handlers_test.go b/internal/handlers/handlers_test.go index 7e9caa88..88166965 100644 --- a/internal/handlers/handlers_test.go +++ b/internal/handlers/handlers_test.go @@ -10,10 +10,10 @@ import ( "github.com/stretchr/testify/assert" - "github.com/openkcm/cmk-core/internal/api/cmkapi" - "github.com/openkcm/cmk-core/internal/api/write" - "github.com/openkcm/cmk-core/internal/handlers" - cmkcontext "github.com/openkcm/cmk-core/utils/context" + "github.com/openkcm/cmk/internal/api/cmkapi" + "github.com/openkcm/cmk/internal/api/write" + "github.com/openkcm/cmk/internal/handlers" + cmkcontext "github.com/openkcm/cmk/utils/context" ) var ( diff --git a/internal/log/log.go b/internal/log/log.go index bc601a1d..31b5a333 100644 --- a/internal/log/log.go +++ b/internal/log/log.go @@ -9,8 +9,8 @@ import ( slogctx "github.com/veqryn/slog-context" - "github.com/openkcm/cmk-core/internal/model" - cmkcontext "github.com/openkcm/cmk-core/utils/context" + "github.com/openkcm/cmk/internal/model" + cmkcontext "github.com/openkcm/cmk/utils/context" ) func InjectRequest(ctx context.Context, r *http.Request) context.Context { diff --git a/internal/manager/authz.go b/internal/manager/authz.go index 140c9798..490c0035 100644 --- a/internal/manager/authz.go +++ b/internal/manager/authz.go @@ -4,13 +4,13 @@ import ( "context" "sync" - "github.com/openkcm/cmk-core/internal/authz" - "github.com/openkcm/cmk-core/internal/constants" - "github.com/openkcm/cmk-core/internal/errs" - "github.com/openkcm/cmk-core/internal/log" - "github.com/openkcm/cmk-core/internal/model" - "github.com/openkcm/cmk-core/internal/repo" - cmkcontext "github.com/openkcm/cmk-core/utils/context" + "github.com/openkcm/cmk/internal/authz" + "github.com/openkcm/cmk/internal/constants" + "github.com/openkcm/cmk/internal/errs" + "github.com/openkcm/cmk/internal/log" + "github.com/openkcm/cmk/internal/model" + "github.com/openkcm/cmk/internal/repo" + cmkcontext "github.com/openkcm/cmk/utils/context" ) type AuthzManager struct { diff --git a/internal/manager/authz_test.go b/internal/manager/authz_test.go index 7d2197c1..b7e72cea 100644 --- a/internal/manager/authz_test.go +++ b/internal/manager/authz_test.go @@ -8,12 +8,12 @@ import ( multitenancy "github.com/bartventer/gorm-multitenancy/v8" - "github.com/openkcm/cmk-core/internal/authz" - "github.com/openkcm/cmk-core/internal/constants" - "github.com/openkcm/cmk-core/internal/manager" - "github.com/openkcm/cmk-core/internal/model" - repomock "github.com/openkcm/cmk-core/internal/repo/mock" - "github.com/openkcm/cmk-core/internal/testutils" + "github.com/openkcm/cmk/internal/authz" + "github.com/openkcm/cmk/internal/constants" + "github.com/openkcm/cmk/internal/manager" + "github.com/openkcm/cmk/internal/model" + repomock "github.com/openkcm/cmk/internal/repo/mock" + "github.com/openkcm/cmk/internal/testutils" ) func TestAuthzManager_LoadEntitiesInAllowList(t *testing.T) { diff --git a/internal/manager/base.go b/internal/manager/base.go index 647217e2..0c8ea05b 100644 --- a/internal/manager/base.go +++ b/internal/manager/base.go @@ -5,11 +5,11 @@ import ( plugincatalog "github.com/openkcm/plugin-sdk/pkg/catalog" - "github.com/openkcm/cmk-core/internal/auditor" - "github.com/openkcm/cmk-core/internal/clients" - "github.com/openkcm/cmk-core/internal/config" - eventprocessor "github.com/openkcm/cmk-core/internal/event-processor" - "github.com/openkcm/cmk-core/internal/repo" + "github.com/openkcm/cmk/internal/auditor" + "github.com/openkcm/cmk/internal/clients" + "github.com/openkcm/cmk/internal/config" + eventprocessor "github.com/openkcm/cmk/internal/event-processor" + "github.com/openkcm/cmk/internal/repo" ) type Manager struct { diff --git a/internal/manager/base_test.go b/internal/manager/base_test.go index 52bd0ba7..37b1f7e2 100644 --- a/internal/manager/base_test.go +++ b/internal/manager/base_test.go @@ -8,11 +8,11 @@ import ( plugincatalog "github.com/openkcm/plugin-sdk/pkg/catalog" - "github.com/openkcm/cmk-core/internal/clients" - "github.com/openkcm/cmk-core/internal/config" - "github.com/openkcm/cmk-core/internal/manager" - "github.com/openkcm/cmk-core/internal/repo/sql" - "github.com/openkcm/cmk-core/internal/testutils" + "github.com/openkcm/cmk/internal/clients" + "github.com/openkcm/cmk/internal/config" + "github.com/openkcm/cmk/internal/manager" + "github.com/openkcm/cmk/internal/repo/sql" + "github.com/openkcm/cmk/internal/testutils" ) const providerTest = "TEST" diff --git a/internal/manager/certificate.go b/internal/manager/certificate.go index 7467fef2..3d591bfc 100644 --- a/internal/manager/certificate.go +++ b/internal/manager/certificate.go @@ -16,13 +16,13 @@ import ( plugincatalog "github.com/openkcm/plugin-sdk/pkg/catalog" certissuerv1 "github.com/openkcm/plugin-sdk/proto/plugin/certificate_issuer/v1" - "github.com/openkcm/cmk-core/internal/config" - "github.com/openkcm/cmk-core/internal/errs" - "github.com/openkcm/cmk-core/internal/log" - "github.com/openkcm/cmk-core/internal/model" - "github.com/openkcm/cmk-core/internal/repo" - cmkcontext "github.com/openkcm/cmk-core/utils/context" - "github.com/openkcm/cmk-core/utils/crypto" + "github.com/openkcm/cmk/internal/config" + "github.com/openkcm/cmk/internal/errs" + "github.com/openkcm/cmk/internal/log" + "github.com/openkcm/cmk/internal/model" + "github.com/openkcm/cmk/internal/repo" + cmkcontext "github.com/openkcm/cmk/utils/context" + "github.com/openkcm/cmk/utils/crypto" ) var ( diff --git a/internal/manager/certificate_test.go b/internal/manager/certificate_test.go index 5fe95232..d8130b83 100644 --- a/internal/manager/certificate_test.go +++ b/internal/manager/certificate_test.go @@ -17,14 +17,14 @@ import ( multitenancy "github.com/bartventer/gorm-multitenancy/v8" certificate_issuerv1 "github.com/openkcm/plugin-sdk/proto/plugin/certificate_issuer/v1" - "github.com/openkcm/cmk-core/internal/config" - "github.com/openkcm/cmk-core/internal/grpc/catalog" - "github.com/openkcm/cmk-core/internal/manager" - "github.com/openkcm/cmk-core/internal/model" - "github.com/openkcm/cmk-core/internal/repo/sql" - "github.com/openkcm/cmk-core/internal/testutils" - cmkcontext "github.com/openkcm/cmk-core/utils/context" - "github.com/openkcm/cmk-core/utils/crypto" + "github.com/openkcm/cmk/internal/config" + "github.com/openkcm/cmk/internal/grpc/catalog" + "github.com/openkcm/cmk/internal/manager" + "github.com/openkcm/cmk/internal/model" + "github.com/openkcm/cmk/internal/repo/sql" + "github.com/openkcm/cmk/internal/testutils" + cmkcontext "github.com/openkcm/cmk/utils/context" + "github.com/openkcm/cmk/utils/crypto" ) var ( diff --git a/internal/manager/export_test.go b/internal/manager/export_test.go index 723b2d86..745a5f68 100644 --- a/internal/manager/export_test.go +++ b/internal/manager/export_test.go @@ -8,8 +8,8 @@ import ( notificationv1 "github.com/openkcm/plugin-sdk/proto/plugin/notification/v1" systeminformationv1 "github.com/openkcm/plugin-sdk/proto/plugin/systeminformation/v1" - "github.com/openkcm/cmk-core/internal/clients/registry/systems" - "github.com/openkcm/cmk-core/internal/model" + "github.com/openkcm/cmk/internal/clients/registry/systems" + "github.com/openkcm/cmk/internal/model" ) var GetPluginAlgorithm = getPluginAlgorithm diff --git a/internal/manager/group.go b/internal/manager/group.go index 669659a9..7e860e55 100644 --- a/internal/manager/group.go +++ b/internal/manager/group.go @@ -6,13 +6,13 @@ import ( "github.com/google/uuid" - "github.com/openkcm/cmk-core/internal/api/cmkapi" - "github.com/openkcm/cmk-core/internal/constants" - "github.com/openkcm/cmk-core/internal/errs" - "github.com/openkcm/cmk-core/internal/model" - "github.com/openkcm/cmk-core/internal/repo" - cmkcontext "github.com/openkcm/cmk-core/utils/context" - "github.com/openkcm/cmk-core/utils/ptr" + "github.com/openkcm/cmk/internal/api/cmkapi" + "github.com/openkcm/cmk/internal/constants" + "github.com/openkcm/cmk/internal/errs" + "github.com/openkcm/cmk/internal/model" + "github.com/openkcm/cmk/internal/repo" + cmkcontext "github.com/openkcm/cmk/utils/context" + "github.com/openkcm/cmk/utils/ptr" ) var ErrGroupRole = errors.New("unsupported role for group creation") diff --git a/internal/manager/group_test.go b/internal/manager/group_test.go index b043c89e..98dc0a56 100644 --- a/internal/manager/group_test.go +++ b/internal/manager/group_test.go @@ -9,14 +9,14 @@ import ( multitenancy "github.com/bartventer/gorm-multitenancy/v8" - "github.com/openkcm/cmk-core/internal/api/cmkapi" - "github.com/openkcm/cmk-core/internal/constants" - "github.com/openkcm/cmk-core/internal/manager" - "github.com/openkcm/cmk-core/internal/model" - "github.com/openkcm/cmk-core/internal/repo" - "github.com/openkcm/cmk-core/internal/repo/sql" - "github.com/openkcm/cmk-core/internal/testutils" - "github.com/openkcm/cmk-core/utils/ptr" + "github.com/openkcm/cmk/internal/api/cmkapi" + "github.com/openkcm/cmk/internal/constants" + "github.com/openkcm/cmk/internal/manager" + "github.com/openkcm/cmk/internal/model" + "github.com/openkcm/cmk/internal/repo" + "github.com/openkcm/cmk/internal/repo/sql" + "github.com/openkcm/cmk/internal/testutils" + "github.com/openkcm/cmk/utils/ptr" ) func SetupGroupManager(t *testing.T) (*manager.GroupManager, *multitenancy.DB, string) { diff --git a/internal/manager/importparams.go b/internal/manager/importparams.go index 070f67a4..2ababf18 100644 --- a/internal/manager/importparams.go +++ b/internal/manager/importparams.go @@ -6,9 +6,9 @@ import ( keystoreopv1 "github.com/openkcm/plugin-sdk/proto/plugin/keystore/operations/v1" - "github.com/openkcm/cmk-core/internal/errs" - "github.com/openkcm/cmk-core/internal/model" - "github.com/openkcm/cmk-core/utils/structreader" + "github.com/openkcm/cmk/internal/errs" + "github.com/openkcm/cmk/internal/model" + "github.com/openkcm/cmk/utils/structreader" ) // CommonImportFields contains fields that are common across all providers diff --git a/internal/manager/importparams_test.go b/internal/manager/importparams_test.go index a1a4223e..a5d5e01a 100644 --- a/internal/manager/importparams_test.go +++ b/internal/manager/importparams_test.go @@ -10,9 +10,9 @@ import ( keystoreopv1 "github.com/openkcm/plugin-sdk/proto/plugin/keystore/operations/v1" - "github.com/openkcm/cmk-core/internal/manager" - "github.com/openkcm/cmk-core/internal/model" - "github.com/openkcm/cmk-core/internal/testutils" + "github.com/openkcm/cmk/internal/manager" + "github.com/openkcm/cmk/internal/model" + "github.com/openkcm/cmk/internal/testutils" ) func TestBuildImportParams(t *testing.T) { diff --git a/internal/manager/key.go b/internal/manager/key.go index f33c83e8..3f6f2137 100644 --- a/internal/manager/key.go +++ b/internal/manager/key.go @@ -17,15 +17,15 @@ import ( commonv1 "github.com/openkcm/plugin-sdk/proto/plugin/keystore/common/v1" keystoreopv1 "github.com/openkcm/plugin-sdk/proto/plugin/keystore/operations/v1" - "github.com/openkcm/cmk-core/internal/api/cmkapi" - "github.com/openkcm/cmk-core/internal/auditor" - "github.com/openkcm/cmk-core/internal/constants" - "github.com/openkcm/cmk-core/internal/errs" - eventprocessor "github.com/openkcm/cmk-core/internal/event-processor" - "github.com/openkcm/cmk-core/internal/log" - "github.com/openkcm/cmk-core/internal/model" - "github.com/openkcm/cmk-core/internal/repo" - "github.com/openkcm/cmk-core/utils/ptr" + "github.com/openkcm/cmk/internal/api/cmkapi" + "github.com/openkcm/cmk/internal/auditor" + "github.com/openkcm/cmk/internal/constants" + "github.com/openkcm/cmk/internal/errs" + eventprocessor "github.com/openkcm/cmk/internal/event-processor" + "github.com/openkcm/cmk/internal/log" + "github.com/openkcm/cmk/internal/model" + "github.com/openkcm/cmk/internal/repo" + "github.com/openkcm/cmk/utils/ptr" ) // BYOKAction constants represent the actions that can be performed on a BYOK key diff --git a/internal/manager/key_label.go b/internal/manager/key_label.go index e0138fc4..0f71a9f9 100644 --- a/internal/manager/key_label.go +++ b/internal/manager/key_label.go @@ -6,9 +6,9 @@ import ( "github.com/google/uuid" - "github.com/openkcm/cmk-core/internal/errs" - "github.com/openkcm/cmk-core/internal/model" - "github.com/openkcm/cmk-core/internal/repo" + "github.com/openkcm/cmk/internal/errs" + "github.com/openkcm/cmk/internal/model" + "github.com/openkcm/cmk/internal/repo" ) type Label interface { diff --git a/internal/manager/key_label_test.go b/internal/manager/key_label_test.go index e42c8fed..7f31cbd6 100644 --- a/internal/manager/key_label_test.go +++ b/internal/manager/key_label_test.go @@ -9,12 +9,12 @@ import ( multitenancy "github.com/bartventer/gorm-multitenancy/v8" - "github.com/openkcm/cmk-core/internal/manager" - "github.com/openkcm/cmk-core/internal/model" - "github.com/openkcm/cmk-core/internal/repo" - "github.com/openkcm/cmk-core/internal/repo/sql" - "github.com/openkcm/cmk-core/internal/testutils" - cmkcontext "github.com/openkcm/cmk-core/utils/context" + "github.com/openkcm/cmk/internal/manager" + "github.com/openkcm/cmk/internal/model" + "github.com/openkcm/cmk/internal/repo" + "github.com/openkcm/cmk/internal/repo/sql" + "github.com/openkcm/cmk/internal/testutils" + cmkcontext "github.com/openkcm/cmk/utils/context" ) func TestGetKeyLabels(t *testing.T) { diff --git a/internal/manager/key_test.go b/internal/manager/key_test.go index 8dd3fb2c..a7eedf91 100644 --- a/internal/manager/key_test.go +++ b/internal/manager/key_test.go @@ -14,18 +14,18 @@ import ( multitenancy "github.com/bartventer/gorm-multitenancy/v8" keystoreopv1 "github.com/openkcm/plugin-sdk/proto/plugin/keystore/operations/v1" - "github.com/openkcm/cmk-core/internal/api/cmkapi" - "github.com/openkcm/cmk-core/internal/auditor" - "github.com/openkcm/cmk-core/internal/config" - "github.com/openkcm/cmk-core/internal/constants" - eventprocessor "github.com/openkcm/cmk-core/internal/event-processor" - "github.com/openkcm/cmk-core/internal/grpc/catalog" - "github.com/openkcm/cmk-core/internal/manager" - "github.com/openkcm/cmk-core/internal/model" - "github.com/openkcm/cmk-core/internal/repo" - "github.com/openkcm/cmk-core/internal/repo/sql" - "github.com/openkcm/cmk-core/internal/testutils" - "github.com/openkcm/cmk-core/utils/ptr" + "github.com/openkcm/cmk/internal/api/cmkapi" + "github.com/openkcm/cmk/internal/auditor" + "github.com/openkcm/cmk/internal/config" + "github.com/openkcm/cmk/internal/constants" + eventprocessor "github.com/openkcm/cmk/internal/event-processor" + "github.com/openkcm/cmk/internal/grpc/catalog" + "github.com/openkcm/cmk/internal/manager" + "github.com/openkcm/cmk/internal/model" + "github.com/openkcm/cmk/internal/repo" + "github.com/openkcm/cmk/internal/repo/sql" + "github.com/openkcm/cmk/internal/testutils" + "github.com/openkcm/cmk/utils/ptr" ) //nolint:containedctx diff --git a/internal/manager/keyconfiguration.go b/internal/manager/keyconfiguration.go index 791c63cc..d0d99f2c 100644 --- a/internal/manager/keyconfiguration.go +++ b/internal/manager/keyconfiguration.go @@ -10,11 +10,11 @@ import ( "github.com/google/uuid" "github.com/openkcm/common-sdk/pkg/commoncfg" - "github.com/openkcm/cmk-core/internal/api/cmkapi" - "github.com/openkcm/cmk-core/internal/config" - "github.com/openkcm/cmk-core/internal/errs" - "github.com/openkcm/cmk-core/internal/model" - "github.com/openkcm/cmk-core/internal/repo" + "github.com/openkcm/cmk/internal/api/cmkapi" + "github.com/openkcm/cmk/internal/config" + "github.com/openkcm/cmk/internal/errs" + "github.com/openkcm/cmk/internal/model" + "github.com/openkcm/cmk/internal/repo" ) const ( diff --git a/internal/manager/keyconfiguration_tag.go b/internal/manager/keyconfiguration_tag.go index a282aebc..10a6f905 100644 --- a/internal/manager/keyconfiguration_tag.go +++ b/internal/manager/keyconfiguration_tag.go @@ -5,8 +5,8 @@ import ( "github.com/google/uuid" - "github.com/openkcm/cmk-core/internal/model" - "github.com/openkcm/cmk-core/internal/repo" + "github.com/openkcm/cmk/internal/model" + "github.com/openkcm/cmk/internal/repo" ) type KeyConfigurationTag interface { diff --git a/internal/manager/keyconfiguration_tag_test.go b/internal/manager/keyconfiguration_tag_test.go index c4c39cac..50e74b1c 100644 --- a/internal/manager/keyconfiguration_tag_test.go +++ b/internal/manager/keyconfiguration_tag_test.go @@ -9,13 +9,13 @@ import ( multitenancy "github.com/bartventer/gorm-multitenancy/v8" - "github.com/openkcm/cmk-core/internal/manager" - "github.com/openkcm/cmk-core/internal/model" - "github.com/openkcm/cmk-core/internal/repo" - "github.com/openkcm/cmk-core/internal/repo/sql" - "github.com/openkcm/cmk-core/internal/testutils" - cmkcontext "github.com/openkcm/cmk-core/utils/context" - "github.com/openkcm/cmk-core/utils/ptr" + "github.com/openkcm/cmk/internal/manager" + "github.com/openkcm/cmk/internal/model" + "github.com/openkcm/cmk/internal/repo" + "github.com/openkcm/cmk/internal/repo/sql" + "github.com/openkcm/cmk/internal/testutils" + cmkcontext "github.com/openkcm/cmk/utils/context" + "github.com/openkcm/cmk/utils/ptr" ) func SetupKeyConfigurationTagManager(t *testing.T) (*manager.KeyConfigurationTagManager, diff --git a/internal/manager/keyconfiguration_test.go b/internal/manager/keyconfiguration_test.go index 1914865a..5b068923 100644 --- a/internal/manager/keyconfiguration_test.go +++ b/internal/manager/keyconfiguration_test.go @@ -14,17 +14,17 @@ import ( multitenancy "github.com/bartventer/gorm-multitenancy/v8" - "github.com/openkcm/cmk-core/internal/api/cmkapi" - "github.com/openkcm/cmk-core/internal/config" - "github.com/openkcm/cmk-core/internal/constants" - "github.com/openkcm/cmk-core/internal/grpc/catalog" - "github.com/openkcm/cmk-core/internal/manager" - "github.com/openkcm/cmk-core/internal/model" - "github.com/openkcm/cmk-core/internal/repo/sql" - "github.com/openkcm/cmk-core/internal/testutils" - cmkcontext "github.com/openkcm/cmk-core/utils/context" - "github.com/openkcm/cmk-core/utils/crypto" - "github.com/openkcm/cmk-core/utils/ptr" + "github.com/openkcm/cmk/internal/api/cmkapi" + "github.com/openkcm/cmk/internal/config" + "github.com/openkcm/cmk/internal/constants" + "github.com/openkcm/cmk/internal/grpc/catalog" + "github.com/openkcm/cmk/internal/manager" + "github.com/openkcm/cmk/internal/model" + "github.com/openkcm/cmk/internal/repo/sql" + "github.com/openkcm/cmk/internal/testutils" + cmkcontext "github.com/openkcm/cmk/utils/context" + "github.com/openkcm/cmk/utils/crypto" + "github.com/openkcm/cmk/utils/ptr" ) var ( diff --git a/internal/manager/keystorepool.go b/internal/manager/keystorepool.go index 46fdc1cf..2ed44083 100644 --- a/internal/manager/keystorepool.go +++ b/internal/manager/keystorepool.go @@ -4,9 +4,9 @@ import ( "context" "sync" - "github.com/openkcm/cmk-core/internal/errs" - "github.com/openkcm/cmk-core/internal/model" - "github.com/openkcm/cmk-core/internal/repo" + "github.com/openkcm/cmk/internal/errs" + "github.com/openkcm/cmk/internal/model" + "github.com/openkcm/cmk/internal/repo" ) // Pool stores available configurations. diff --git a/internal/manager/keystorepool_test.go b/internal/manager/keystorepool_test.go index db9f5682..7155ceb9 100644 --- a/internal/manager/keystorepool_test.go +++ b/internal/manager/keystorepool_test.go @@ -9,10 +9,10 @@ import ( "github.com/google/uuid" "github.com/stretchr/testify/require" - "github.com/openkcm/cmk-core/internal/manager" - "github.com/openkcm/cmk-core/internal/model" - "github.com/openkcm/cmk-core/internal/repo/sql" - "github.com/openkcm/cmk-core/internal/testutils" + "github.com/openkcm/cmk/internal/manager" + "github.com/openkcm/cmk/internal/model" + "github.com/openkcm/cmk/internal/repo/sql" + "github.com/openkcm/cmk/internal/testutils" ) var itemID = uuid.New() diff --git a/internal/manager/keyversion.go b/internal/manager/keyversion.go index 170b8675..3f60e398 100644 --- a/internal/manager/keyversion.go +++ b/internal/manager/keyversion.go @@ -12,13 +12,13 @@ import ( plugincatalog "github.com/openkcm/plugin-sdk/pkg/catalog" keystoreopv1 "github.com/openkcm/plugin-sdk/proto/plugin/keystore/operations/v1" - "github.com/openkcm/cmk-core/internal/api/cmkapi" - "github.com/openkcm/cmk-core/internal/auditor" - "github.com/openkcm/cmk-core/internal/errs" - "github.com/openkcm/cmk-core/internal/log" - "github.com/openkcm/cmk-core/internal/model" - "github.com/openkcm/cmk-core/internal/repo" - "github.com/openkcm/cmk-core/utils/ptr" + "github.com/openkcm/cmk/internal/api/cmkapi" + "github.com/openkcm/cmk/internal/auditor" + "github.com/openkcm/cmk/internal/errs" + "github.com/openkcm/cmk/internal/log" + "github.com/openkcm/cmk/internal/model" + "github.com/openkcm/cmk/internal/repo" + "github.com/openkcm/cmk/utils/ptr" ) type KeyVersion interface { diff --git a/internal/manager/keyversion_test.go b/internal/manager/keyversion_test.go index 99f431e9..6dd48224 100644 --- a/internal/manager/keyversion_test.go +++ b/internal/manager/keyversion_test.go @@ -9,15 +9,15 @@ import ( "github.com/google/uuid" "github.com/stretchr/testify/suite" - "github.com/openkcm/cmk-core/internal/auditor" - "github.com/openkcm/cmk-core/internal/config" - "github.com/openkcm/cmk-core/internal/constants" - "github.com/openkcm/cmk-core/internal/grpc/catalog" - "github.com/openkcm/cmk-core/internal/manager" - "github.com/openkcm/cmk-core/internal/model" - "github.com/openkcm/cmk-core/internal/repo" - "github.com/openkcm/cmk-core/internal/repo/sql" - "github.com/openkcm/cmk-core/internal/testutils" + "github.com/openkcm/cmk/internal/auditor" + "github.com/openkcm/cmk/internal/config" + "github.com/openkcm/cmk/internal/constants" + "github.com/openkcm/cmk/internal/grpc/catalog" + "github.com/openkcm/cmk/internal/manager" + "github.com/openkcm/cmk/internal/model" + "github.com/openkcm/cmk/internal/repo" + "github.com/openkcm/cmk/internal/repo/sql" + "github.com/openkcm/cmk/internal/testutils" ) var ( diff --git a/internal/manager/notification.go b/internal/manager/notification.go index 7a160f9c..280e191b 100644 --- a/internal/manager/notification.go +++ b/internal/manager/notification.go @@ -6,7 +6,7 @@ import ( plugincatalog "github.com/openkcm/plugin-sdk/pkg/catalog" notificationv1 "github.com/openkcm/plugin-sdk/proto/plugin/notification/v1" - "github.com/openkcm/cmk-core/internal/log" + "github.com/openkcm/cmk/internal/log" ) const ( diff --git a/internal/manager/notification_test.go b/internal/manager/notification_test.go index b3bb3022..b81e8446 100644 --- a/internal/manager/notification_test.go +++ b/internal/manager/notification_test.go @@ -9,10 +9,10 @@ import ( notificationv1 "github.com/openkcm/plugin-sdk/proto/plugin/notification/v1" - "github.com/openkcm/cmk-core/internal/config" - "github.com/openkcm/cmk-core/internal/grpc/catalog" - "github.com/openkcm/cmk-core/internal/manager" - "github.com/openkcm/cmk-core/internal/testutils" + "github.com/openkcm/cmk/internal/config" + "github.com/openkcm/cmk/internal/grpc/catalog" + "github.com/openkcm/cmk/internal/manager" + "github.com/openkcm/cmk/internal/testutils" ) type NotificationServiceMock struct { diff --git a/internal/manager/providerconfigmanager.go b/internal/manager/providerconfigmanager.go index 312d18ee..72191ea9 100644 --- a/internal/manager/providerconfigmanager.go +++ b/internal/manager/providerconfigmanager.go @@ -17,14 +17,14 @@ import ( keystoremanagerv1 "github.com/openkcm/plugin-sdk/proto/plugin/keystore/management/v1" keystoreopv1 "github.com/openkcm/plugin-sdk/proto/plugin/keystore/operations/v1" - "github.com/openkcm/cmk-core/internal/constants" - "github.com/openkcm/cmk-core/internal/errs" - "github.com/openkcm/cmk-core/internal/log" - "github.com/openkcm/cmk-core/internal/model" - "github.com/openkcm/cmk-core/internal/repo" - cmkcontext "github.com/openkcm/cmk-core/utils/context" - pluginHelpers "github.com/openkcm/cmk-core/utils/plugins" - "github.com/openkcm/cmk-core/utils/ptr" + "github.com/openkcm/cmk/internal/constants" + "github.com/openkcm/cmk/internal/errs" + "github.com/openkcm/cmk/internal/log" + "github.com/openkcm/cmk/internal/model" + "github.com/openkcm/cmk/internal/repo" + cmkcontext "github.com/openkcm/cmk/utils/context" + pluginHelpers "github.com/openkcm/cmk/utils/plugins" + "github.com/openkcm/cmk/utils/ptr" ) const ( diff --git a/internal/manager/system.go b/internal/manager/system.go index 545f0458..c606da8b 100644 --- a/internal/manager/system.go +++ b/internal/manager/system.go @@ -12,20 +12,20 @@ import ( plugincatalog "github.com/openkcm/plugin-sdk/pkg/catalog" slogctx "github.com/veqryn/slog-context" - "github.com/openkcm/cmk-core/internal/api/cmkapi" - "github.com/openkcm/cmk-core/internal/auditor" - "github.com/openkcm/cmk-core/internal/clients" - "github.com/openkcm/cmk-core/internal/clients/registry" - "github.com/openkcm/cmk-core/internal/clients/registry/systems" - "github.com/openkcm/cmk-core/internal/config" - "github.com/openkcm/cmk-core/internal/constants" - "github.com/openkcm/cmk-core/internal/errs" - eventprocessor "github.com/openkcm/cmk-core/internal/event-processor" - "github.com/openkcm/cmk-core/internal/log" - "github.com/openkcm/cmk-core/internal/model" - "github.com/openkcm/cmk-core/internal/repo" - cmkcontext "github.com/openkcm/cmk-core/utils/context" - "github.com/openkcm/cmk-core/utils/ptr" + "github.com/openkcm/cmk/internal/api/cmkapi" + "github.com/openkcm/cmk/internal/auditor" + "github.com/openkcm/cmk/internal/clients" + "github.com/openkcm/cmk/internal/clients/registry" + "github.com/openkcm/cmk/internal/clients/registry/systems" + "github.com/openkcm/cmk/internal/config" + "github.com/openkcm/cmk/internal/constants" + "github.com/openkcm/cmk/internal/errs" + eventprocessor "github.com/openkcm/cmk/internal/event-processor" + "github.com/openkcm/cmk/internal/log" + "github.com/openkcm/cmk/internal/model" + "github.com/openkcm/cmk/internal/repo" + cmkcontext "github.com/openkcm/cmk/utils/context" + "github.com/openkcm/cmk/utils/ptr" ) type System interface { diff --git a/internal/manager/system_test.go b/internal/manager/system_test.go index a1ebe80f..e99e04b7 100644 --- a/internal/manager/system_test.go +++ b/internal/manager/system_test.go @@ -15,20 +15,20 @@ import ( systemgrpc "github.com/openkcm/api-sdk/proto/kms/api/cmk/registry/system/v1" regionpb "github.com/openkcm/api-sdk/proto/kms/api/cmk/types/v1" - "github.com/openkcm/cmk-core/internal/api/cmkapi" - "github.com/openkcm/cmk-core/internal/auditor" - "github.com/openkcm/cmk-core/internal/clients" - "github.com/openkcm/cmk-core/internal/clients/registry/systems" - "github.com/openkcm/cmk-core/internal/config" - "github.com/openkcm/cmk-core/internal/constants" - eventprocessor "github.com/openkcm/cmk-core/internal/event-processor" - "github.com/openkcm/cmk-core/internal/grpc/catalog" - "github.com/openkcm/cmk-core/internal/manager" - "github.com/openkcm/cmk-core/internal/model" - "github.com/openkcm/cmk-core/internal/repo" - "github.com/openkcm/cmk-core/internal/repo/sql" - "github.com/openkcm/cmk-core/internal/testutils" - "github.com/openkcm/cmk-core/utils/ptr" + "github.com/openkcm/cmk/internal/api/cmkapi" + "github.com/openkcm/cmk/internal/auditor" + "github.com/openkcm/cmk/internal/clients" + "github.com/openkcm/cmk/internal/clients/registry/systems" + "github.com/openkcm/cmk/internal/config" + "github.com/openkcm/cmk/internal/constants" + eventprocessor "github.com/openkcm/cmk/internal/event-processor" + "github.com/openkcm/cmk/internal/grpc/catalog" + "github.com/openkcm/cmk/internal/manager" + "github.com/openkcm/cmk/internal/model" + "github.com/openkcm/cmk/internal/repo" + "github.com/openkcm/cmk/internal/repo/sql" + "github.com/openkcm/cmk/internal/testutils" + "github.com/openkcm/cmk/utils/ptr" ) func SetupSystemManager(t *testing.T, clientsFactory *clients.Factory) ( diff --git a/internal/manager/systeminformation.go b/internal/manager/systeminformation.go index 664b0742..44440b6f 100644 --- a/internal/manager/systeminformation.go +++ b/internal/manager/systeminformation.go @@ -10,12 +10,12 @@ import ( plugincatalog "github.com/openkcm/plugin-sdk/pkg/catalog" systeminformationv1 "github.com/openkcm/plugin-sdk/proto/plugin/systeminformation/v1" - "github.com/openkcm/cmk-core/internal/clients/registry/systems" - "github.com/openkcm/cmk-core/internal/config" - "github.com/openkcm/cmk-core/internal/errs" - "github.com/openkcm/cmk-core/internal/log" - "github.com/openkcm/cmk-core/internal/model" - "github.com/openkcm/cmk-core/internal/repo" + "github.com/openkcm/cmk/internal/clients/registry/systems" + "github.com/openkcm/cmk/internal/config" + "github.com/openkcm/cmk/internal/errs" + "github.com/openkcm/cmk/internal/log" + "github.com/openkcm/cmk/internal/model" + "github.com/openkcm/cmk/internal/repo" ) var ( diff --git a/internal/manager/systeminformation_test.go b/internal/manager/systeminformation_test.go index 8e4ef05d..d08a2f76 100644 --- a/internal/manager/systeminformation_test.go +++ b/internal/manager/systeminformation_test.go @@ -13,13 +13,13 @@ import ( multitenancy "github.com/bartventer/gorm-multitenancy/v8" systeminformationv1 "github.com/openkcm/plugin-sdk/proto/plugin/systeminformation/v1" - "github.com/openkcm/cmk-core/internal/config" - "github.com/openkcm/cmk-core/internal/grpc/catalog" - "github.com/openkcm/cmk-core/internal/manager" - "github.com/openkcm/cmk-core/internal/model" - "github.com/openkcm/cmk-core/internal/repo" - "github.com/openkcm/cmk-core/internal/repo/sql" - "github.com/openkcm/cmk-core/internal/testutils" + "github.com/openkcm/cmk/internal/config" + "github.com/openkcm/cmk/internal/grpc/catalog" + "github.com/openkcm/cmk/internal/manager" + "github.com/openkcm/cmk/internal/model" + "github.com/openkcm/cmk/internal/repo" + "github.com/openkcm/cmk/internal/repo/sql" + "github.com/openkcm/cmk/internal/testutils" ) const ( diff --git a/internal/manager/tag.go b/internal/manager/tag.go index 27267527..be703ca0 100644 --- a/internal/manager/tag.go +++ b/internal/manager/tag.go @@ -6,8 +6,8 @@ import ( "github.com/google/uuid" - "github.com/openkcm/cmk-core/internal/errs" - "github.com/openkcm/cmk-core/internal/repo" + "github.com/openkcm/cmk/internal/errs" + "github.com/openkcm/cmk/internal/repo" ) var ( diff --git a/internal/manager/tenant.go b/internal/manager/tenant.go index 10784768..731dc6f9 100644 --- a/internal/manager/tenant.go +++ b/internal/manager/tenant.go @@ -3,9 +3,9 @@ package manager import ( "context" - "github.com/openkcm/cmk-core/internal/model" - "github.com/openkcm/cmk-core/internal/repo" - cmkcontext "github.com/openkcm/cmk-core/utils/context" + "github.com/openkcm/cmk/internal/model" + "github.com/openkcm/cmk/internal/repo" + cmkcontext "github.com/openkcm/cmk/utils/context" ) type Tenant interface { diff --git a/internal/manager/tenant_test.go b/internal/manager/tenant_test.go index fce319e8..36e67b62 100644 --- a/internal/manager/tenant_test.go +++ b/internal/manager/tenant_test.go @@ -6,9 +6,9 @@ import ( "github.com/bartventer/gorm-multitenancy/v8/pkg/driver" "github.com/stretchr/testify/assert" - "github.com/openkcm/cmk-core/internal/manager" - "github.com/openkcm/cmk-core/internal/repo/sql" - "github.com/openkcm/cmk-core/internal/testutils" + "github.com/openkcm/cmk/internal/manager" + "github.com/openkcm/cmk/internal/repo/sql" + "github.com/openkcm/cmk/internal/testutils" ) func TestTenantManager(t *testing.T) { diff --git a/internal/manager/tenantconfigs.go b/internal/manager/tenantconfigs.go index 9204aa26..4aa1cbae 100644 --- a/internal/manager/tenantconfigs.go +++ b/internal/manager/tenantconfigs.go @@ -7,11 +7,11 @@ import ( plugincatalog "github.com/openkcm/plugin-sdk/pkg/catalog" keystoreopv1 "github.com/openkcm/plugin-sdk/proto/plugin/keystore/operations/v1" - "github.com/openkcm/cmk-core/internal/constants" - "github.com/openkcm/cmk-core/internal/errs" - "github.com/openkcm/cmk-core/internal/model" - "github.com/openkcm/cmk-core/internal/repo" - pluginHelpers "github.com/openkcm/cmk-core/utils/plugins" + "github.com/openkcm/cmk/internal/constants" + "github.com/openkcm/cmk/internal/errs" + "github.com/openkcm/cmk/internal/model" + "github.com/openkcm/cmk/internal/repo" + pluginHelpers "github.com/openkcm/cmk/utils/plugins" ) type TenantConfigManager struct { diff --git a/internal/manager/tenantconfigs_test.go b/internal/manager/tenantconfigs_test.go index 35bbcc35..a3c98e28 100644 --- a/internal/manager/tenantconfigs_test.go +++ b/internal/manager/tenantconfigs_test.go @@ -11,13 +11,13 @@ import ( multitenancy "github.com/bartventer/gorm-multitenancy/v8" - "github.com/openkcm/cmk-core/internal/config" - "github.com/openkcm/cmk-core/internal/constants" - "github.com/openkcm/cmk-core/internal/grpc/catalog" - "github.com/openkcm/cmk-core/internal/manager" - "github.com/openkcm/cmk-core/internal/model" - "github.com/openkcm/cmk-core/internal/repo/sql" - "github.com/openkcm/cmk-core/internal/testutils" + "github.com/openkcm/cmk/internal/config" + "github.com/openkcm/cmk/internal/constants" + "github.com/openkcm/cmk/internal/grpc/catalog" + "github.com/openkcm/cmk/internal/manager" + "github.com/openkcm/cmk/internal/model" + "github.com/openkcm/cmk/internal/repo/sql" + "github.com/openkcm/cmk/internal/testutils" ) var ErrForced = errors.New("forced") diff --git a/internal/manager/workflow.go b/internal/manager/workflow.go index 9f5f85ff..b9060544 100644 --- a/internal/manager/workflow.go +++ b/internal/manager/workflow.go @@ -9,14 +9,14 @@ import ( "github.com/google/uuid" - "github.com/openkcm/cmk-core/internal/api/cmkapi" - "github.com/openkcm/cmk-core/internal/config" - "github.com/openkcm/cmk-core/internal/constants" - "github.com/openkcm/cmk-core/internal/errs" - "github.com/openkcm/cmk-core/internal/model" - "github.com/openkcm/cmk-core/internal/repo" - wf "github.com/openkcm/cmk-core/internal/workflow" - "github.com/openkcm/cmk-core/utils/ptr" + "github.com/openkcm/cmk/internal/api/cmkapi" + "github.com/openkcm/cmk/internal/config" + "github.com/openkcm/cmk/internal/constants" + "github.com/openkcm/cmk/internal/errs" + "github.com/openkcm/cmk/internal/model" + "github.com/openkcm/cmk/internal/repo" + wf "github.com/openkcm/cmk/internal/workflow" + "github.com/openkcm/cmk/utils/ptr" ) var ErrWorkflowApproverDecision = errors.New("workflow approver decision") diff --git a/internal/manager/workflow_test.go b/internal/manager/workflow_test.go index a0ef43a2..0f221847 100644 --- a/internal/manager/workflow_test.go +++ b/internal/manager/workflow_test.go @@ -8,19 +8,19 @@ import ( "github.com/google/uuid" "github.com/stretchr/testify/assert" - "github.com/openkcm/cmk-core/internal/api/cmkapi" - "github.com/openkcm/cmk-core/internal/auditor" - "github.com/openkcm/cmk-core/internal/clients" - "github.com/openkcm/cmk-core/internal/config" - "github.com/openkcm/cmk-core/internal/constants" - "github.com/openkcm/cmk-core/internal/errs" - "github.com/openkcm/cmk-core/internal/grpc/catalog" - "github.com/openkcm/cmk-core/internal/manager" - "github.com/openkcm/cmk-core/internal/model" - "github.com/openkcm/cmk-core/internal/repo" - "github.com/openkcm/cmk-core/internal/repo/sql" - "github.com/openkcm/cmk-core/internal/testutils" - "github.com/openkcm/cmk-core/internal/workflow" + "github.com/openkcm/cmk/internal/api/cmkapi" + "github.com/openkcm/cmk/internal/auditor" + "github.com/openkcm/cmk/internal/clients" + "github.com/openkcm/cmk/internal/config" + "github.com/openkcm/cmk/internal/constants" + "github.com/openkcm/cmk/internal/errs" + "github.com/openkcm/cmk/internal/grpc/catalog" + "github.com/openkcm/cmk/internal/manager" + "github.com/openkcm/cmk/internal/model" + "github.com/openkcm/cmk/internal/repo" + "github.com/openkcm/cmk/internal/repo/sql" + "github.com/openkcm/cmk/internal/testutils" + "github.com/openkcm/cmk/internal/workflow" ) func SetupWorkflowManager(t *testing.T) (*manager.WorkflowManager, diff --git a/internal/middleware/clientdata.go b/internal/middleware/clientdata.go index 90a587ec..66d0744d 100644 --- a/internal/middleware/clientdata.go +++ b/internal/middleware/clientdata.go @@ -12,8 +12,8 @@ import ( "github.com/openkcm/common-sdk/pkg/commoncfg" "github.com/openkcm/common-sdk/pkg/storage/keyvalue" - "github.com/openkcm/cmk-core/internal/flags" - "github.com/openkcm/cmk-core/internal/log" + "github.com/openkcm/cmk/internal/flags" + "github.com/openkcm/cmk/internal/log" ) type clientDataContextKey string diff --git a/internal/middleware/clientdata_test.go b/internal/middleware/clientdata_test.go index 9cab9168..01234502 100644 --- a/internal/middleware/clientdata_test.go +++ b/internal/middleware/clientdata_test.go @@ -22,9 +22,9 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/openkcm/cmk-core/internal/config" - "github.com/openkcm/cmk-core/internal/flags" - "github.com/openkcm/cmk-core/internal/middleware" + "github.com/openkcm/cmk/internal/config" + "github.com/openkcm/cmk/internal/flags" + "github.com/openkcm/cmk/internal/middleware" ) // testData holds test setup data diff --git a/internal/middleware/context.go b/internal/middleware/context.go index 9f80b78a..6f3e97f1 100644 --- a/internal/middleware/context.go +++ b/internal/middleware/context.go @@ -3,7 +3,7 @@ package middleware import ( "net/http" - cmkcontext "github.com/openkcm/cmk-core/utils/context" + cmkcontext "github.com/openkcm/cmk/utils/context" ) // InjectRequestID injects a RequestID into the context to be used by other middlewares diff --git a/internal/middleware/logging.go b/internal/middleware/logging.go index 11bc3a94..4a7932bd 100644 --- a/internal/middleware/logging.go +++ b/internal/middleware/logging.go @@ -5,7 +5,7 @@ import ( "net/http" "time" - "github.com/openkcm/cmk-core/internal/log" + "github.com/openkcm/cmk/internal/log" ) // LoggingMiddleware logs the start and end of each request, along with the duration and status code. diff --git a/internal/middleware/logging_test.go b/internal/middleware/logging_test.go index 4a3d8c00..7176a93a 100644 --- a/internal/middleware/logging_test.go +++ b/internal/middleware/logging_test.go @@ -10,7 +10,7 @@ import ( "github.com/stretchr/testify/assert" - "github.com/openkcm/cmk-core/internal/middleware" + "github.com/openkcm/cmk/internal/middleware" ) // TestLoggingMiddleware tests the logging middleware diff --git a/internal/middleware/multitenancy_test.go b/internal/middleware/multitenancy_test.go index 8f3e2ee1..4f034939 100644 --- a/internal/middleware/multitenancy_test.go +++ b/internal/middleware/multitenancy_test.go @@ -10,7 +10,7 @@ import ( multitenancyMiddleware "github.com/bartventer/gorm-multitenancy/middleware/nethttp/v8" - "github.com/openkcm/cmk-core/internal/middleware" + "github.com/openkcm/cmk/internal/middleware" ) func TestMultiTenancyMiddleware(t *testing.T) { diff --git a/internal/middleware/oapi_validator.go b/internal/middleware/oapi_validator.go index 5e9f2417..99570ede 100644 --- a/internal/middleware/oapi_validator.go +++ b/internal/middleware/oapi_validator.go @@ -8,7 +8,7 @@ import ( md "github.com/oapi-codegen/nethttp-middleware" - "github.com/openkcm/cmk-core/internal/handlers" + "github.com/openkcm/cmk/internal/handlers" ) // OAPIMiddleware validates a Request against the OpenAPI Spec diff --git a/internal/middleware/panic.go b/internal/middleware/panic.go index de9cf0c2..70d35dfd 100644 --- a/internal/middleware/panic.go +++ b/internal/middleware/panic.go @@ -7,9 +7,9 @@ import ( "net/http" "runtime/debug" - "github.com/openkcm/cmk-core/internal/api/write" - "github.com/openkcm/cmk-core/internal/apierrors" - "github.com/openkcm/cmk-core/internal/log" + "github.com/openkcm/cmk/internal/api/write" + "github.com/openkcm/cmk/internal/apierrors" + "github.com/openkcm/cmk/internal/log" ) // PanicRecoveryMiddleware is a middleware that recovers from panics and logs them. diff --git a/internal/middleware/panic_test.go b/internal/middleware/panic_test.go index 03a2337b..04401ab1 100644 --- a/internal/middleware/panic_test.go +++ b/internal/middleware/panic_test.go @@ -7,7 +7,7 @@ import ( "github.com/stretchr/testify/assert" - "github.com/openkcm/cmk-core/internal/middleware" + "github.com/openkcm/cmk/internal/middleware" ) func TestPanicRecoveryMiddleware(t *testing.T) { diff --git a/internal/model/certificate_test.go b/internal/model/certificate_test.go index 537a0608..cf1a3d83 100644 --- a/internal/model/certificate_test.go +++ b/internal/model/certificate_test.go @@ -5,7 +5,7 @@ import ( "github.com/stretchr/testify/assert" - "github.com/openkcm/cmk-core/internal/model" + "github.com/openkcm/cmk/internal/model" ) func TestCertificateTable(t *testing.T) { diff --git a/internal/model/group.go b/internal/model/group.go index 592425a0..ac4ac10e 100644 --- a/internal/model/group.go +++ b/internal/model/group.go @@ -5,7 +5,7 @@ import ( "github.com/google/uuid" - "github.com/openkcm/cmk-core/internal/constants" + "github.com/openkcm/cmk/internal/constants" ) type Group struct { diff --git a/internal/model/group_test.go b/internal/model/group_test.go index 0fe998e1..652f9697 100644 --- a/internal/model/group_test.go +++ b/internal/model/group_test.go @@ -5,7 +5,7 @@ import ( "github.com/stretchr/testify/assert" - "github.com/openkcm/cmk-core/internal/model" + "github.com/openkcm/cmk/internal/model" ) func TestGroupTable(t *testing.T) { diff --git a/internal/model/importparams_test.go b/internal/model/importparams_test.go index 29d184fb..d5af50cb 100644 --- a/internal/model/importparams_test.go +++ b/internal/model/importparams_test.go @@ -6,7 +6,7 @@ import ( "github.com/stretchr/testify/assert" - "github.com/openkcm/cmk-core/internal/model" + "github.com/openkcm/cmk/internal/model" ) func TestImportParamsTable(t *testing.T) { diff --git a/internal/model/key_test.go b/internal/model/key_test.go index ebb6f6aa..69929988 100644 --- a/internal/model/key_test.go +++ b/internal/model/key_test.go @@ -5,7 +5,7 @@ import ( "github.com/stretchr/testify/assert" - "github.com/openkcm/cmk-core/internal/model" + "github.com/openkcm/cmk/internal/model" ) func TestKeyTable(t *testing.T) { diff --git a/internal/model/keyconfiguration_test.go b/internal/model/keyconfiguration_test.go index 3e4503b0..932dede3 100644 --- a/internal/model/keyconfiguration_test.go +++ b/internal/model/keyconfiguration_test.go @@ -5,7 +5,7 @@ import ( "github.com/stretchr/testify/assert" - "github.com/openkcm/cmk-core/internal/model" + "github.com/openkcm/cmk/internal/model" ) func TestKeyConfiguration(t *testing.T) { diff --git a/internal/model/keystore_config.go b/internal/model/keystore_config.go index b460d0f7..5e181062 100644 --- a/internal/model/keystore_config.go +++ b/internal/model/keystore_config.go @@ -5,7 +5,7 @@ import ( "github.com/google/uuid" - "github.com/openkcm/cmk-core/internal/config" + "github.com/openkcm/cmk/internal/config" ) // KeystoreConfiguration is an internal entity of pool item that should be persisted. diff --git a/internal/model/keystore_config_test.go b/internal/model/keystore_config_test.go index 688cb81e..897f312a 100644 --- a/internal/model/keystore_config_test.go +++ b/internal/model/keystore_config_test.go @@ -5,7 +5,7 @@ import ( "github.com/stretchr/testify/assert" - "github.com/openkcm/cmk-core/internal/model" + "github.com/openkcm/cmk/internal/model" ) func TestKeystoreConfigTable(t *testing.T) { diff --git a/internal/model/keyversion_test.go b/internal/model/keyversion_test.go index 06c8f49d..08f957e7 100644 --- a/internal/model/keyversion_test.go +++ b/internal/model/keyversion_test.go @@ -5,7 +5,7 @@ import ( "github.com/stretchr/testify/assert" - "github.com/openkcm/cmk-core/internal/model" + "github.com/openkcm/cmk/internal/model" ) func TestKeyVersionTable(t *testing.T) { diff --git a/internal/model/label_test.go b/internal/model/label_test.go index 12cb61ec..4c01ee86 100644 --- a/internal/model/label_test.go +++ b/internal/model/label_test.go @@ -5,7 +5,7 @@ import ( "github.com/stretchr/testify/assert" - "github.com/openkcm/cmk-core/internal/model" + "github.com/openkcm/cmk/internal/model" ) func TestKeyLabelsTable(t *testing.T) { diff --git a/internal/model/system.go b/internal/model/system.go index e1c2d0b1..ab2d1e27 100644 --- a/internal/model/system.go +++ b/internal/model/system.go @@ -4,8 +4,8 @@ import ( "github.com/google/uuid" "gorm.io/gorm" - "github.com/openkcm/cmk-core/internal/api/cmkapi" - "github.com/openkcm/cmk-core/internal/config" + "github.com/openkcm/cmk/internal/api/cmkapi" + "github.com/openkcm/cmk/internal/config" ) //nolint:recvcheck diff --git a/internal/model/system_test.go b/internal/model/system_test.go index f223e897..f4b5adad 100644 --- a/internal/model/system_test.go +++ b/internal/model/system_test.go @@ -5,7 +5,7 @@ import ( "github.com/stretchr/testify/assert" - "github.com/openkcm/cmk-core/internal/model" + "github.com/openkcm/cmk/internal/model" ) func TestSystem(t *testing.T) { diff --git a/internal/model/tag_test.go b/internal/model/tag_test.go index 1429f0b9..92bc3f34 100644 --- a/internal/model/tag_test.go +++ b/internal/model/tag_test.go @@ -5,7 +5,7 @@ import ( "github.com/stretchr/testify/assert" - "github.com/openkcm/cmk-core/internal/model" + "github.com/openkcm/cmk/internal/model" ) func TestTagsTable(t *testing.T) { diff --git a/internal/model/tenant_status_test.go b/internal/model/tenant_status_test.go index ca2e0e27..0acb6fae 100644 --- a/internal/model/tenant_status_test.go +++ b/internal/model/tenant_status_test.go @@ -7,7 +7,7 @@ import ( pb "github.com/openkcm/api-sdk/proto/kms/api/cmk/registry/tenant/v1" - "github.com/openkcm/cmk-core/internal/model" + "github.com/openkcm/cmk/internal/model" ) func TestTenantStatusValidation(t *testing.T) { diff --git a/internal/model/tenant_test.go b/internal/model/tenant_test.go index 9bdc2fdf..319c1e9e 100644 --- a/internal/model/tenant_test.go +++ b/internal/model/tenant_test.go @@ -8,9 +8,9 @@ import ( multitenancy "github.com/bartventer/gorm-multitenancy/v8" - "github.com/openkcm/cmk-core/internal/model" - "github.com/openkcm/cmk-core/internal/repo/sql" - "github.com/openkcm/cmk-core/internal/testutils" + "github.com/openkcm/cmk/internal/model" + "github.com/openkcm/cmk/internal/repo/sql" + "github.com/openkcm/cmk/internal/testutils" ) func TestTenantsTable(t *testing.T) { diff --git a/internal/model/workflow_test.go b/internal/model/workflow_test.go index 5df597f4..6f1b6d45 100644 --- a/internal/model/workflow_test.go +++ b/internal/model/workflow_test.go @@ -5,7 +5,7 @@ import ( "github.com/stretchr/testify/assert" - "github.com/openkcm/cmk-core/internal/model" + "github.com/openkcm/cmk/internal/model" ) func TestWorkflowTable(t *testing.T) { diff --git a/internal/plugins/builtin/builtin.go b/internal/plugins/builtin/builtin.go index 86a56c4e..acc457b7 100644 --- a/internal/plugins/builtin/builtin.go +++ b/internal/plugins/builtin/builtin.go @@ -3,12 +3,12 @@ package builtin import ( "github.com/openkcm/plugin-sdk/pkg/catalog" - "github.com/openkcm/cmk-core/internal/plugins/builtin/certificateissuer" - "github.com/openkcm/cmk-core/internal/plugins/builtin/identitymanagement" - keystoreman "github.com/openkcm/cmk-core/internal/plugins/builtin/keystore/management" - keystoreop "github.com/openkcm/cmk-core/internal/plugins/builtin/keystore/operations" - "github.com/openkcm/cmk-core/internal/plugins/builtin/notification" - "github.com/openkcm/cmk-core/internal/plugins/builtin/systeminformation" + "github.com/openkcm/cmk/internal/plugins/builtin/certificateissuer" + "github.com/openkcm/cmk/internal/plugins/builtin/identitymanagement" + keystoreman "github.com/openkcm/cmk/internal/plugins/builtin/keystore/management" + keystoreop "github.com/openkcm/cmk/internal/plugins/builtin/keystore/operations" + "github.com/openkcm/cmk/internal/plugins/builtin/notification" + "github.com/openkcm/cmk/internal/plugins/builtin/systeminformation" ) func BuiltIns() []catalog.BuiltIn { diff --git a/internal/repo/mock/db.go b/internal/repo/mock/db.go index 331515d4..06332c87 100644 --- a/internal/repo/mock/db.go +++ b/internal/repo/mock/db.go @@ -6,9 +6,9 @@ import ( "github.com/google/uuid" - "github.com/openkcm/cmk-core/internal/errs" - "github.com/openkcm/cmk-core/internal/model" - "github.com/openkcm/cmk-core/internal/repo" + "github.com/openkcm/cmk/internal/errs" + "github.com/openkcm/cmk/internal/model" + "github.com/openkcm/cmk/internal/repo" ) type ModelInfo struct { diff --git a/internal/repo/mock/db_test.go b/internal/repo/mock/db_test.go index e7492751..44ef6f58 100644 --- a/internal/repo/mock/db_test.go +++ b/internal/repo/mock/db_test.go @@ -7,9 +7,9 @@ import ( "github.com/google/uuid" "github.com/stretchr/testify/assert" - "github.com/openkcm/cmk-core/internal/model" - "github.com/openkcm/cmk-core/internal/repo" - "github.com/openkcm/cmk-core/internal/repo/mock" + "github.com/openkcm/cmk/internal/model" + "github.com/openkcm/cmk/internal/repo" + "github.com/openkcm/cmk/internal/repo/mock" ) func TestCreate(t *testing.T) { diff --git a/internal/repo/mock/multitenancydb_test.go b/internal/repo/mock/multitenancydb_test.go index 3402c3f9..6a3e4531 100644 --- a/internal/repo/mock/multitenancydb_test.go +++ b/internal/repo/mock/multitenancydb_test.go @@ -6,8 +6,8 @@ import ( "github.com/google/uuid" "github.com/stretchr/testify/assert" - "github.com/openkcm/cmk-core/internal/model" - "github.com/openkcm/cmk-core/internal/repo/mock" + "github.com/openkcm/cmk/internal/model" + "github.com/openkcm/cmk/internal/repo/mock" ) func TestInMemoryMultitenancyDB_CreateDB(t *testing.T) { diff --git a/internal/repo/mock/repo.go b/internal/repo/mock/repo.go index 367fedcc..4ed3a553 100644 --- a/internal/repo/mock/repo.go +++ b/internal/repo/mock/repo.go @@ -6,9 +6,9 @@ import ( "github.com/bartventer/gorm-multitenancy/middleware/nethttp/v8" - "github.com/openkcm/cmk-core/internal/errs" - "github.com/openkcm/cmk-core/internal/repo" - cmkcontext "github.com/openkcm/cmk-core/utils/context" + "github.com/openkcm/cmk/internal/errs" + "github.com/openkcm/cmk/internal/repo" + cmkcontext "github.com/openkcm/cmk/utils/context" ) // InMemoryRepository represents the repository for managing mock Resource data. diff --git a/internal/repo/mock/repo_test.go b/internal/repo/mock/repo_test.go index 48eb6711..cae860e6 100644 --- a/internal/repo/mock/repo_test.go +++ b/internal/repo/mock/repo_test.go @@ -7,10 +7,10 @@ import ( "github.com/google/uuid" "github.com/stretchr/testify/assert" - "github.com/openkcm/cmk-core/internal/model" - "github.com/openkcm/cmk-core/internal/repo" - "github.com/openkcm/cmk-core/internal/repo/mock" - "github.com/openkcm/cmk-core/internal/testutils" + "github.com/openkcm/cmk/internal/model" + "github.com/openkcm/cmk/internal/repo" + "github.com/openkcm/cmk/internal/repo/mock" + "github.com/openkcm/cmk/internal/testutils" ) func TestInMemoryRepository_Create(t *testing.T) { diff --git a/internal/repo/query_test.go b/internal/repo/query_test.go index b8ee6e0d..31806857 100644 --- a/internal/repo/query_test.go +++ b/internal/repo/query_test.go @@ -6,8 +6,8 @@ import ( "github.com/stretchr/testify/assert" - "github.com/openkcm/cmk-core/internal/model" - "github.com/openkcm/cmk-core/internal/repo" + "github.com/openkcm/cmk/internal/model" + "github.com/openkcm/cmk/internal/repo" ) func TestQuery_Join(t *testing.T) { diff --git a/internal/repo/repository.go b/internal/repo/repository.go index 047ab079..cc68e661 100644 --- a/internal/repo/repository.go +++ b/internal/repo/repository.go @@ -10,8 +10,8 @@ import ( "github.com/google/uuid" - "github.com/openkcm/cmk-core/internal/errs" - "github.com/openkcm/cmk-core/internal/model" + "github.com/openkcm/cmk/internal/errs" + "github.com/openkcm/cmk/internal/model" ) // TransactionFunc is func signature for ExecTransaction. diff --git a/internal/repo/repository_test.go b/internal/repo/repository_test.go index 97b6b96d..c9e5df91 100644 --- a/internal/repo/repository_test.go +++ b/internal/repo/repository_test.go @@ -8,9 +8,9 @@ import ( "github.com/google/uuid" "github.com/stretchr/testify/assert" - "github.com/openkcm/cmk-core/internal/repo" - "github.com/openkcm/cmk-core/internal/repo/sql" - "github.com/openkcm/cmk-core/internal/testutils" + "github.com/openkcm/cmk/internal/repo" + "github.com/openkcm/cmk/internal/repo/sql" + "github.com/openkcm/cmk/internal/testutils" ) func TestConcurrency(t *testing.T) { diff --git a/internal/repo/sql/repo.go b/internal/repo/sql/repo.go index b053f66e..68170d65 100644 --- a/internal/repo/sql/repo.go +++ b/internal/repo/sql/repo.go @@ -13,12 +13,12 @@ import ( multitenancy "github.com/bartventer/gorm-multitenancy/v8" - "github.com/openkcm/cmk-core/internal/errs" - "github.com/openkcm/cmk-core/internal/log" - "github.com/openkcm/cmk-core/internal/model" - "github.com/openkcm/cmk-core/internal/repo" - "github.com/openkcm/cmk-core/internal/repo/violations" - cmkcontext "github.com/openkcm/cmk-core/utils/context" + "github.com/openkcm/cmk/internal/errs" + "github.com/openkcm/cmk/internal/log" + "github.com/openkcm/cmk/internal/model" + "github.com/openkcm/cmk/internal/repo" + "github.com/openkcm/cmk/internal/repo/violations" + cmkcontext "github.com/openkcm/cmk/utils/context" ) const ( diff --git a/internal/repo/sql/repo_test.go b/internal/repo/sql/repo_test.go index dd734d20..cc0e7baa 100644 --- a/internal/repo/sql/repo_test.go +++ b/internal/repo/sql/repo_test.go @@ -13,10 +13,10 @@ import ( multitenancy "github.com/bartventer/gorm-multitenancy/v8" - "github.com/openkcm/cmk-core/internal/model" - "github.com/openkcm/cmk-core/internal/repo" - "github.com/openkcm/cmk-core/internal/repo/sql" - "github.com/openkcm/cmk-core/internal/testutils" + "github.com/openkcm/cmk/internal/model" + "github.com/openkcm/cmk/internal/repo" + "github.com/openkcm/cmk/internal/repo/sql" + "github.com/openkcm/cmk/internal/testutils" ) func TestRepo_WithTenant(t *testing.T) { diff --git a/internal/repo/violations/postgres_test.go b/internal/repo/violations/postgres_test.go index 740d8c49..9d7b035a 100644 --- a/internal/repo/violations/postgres_test.go +++ b/internal/repo/violations/postgres_test.go @@ -7,7 +7,7 @@ import ( "github.com/jackc/pgx/v5/pgconn" "github.com/stretchr/testify/require" - "github.com/openkcm/cmk-core/internal/repo/violations" + "github.com/openkcm/cmk/internal/repo/violations" ) var errNotPostgres = errors.New("not postgres") diff --git a/internal/tenant-manager/business/business.go b/internal/tenant-manager/business/business.go index d88a97b5..23d0264c 100644 --- a/internal/tenant-manager/business/business.go +++ b/internal/tenant-manager/business/business.go @@ -8,11 +8,11 @@ import ( "github.com/openkcm/orbital/codec" "github.com/samber/oops" - "github.com/openkcm/cmk-core/internal/clients" - "github.com/openkcm/cmk-core/internal/config" - "github.com/openkcm/cmk-core/internal/db" - "github.com/openkcm/cmk-core/internal/log" - "github.com/openkcm/cmk-core/internal/tenant-manager/operator" + "github.com/openkcm/cmk/internal/clients" + "github.com/openkcm/cmk/internal/config" + "github.com/openkcm/cmk/internal/db" + "github.com/openkcm/cmk/internal/log" + "github.com/openkcm/cmk/internal/tenant-manager/operator" ) const logDomain = "business" diff --git a/internal/tenant-manager/business/business_test.go b/internal/tenant-manager/business/business_test.go index d14555b9..d4e460da 100644 --- a/internal/tenant-manager/business/business_test.go +++ b/internal/tenant-manager/business/business_test.go @@ -7,9 +7,9 @@ import ( "github.com/stretchr/testify/assert" - "github.com/openkcm/cmk-core/internal/config" - "github.com/openkcm/cmk-core/internal/tenant-manager/business" - "github.com/openkcm/cmk-core/internal/testutils" + "github.com/openkcm/cmk/internal/config" + "github.com/openkcm/cmk/internal/tenant-manager/business" + "github.com/openkcm/cmk/internal/testutils" ) func TestBusinessMain(t *testing.T) { diff --git a/internal/tenant-manager/cli/cli_test.go b/internal/tenant-manager/cli/cli_test.go index 9b8647c1..c6fd141e 100644 --- a/internal/tenant-manager/cli/cli_test.go +++ b/internal/tenant-manager/cli/cli_test.go @@ -15,12 +15,12 @@ import ( multitenancy "github.com/bartventer/gorm-multitenancy/v8" tenantgrpc "github.com/openkcm/api-sdk/proto/kms/api/cmk/registry/tenant/v1" - "github.com/openkcm/cmk-core/internal/model" - "github.com/openkcm/cmk-core/internal/tenant-manager/cli" - tmdb "github.com/openkcm/cmk-core/internal/tenant-manager/db" - "github.com/openkcm/cmk-core/internal/testutils" - integrationutils "github.com/openkcm/cmk-core/test/integration_utils" - "github.com/openkcm/cmk-core/utils/base62" + "github.com/openkcm/cmk/internal/model" + "github.com/openkcm/cmk/internal/tenant-manager/cli" + tmdb "github.com/openkcm/cmk/internal/tenant-manager/db" + "github.com/openkcm/cmk/internal/testutils" + integrationutils "github.com/openkcm/cmk/test/integration_utils" + "github.com/openkcm/cmk/utils/base62" ) type CLISuite struct { diff --git a/internal/tenant-manager/cli/command.go b/internal/tenant-manager/cli/command.go index b6dcf2b4..0cf0a231 100644 --- a/internal/tenant-manager/cli/command.go +++ b/internal/tenant-manager/cli/command.go @@ -13,9 +13,9 @@ import ( multitenancy "github.com/bartventer/gorm-multitenancy/v8" - "github.com/openkcm/cmk-core/internal/config" - "github.com/openkcm/cmk-core/internal/constants" - "github.com/openkcm/cmk-core/internal/db" + "github.com/openkcm/cmk/internal/config" + "github.com/openkcm/cmk/internal/constants" + "github.com/openkcm/cmk/internal/db" ) const ( diff --git a/internal/tenant-manager/cli/creategroupscmd.go b/internal/tenant-manager/cli/creategroupscmd.go index 9642d2ab..60c7d98f 100644 --- a/internal/tenant-manager/cli/creategroupscmd.go +++ b/internal/tenant-manager/cli/creategroupscmd.go @@ -5,8 +5,8 @@ import ( "github.com/spf13/cobra" - "github.com/openkcm/cmk-core/internal/repo/sql" - tmdb "github.com/openkcm/cmk-core/internal/tenant-manager/db" + "github.com/openkcm/cmk/internal/repo/sql" + tmdb "github.com/openkcm/cmk/internal/tenant-manager/db" ) func (f *CommandFactory) NewCreateGroupsCmd() *cobra.Command { diff --git a/internal/tenant-manager/cli/createtenantcmd.go b/internal/tenant-manager/cli/createtenantcmd.go index bc0c0123..4255ca95 100644 --- a/internal/tenant-manager/cli/createtenantcmd.go +++ b/internal/tenant-manager/cli/createtenantcmd.go @@ -7,9 +7,9 @@ import ( multitenancy "github.com/bartventer/gorm-multitenancy/v8" - "github.com/openkcm/cmk-core/internal/model" - tmdb "github.com/openkcm/cmk-core/internal/tenant-manager/db" - "github.com/openkcm/cmk-core/utils/base62" + "github.com/openkcm/cmk/internal/model" + tmdb "github.com/openkcm/cmk/internal/tenant-manager/db" + "github.com/openkcm/cmk/utils/base62" ) //nolint:funlen diff --git a/internal/tenant-manager/cli/db_test.go b/internal/tenant-manager/cli/db_test.go index 1f6acc82..3580a040 100644 --- a/internal/tenant-manager/cli/db_test.go +++ b/internal/tenant-manager/cli/db_test.go @@ -16,12 +16,12 @@ import ( multitenancy "github.com/bartventer/gorm-multitenancy/v8" - "github.com/openkcm/cmk-core/internal/model" - sqlRepo "github.com/openkcm/cmk-core/internal/repo/sql" - tmdb "github.com/openkcm/cmk-core/internal/tenant-manager/db" - "github.com/openkcm/cmk-core/internal/testutils" - integrationutils "github.com/openkcm/cmk-core/test/integration_utils" - "github.com/openkcm/cmk-core/utils/base62" + "github.com/openkcm/cmk/internal/model" + sqlRepo "github.com/openkcm/cmk/internal/repo/sql" + tmdb "github.com/openkcm/cmk/internal/tenant-manager/db" + "github.com/openkcm/cmk/internal/testutils" + integrationutils "github.com/openkcm/cmk/test/integration_utils" + "github.com/openkcm/cmk/utils/base62" ) type DBSuite struct { diff --git a/internal/tenant-manager/cli/deletetenantcmd.go b/internal/tenant-manager/cli/deletetenantcmd.go index e968c481..c18fd586 100644 --- a/internal/tenant-manager/cli/deletetenantcmd.go +++ b/internal/tenant-manager/cli/deletetenantcmd.go @@ -7,9 +7,9 @@ import ( multitenancy "github.com/bartventer/gorm-multitenancy/v8" - "github.com/openkcm/cmk-core/internal/model" - "github.com/openkcm/cmk-core/internal/repo" - "github.com/openkcm/cmk-core/internal/repo/sql" + "github.com/openkcm/cmk/internal/model" + "github.com/openkcm/cmk/internal/repo" + "github.com/openkcm/cmk/internal/repo/sql" ) func (f *CommandFactory) NewDeleteTenantCmd() *cobra.Command { diff --git a/internal/tenant-manager/cli/gettenantcmd.go b/internal/tenant-manager/cli/gettenantcmd.go index d6417a73..a6675923 100644 --- a/internal/tenant-manager/cli/gettenantcmd.go +++ b/internal/tenant-manager/cli/gettenantcmd.go @@ -5,7 +5,7 @@ import ( "github.com/spf13/cobra" - "github.com/openkcm/cmk-core/internal/repo/sql" + "github.com/openkcm/cmk/internal/repo/sql" ) func (f *CommandFactory) NewGetTenantCmd() *cobra.Command { diff --git a/internal/tenant-manager/cli/listtenantscmd.go b/internal/tenant-manager/cli/listtenantscmd.go index 454ecdd4..764b339a 100644 --- a/internal/tenant-manager/cli/listtenantscmd.go +++ b/internal/tenant-manager/cli/listtenantscmd.go @@ -3,9 +3,9 @@ package cli import ( "github.com/spf13/cobra" - "github.com/openkcm/cmk-core/internal/model" - "github.com/openkcm/cmk-core/internal/repo" - "github.com/openkcm/cmk-core/internal/repo/sql" + "github.com/openkcm/cmk/internal/model" + "github.com/openkcm/cmk/internal/repo" + "github.com/openkcm/cmk/internal/repo/sql" ) func (f *CommandFactory) NewListTenantsCmd() *cobra.Command { diff --git a/internal/tenant-manager/cli/updatetenantcmd.go b/internal/tenant-manager/cli/updatetenantcmd.go index f2bc0cd4..3a96bfdf 100644 --- a/internal/tenant-manager/cli/updatetenantcmd.go +++ b/internal/tenant-manager/cli/updatetenantcmd.go @@ -3,9 +3,9 @@ package cli import ( "github.com/spf13/cobra" - "github.com/openkcm/cmk-core/internal/model" - "github.com/openkcm/cmk-core/internal/repo" - "github.com/openkcm/cmk-core/internal/repo/sql" + "github.com/openkcm/cmk/internal/model" + "github.com/openkcm/cmk/internal/repo" + "github.com/openkcm/cmk/internal/repo/sql" ) func (f *CommandFactory) NewUpdateTenantCmd() *cobra.Command { diff --git a/internal/tenant-manager/cli/utils.go b/internal/tenant-manager/cli/utils.go index 179cf20b..e54bbdbc 100644 --- a/internal/tenant-manager/cli/utils.go +++ b/internal/tenant-manager/cli/utils.go @@ -6,8 +6,8 @@ import ( "github.com/spf13/cobra" - "github.com/openkcm/cmk-core/internal/model" - "github.com/openkcm/cmk-core/internal/repo" + "github.com/openkcm/cmk/internal/model" + "github.com/openkcm/cmk/internal/repo" ) func FindTenant(ctx context.Context, cmd *cobra.Command, id string, r repo.Repo) *model.Tenant { diff --git a/internal/tenant-manager/db/db.go b/internal/tenant-manager/db/db.go index fb7f0722..1b190afb 100644 --- a/internal/tenant-manager/db/db.go +++ b/internal/tenant-manager/db/db.go @@ -11,13 +11,13 @@ import ( multitenancy "github.com/bartventer/gorm-multitenancy/v8" slogctx "github.com/veqryn/slog-context" - "github.com/openkcm/cmk-core/internal/constants" - "github.com/openkcm/cmk-core/internal/errs" - "github.com/openkcm/cmk-core/internal/log" - "github.com/openkcm/cmk-core/internal/model" - "github.com/openkcm/cmk-core/internal/repo" - sqlRepo "github.com/openkcm/cmk-core/internal/repo/sql" - cmkcontext "github.com/openkcm/cmk-core/utils/context" + "github.com/openkcm/cmk/internal/constants" + "github.com/openkcm/cmk/internal/errs" + "github.com/openkcm/cmk/internal/log" + "github.com/openkcm/cmk/internal/model" + "github.com/openkcm/cmk/internal/repo" + sqlRepo "github.com/openkcm/cmk/internal/repo/sql" + cmkcontext "github.com/openkcm/cmk/utils/context" ) var _ slogctx.Handler diff --git a/internal/tenant-manager/db/db_test.go b/internal/tenant-manager/db/db_test.go index 87b1c047..c97e34c2 100644 --- a/internal/tenant-manager/db/db_test.go +++ b/internal/tenant-manager/db/db_test.go @@ -10,12 +10,12 @@ import ( "github.com/stretchr/testify/require" "gorm.io/gorm" - "github.com/openkcm/cmk-core/internal/constants" - "github.com/openkcm/cmk-core/internal/model" - "github.com/openkcm/cmk-core/internal/tenant-manager/db" - "github.com/openkcm/cmk-core/internal/testutils" - integrationutils "github.com/openkcm/cmk-core/test/integration_utils" - "github.com/openkcm/cmk-core/utils/base62" + "github.com/openkcm/cmk/internal/constants" + "github.com/openkcm/cmk/internal/model" + "github.com/openkcm/cmk/internal/tenant-manager/db" + "github.com/openkcm/cmk/internal/testutils" + integrationutils "github.com/openkcm/cmk/test/integration_utils" + "github.com/openkcm/cmk/utils/base62" ) var ( diff --git a/internal/tenant-manager/operator/export_test.go b/internal/tenant-manager/operator/export_test.go index ef3f3567..90c2333e 100644 --- a/internal/tenant-manager/operator/export_test.go +++ b/internal/tenant-manager/operator/export_test.go @@ -7,7 +7,7 @@ import ( multitenancy "github.com/bartventer/gorm-multitenancy/v8" - "github.com/openkcm/cmk-core/internal/repo" + "github.com/openkcm/cmk/internal/repo" ) func (o *TenantOperator) HandleCreateTenant(ctx context.Context, req orbital.HandlerRequest) ( diff --git a/internal/tenant-manager/operator/operator.go b/internal/tenant-manager/operator/operator.go index 9c14154c..5f7bca82 100644 --- a/internal/tenant-manager/operator/operator.go +++ b/internal/tenant-manager/operator/operator.go @@ -16,15 +16,15 @@ import ( multitenancy "github.com/bartventer/gorm-multitenancy/v8" tenantgrpc "github.com/openkcm/api-sdk/proto/kms/api/cmk/registry/tenant/v1" - "github.com/openkcm/cmk-core/internal/config" - "github.com/openkcm/cmk-core/internal/constants" - "github.com/openkcm/cmk-core/internal/errs" - "github.com/openkcm/cmk-core/internal/log" - "github.com/openkcm/cmk-core/internal/model" - "github.com/openkcm/cmk-core/internal/repo" - "github.com/openkcm/cmk-core/internal/repo/sql" - tmdb "github.com/openkcm/cmk-core/internal/tenant-manager/db" - "github.com/openkcm/cmk-core/utils/base62" + "github.com/openkcm/cmk/internal/config" + "github.com/openkcm/cmk/internal/constants" + "github.com/openkcm/cmk/internal/errs" + "github.com/openkcm/cmk/internal/log" + "github.com/openkcm/cmk/internal/model" + "github.com/openkcm/cmk/internal/repo" + "github.com/openkcm/cmk/internal/repo/sql" + tmdb "github.com/openkcm/cmk/internal/tenant-manager/db" + "github.com/openkcm/cmk/utils/base62" ) const ( diff --git a/internal/tenant-manager/operator/operator_test.go b/internal/tenant-manager/operator/operator_test.go index 06d749b8..7d348395 100644 --- a/internal/tenant-manager/operator/operator_test.go +++ b/internal/tenant-manager/operator/operator_test.go @@ -22,12 +22,12 @@ import ( tenantgrpc "github.com/openkcm/api-sdk/proto/kms/api/cmk/registry/tenant/v1" slogctx "github.com/veqryn/slog-context" - "github.com/openkcm/cmk-core/internal/clients/registry/tenants" - "github.com/openkcm/cmk-core/internal/model" - "github.com/openkcm/cmk-core/internal/tenant-manager/operator" - "github.com/openkcm/cmk-core/internal/testutils" - integrationutils "github.com/openkcm/cmk-core/test/integration_utils" - tmdb "github.com/openkcm/cmk-core/utils/base62" + "github.com/openkcm/cmk/internal/clients/registry/tenants" + "github.com/openkcm/cmk/internal/model" + "github.com/openkcm/cmk/internal/tenant-manager/operator" + "github.com/openkcm/cmk/internal/testutils" + integrationutils "github.com/openkcm/cmk/test/integration_utils" + tmdb "github.com/openkcm/cmk/utils/base62" ) const ( diff --git a/internal/tenant-manager/operator/probe.go b/internal/tenant-manager/operator/probe.go index 953f4e81..2257fddf 100644 --- a/internal/tenant-manager/operator/probe.go +++ b/internal/tenant-manager/operator/probe.go @@ -9,12 +9,12 @@ import ( multitenancy "github.com/bartventer/gorm-multitenancy/v8" - "github.com/openkcm/cmk-core/internal/constants" - "github.com/openkcm/cmk-core/internal/errs" - "github.com/openkcm/cmk-core/internal/log" - "github.com/openkcm/cmk-core/internal/model" - "github.com/openkcm/cmk-core/internal/repo" - cmkcontext "github.com/openkcm/cmk-core/utils/context" + "github.com/openkcm/cmk/internal/constants" + "github.com/openkcm/cmk/internal/errs" + "github.com/openkcm/cmk/internal/log" + "github.com/openkcm/cmk/internal/model" + "github.com/openkcm/cmk/internal/repo" + cmkcontext "github.com/openkcm/cmk/utils/context" ) const ( diff --git a/internal/tenant-manager/operator/probe_test.go b/internal/tenant-manager/operator/probe_test.go index d58e1aac..74a66a27 100644 --- a/internal/tenant-manager/operator/probe_test.go +++ b/internal/tenant-manager/operator/probe_test.go @@ -10,12 +10,12 @@ import ( multitenancy "github.com/bartventer/gorm-multitenancy/v8" - "github.com/openkcm/cmk-core/internal/constants" - "github.com/openkcm/cmk-core/internal/model" - "github.com/openkcm/cmk-core/internal/repo/sql" - "github.com/openkcm/cmk-core/internal/tenant-manager/db" - "github.com/openkcm/cmk-core/internal/tenant-manager/operator" - "github.com/openkcm/cmk-core/internal/testutils" + "github.com/openkcm/cmk/internal/constants" + "github.com/openkcm/cmk/internal/model" + "github.com/openkcm/cmk/internal/repo/sql" + "github.com/openkcm/cmk/internal/tenant-manager/db" + "github.com/openkcm/cmk/internal/tenant-manager/operator" + "github.com/openkcm/cmk/internal/testutils" ) const ( diff --git a/internal/testutils/api.go b/internal/testutils/api.go index c4b2f0ef..69fef098 100644 --- a/internal/testutils/api.go +++ b/internal/testutils/api.go @@ -18,13 +18,13 @@ import ( multitenancy "github.com/bartventer/gorm-multitenancy/v8" md "github.com/oapi-codegen/nethttp-middleware" - "github.com/openkcm/cmk-core/internal/api/cmkapi" - "github.com/openkcm/cmk-core/internal/clients" - "github.com/openkcm/cmk-core/internal/config" - "github.com/openkcm/cmk-core/internal/controllers/cmk" - "github.com/openkcm/cmk-core/internal/handlers" - "github.com/openkcm/cmk-core/internal/middleware" - "github.com/openkcm/cmk-core/internal/repo/sql" + "github.com/openkcm/cmk/internal/api/cmkapi" + "github.com/openkcm/cmk/internal/clients" + "github.com/openkcm/cmk/internal/config" + "github.com/openkcm/cmk/internal/controllers/cmk" + "github.com/openkcm/cmk/internal/handlers" + "github.com/openkcm/cmk/internal/middleware" + "github.com/openkcm/cmk/internal/repo/sql" ) const TestCertURL = "https://aia.pki.co.test.com/aia/TEST%20Cloud%20Root%20CA.crt" diff --git a/internal/testutils/api_test.go b/internal/testutils/api_test.go index 6efb0b7b..29bf7cdc 100644 --- a/internal/testutils/api_test.go +++ b/internal/testutils/api_test.go @@ -8,7 +8,7 @@ import ( multitenancy "github.com/bartventer/gorm-multitenancy/v8" - "github.com/openkcm/cmk-core/internal/testutils" + "github.com/openkcm/cmk/internal/testutils" ) // TestStartAPIServerReturnsServeMux tests if StartAPIServer returns a ServeMux diff --git a/internal/testutils/certificate.go b/internal/testutils/certificate.go index 6e5e7ea2..6702b11f 100644 --- a/internal/testutils/certificate.go +++ b/internal/testutils/certificate.go @@ -13,8 +13,8 @@ import ( "github.com/fullsailor/pkcs7" "github.com/stretchr/testify/assert" - "github.com/openkcm/cmk-core/internal/manager" - "github.com/openkcm/cmk-core/utils/crypto" + "github.com/openkcm/cmk/internal/manager" + "github.com/openkcm/cmk/utils/crypto" ) func CreateCertificateChain( diff --git a/internal/testutils/certificate_test.go b/internal/testutils/certificate_test.go index fe270fb9..801c41ec 100644 --- a/internal/testutils/certificate_test.go +++ b/internal/testutils/certificate_test.go @@ -5,9 +5,9 @@ import ( "github.com/stretchr/testify/assert" - "github.com/openkcm/cmk-core/internal/manager" - "github.com/openkcm/cmk-core/internal/model" - "github.com/openkcm/cmk-core/internal/testutils" + "github.com/openkcm/cmk/internal/manager" + "github.com/openkcm/cmk/internal/model" + "github.com/openkcm/cmk/internal/testutils" ) func TestCreateTestCertificate(t *testing.T) { diff --git a/internal/testutils/db.go b/internal/testutils/db.go index eba0317e..ec55c8a9 100644 --- a/internal/testutils/db.go +++ b/internal/testutils/db.go @@ -17,10 +17,10 @@ import ( multitenancy "github.com/bartventer/gorm-multitenancy/v8" - "github.com/openkcm/cmk-core/internal/config" - "github.com/openkcm/cmk-core/internal/db" - "github.com/openkcm/cmk-core/internal/model" - "github.com/openkcm/cmk-core/internal/repo" + "github.com/openkcm/cmk/internal/config" + "github.com/openkcm/cmk/internal/db" + "github.com/openkcm/cmk/internal/model" + "github.com/openkcm/cmk/internal/repo" ) const ( diff --git a/internal/testutils/db_error.go b/internal/testutils/db_error.go index 8bb5c55b..b1764331 100644 --- a/internal/testutils/db_error.go +++ b/internal/testutils/db_error.go @@ -10,8 +10,8 @@ import ( multitenancy "github.com/bartventer/gorm-multitenancy/v8" - "github.com/openkcm/cmk-core/internal/errs" - "github.com/openkcm/cmk-core/internal/model" + "github.com/openkcm/cmk/internal/errs" + "github.com/openkcm/cmk/internal/model" ) // callbackError - the error callback name. diff --git a/internal/testutils/db_error_test.go b/internal/testutils/db_error_test.go index d28f19e2..91a5890a 100644 --- a/internal/testutils/db_error_test.go +++ b/internal/testutils/db_error_test.go @@ -6,7 +6,7 @@ import ( "github.com/stretchr/testify/assert" - "github.com/openkcm/cmk-core/internal/testutils" + "github.com/openkcm/cmk/internal/testutils" ) var ErrForced = errors.New("forced error") diff --git a/internal/testutils/db_test.go b/internal/testutils/db_test.go index 489a3ac7..b462ef93 100644 --- a/internal/testutils/db_test.go +++ b/internal/testutils/db_test.go @@ -6,8 +6,8 @@ import ( "github.com/bartventer/gorm-multitenancy/v8/pkg/driver" "github.com/stretchr/testify/assert" - "github.com/openkcm/cmk-core/internal/model" - "github.com/openkcm/cmk-core/internal/testutils" + "github.com/openkcm/cmk/internal/model" + "github.com/openkcm/cmk/internal/testutils" ) // TestRelatedModel represents a model for testing preload functionality diff --git a/internal/testutils/grpc.go b/internal/testutils/grpc.go index 2d1aa214..b6e2621f 100644 --- a/internal/testutils/grpc.go +++ b/internal/testutils/grpc.go @@ -13,7 +13,7 @@ import ( "github.com/stretchr/testify/assert" "google.golang.org/grpc" - "github.com/openkcm/cmk-core/internal/clients" + "github.com/openkcm/cmk/internal/clients" ) const ( diff --git a/internal/testutils/model.go b/internal/testutils/model.go index abc2a3a6..fe8ceb31 100644 --- a/internal/testutils/model.go +++ b/internal/testutils/model.go @@ -9,12 +9,12 @@ import ( multitenancy "github.com/bartventer/gorm-multitenancy/v8" - "github.com/openkcm/cmk-core/internal/config" - "github.com/openkcm/cmk-core/internal/constants" - "github.com/openkcm/cmk-core/internal/manager" - "github.com/openkcm/cmk-core/internal/model" - wfMechanism "github.com/openkcm/cmk-core/internal/workflow" - "github.com/openkcm/cmk-core/utils/ptr" + "github.com/openkcm/cmk/internal/config" + "github.com/openkcm/cmk/internal/constants" + "github.com/openkcm/cmk/internal/manager" + "github.com/openkcm/cmk/internal/model" + wfMechanism "github.com/openkcm/cmk/internal/workflow" + "github.com/openkcm/cmk/utils/ptr" ) const ( diff --git a/internal/testutils/mutator_test.go b/internal/testutils/mutator_test.go index ed49c05e..fc350c21 100644 --- a/internal/testutils/mutator_test.go +++ b/internal/testutils/mutator_test.go @@ -5,7 +5,7 @@ import ( "github.com/stretchr/testify/assert" - "github.com/openkcm/cmk-core/internal/testutils" + "github.com/openkcm/cmk/internal/testutils" ) type TestStruct struct { diff --git a/internal/testutils/system.go b/internal/testutils/system.go index 8d0b8933..d79c7daf 100644 --- a/internal/testutils/system.go +++ b/internal/testutils/system.go @@ -3,7 +3,7 @@ package testutils import ( "github.com/google/uuid" - "github.com/openkcm/cmk-core/internal/model" + "github.com/openkcm/cmk/internal/model" ) // SystemMutator provides a base System for testing diff --git a/internal/testutils/system_test.go b/internal/testutils/system_test.go index 7ee127bb..0620db73 100644 --- a/internal/testutils/system_test.go +++ b/internal/testutils/system_test.go @@ -5,8 +5,8 @@ import ( "github.com/stretchr/testify/assert" - "github.com/openkcm/cmk-core/internal/model" - "github.com/openkcm/cmk-core/internal/testutils" + "github.com/openkcm/cmk/internal/model" + "github.com/openkcm/cmk/internal/testutils" ) func TestCreateTestSystem(t *testing.T) { diff --git a/internal/testutils/testplugins/certificateissuer/main_test.go b/internal/testutils/testplugins/certificateissuer/main_test.go index c1bce825..decec98e 100644 --- a/internal/testutils/testplugins/certificateissuer/main_test.go +++ b/internal/testutils/testplugins/certificateissuer/main_test.go @@ -9,7 +9,7 @@ import ( certificate_issuerv1 "github.com/openkcm/plugin-sdk/proto/plugin/certificate_issuer/v1" configv1 "github.com/openkcm/plugin-sdk/proto/service/common/config/v1" - tp "github.com/openkcm/cmk-core/internal/testutils/testplugins/certificateissuer" + tp "github.com/openkcm/cmk/internal/testutils/testplugins/certificateissuer" ) func TestConfigureReturnsEmptyResponse(t *testing.T) { diff --git a/internal/testutils/testplugins/identitymanagement/main_test.go b/internal/testutils/testplugins/identitymanagement/main_test.go index 10cd1680..249abfb5 100644 --- a/internal/testutils/testplugins/identitymanagement/main_test.go +++ b/internal/testutils/testplugins/identitymanagement/main_test.go @@ -9,7 +9,7 @@ import ( idmangv1 "github.com/openkcm/plugin-sdk/proto/plugin/identity_management/v1" configv1 "github.com/openkcm/plugin-sdk/proto/service/common/config/v1" - tp "github.com/openkcm/cmk-core/internal/testutils/testplugins/identitymanagement" + tp "github.com/openkcm/cmk/internal/testutils/testplugins/identitymanagement" ) func TestConfigureReturnsEmptyResponse(t *testing.T) { diff --git a/internal/testutils/testplugins/keystoreop/main.go b/internal/testutils/testplugins/keystoreop/main.go index 8535e524..591ca69e 100644 --- a/internal/testutils/testplugins/keystoreop/main.go +++ b/internal/testutils/testplugins/keystoreop/main.go @@ -16,7 +16,7 @@ import ( keyopv1 "github.com/openkcm/plugin-sdk/proto/plugin/keystore/operations/v1" configv1 "github.com/openkcm/plugin-sdk/proto/service/common/config/v1" - "github.com/openkcm/cmk-core/internal/testutils" + "github.com/openkcm/cmk/internal/testutils" ) const importParamsValidityHours = 24 diff --git a/internal/testutils/testplugins/keystoreop/main_test.go b/internal/testutils/testplugins/keystoreop/main_test.go index 34ef5737..e41a05ee 100644 --- a/internal/testutils/testplugins/keystoreop/main_test.go +++ b/internal/testutils/testplugins/keystoreop/main_test.go @@ -11,8 +11,8 @@ import ( keyopv1 "github.com/openkcm/plugin-sdk/proto/plugin/keystore/operations/v1" - tp "github.com/openkcm/cmk-core/internal/testutils/testplugins/keystoreop" - "github.com/openkcm/cmk-core/utils/ptr" + tp "github.com/openkcm/cmk/internal/testutils/testplugins/keystoreop" + "github.com/openkcm/cmk/utils/ptr" ) func setupTest() *tp.TestPlugin { diff --git a/internal/testutils/testplugins/notification/main_test.go b/internal/testutils/testplugins/notification/main_test.go index 4a186a55..17e38665 100644 --- a/internal/testutils/testplugins/notification/main_test.go +++ b/internal/testutils/testplugins/notification/main_test.go @@ -9,7 +9,7 @@ import ( notificationv1 "github.com/openkcm/plugin-sdk/proto/plugin/notification/v1" configv1 "github.com/openkcm/plugin-sdk/proto/service/common/config/v1" - tp "github.com/openkcm/cmk-core/internal/testutils/testplugins/notification" + tp "github.com/openkcm/cmk/internal/testutils/testplugins/notification" ) func TestConfigureReturnsEmptyResponse(t *testing.T) { diff --git a/internal/testutils/testplugins/systeminformation/main_test.go b/internal/testutils/testplugins/systeminformation/main_test.go index c1df6ef0..f808ceeb 100644 --- a/internal/testutils/testplugins/systeminformation/main_test.go +++ b/internal/testutils/testplugins/systeminformation/main_test.go @@ -9,7 +9,7 @@ import ( systeminformationv1 "github.com/openkcm/plugin-sdk/proto/plugin/systeminformation/v1" configv1 "github.com/openkcm/plugin-sdk/proto/service/common/config/v1" - tp "github.com/openkcm/cmk-core/internal/testutils/testplugins/systeminformation" + tp "github.com/openkcm/cmk/internal/testutils/testplugins/systeminformation" ) func TestConfigureReturnsEmptyResponse(t *testing.T) { diff --git a/internal/workflow/errors.go b/internal/workflow/errors.go index 5663a86e..fc43a51f 100644 --- a/internal/workflow/errors.go +++ b/internal/workflow/errors.go @@ -6,7 +6,7 @@ import ( "github.com/google/uuid" - "github.com/openkcm/cmk-core/internal/errs" + "github.com/openkcm/cmk/internal/errs" ) var ( diff --git a/internal/workflow/key_actions.go b/internal/workflow/key_actions.go index 1af0e2c8..66a08071 100644 --- a/internal/workflow/key_actions.go +++ b/internal/workflow/key_actions.go @@ -5,10 +5,10 @@ import ( "github.com/google/uuid" - "github.com/openkcm/cmk-core/internal/api/cmkapi" - "github.com/openkcm/cmk-core/internal/errs" - "github.com/openkcm/cmk-core/internal/model" - "github.com/openkcm/cmk-core/utils/ptr" + "github.com/openkcm/cmk/internal/api/cmkapi" + "github.com/openkcm/cmk/internal/errs" + "github.com/openkcm/cmk/internal/model" + "github.com/openkcm/cmk/utils/ptr" ) type KeyActions interface { diff --git a/internal/workflow/key_actions_test.go b/internal/workflow/key_actions_test.go index 24a0eb69..86ce3f66 100644 --- a/internal/workflow/key_actions_test.go +++ b/internal/workflow/key_actions_test.go @@ -6,12 +6,12 @@ import ( "github.com/google/uuid" "github.com/stretchr/testify/assert" - "github.com/openkcm/cmk-core/internal/constants" - "github.com/openkcm/cmk-core/internal/model" - "github.com/openkcm/cmk-core/internal/repo" - sqlRepo "github.com/openkcm/cmk-core/internal/repo/sql" - "github.com/openkcm/cmk-core/internal/testutils" - "github.com/openkcm/cmk-core/internal/workflow" + "github.com/openkcm/cmk/internal/constants" + "github.com/openkcm/cmk/internal/model" + "github.com/openkcm/cmk/internal/repo" + sqlRepo "github.com/openkcm/cmk/internal/repo/sql" + "github.com/openkcm/cmk/internal/testutils" + "github.com/openkcm/cmk/internal/workflow" ) func TestKeyActionPrimary(t *testing.T) { diff --git a/internal/workflow/key_configuration_actions.go b/internal/workflow/key_configuration_actions.go index 6bc08755..3b850b00 100644 --- a/internal/workflow/key_configuration_actions.go +++ b/internal/workflow/key_configuration_actions.go @@ -5,7 +5,7 @@ import ( "github.com/google/uuid" - "github.com/openkcm/cmk-core/internal/errs" + "github.com/openkcm/cmk/internal/errs" ) type KeyConfigurationActions interface { diff --git a/internal/workflow/key_configuration_actions_test.go b/internal/workflow/key_configuration_actions_test.go index 49bd2e59..b443052b 100644 --- a/internal/workflow/key_configuration_actions_test.go +++ b/internal/workflow/key_configuration_actions_test.go @@ -6,11 +6,11 @@ import ( "github.com/google/uuid" "github.com/stretchr/testify/assert" - "github.com/openkcm/cmk-core/internal/model" - "github.com/openkcm/cmk-core/internal/repo" - sqlRepo "github.com/openkcm/cmk-core/internal/repo/sql" - "github.com/openkcm/cmk-core/internal/testutils" - "github.com/openkcm/cmk-core/internal/workflow" + "github.com/openkcm/cmk/internal/model" + "github.com/openkcm/cmk/internal/repo" + sqlRepo "github.com/openkcm/cmk/internal/repo/sql" + "github.com/openkcm/cmk/internal/testutils" + "github.com/openkcm/cmk/internal/workflow" ) var ( diff --git a/internal/workflow/system_actions.go b/internal/workflow/system_actions.go index 5e81d8be..1fc87bbc 100644 --- a/internal/workflow/system_actions.go +++ b/internal/workflow/system_actions.go @@ -5,8 +5,8 @@ import ( "github.com/google/uuid" - "github.com/openkcm/cmk-core/internal/errs" - "github.com/openkcm/cmk-core/internal/model" + "github.com/openkcm/cmk/internal/errs" + "github.com/openkcm/cmk/internal/model" ) type SystemActions interface { diff --git a/internal/workflow/system_actions_test.go b/internal/workflow/system_actions_test.go index f76652ed..9d6936a6 100644 --- a/internal/workflow/system_actions_test.go +++ b/internal/workflow/system_actions_test.go @@ -6,11 +6,11 @@ import ( "github.com/google/uuid" "github.com/stretchr/testify/assert" - "github.com/openkcm/cmk-core/internal/model" - "github.com/openkcm/cmk-core/internal/repo" - sqlRepo "github.com/openkcm/cmk-core/internal/repo/sql" - "github.com/openkcm/cmk-core/internal/testutils" - "github.com/openkcm/cmk-core/internal/workflow" + "github.com/openkcm/cmk/internal/model" + "github.com/openkcm/cmk/internal/repo" + sqlRepo "github.com/openkcm/cmk/internal/repo/sql" + "github.com/openkcm/cmk/internal/testutils" + "github.com/openkcm/cmk/internal/workflow" ) var ( diff --git a/internal/workflow/workflow.go b/internal/workflow/workflow.go index 5f99c03a..cfdab042 100644 --- a/internal/workflow/workflow.go +++ b/internal/workflow/workflow.go @@ -7,11 +7,11 @@ import ( "github.com/google/uuid" "github.com/looplab/fsm" - "github.com/openkcm/cmk-core/internal/constants" - "github.com/openkcm/cmk-core/internal/errs" - "github.com/openkcm/cmk-core/internal/log" - "github.com/openkcm/cmk-core/internal/model" - "github.com/openkcm/cmk-core/internal/repo" + "github.com/openkcm/cmk/internal/constants" + "github.com/openkcm/cmk/internal/errs" + "github.com/openkcm/cmk/internal/log" + "github.com/openkcm/cmk/internal/model" + "github.com/openkcm/cmk/internal/repo" ) var SystemUserID = uuid.MustParse("ffffffff-ffff-ffff-ffff-ffffffffffff") diff --git a/internal/workflow/workflow_test.go b/internal/workflow/workflow_test.go index 20d7c7c8..d77bbb93 100644 --- a/internal/workflow/workflow_test.go +++ b/internal/workflow/workflow_test.go @@ -13,17 +13,17 @@ import ( multitenancy "github.com/bartventer/gorm-multitenancy/v8" systemgrpc "github.com/openkcm/api-sdk/proto/kms/api/cmk/registry/system/v1" - "github.com/openkcm/cmk-core/internal/clients" - "github.com/openkcm/cmk-core/internal/clients/registry/systems" - "github.com/openkcm/cmk-core/internal/config" - eventprocessor "github.com/openkcm/cmk-core/internal/event-processor" - "github.com/openkcm/cmk-core/internal/grpc/catalog" - "github.com/openkcm/cmk-core/internal/manager" - "github.com/openkcm/cmk-core/internal/model" - "github.com/openkcm/cmk-core/internal/repo" - sqlRepo "github.com/openkcm/cmk-core/internal/repo/sql" - "github.com/openkcm/cmk-core/internal/testutils" - "github.com/openkcm/cmk-core/internal/workflow" + "github.com/openkcm/cmk/internal/clients" + "github.com/openkcm/cmk/internal/clients/registry/systems" + "github.com/openkcm/cmk/internal/config" + eventprocessor "github.com/openkcm/cmk/internal/event-processor" + "github.com/openkcm/cmk/internal/grpc/catalog" + "github.com/openkcm/cmk/internal/manager" + "github.com/openkcm/cmk/internal/model" + "github.com/openkcm/cmk/internal/repo" + sqlRepo "github.com/openkcm/cmk/internal/repo/sql" + "github.com/openkcm/cmk/internal/testutils" + "github.com/openkcm/cmk/internal/workflow" ) var ( diff --git a/providers/clients/aws/aws_options_test.go b/providers/clients/aws/aws_options_test.go index 66bca908..c853fafa 100644 --- a/providers/clients/aws/aws_options_test.go +++ b/providers/clients/aws/aws_options_test.go @@ -7,8 +7,8 @@ import ( "github.com/aws/aws-sdk-go-v2/service/kms" "github.com/stretchr/testify/assert" - "github.com/openkcm/cmk-core/providers/clients/aws" - "github.com/openkcm/cmk-core/providers/clients/aws/mock" + "github.com/openkcm/cmk/providers/clients/aws" + "github.com/openkcm/cmk/providers/clients/aws/mock" ) func TestOptions(t *testing.T) { diff --git a/providers/clients/aws/client.go b/providers/clients/aws/client.go index 6488cd78..9ea60416 100644 --- a/providers/clients/aws/client.go +++ b/providers/clients/aws/client.go @@ -11,10 +11,10 @@ import ( "github.com/aws/aws-sdk-go-v2/service/kms" "github.com/aws/aws-sdk-go-v2/service/kms/types" - "github.com/openkcm/cmk-core/internal/errs" - "github.com/openkcm/cmk-core/providers" - "github.com/openkcm/cmk-core/utils/must" - "github.com/openkcm/cmk-core/utils/ptr" + "github.com/openkcm/cmk/internal/errs" + "github.com/openkcm/cmk/providers" + "github.com/openkcm/cmk/utils/must" + "github.com/openkcm/cmk/utils/ptr" ) // kmsClient defines the methods of the AWS KMS client that we use. diff --git a/providers/clients/aws/client_test.go b/providers/clients/aws/client_test.go index f9fbbf82..773f7428 100644 --- a/providers/clients/aws/client_test.go +++ b/providers/clients/aws/client_test.go @@ -13,10 +13,10 @@ import ( "github.com/google/uuid" "github.com/stretchr/testify/assert" - "github.com/openkcm/cmk-core/providers" - "github.com/openkcm/cmk-core/providers/clients/aws" - "github.com/openkcm/cmk-core/providers/clients/aws/mock" - "github.com/openkcm/cmk-core/utils/ptr" + "github.com/openkcm/cmk/providers" + "github.com/openkcm/cmk/providers/clients/aws" + "github.com/openkcm/cmk/providers/clients/aws/mock" + "github.com/openkcm/cmk/utils/ptr" ) var ( diff --git a/providers/clients/dummy/transform/key/key.go b/providers/clients/dummy/transform/key/key.go index 2e53b913..5c957563 100644 --- a/providers/clients/dummy/transform/key/key.go +++ b/providers/clients/dummy/transform/key/key.go @@ -1,9 +1,9 @@ package key import ( - "github.com/openkcm/cmk-core/internal/model" - "github.com/openkcm/cmk-core/providers" - "github.com/openkcm/cmk-core/utils/ptr" + "github.com/openkcm/cmk/internal/model" + "github.com/openkcm/cmk/providers" + "github.com/openkcm/cmk/utils/ptr" ) // ToProvider converts a model.Key and array of providers.KeyVersion to a providers.Key. diff --git a/providers/clients/dummy/transform/keyversion/keyversion.go b/providers/clients/dummy/transform/keyversion/keyversion.go index 563abc29..fe57f8f8 100644 --- a/providers/clients/dummy/transform/keyversion/keyversion.go +++ b/providers/clients/dummy/transform/keyversion/keyversion.go @@ -3,9 +3,9 @@ package keyversion import ( "time" - "github.com/openkcm/cmk-core/internal/model" - "github.com/openkcm/cmk-core/providers" - "github.com/openkcm/cmk-core/utils/ptr" + "github.com/openkcm/cmk/internal/model" + "github.com/openkcm/cmk/providers" + "github.com/openkcm/cmk/utils/ptr" ) // FromProvider converts a providers.KeyVersion and model.Key to a model.KeyVersion. diff --git a/providers/mock/client_mock.go b/providers/mock/client_mock.go index 00fd21c9..0ca1d993 100644 --- a/providers/mock/client_mock.go +++ b/providers/mock/client_mock.go @@ -3,7 +3,7 @@ package mock import ( "context" - "github.com/openkcm/cmk-core/providers" + "github.com/openkcm/cmk/providers" ) // Type definitions for the functions used in Client diff --git a/providers/provider.go b/providers/provider.go index faab433f..8f2b548e 100644 --- a/providers/provider.go +++ b/providers/provider.go @@ -7,10 +7,10 @@ import ( "log/slog" "time" - "github.com/openkcm/cmk-core/internal/errs" - "github.com/openkcm/cmk-core/internal/log" - "github.com/openkcm/cmk-core/utils/ptr" - "github.com/openkcm/cmk-core/utils/slice" + "github.com/openkcm/cmk/internal/errs" + "github.com/openkcm/cmk/internal/log" + "github.com/openkcm/cmk/utils/ptr" + "github.com/openkcm/cmk/utils/slice" ) // Errs defines the errors that can be returned by the provider diff --git a/providers/provider_test.go b/providers/provider_test.go index e51ab583..eface6c0 100644 --- a/providers/provider_test.go +++ b/providers/provider_test.go @@ -9,10 +9,10 @@ import ( "github.com/google/uuid" "github.com/stretchr/testify/assert" - "github.com/openkcm/cmk-core/providers" - "github.com/openkcm/cmk-core/providers/mock" - "github.com/openkcm/cmk-core/utils/ptr" - "github.com/openkcm/cmk-core/utils/slice" + "github.com/openkcm/cmk/providers" + "github.com/openkcm/cmk/providers/mock" + "github.com/openkcm/cmk/utils/ptr" + "github.com/openkcm/cmk/utils/slice" ) var ( diff --git a/test/async_test/certrotation_test.go b/test/async_test/certrotation_test.go index 1d7d7eff..a00e6d91 100644 --- a/test/async_test/certrotation_test.go +++ b/test/async_test/certrotation_test.go @@ -8,13 +8,13 @@ import ( "github.com/bartventer/gorm-multitenancy/v8/pkg/driver" "github.com/stretchr/testify/assert" - "github.com/openkcm/cmk-core/internal/async" - "github.com/openkcm/cmk-core/internal/config" - "github.com/openkcm/cmk-core/internal/model" - "github.com/openkcm/cmk-core/internal/repo" - "github.com/openkcm/cmk-core/internal/repo/sql" - "github.com/openkcm/cmk-core/internal/testutils" - integrationutils "github.com/openkcm/cmk-core/test/integration_utils" + "github.com/openkcm/cmk/internal/async" + "github.com/openkcm/cmk/internal/config" + "github.com/openkcm/cmk/internal/model" + "github.com/openkcm/cmk/internal/repo" + "github.com/openkcm/cmk/internal/repo/sql" + "github.com/openkcm/cmk/internal/testutils" + integrationutils "github.com/openkcm/cmk/test/integration_utils" ) func TestCertRotation(t *testing.T) { diff --git a/test/async_test/common_test.go b/test/async_test/common_test.go index ef95e16e..7e1e80f3 100644 --- a/test/async_test/common_test.go +++ b/test/async_test/common_test.go @@ -16,18 +16,18 @@ import ( multitenancy "github.com/bartventer/gorm-multitenancy/v8" plugincatalog "github.com/openkcm/plugin-sdk/pkg/catalog" - "github.com/openkcm/cmk-core/internal/async" - "github.com/openkcm/cmk-core/internal/config" - "github.com/openkcm/cmk-core/internal/constants" - eventprocessor "github.com/openkcm/cmk-core/internal/event-processor" - "github.com/openkcm/cmk-core/internal/grpc/catalog" - "github.com/openkcm/cmk-core/internal/manager" - "github.com/openkcm/cmk-core/internal/model" - "github.com/openkcm/cmk-core/internal/repo" - "github.com/openkcm/cmk-core/internal/repo/sql" - "github.com/openkcm/cmk-core/internal/testutils" - integrationutils "github.com/openkcm/cmk-core/test/integration_utils" - "github.com/openkcm/cmk-core/utils/crypto" + "github.com/openkcm/cmk/internal/async" + "github.com/openkcm/cmk/internal/config" + "github.com/openkcm/cmk/internal/constants" + eventprocessor "github.com/openkcm/cmk/internal/event-processor" + "github.com/openkcm/cmk/internal/grpc/catalog" + "github.com/openkcm/cmk/internal/manager" + "github.com/openkcm/cmk/internal/model" + "github.com/openkcm/cmk/internal/repo" + "github.com/openkcm/cmk/internal/repo/sql" + "github.com/openkcm/cmk/internal/testutils" + integrationutils "github.com/openkcm/cmk/test/integration_utils" + "github.com/openkcm/cmk/utils/crypto" ) // There is no PKI mock, so credentials for this must be added below diff --git a/test/async_test/hyoksync_test.go b/test/async_test/hyoksync_test.go index be84db6a..7051c220 100644 --- a/test/async_test/hyoksync_test.go +++ b/test/async_test/hyoksync_test.go @@ -8,14 +8,14 @@ import ( "github.com/bartventer/gorm-multitenancy/v8/pkg/driver" "github.com/stretchr/testify/assert" - "github.com/openkcm/cmk-core/internal/async" - "github.com/openkcm/cmk-core/internal/config" - "github.com/openkcm/cmk-core/internal/log" - "github.com/openkcm/cmk-core/internal/model" - "github.com/openkcm/cmk-core/internal/repo" - "github.com/openkcm/cmk-core/internal/repo/sql" - "github.com/openkcm/cmk-core/internal/testutils" - integrationutils "github.com/openkcm/cmk-core/test/integration_utils" + "github.com/openkcm/cmk/internal/async" + "github.com/openkcm/cmk/internal/config" + "github.com/openkcm/cmk/internal/log" + "github.com/openkcm/cmk/internal/model" + "github.com/openkcm/cmk/internal/repo" + "github.com/openkcm/cmk/internal/repo/sql" + "github.com/openkcm/cmk/internal/testutils" + integrationutils "github.com/openkcm/cmk/test/integration_utils" ) func TestSchedulerHYOKSync(t *testing.T) { diff --git a/test/async_test/keystorepool_test.go b/test/async_test/keystorepool_test.go index 25cde9cf..eb133bb9 100644 --- a/test/async_test/keystorepool_test.go +++ b/test/async_test/keystorepool_test.go @@ -8,13 +8,13 @@ import ( "github.com/bartventer/gorm-multitenancy/v8/pkg/driver" "github.com/stretchr/testify/assert" - "github.com/openkcm/cmk-core/internal/async" - "github.com/openkcm/cmk-core/internal/config" - "github.com/openkcm/cmk-core/internal/model" - "github.com/openkcm/cmk-core/internal/repo" - "github.com/openkcm/cmk-core/internal/repo/sql" - "github.com/openkcm/cmk-core/internal/testutils" - integrationutils "github.com/openkcm/cmk-core/test/integration_utils" + "github.com/openkcm/cmk/internal/async" + "github.com/openkcm/cmk/internal/config" + "github.com/openkcm/cmk/internal/model" + "github.com/openkcm/cmk/internal/repo" + "github.com/openkcm/cmk/internal/repo/sql" + "github.com/openkcm/cmk/internal/testutils" + integrationutils "github.com/openkcm/cmk/test/integration_utils" ) func TestKeystorePoolFilling(t *testing.T) { diff --git a/test/async_test/systeminformation_test.go b/test/async_test/systeminformation_test.go index b28c59c6..3c13794b 100644 --- a/test/async_test/systeminformation_test.go +++ b/test/async_test/systeminformation_test.go @@ -8,13 +8,13 @@ import ( "github.com/bartventer/gorm-multitenancy/v8/pkg/driver" "github.com/stretchr/testify/assert" - "github.com/openkcm/cmk-core/internal/async" - "github.com/openkcm/cmk-core/internal/config" - "github.com/openkcm/cmk-core/internal/model" - "github.com/openkcm/cmk-core/internal/repo" - "github.com/openkcm/cmk-core/internal/repo/sql" - "github.com/openkcm/cmk-core/internal/testutils" - integrationutils "github.com/openkcm/cmk-core/test/integration_utils" + "github.com/openkcm/cmk/internal/async" + "github.com/openkcm/cmk/internal/config" + "github.com/openkcm/cmk/internal/model" + "github.com/openkcm/cmk/internal/repo" + "github.com/openkcm/cmk/internal/repo/sql" + "github.com/openkcm/cmk/internal/testutils" + integrationutils "github.com/openkcm/cmk/test/integration_utils" ) var ( diff --git a/test/aws_tests/kms_provider_aws_test.go b/test/aws_tests/kms_provider_aws_test.go index cbe39b94..0710d51b 100644 --- a/test/aws_tests/kms_provider_aws_test.go +++ b/test/aws_tests/kms_provider_aws_test.go @@ -14,9 +14,9 @@ import ( "github.com/google/uuid" "github.com/stretchr/testify/assert" - "github.com/openkcm/cmk-core/providers" - "github.com/openkcm/cmk-core/providers/clients/aws" - "github.com/openkcm/cmk-core/utils/ptr" + "github.com/openkcm/cmk/providers" + "github.com/openkcm/cmk/providers/clients/aws" + "github.com/openkcm/cmk/utils/ptr" ) const ( diff --git a/test/event-processor/reconciliation_test.go b/test/event-processor/reconciliation_test.go index 9251a1a3..c2fc3237 100644 --- a/test/event-processor/reconciliation_test.go +++ b/test/event-processor/reconciliation_test.go @@ -21,19 +21,19 @@ import ( multitenancy "github.com/bartventer/gorm-multitenancy/v8" - "github.com/openkcm/cmk-core/internal/api/cmkapi" - "github.com/openkcm/cmk-core/internal/config" - eventprocessor "github.com/openkcm/cmk-core/internal/event-processor" - eventProto "github.com/openkcm/cmk-core/internal/event-processor/proto" - "github.com/openkcm/cmk-core/internal/grpc/catalog" - "github.com/openkcm/cmk-core/internal/manager" - "github.com/openkcm/cmk-core/internal/model" - "github.com/openkcm/cmk-core/internal/repo" - sqlPkg "github.com/openkcm/cmk-core/internal/repo/sql" - "github.com/openkcm/cmk-core/internal/testutils" - integrationutils "github.com/openkcm/cmk-core/test/integration_utils" - cmkcontext "github.com/openkcm/cmk-core/utils/context" - "github.com/openkcm/cmk-core/utils/ptr" + "github.com/openkcm/cmk/internal/api/cmkapi" + "github.com/openkcm/cmk/internal/config" + eventprocessor "github.com/openkcm/cmk/internal/event-processor" + eventProto "github.com/openkcm/cmk/internal/event-processor/proto" + "github.com/openkcm/cmk/internal/grpc/catalog" + "github.com/openkcm/cmk/internal/manager" + "github.com/openkcm/cmk/internal/model" + "github.com/openkcm/cmk/internal/repo" + sqlPkg "github.com/openkcm/cmk/internal/repo/sql" + "github.com/openkcm/cmk/internal/testutils" + integrationutils "github.com/openkcm/cmk/test/integration_utils" + cmkcontext "github.com/openkcm/cmk/utils/context" + "github.com/openkcm/cmk/utils/ptr" ) type TestSuite struct { diff --git a/test/identity_management/identity_management_test.go b/test/identity_management/identity_management_test.go index 140ab68e..7c0db4e6 100644 --- a/test/identity_management/identity_management_test.go +++ b/test/identity_management/identity_management_test.go @@ -11,8 +11,8 @@ import ( plugincatalog "github.com/openkcm/plugin-sdk/pkg/catalog" idmangv1 "github.com/openkcm/plugin-sdk/proto/plugin/identity_management/v1" - "github.com/openkcm/cmk-core/internal/config" - "github.com/openkcm/cmk-core/internal/grpc/catalog" + "github.com/openkcm/cmk/internal/config" + "github.com/openkcm/cmk/internal/grpc/catalog" ) var ( diff --git a/test/integration_utils/db.go b/test/integration_utils/db.go index db2404fc..0312a88e 100644 --- a/test/integration_utils/db.go +++ b/test/integration_utils/db.go @@ -3,7 +3,7 @@ package integrationutils import ( "github.com/openkcm/common-sdk/pkg/commoncfg" - "github.com/openkcm/cmk-core/internal/config" + "github.com/openkcm/cmk/internal/config" ) var DB = config.Database{ diff --git a/test/integration_utils/plugin_test.go b/test/integration_utils/plugin_test.go index 09a667c3..3257a4bf 100644 --- a/test/integration_utils/plugin_test.go +++ b/test/integration_utils/plugin_test.go @@ -5,7 +5,7 @@ import ( "github.com/stretchr/testify/assert" - integrationutils "github.com/openkcm/cmk-core/test/integration_utils" + integrationutils "github.com/openkcm/cmk/test/integration_utils" ) func TestPlugins(t *testing.T) { diff --git a/test/integration_utils/tenant_assertions.go b/test/integration_utils/tenant_assertions.go index e5d3f0d2..761db1df 100644 --- a/test/integration_utils/tenant_assertions.go +++ b/test/integration_utils/tenant_assertions.go @@ -10,11 +10,11 @@ import ( multitenancy "github.com/bartventer/gorm-multitenancy/v8" - "github.com/openkcm/cmk-core/internal/constants" - "github.com/openkcm/cmk-core/internal/model" - "github.com/openkcm/cmk-core/internal/repo" - "github.com/openkcm/cmk-core/internal/repo/sql" - cmkcontext "github.com/openkcm/cmk-core/utils/context" + "github.com/openkcm/cmk/internal/constants" + "github.com/openkcm/cmk/internal/model" + "github.com/openkcm/cmk/internal/repo" + "github.com/openkcm/cmk/internal/repo/sql" + cmkcontext "github.com/openkcm/cmk/utils/context" ) type TableInfo struct { diff --git a/test/local_aws_tests/kms_provider_local_test.go b/test/local_aws_tests/kms_provider_local_test.go index a83c423b..94093fe8 100644 --- a/test/local_aws_tests/kms_provider_local_test.go +++ b/test/local_aws_tests/kms_provider_local_test.go @@ -9,9 +9,9 @@ import ( "github.com/google/uuid" "github.com/stretchr/testify/assert" - "github.com/openkcm/cmk-core/providers" - "github.com/openkcm/cmk-core/providers/clients/aws" - "github.com/openkcm/cmk-core/utils/ptr" + "github.com/openkcm/cmk/providers" + "github.com/openkcm/cmk/providers/clients/aws" + "github.com/openkcm/cmk/utils/ptr" ) // Local KMS variables diff --git a/test/notification/notification_test.go b/test/notification/notification_test.go index 6a506c0b..49954af0 100644 --- a/test/notification/notification_test.go +++ b/test/notification/notification_test.go @@ -9,10 +9,10 @@ import ( plugincatalog "github.com/openkcm/plugin-sdk/pkg/catalog" - "github.com/openkcm/cmk-core/internal/config" - "github.com/openkcm/cmk-core/internal/grpc/catalog" - "github.com/openkcm/cmk-core/internal/manager" - integrationutils "github.com/openkcm/cmk-core/test/integration_utils" + "github.com/openkcm/cmk/internal/config" + "github.com/openkcm/cmk/internal/grpc/catalog" + "github.com/openkcm/cmk/internal/manager" + integrationutils "github.com/openkcm/cmk/test/integration_utils" ) var ansPath string diff --git a/test/psqlreplicatests/psqlreplica_test.go b/test/psqlreplicatests/psqlreplica_test.go index 1ee1d4e3..55060c6d 100644 --- a/test/psqlreplicatests/psqlreplica_test.go +++ b/test/psqlreplicatests/psqlreplica_test.go @@ -7,13 +7,13 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/openkcm/cmk-core/internal/config" - "github.com/openkcm/cmk-core/internal/db" - "github.com/openkcm/cmk-core/internal/model" - "github.com/openkcm/cmk-core/internal/repo" - "github.com/openkcm/cmk-core/internal/repo/sql" - "github.com/openkcm/cmk-core/internal/testutils" - integrationutils "github.com/openkcm/cmk-core/test/integration_utils" + "github.com/openkcm/cmk/internal/config" + "github.com/openkcm/cmk/internal/db" + "github.com/openkcm/cmk/internal/model" + "github.com/openkcm/cmk/internal/repo" + "github.com/openkcm/cmk/internal/repo/sql" + "github.com/openkcm/cmk/internal/testutils" + integrationutils "github.com/openkcm/cmk/test/integration_utils" ) func TestConnectToPsqlWithReplica(t *testing.T) { diff --git a/test/registry_service/helpers_test.go b/test/registry_service/helpers_test.go index fa9a9516..b640058b 100644 --- a/test/registry_service/helpers_test.go +++ b/test/registry_service/helpers_test.go @@ -11,7 +11,7 @@ import ( tenantgrpc "github.com/openkcm/api-sdk/proto/kms/api/cmk/registry/tenant/v1" regionpb "github.com/openkcm/api-sdk/proto/kms/api/cmk/types/v1" - "github.com/openkcm/cmk-core/internal/errs" + "github.com/openkcm/cmk/internal/errs" ) var ErrUnknownClient = errors.New("client is unknown") diff --git a/test/registry_service/systems_test.go b/test/registry_service/systems_test.go index dbdbf426..a515fe61 100644 --- a/test/registry_service/systems_test.go +++ b/test/registry_service/systems_test.go @@ -13,8 +13,8 @@ import ( systemgrpc "github.com/openkcm/api-sdk/proto/kms/api/cmk/registry/system/v1" - "github.com/openkcm/cmk-core/internal/clients/registry/systems" - "github.com/openkcm/cmk-core/internal/testutils" + "github.com/openkcm/cmk/internal/clients/registry/systems" + "github.com/openkcm/cmk/internal/testutils" ) const ( diff --git a/test/systeminformation_tests/systeminformation_test.go b/test/systeminformation_tests/systeminformation_test.go index 7fb4ff59..909dec07 100644 --- a/test/systeminformation_tests/systeminformation_test.go +++ b/test/systeminformation_tests/systeminformation_test.go @@ -11,14 +11,14 @@ import ( plugincatalog "github.com/openkcm/plugin-sdk/pkg/catalog" - "github.com/openkcm/cmk-core/internal/config" - "github.com/openkcm/cmk-core/internal/grpc/catalog" - "github.com/openkcm/cmk-core/internal/manager" - "github.com/openkcm/cmk-core/internal/model" - "github.com/openkcm/cmk-core/internal/repo" - "github.com/openkcm/cmk-core/internal/repo/sql" - "github.com/openkcm/cmk-core/internal/testutils" - integrationutils "github.com/openkcm/cmk-core/test/integration_utils" + "github.com/openkcm/cmk/internal/config" + "github.com/openkcm/cmk/internal/grpc/catalog" + "github.com/openkcm/cmk/internal/manager" + "github.com/openkcm/cmk/internal/model" + "github.com/openkcm/cmk/internal/repo" + "github.com/openkcm/cmk/internal/repo/sql" + "github.com/openkcm/cmk/internal/testutils" + integrationutils "github.com/openkcm/cmk/test/integration_utils" ) const ( diff --git a/test/tenant-manager/tenant_provisioning_test.go b/test/tenant-manager/tenant_provisioning_test.go index 1231173b..1946f810 100644 --- a/test/tenant-manager/tenant_provisioning_test.go +++ b/test/tenant-manager/tenant_provisioning_test.go @@ -13,14 +13,14 @@ import ( multitenancy "github.com/bartventer/gorm-multitenancy/v8" tenantgrpc "github.com/openkcm/api-sdk/proto/kms/api/cmk/registry/tenant/v1" - "github.com/openkcm/cmk-core/internal/clients" - "github.com/openkcm/cmk-core/internal/config" - "github.com/openkcm/cmk-core/internal/constants" - "github.com/openkcm/cmk-core/internal/model" - "github.com/openkcm/cmk-core/internal/repo/sql" - "github.com/openkcm/cmk-core/internal/testutils" - integrationutils "github.com/openkcm/cmk-core/test/integration_utils" - "github.com/openkcm/cmk-core/utils/base62" + "github.com/openkcm/cmk/internal/clients" + "github.com/openkcm/cmk/internal/config" + "github.com/openkcm/cmk/internal/constants" + "github.com/openkcm/cmk/internal/model" + "github.com/openkcm/cmk/internal/repo/sql" + "github.com/openkcm/cmk/internal/testutils" + integrationutils "github.com/openkcm/cmk/test/integration_utils" + "github.com/openkcm/cmk/utils/base62" ) func TestRegistryTenantManagerIntegration(t *testing.T) { diff --git a/utils/base62/base62.go b/utils/base62/base62.go index ea0bbe09..717f91c7 100644 --- a/utils/base62/base62.go +++ b/utils/base62/base62.go @@ -6,7 +6,7 @@ import ( "github.com/jxskiss/base62" - "github.com/openkcm/cmk-core/internal/errs" + "github.com/openkcm/cmk/internal/errs" ) const ( diff --git a/utils/base62/base62_test.go b/utils/base62/base62_test.go index 392843a6..9c376297 100644 --- a/utils/base62/base62_test.go +++ b/utils/base62/base62_test.go @@ -8,7 +8,7 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/openkcm/cmk-core/utils/base62" + "github.com/openkcm/cmk/utils/base62" ) func TestSchemaName(t *testing.T) { diff --git a/utils/bool/bool_test.go b/utils/bool/bool_test.go index 86fbb4db..c7bcf382 100644 --- a/utils/bool/bool_test.go +++ b/utils/bool/bool_test.go @@ -5,7 +5,7 @@ import ( "github.com/stretchr/testify/require" - boolutil "github.com/openkcm/cmk-core/utils/bool" + boolutil "github.com/openkcm/cmk/utils/bool" ) func TestAnyTrue(t *testing.T) { diff --git a/utils/cert/cert.go b/utils/cert/cert.go index 07e67f9c..a0d23275 100644 --- a/utils/cert/cert.go +++ b/utils/cert/cert.go @@ -21,7 +21,7 @@ import ( "os" "time" - "github.com/openkcm/cmk-core/internal/errs" + "github.com/openkcm/cmk/internal/errs" ) // Error definitions for various failure scenarios in certificate and key generation. diff --git a/utils/cert/cert_test.go b/utils/cert/cert_test.go index 7a174832..33b16d35 100644 --- a/utils/cert/cert_test.go +++ b/utils/cert/cert_test.go @@ -10,8 +10,8 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/openkcm/cmk-core/utils/cert" - "github.com/openkcm/cmk-core/utils/cert/mock" + "github.com/openkcm/cmk/utils/cert" + "github.com/openkcm/cmk/utils/cert/mock" ) var ( diff --git a/utils/cert/mock/pemencoder.go b/utils/cert/mock/pemencoder.go index 2744ef00..cf52194e 100644 --- a/utils/cert/mock/pemencoder.go +++ b/utils/cert/mock/pemencoder.go @@ -4,7 +4,7 @@ import ( "encoding/pem" "io" - "github.com/openkcm/cmk-core/internal/errs" + "github.com/openkcm/cmk/internal/errs" ) // PEMEncoder is a mock implementation of the PEMEncoder interface. diff --git a/utils/context/context.go b/utils/context/context.go index 06f9c68d..54d85fd9 100644 --- a/utils/context/context.go +++ b/utils/context/context.go @@ -7,7 +7,7 @@ import ( "github.com/bartventer/gorm-multitenancy/middleware/nethttp/v8" "github.com/google/uuid" - "github.com/openkcm/cmk-core/internal/errs" + "github.com/openkcm/cmk/internal/errs" ) var ( diff --git a/utils/context/context_test.go b/utils/context/context_test.go index 70586e78..95de57c2 100644 --- a/utils/context/context_test.go +++ b/utils/context/context_test.go @@ -7,8 +7,8 @@ import ( "github.com/stretchr/testify/assert" - "github.com/openkcm/cmk-core/internal/testutils" - cmkcontext "github.com/openkcm/cmk-core/utils/context" + "github.com/openkcm/cmk/internal/testutils" + cmkcontext "github.com/openkcm/cmk/utils/context" ) func TestExtractTenantID(t *testing.T) { diff --git a/utils/crypto/crypto.go b/utils/crypto/crypto.go index 0abb36ee..77ecc93b 100644 --- a/utils/crypto/crypto.go +++ b/utils/crypto/crypto.go @@ -11,7 +11,7 @@ import ( "encoding/pem" "errors" - "github.com/openkcm/cmk-core/internal/errs" + "github.com/openkcm/cmk/internal/errs" ) const ( diff --git a/utils/crypto/crypto_test.go b/utils/crypto/crypto_test.go index c7e2e1da..f46ab716 100644 --- a/utils/crypto/crypto_test.go +++ b/utils/crypto/crypto_test.go @@ -17,7 +17,7 @@ import ( "github.com/stretchr/testify/assert" - cryptoUtils "github.com/openkcm/cmk-core/utils/crypto" + cryptoUtils "github.com/openkcm/cmk/utils/crypto" ) var ( diff --git a/utils/must/must_test.go b/utils/must/must_test.go index bcd9f1d9..c15ad28e 100644 --- a/utils/must/must_test.go +++ b/utils/must/must_test.go @@ -6,7 +6,7 @@ import ( "github.com/stretchr/testify/assert" - "github.com/openkcm/cmk-core/utils/must" + "github.com/openkcm/cmk/utils/must" ) var ( diff --git a/utils/oauth2/oauth2_test.go b/utils/oauth2/oauth2_test.go index bb59a897..90516237 100644 --- a/utils/oauth2/oauth2_test.go +++ b/utils/oauth2/oauth2_test.go @@ -6,9 +6,9 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/openkcm/cmk-core/utils/cert" - "github.com/openkcm/cmk-core/utils/oauth2" - "github.com/openkcm/cmk-core/utils/tlsconfig" + "github.com/openkcm/cmk/utils/cert" + "github.com/openkcm/cmk/utils/oauth2" + "github.com/openkcm/cmk/utils/tlsconfig" ) func TestNewClient(t *testing.T) { diff --git a/utils/oauth2/token_injector.go b/utils/oauth2/token_injector.go index 661141fe..657e9093 100644 --- a/utils/oauth2/token_injector.go +++ b/utils/oauth2/token_injector.go @@ -8,7 +8,7 @@ import ( "golang.org/x/oauth2" "golang.org/x/oauth2/clientcredentials" - "github.com/openkcm/cmk-core/internal/errs" + "github.com/openkcm/cmk/internal/errs" ) var ( diff --git a/utils/oauth2/token_injector_test.go b/utils/oauth2/token_injector_test.go index 82cc96c0..2079053a 100644 --- a/utils/oauth2/token_injector_test.go +++ b/utils/oauth2/token_injector_test.go @@ -13,7 +13,7 @@ import ( "golang.org/x/oauth2" "golang.org/x/oauth2/clientcredentials" - oauth2injector "github.com/openkcm/cmk-core/utils/oauth2" + oauth2injector "github.com/openkcm/cmk/utils/oauth2" ) var ErrForced = errors.New("forced error") diff --git a/utils/odata/odata_test.go b/utils/odata/odata_test.go index f5b9e059..5b58f2d8 100644 --- a/utils/odata/odata_test.go +++ b/utils/odata/odata_test.go @@ -5,7 +5,7 @@ import ( "github.com/stretchr/testify/assert" - "github.com/openkcm/cmk-core/utils/odata" + "github.com/openkcm/cmk/utils/odata" ) // TestQuery tests the Query struct diff --git a/utils/protobuf/protobuf_test.go b/utils/protobuf/protobuf_test.go index 9d01d0e7..698a4b46 100644 --- a/utils/protobuf/protobuf_test.go +++ b/utils/protobuf/protobuf_test.go @@ -6,7 +6,7 @@ import ( "github.com/stretchr/testify/assert" "google.golang.org/protobuf/types/known/structpb" - "github.com/openkcm/cmk-core/utils/protobuf" + "github.com/openkcm/cmk/utils/protobuf" ) func TestStructToProtobuf(t *testing.T) { diff --git a/utils/ptr/ptr_test.go b/utils/ptr/ptr_test.go index 3edfb05b..4ccc0136 100644 --- a/utils/ptr/ptr_test.go +++ b/utils/ptr/ptr_test.go @@ -8,7 +8,7 @@ import ( "github.com/google/uuid" "github.com/stretchr/testify/assert" - "github.com/openkcm/cmk-core/utils/ptr" + "github.com/openkcm/cmk/utils/ptr" ) func TestPanicIfDifferent(t *testing.T) { diff --git a/utils/slice/slice_test.go b/utils/slice/slice_test.go index 9f9d7540..7a82437a 100644 --- a/utils/slice/slice_test.go +++ b/utils/slice/slice_test.go @@ -5,7 +5,7 @@ import ( "github.com/stretchr/testify/assert" - "github.com/openkcm/cmk-core/utils/slice" + "github.com/openkcm/cmk/utils/slice" ) func TestContains(t *testing.T) { diff --git a/utils/structreader/structreader_test.go b/utils/structreader/structreader_test.go index 70bd98f7..cb64bd18 100644 --- a/utils/structreader/structreader_test.go +++ b/utils/structreader/structreader_test.go @@ -6,7 +6,7 @@ import ( "github.com/stretchr/testify/assert" "google.golang.org/protobuf/types/known/structpb" - "github.com/openkcm/cmk-core/utils/structreader" + "github.com/openkcm/cmk/utils/structreader" ) func TestNewConfigReader(t *testing.T) { diff --git a/utils/tlsconfig/tlsconfig_test.go b/utils/tlsconfig/tlsconfig_test.go index 6aaf68ad..c5d2a91e 100644 --- a/utils/tlsconfig/tlsconfig_test.go +++ b/utils/tlsconfig/tlsconfig_test.go @@ -8,8 +8,8 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/openkcm/cmk-core/utils/cert" - "github.com/openkcm/cmk-core/utils/tlsconfig" + "github.com/openkcm/cmk/utils/cert" + "github.com/openkcm/cmk/utils/tlsconfig" ) func TestCustomCertPool(t *testing.T) { diff --git a/utils/validator/validator.go b/utils/validator/validator.go index 0b3ae014..bcab8e43 100644 --- a/utils/validator/validator.go +++ b/utils/validator/validator.go @@ -5,7 +5,7 @@ import ( "github.com/google/uuid" - "github.com/openkcm/cmk-core/internal/errs" + "github.com/openkcm/cmk/internal/errs" ) var ( diff --git a/utils/validator/validator_test.go b/utils/validator/validator_test.go index 8efb00ee..5fe21c6c 100644 --- a/utils/validator/validator_test.go +++ b/utils/validator/validator_test.go @@ -3,7 +3,7 @@ package validator_test import ( "testing" - "github.com/openkcm/cmk-core/utils/validator" + "github.com/openkcm/cmk/utils/validator" ) func TestValidateUUID(t *testing.T) { From af6313bbc9ebf3fd56dff8732962aaa3385eac69 Mon Sep 17 00:00:00 2001 From: Nicolae Nicora Date: Fri, 24 Oct 2025 19:47:41 +0200 Subject: [PATCH 14/14] fix: renamed the core to cmk-core --- Taskfile.yaml | 2 +- charts/{core => cmk-core}/.helmignore | 0 charts/{core => cmk-core}/Chart.yaml | 0 charts/{core => cmk-core}/README.md | 0 charts/{core => cmk-core}/templates/NOTES.txt | 0 charts/{core => cmk-core}/templates/_helpers.tpl | 0 charts/{core => cmk-core}/templates/configmap.yaml | 0 charts/{core => cmk-core}/templates/deployment.yaml | 0 charts/{core => cmk-core}/templates/hpa.yaml | 0 charts/{core => cmk-core}/templates/pdb.yaml | 0 charts/{core => cmk-core}/templates/service.yaml | 0 charts/{core => cmk-core}/templates/serviceaccount.yaml | 0 charts/{core => cmk-core}/values.yaml | 0 cmd/{core => cmk-core}/apiserver/command.go | 0 cmd/{core => cmk-core}/apiserver/command_test.go | 0 cmd/{core => cmk-core}/apiserver/export_test.go | 0 cmd/{core => cmk-core}/main.go | 0 cmd/{core => cmk-core}/taskscheduler/command.go | 0 cmd/{core => cmk-core}/taskworker/command.go | 0 19 files changed, 1 insertion(+), 1 deletion(-) rename charts/{core => cmk-core}/.helmignore (100%) rename charts/{core => cmk-core}/Chart.yaml (100%) rename charts/{core => cmk-core}/README.md (100%) rename charts/{core => cmk-core}/templates/NOTES.txt (100%) rename charts/{core => cmk-core}/templates/_helpers.tpl (100%) rename charts/{core => cmk-core}/templates/configmap.yaml (100%) rename charts/{core => cmk-core}/templates/deployment.yaml (100%) rename charts/{core => cmk-core}/templates/hpa.yaml (100%) rename charts/{core => cmk-core}/templates/pdb.yaml (100%) rename charts/{core => cmk-core}/templates/service.yaml (100%) rename charts/{core => cmk-core}/templates/serviceaccount.yaml (100%) rename charts/{core => cmk-core}/values.yaml (100%) rename cmd/{core => cmk-core}/apiserver/command.go (100%) rename cmd/{core => cmk-core}/apiserver/command_test.go (100%) rename cmd/{core => cmk-core}/apiserver/export_test.go (100%) rename cmd/{core => cmk-core}/main.go (100%) rename cmd/{core => cmk-core}/taskscheduler/command.go (100%) rename cmd/{core => cmk-core}/taskworker/command.go (100%) diff --git a/Taskfile.yaml b/Taskfile.yaml index da6d7859..1f783b6b 100644 --- a/Taskfile.yaml +++ b/Taskfile.yaml @@ -7,6 +7,6 @@ includes: excludes: [] # put task names in here which are overwritten in this file vars: CODE_DIRS: '{{.ROOT_DIR}}/cmd/... {{.ROOT_DIR}}/internal/... {{.ROOT_DIR}}/apis/... {{.ROOT_DIR}}/providers/... {{.ROOT_DIR}}/test/... {{.ROOT_DIR}}/utils/...' - COMPONENTS: 'core tenant-manager tenant-manager-cli' + COMPONENTS: 'cmk-core tenant-manager tenant-manager-cli' REPO_URL: 'https://github.com/openkcm/cmk' diff --git a/charts/core/.helmignore b/charts/cmk-core/.helmignore similarity index 100% rename from charts/core/.helmignore rename to charts/cmk-core/.helmignore diff --git a/charts/core/Chart.yaml b/charts/cmk-core/Chart.yaml similarity index 100% rename from charts/core/Chart.yaml rename to charts/cmk-core/Chart.yaml diff --git a/charts/core/README.md b/charts/cmk-core/README.md similarity index 100% rename from charts/core/README.md rename to charts/cmk-core/README.md diff --git a/charts/core/templates/NOTES.txt b/charts/cmk-core/templates/NOTES.txt similarity index 100% rename from charts/core/templates/NOTES.txt rename to charts/cmk-core/templates/NOTES.txt diff --git a/charts/core/templates/_helpers.tpl b/charts/cmk-core/templates/_helpers.tpl similarity index 100% rename from charts/core/templates/_helpers.tpl rename to charts/cmk-core/templates/_helpers.tpl diff --git a/charts/core/templates/configmap.yaml b/charts/cmk-core/templates/configmap.yaml similarity index 100% rename from charts/core/templates/configmap.yaml rename to charts/cmk-core/templates/configmap.yaml diff --git a/charts/core/templates/deployment.yaml b/charts/cmk-core/templates/deployment.yaml similarity index 100% rename from charts/core/templates/deployment.yaml rename to charts/cmk-core/templates/deployment.yaml diff --git a/charts/core/templates/hpa.yaml b/charts/cmk-core/templates/hpa.yaml similarity index 100% rename from charts/core/templates/hpa.yaml rename to charts/cmk-core/templates/hpa.yaml diff --git a/charts/core/templates/pdb.yaml b/charts/cmk-core/templates/pdb.yaml similarity index 100% rename from charts/core/templates/pdb.yaml rename to charts/cmk-core/templates/pdb.yaml diff --git a/charts/core/templates/service.yaml b/charts/cmk-core/templates/service.yaml similarity index 100% rename from charts/core/templates/service.yaml rename to charts/cmk-core/templates/service.yaml diff --git a/charts/core/templates/serviceaccount.yaml b/charts/cmk-core/templates/serviceaccount.yaml similarity index 100% rename from charts/core/templates/serviceaccount.yaml rename to charts/cmk-core/templates/serviceaccount.yaml diff --git a/charts/core/values.yaml b/charts/cmk-core/values.yaml similarity index 100% rename from charts/core/values.yaml rename to charts/cmk-core/values.yaml diff --git a/cmd/core/apiserver/command.go b/cmd/cmk-core/apiserver/command.go similarity index 100% rename from cmd/core/apiserver/command.go rename to cmd/cmk-core/apiserver/command.go diff --git a/cmd/core/apiserver/command_test.go b/cmd/cmk-core/apiserver/command_test.go similarity index 100% rename from cmd/core/apiserver/command_test.go rename to cmd/cmk-core/apiserver/command_test.go diff --git a/cmd/core/apiserver/export_test.go b/cmd/cmk-core/apiserver/export_test.go similarity index 100% rename from cmd/core/apiserver/export_test.go rename to cmd/cmk-core/apiserver/export_test.go diff --git a/cmd/core/main.go b/cmd/cmk-core/main.go similarity index 100% rename from cmd/core/main.go rename to cmd/cmk-core/main.go diff --git a/cmd/core/taskscheduler/command.go b/cmd/cmk-core/taskscheduler/command.go similarity index 100% rename from cmd/core/taskscheduler/command.go rename to cmd/cmk-core/taskscheduler/command.go diff --git a/cmd/core/taskworker/command.go b/cmd/cmk-core/taskworker/command.go similarity index 100% rename from cmd/core/taskworker/command.go rename to cmd/cmk-core/taskworker/command.go