diff --git a/api/v1alpha1/work_types.go b/api/v1alpha1/work_types.go index 7e830616..d8a9a12d 100644 --- a/api/v1alpha1/work_types.go +++ b/api/v1alpha1/work_types.go @@ -88,7 +88,7 @@ func (w *Work) GetSchedulingSelectors() map[string]string { type Workload struct { // +optional Filepath string `json:"filepath,omitempty"` - Content []byte `json:"content,omitempty"` + Content string `json:"content,omitempty"` } //+kubebuilder:object:root=true diff --git a/api/v1alpha1/zz_generated.deepcopy.go b/api/v1alpha1/zz_generated.deepcopy.go index 7fdf30d2..c253609a 100644 --- a/api/v1alpha1/zz_generated.deepcopy.go +++ b/api/v1alpha1/zz_generated.deepcopy.go @@ -790,11 +790,6 @@ func (in *Workflows) DeepCopy() *Workflows { // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *Workload) DeepCopyInto(out *Workload) { *out = *in - if in.Content != nil { - in, out := &in.Content, &out.Content - *out = make([]byte, len(*in)) - copy(*out, *in) - } } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Workload. @@ -813,9 +808,7 @@ func (in *WorkloadCoreFields) DeepCopyInto(out *WorkloadCoreFields) { if in.Workloads != nil { in, out := &in.Workloads, &out.Workloads *out = make([]Workload, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } + copy(*out, *in) } } diff --git a/charts/kratix/crds/platform_kratix_io_crds.yaml b/charts/kratix/crds/platform_kratix_io_crds.yaml index 719b587c..c1076212 100644 --- a/charts/kratix/crds/platform_kratix_io_crds.yaml +++ b/charts/kratix/crds/platform_kratix_io_crds.yaml @@ -310,7 +310,6 @@ spec: description: Workload represents the manifest workload to be deployed on destination properties: content: - format: byte type: string filepath: type: string @@ -392,7 +391,6 @@ spec: description: Workload represents the manifest workload to be deployed on destination properties: content: - format: byte type: string filepath: type: string diff --git a/charts/kratix/templates/distribution.yaml b/charts/kratix/templates/distribution.yaml index 7bb52227..d44ba932 100644 --- a/charts/kratix/templates/distribution.yaml +++ b/charts/kratix/templates/distribution.yaml @@ -349,7 +349,7 @@ metadata: --- apiVersion: v1 data: - WC_IMG: syntasso/kratix-platform-pipeline-adapter:b3e46e2874b588be34c42e218defe2eff97634b9 + WC_IMG: syntasso/kratix-platform-pipeline-adapter:d94ba3c7b4ea68e010631ccfea4e611beb881e87 kind: ConfigMap metadata: name: kratix-platform-wc-img-config @@ -410,7 +410,7 @@ spec: configMapKeyRef: key: WC_IMG name: kratix-platform-wc-img-config - image: syntasso/kratix-platform:b3e46e2874b588be34c42e218defe2eff97634b9 + image: syntasso/kratix-platform:d94ba3c7b4ea68e010631ccfea4e611beb881e87 livenessProbe: httpGet: path: /healthz diff --git a/config/crd/bases/platform.kratix.io_workplacements.yaml b/config/crd/bases/platform.kratix.io_workplacements.yaml index 04d30117..b9aafa93 100644 --- a/config/crd/bases/platform.kratix.io_workplacements.yaml +++ b/config/crd/bases/platform.kratix.io_workplacements.yaml @@ -48,7 +48,6 @@ spec: on destination properties: content: - format: byte type: string filepath: type: string diff --git a/config/crd/bases/platform.kratix.io_works.yaml b/config/crd/bases/platform.kratix.io_works.yaml index 9978ee65..7bbfaa7f 100644 --- a/config/crd/bases/platform.kratix.io_works.yaml +++ b/config/crd/bases/platform.kratix.io_works.yaml @@ -71,7 +71,6 @@ spec: on destination properties: content: - format: byte type: string filepath: type: string diff --git a/config/manager/kustomization.yaml b/config/manager/kustomization.yaml index 5ab14c69..781890e3 100644 --- a/config/manager/kustomization.yaml +++ b/config/manager/kustomization.yaml @@ -20,4 +20,4 @@ configMapGenerator: images: - name: controller newName: syntasso/kratix-platform - newTag: b3e46e2874b588be34c42e218defe2eff97634b9 + newTag: d94ba3c7b4ea68e010631ccfea4e611beb881e87 diff --git a/controllers/promise_controller.go b/controllers/promise_controller.go index d836591b..88999808 100644 --- a/controllers/promise_controller.go +++ b/controllers/promise_controller.go @@ -534,7 +534,7 @@ func (r *PromiseReconciler) createWorkResourceForDependencies(ctx context.Contex work.Spec.Workloads = []v1alpha1.Workload{ { - Content: yamlBytes, + Content: string(yamlBytes), Filepath: "static/dependencies.yaml", }, } diff --git a/controllers/workplacement_controller.go b/controllers/workplacement_controller.go index 93f08034..5d767423 100644 --- a/controllers/workplacement_controller.go +++ b/controllers/workplacement_controller.go @@ -126,7 +126,7 @@ func (r *WorkPlacementReconciler) deleteWorkPlacement(ctx context.Context, write func (r *WorkPlacementReconciler) writeWorkloadsToStateStore(writer writers.StateStoreWriter, workPlacement v1alpha1.WorkPlacement, logger logr.Logger) error { for _, workload := range workPlacement.Spec.Workloads { filepath := filepath.Join(getDir(workPlacement), workload.Filepath) - err := writer.WriteObject(filepath, workload.Content) + err := writer.WriteObject(filepath, []byte(workload.Content)) if err != nil { logger.Error(err, "Error writing resources to repository", "filepath", filepath) return err diff --git a/distribution/kratix.yaml b/distribution/kratix.yaml index a9c4337c..9078b40a 100644 --- a/distribution/kratix.yaml +++ b/distribution/kratix.yaml @@ -358,7 +358,6 @@ spec: on destination properties: content: - format: byte type: string filepath: type: string @@ -446,7 +445,6 @@ spec: on destination properties: content: - format: byte type: string filepath: type: string @@ -806,7 +804,7 @@ metadata: --- apiVersion: v1 data: - WC_IMG: syntasso/kratix-platform-pipeline-adapter:b3e46e2874b588be34c42e218defe2eff97634b9 + WC_IMG: syntasso/kratix-platform-pipeline-adapter:d94ba3c7b4ea68e010631ccfea4e611beb881e87 kind: ConfigMap metadata: name: kratix-platform-wc-img-config @@ -867,7 +865,7 @@ spec: configMapKeyRef: key: WC_IMG name: kratix-platform-wc-img-config - image: syntasso/kratix-platform:b3e46e2874b588be34c42e218defe2eff97634b9 + image: syntasso/kratix-platform:d94ba3c7b4ea68e010631ccfea4e611beb881e87 livenessProbe: httpGet: path: /healthz diff --git a/distribution/single-cluster/install-all-in-one.yaml b/distribution/single-cluster/install-all-in-one.yaml index baabb4ee..4d17bdef 100644 --- a/distribution/single-cluster/install-all-in-one.yaml +++ b/distribution/single-cluster/install-all-in-one.yaml @@ -358,7 +358,6 @@ spec: on destination properties: content: - format: byte type: string filepath: type: string @@ -446,7 +445,6 @@ spec: on destination properties: content: - format: byte type: string filepath: type: string @@ -806,7 +804,7 @@ metadata: --- apiVersion: v1 data: - WC_IMG: syntasso/kratix-platform-pipeline-adapter:b3e46e2874b588be34c42e218defe2eff97634b9 + WC_IMG: syntasso/kratix-platform-pipeline-adapter:d94ba3c7b4ea68e010631ccfea4e611beb881e87 kind: ConfigMap metadata: name: kratix-platform-wc-img-config @@ -867,7 +865,7 @@ spec: configMapKeyRef: key: WC_IMG name: kratix-platform-wc-img-config - image: syntasso/kratix-platform:b3e46e2874b588be34c42e218defe2eff97634b9 + image: syntasso/kratix-platform:d94ba3c7b4ea68e010631ccfea4e611beb881e87 livenessProbe: httpGet: path: /healthz diff --git a/work-creator/pipeline/work_creator.go b/work-creator/pipeline/work_creator.go index 500c641e..12ba1a77 100644 --- a/work-creator/pipeline/work_creator.go +++ b/work-creator/pipeline/work_creator.go @@ -121,7 +121,7 @@ func (w *WorkCreator) getWorkloadsFromDir(prefixToTrimFromWorkloadFilepath, root } workload := platformv1alpha1.Workload{ - Content: byteValue, + Content: string(byteValue), Filepath: path, } diff --git a/work-creator/pipeline/work_creator_test.go b/work-creator/pipeline/work_creator_test.go index 5fa26933..0d1a8302 100644 --- a/work-creator/pipeline/work_creator_test.go +++ b/work-creator/pipeline/work_creator_test.go @@ -86,7 +86,7 @@ var _ = Describe("WorkCreator", func() { for _, workload := range workResource.Spec.Workloads { fileContent, err := ioutil.ReadFile(filepath.Join(mockPipelineDirectory, "input", workload.Filepath)) Expect(err).NotTo(HaveOccurred()) - Expect(workload.Content).To(Equal(fileContent)) + Expect(workload.Content).To(Equal(string(fileContent))) } }) })