From b9d919a7908b75f4e415434e5816cffe7c01240c Mon Sep 17 00:00:00 2001 From: Lency Qian Date: Mon, 6 May 2024 14:03:00 +0800 Subject: [PATCH 1/7] add container CRDs --- .../apis/v1alpha1/model/campaigncontainer.go | 52 ++ .../apis/v1alpha1/model/catalogcontainer.go | 53 ++ .../apis/v1alpha1/model/instancecontainer.go | 52 ++ .../apis/v1alpha1/model/solutioncontainer.go | 52 ++ .../apis/v1alpha1/model/targetcontainer.go | 52 ++ k8s/PROJECT | 45 ++ k8s/apis/fabric/v1/targetcontainer_types.go | 45 ++ k8s/apis/fabric/v1/zz_generated.deepcopy.go | 83 +++ .../federation/v1/catalogcontainer_types.go | 42 ++ .../federation/v1/zz_generated.deepcopy.go | 83 +++ k8s/apis/model/v1/common_types.go | 25 + k8s/apis/model/v1/zz_generated.deepcopy.go | 75 +++ .../solution/v1/instancecontainer_types.go | 42 ++ .../solution/v1/solutioncontainer_types.go | 42 ++ k8s/apis/solution/v1/zz_generated.deepcopy.go | 166 +++++ .../workflow/v1/campaigncontainer_types.go | 41 ++ k8s/apis/workflow/v1/zz_generated.deepcopy.go | 83 +++ .../fabric.symphony_targetcontainers.yaml | 119 ++++ ...federation.symphony_catalogcontainers.yaml | 113 ++++ .../solution.symphony_instancecontainers.yaml | 113 ++++ .../solution.symphony_solutioncontainers.yaml | 113 ++++ .../workflow.symphony_campaigncontainers.yaml | 111 ++++ k8s/config/oss/crd/kustomization.yaml | 5 + ...ainjection_in_fabric_targetcontainers.yaml | 7 + ...ction_in_federation_catalogcontainers.yaml | 7 + ...ection_in_solution_instancecontainers.yaml | 7 + ...ection_in_solution_solutioncontainers.yaml | 7 + ...ection_in_workflow_campaigncontainers.yaml | 7 + .../webhook_in_fabric_targetcontainers.yaml | 16 + ...bhook_in_federation_catalogcontainers.yaml | 16 + ...ebhook_in_solution_instancecontainers.yaml | 16 + ...ebhook_in_solution_solutioncontainers.yaml | 16 + ...ebhook_in_workflow_campaigncontainers.yaml | 16 + .../fabric_targetcontainer_editor_role.yaml | 31 + .../fabric_targetcontainer_viewer_role.yaml | 33 + ...deration_catalogcontainer_editor_role.yaml | 31 + ...deration_catalogcontainer_viewer_role.yaml | 33 + ...olution_instancecontainer_editor_role.yaml | 37 ++ ...olution_instancecontainer_viewer_role.yaml | 33 + ...olution_solutioncontainer_editor_role.yaml | 31 + ...olution_solutioncontainer_viewer_role.yaml | 33 + ...orkflow_campaigncontainer_editor_role.yaml | 31 + ...orkflow_campaigncontainer_viewer_role.yaml | 33 + .../samples/fabric_v1_targetcontainer.yaml | 12 + .../federation_v1_catalogcontainer.yaml | 12 + .../solution_v1_instancecontainer.yaml | 12 + .../solution_v1_solutioncontainer.yaml | 12 + .../workflow_v1_campaigncontainer.yaml | 12 + .../fabric/targetcontainer_controller.go | 52 ++ .../federation/catalogcontainer_controller.go | 52 ++ .../solution/instancecontainer_controller.go | 52 ++ .../solution/solutioncontainer_controller.go | 52 ++ .../workflow/campaigncontainer_controller.go | 52 ++ k8s/main.go | 35 + .../templates/symphony-core/symphonyk8s.yaml | 607 +++++++++++++++++- 55 files changed, 2991 insertions(+), 19 deletions(-) create mode 100644 api/pkg/apis/v1alpha1/model/campaigncontainer.go create mode 100644 api/pkg/apis/v1alpha1/model/catalogcontainer.go create mode 100644 api/pkg/apis/v1alpha1/model/instancecontainer.go create mode 100644 api/pkg/apis/v1alpha1/model/solutioncontainer.go create mode 100644 api/pkg/apis/v1alpha1/model/targetcontainer.go create mode 100644 k8s/apis/fabric/v1/targetcontainer_types.go create mode 100644 k8s/apis/federation/v1/catalogcontainer_types.go create mode 100644 k8s/apis/solution/v1/instancecontainer_types.go create mode 100644 k8s/apis/solution/v1/solutioncontainer_types.go create mode 100644 k8s/apis/workflow/v1/campaigncontainer_types.go create mode 100644 k8s/config/oss/crd/bases/fabric.symphony_targetcontainers.yaml create mode 100644 k8s/config/oss/crd/bases/federation.symphony_catalogcontainers.yaml create mode 100644 k8s/config/oss/crd/bases/solution.symphony_instancecontainers.yaml create mode 100644 k8s/config/oss/crd/bases/solution.symphony_solutioncontainers.yaml create mode 100644 k8s/config/oss/crd/bases/workflow.symphony_campaigncontainers.yaml create mode 100644 k8s/config/oss/crd/patches/cainjection_in_fabric_targetcontainers.yaml create mode 100644 k8s/config/oss/crd/patches/cainjection_in_federation_catalogcontainers.yaml create mode 100644 k8s/config/oss/crd/patches/cainjection_in_solution_instancecontainers.yaml create mode 100644 k8s/config/oss/crd/patches/cainjection_in_solution_solutioncontainers.yaml create mode 100644 k8s/config/oss/crd/patches/cainjection_in_workflow_campaigncontainers.yaml create mode 100644 k8s/config/oss/crd/patches/webhook_in_fabric_targetcontainers.yaml create mode 100644 k8s/config/oss/crd/patches/webhook_in_federation_catalogcontainers.yaml create mode 100644 k8s/config/oss/crd/patches/webhook_in_solution_instancecontainers.yaml create mode 100644 k8s/config/oss/crd/patches/webhook_in_solution_solutioncontainers.yaml create mode 100644 k8s/config/oss/crd/patches/webhook_in_workflow_campaigncontainers.yaml create mode 100644 k8s/config/oss/rbac/fabric_targetcontainer_editor_role.yaml create mode 100644 k8s/config/oss/rbac/fabric_targetcontainer_viewer_role.yaml create mode 100644 k8s/config/oss/rbac/federation_catalogcontainer_editor_role.yaml create mode 100644 k8s/config/oss/rbac/federation_catalogcontainer_viewer_role.yaml create mode 100644 k8s/config/oss/rbac/solution_instancecontainer_editor_role.yaml create mode 100644 k8s/config/oss/rbac/solution_instancecontainer_viewer_role.yaml create mode 100644 k8s/config/oss/rbac/solution_solutioncontainer_editor_role.yaml create mode 100644 k8s/config/oss/rbac/solution_solutioncontainer_viewer_role.yaml create mode 100644 k8s/config/oss/rbac/workflow_campaigncontainer_editor_role.yaml create mode 100644 k8s/config/oss/rbac/workflow_campaigncontainer_viewer_role.yaml create mode 100644 k8s/config/oss/samples/fabric_v1_targetcontainer.yaml create mode 100644 k8s/config/oss/samples/federation_v1_catalogcontainer.yaml create mode 100644 k8s/config/oss/samples/solution_v1_instancecontainer.yaml create mode 100644 k8s/config/oss/samples/solution_v1_solutioncontainer.yaml create mode 100644 k8s/config/oss/samples/workflow_v1_campaigncontainer.yaml create mode 100644 k8s/controllers/fabric/targetcontainer_controller.go create mode 100644 k8s/controllers/federation/catalogcontainer_controller.go create mode 100644 k8s/controllers/solution/instancecontainer_controller.go create mode 100644 k8s/controllers/solution/solutioncontainer_controller.go create mode 100644 k8s/controllers/workflow/campaigncontainer_controller.go diff --git a/api/pkg/apis/v1alpha1/model/campaigncontainer.go b/api/pkg/apis/v1alpha1/model/campaigncontainer.go new file mode 100644 index 000000000..c83928b18 --- /dev/null +++ b/api/pkg/apis/v1alpha1/model/campaigncontainer.go @@ -0,0 +1,52 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT license. + * SPDX-License-Identifier: MIT + */ + +package model + +import ( + "errors" +) + +type CampaignContainerState struct { + ObjectMeta ObjectMeta `json:"metadata,omitempty"` + Spec *CampaignContainerSpec `json:"spec,omitempty"` +} + +type CampaignContainerSpec struct { + Name string `json:"name,omitempty"` +} + +func (c CampaignContainerSpec) DeepEquals(other IDeepEquals) (bool, error) { + otherC, ok := other.(CampaignContainerSpec) + if !ok { + return false, errors.New("parameter is not a CampaignContainerSpec type") + } + + if c.Name != otherC.Name { + return false, nil + } + + return true, nil +} + +func (c CampaignContainerState) DeepEquals(other IDeepEquals) (bool, error) { + otherC, ok := other.(CampaignContainerState) + if !ok { + return false, errors.New("parameter is not a CampaignContainerState type") + } + + equal, err := c.ObjectMeta.DeepEquals(otherC.ObjectMeta) + if err != nil || !equal { + return equal, err + } + + equal, err = c.Spec.DeepEquals(*otherC.Spec) + if err != nil || !equal { + return equal, err + } + + return true, nil +} diff --git a/api/pkg/apis/v1alpha1/model/catalogcontainer.go b/api/pkg/apis/v1alpha1/model/catalogcontainer.go new file mode 100644 index 000000000..2ed093ae8 --- /dev/null +++ b/api/pkg/apis/v1alpha1/model/catalogcontainer.go @@ -0,0 +1,53 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT license. + * SPDX-License-Identifier: MIT + */ + +package model + +import ( + "errors" +) + +// TODO: all state objects should converge to this paradigm: id, spec and status +type CatalogContainerState struct { + ObjectMeta ObjectMeta `json:"metadata,omitempty"` + Spec *CatalogContainerSpec `json:"spec,omitempty"` +} + +type CatalogContainerSpec struct { + Name string `json:"name"` +} + +func (c CatalogContainerSpec) DeepEquals(other IDeepEquals) (bool, error) { + otherC, ok := other.(CatalogContainerSpec) + if !ok { + return false, errors.New("parameter is not a CatalogContainerSpec type") + } + + if c.Name != otherC.Name { + return false, nil + } + + return true, nil +} + +func (c CatalogContainerState) DeepEquals(other IDeepEquals) (bool, error) { + otherC, ok := other.(CatalogContainerState) + if !ok { + return false, errors.New("parameter is not a CatalogContainerState type") + } + + equal, err := c.ObjectMeta.DeepEquals(otherC.ObjectMeta) + if err != nil || !equal { + return equal, err + } + + equal, err = c.Spec.DeepEquals(*otherC.Spec) + if err != nil || !equal { + return equal, err + } + + return true, nil +} diff --git a/api/pkg/apis/v1alpha1/model/instancecontainer.go b/api/pkg/apis/v1alpha1/model/instancecontainer.go new file mode 100644 index 000000000..81e09bee8 --- /dev/null +++ b/api/pkg/apis/v1alpha1/model/instancecontainer.go @@ -0,0 +1,52 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT license. + * SPDX-License-Identifier: MIT + */ + +package model + +import ( + "errors" +) + +type InstanceContainerState struct { + ObjectMeta ObjectMeta `json:"metadata,omitempty"` + Spec *InstanceContainerSpec `json:"spec,omitempty"` +} + +type InstanceContainerSpec struct { + Name string `json:"name,omitempty"` +} + +func (c InstanceContainerSpec) DeepEquals(other IDeepEquals) (bool, error) { + otherC, ok := other.(InstanceContainerSpec) + if !ok { + return false, errors.New("parameter is not a InstanceContainerSpec type") + } + + if c.Name != otherC.Name { + return false, nil + } + + return true, nil +} + +func (c InstanceContainerState) DeepEquals(other IDeepEquals) (bool, error) { + otherC, ok := other.(InstanceContainerState) + if !ok { + return false, errors.New("parameter is not a InstanceContainerState type") + } + + equal, err := c.ObjectMeta.DeepEquals(otherC.ObjectMeta) + if err != nil || !equal { + return equal, err + } + + equal, err = c.Spec.DeepEquals(*otherC.Spec) + if err != nil || !equal { + return equal, err + } + + return true, nil +} diff --git a/api/pkg/apis/v1alpha1/model/solutioncontainer.go b/api/pkg/apis/v1alpha1/model/solutioncontainer.go new file mode 100644 index 000000000..c8c325b11 --- /dev/null +++ b/api/pkg/apis/v1alpha1/model/solutioncontainer.go @@ -0,0 +1,52 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT license. + * SPDX-License-Identifier: MIT + */ + +package model + +import ( + "errors" +) + +type SolutionContainerState struct { + ObjectMeta ObjectMeta `json:"metadata,omitempty"` + Spec *SolutionContainerSpec `json:"spec,omitempty"` +} + +type SolutionContainerSpec struct { + Name string `json:"name,omitempty"` +} + +func (c SolutionContainerSpec) DeepEquals(other IDeepEquals) (bool, error) { + otherC, ok := other.(SolutionContainerSpec) + if !ok { + return false, errors.New("parameter is not a SolutionContainerSpec type") + } + + if c.Name != otherC.Name { + return false, nil + } + + return true, nil +} + +func (c SolutionContainerState) DeepEquals(other IDeepEquals) (bool, error) { + otherC, ok := other.(SolutionContainerState) + if !ok { + return false, errors.New("parameter is not a SolutionContainerState type") + } + + equal, err := c.ObjectMeta.DeepEquals(otherC.ObjectMeta) + if err != nil || !equal { + return equal, err + } + + equal, err = c.Spec.DeepEquals(*otherC.Spec) + if err != nil || !equal { + return equal, err + } + + return true, nil +} diff --git a/api/pkg/apis/v1alpha1/model/targetcontainer.go b/api/pkg/apis/v1alpha1/model/targetcontainer.go new file mode 100644 index 000000000..ff42fe461 --- /dev/null +++ b/api/pkg/apis/v1alpha1/model/targetcontainer.go @@ -0,0 +1,52 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT license. + * SPDX-License-Identifier: MIT + */ + +package model + +import ( + "errors" +) + +type TargetContainerState struct { + ObjectMeta ObjectMeta `json:"metadata,omitempty"` + Spec *TargetContainerSpec `json:"spec,omitempty"` +} + +type TargetContainerSpec struct { + Name string `json:"name,omitempty"` +} + +func (c TargetContainerSpec) DeepEquals(other IDeepEquals) (bool, error) { + otherC, ok := other.(TargetContainerSpec) + if !ok { + return false, errors.New("parameter is not a TargetContainerSpec type") + } + + if c.Name != otherC.Name { + return false, nil + } + + return true, nil +} + +func (c TargetContainerState) DeepEquals(other IDeepEquals) (bool, error) { + otherC, ok := other.(TargetContainerState) + if !ok { + return false, errors.New("parameter is not a TargetContainerState type") + } + + equal, err := c.ObjectMeta.DeepEquals(otherC.ObjectMeta) + if err != nil || !equal { + return equal, err + } + + equal, err = c.Spec.DeepEquals(*otherC.Spec) + if err != nil || !equal { + return equal, err + } + + return true, nil +} diff --git a/k8s/PROJECT b/k8s/PROJECT index 03909b895..2270c0fb1 100644 --- a/k8s/PROJECT +++ b/k8s/PROJECT @@ -152,4 +152,49 @@ resources: defaulting: true validation: true webhookVersion: v1 +- api: + crdVersion: v1 + namespaced: true + controller: true + domain: symphony + group: solution + kind: InstanceContainer + path: gopls-workspace/apis/solution/v1 + version: v1 +- api: + crdVersion: v1 + namespaced: true + controller: true + domain: symphony + group: solution + kind: SolutionContainer + path: gopls-workspace/apis/solution/v1 + version: v1 +- api: + crdVersion: v1 + namespaced: true + controller: true + domain: symphony + group: fabric + kind: TargetContainer + path: gopls-workspace/apis/fabric/v1 + version: v1 +- api: + crdVersion: v1 + namespaced: true + controller: true + domain: symphony + group: federation + kind: CatalogContainer + path: gopls-workspace/apis/federation/v1 + version: v1 +- api: + crdVersion: v1 + namespaced: true + controller: true + domain: symphony + group: workflow + kind: CampaignContainer + path: gopls-workspace/apis/workflow/v1 + version: v1 version: "3" diff --git a/k8s/apis/fabric/v1/targetcontainer_types.go b/k8s/apis/fabric/v1/targetcontainer_types.go new file mode 100644 index 000000000..331c2ceb7 --- /dev/null +++ b/k8s/apis/fabric/v1/targetcontainer_types.go @@ -0,0 +1,45 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT license. + * SPDX-License-Identifier: MIT + */ + +package v1 + +import ( + apimodel "github.com/eclipse-symphony/symphony/api/pkg/apis/v1alpha1/model" + k8smodel "github.com/eclipse-symphony/symphony/k8s/apis/model/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" +) + +// TargetContainerStatus defines the observed state of Target +type TargetContainerStatus struct { + // Important: Run "make" to regenerate code after modifying this file + Properties map[string]string `json:"properties,omitempty"` + ProvisioningStatus apimodel.ProvisioningStatus `json:"provisioningStatus"` + LastModified metav1.Time `json:"lastModified,omitempty"` +} + +// +kubebuilder:object:root=true +// +kubebuilder:subresource:status +// +kubebuilder:printcolumn:name="Status",type=string,JSONPath=`.status.properties.status` +// Target is the Schema for the targets API +type TargetContainer struct { + metav1.TypeMeta `json:",inline"` + metav1.ObjectMeta `json:"metadata,omitempty"` + + Spec k8smodel.TargetContainerSpec `json:"spec,omitempty"` + Status TargetContainerStatus `json:"status,omitempty"` +} + +// +kubebuilder:object:root=true +// TargetList contains a list of Target +type TargetContainerList struct { + metav1.TypeMeta `json:",inline"` + metav1.ListMeta `json:"metadata,omitempty"` + Items []TargetContainer `json:"items"` +} + +func init() { + SchemeBuilder.Register(&TargetContainer{}, &TargetContainerList{}) +} diff --git a/k8s/apis/fabric/v1/zz_generated.deepcopy.go b/k8s/apis/fabric/v1/zz_generated.deepcopy.go index 71072473a..204669bf4 100644 --- a/k8s/apis/fabric/v1/zz_generated.deepcopy.go +++ b/k8s/apis/fabric/v1/zz_generated.deepcopy.go @@ -123,6 +123,89 @@ func (in *Target) DeepCopyObject() runtime.Object { return nil } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *TargetContainer) DeepCopyInto(out *TargetContainer) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + out.Spec = in.Spec + in.Status.DeepCopyInto(&out.Status) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TargetContainer. +func (in *TargetContainer) DeepCopy() *TargetContainer { + if in == nil { + return nil + } + out := new(TargetContainer) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *TargetContainer) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *TargetContainerList) DeepCopyInto(out *TargetContainerList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]TargetContainer, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TargetContainerList. +func (in *TargetContainerList) DeepCopy() *TargetContainerList { + if in == nil { + return nil + } + out := new(TargetContainerList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *TargetContainerList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *TargetContainerStatus) DeepCopyInto(out *TargetContainerStatus) { + *out = *in + if in.Properties != nil { + in, out := &in.Properties, &out.Properties + *out = make(map[string]string, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + in.ProvisioningStatus.DeepCopyInto(&out.ProvisioningStatus) + in.LastModified.DeepCopyInto(&out.LastModified) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TargetContainerStatus. +func (in *TargetContainerStatus) DeepCopy() *TargetContainerStatus { + if in == nil { + return nil + } + out := new(TargetContainerStatus) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *TargetList) DeepCopyInto(out *TargetList) { *out = *in diff --git a/k8s/apis/federation/v1/catalogcontainer_types.go b/k8s/apis/federation/v1/catalogcontainer_types.go new file mode 100644 index 000000000..92fb5cf85 --- /dev/null +++ b/k8s/apis/federation/v1/catalogcontainer_types.go @@ -0,0 +1,42 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT license. + * SPDX-License-Identifier: MIT + */ + +package v1 + +import ( + apimodel "github.com/eclipse-symphony/symphony/api/pkg/apis/v1alpha1/model" + k8smodel "github.com/eclipse-symphony/symphony/k8s/apis/model/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" +) + +type CatalogContainerStatus struct { + Properties map[string]string `json:"properties"` + ProvisioningStatus apimodel.ProvisioningStatus `json:"provisioningStatus"` + LastModified metav1.Time `json:"lastModified,omitempty"` +} + +// +kubebuilder:object:root=true +// +kubebuilder:subresource:status +// CatalogContainer is the Schema for the catalogs API +type CatalogContainer struct { + metav1.TypeMeta `json:",inline"` + metav1.ObjectMeta `json:"metadata,omitempty"` + + Spec k8smodel.CatalogContainerSpec `json:"spec,omitempty"` + Status CatalogContainerStatus `json:"status,omitempty"` +} + +// +kubebuilder:object:root=true +// CatalogContainerList contains a list of Catalog +type CatalogContainerList struct { + metav1.TypeMeta `json:",inline"` + metav1.ListMeta `json:"metadata,omitempty"` + Items []CatalogContainer `json:"items"` +} + +func init() { + SchemeBuilder.Register(&CatalogContainer{}, &CatalogContainerList{}) +} diff --git a/k8s/apis/federation/v1/zz_generated.deepcopy.go b/k8s/apis/federation/v1/zz_generated.deepcopy.go index d15ffc6d2..ec7745262 100644 --- a/k8s/apis/federation/v1/zz_generated.deepcopy.go +++ b/k8s/apis/federation/v1/zz_generated.deepcopy.go @@ -42,6 +42,89 @@ func (in *Catalog) DeepCopyObject() runtime.Object { return nil } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *CatalogContainer) DeepCopyInto(out *CatalogContainer) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + out.Spec = in.Spec + in.Status.DeepCopyInto(&out.Status) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CatalogContainer. +func (in *CatalogContainer) DeepCopy() *CatalogContainer { + if in == nil { + return nil + } + out := new(CatalogContainer) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *CatalogContainer) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *CatalogContainerList) DeepCopyInto(out *CatalogContainerList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]CatalogContainer, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CatalogContainerList. +func (in *CatalogContainerList) DeepCopy() *CatalogContainerList { + if in == nil { + return nil + } + out := new(CatalogContainerList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *CatalogContainerList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *CatalogContainerStatus) DeepCopyInto(out *CatalogContainerStatus) { + *out = *in + if in.Properties != nil { + in, out := &in.Properties, &out.Properties + *out = make(map[string]string, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + in.ProvisioningStatus.DeepCopyInto(&out.ProvisioningStatus) + in.LastModified.DeepCopyInto(&out.LastModified) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CatalogContainerStatus. +func (in *CatalogContainerStatus) DeepCopy() *CatalogContainerStatus { + if in == nil { + return nil + } + out := new(CatalogContainerStatus) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *CatalogList) DeepCopyInto(out *CatalogList) { *out = *in diff --git a/k8s/apis/model/v1/common_types.go b/k8s/apis/model/v1/common_types.go index f9b4f0d36..f4cd7fd41 100644 --- a/k8s/apis/model/v1/common_types.go +++ b/k8s/apis/model/v1/common_types.go @@ -99,6 +99,16 @@ type InstanceSpec struct { ReconciliationPolicy *ReconciliationPolicySpec `json:"reconciliationPolicy,omitempty"` } +// +kubebuilder:object:generate=true +type TargetContainerSpec struct { + DisplayName string `json:"displayName,omitempty"` +} + +// +kubebuilder:object:generate=true +type InstanceContainerSpec struct { + DisplayName string `json:"displayName,omitempty"` +} + // +kubebuilder:object:generate=true type SolutionSpec struct { DisplayName string `json:"displayName,omitempty"` @@ -108,6 +118,11 @@ type SolutionSpec struct { Version string `json:"version,omitempty"` } +// +kubebuilder:object:generate=true +type SolutionContainerSpec struct { + DisplayName string `json:"displayName,omitempty"` +} + // +kubebuilder:object:generate=true type ScheduleSpec struct { Date string `json:"date"` @@ -149,6 +164,11 @@ type CampaignSpec struct { SelfDriving bool `json:"selfDriving,omitempty"` } +// +kubebuilder:object:generate=true +type CampaignContainerSpec struct { + DisplayName string `json:"displayName,omitempty"` +} + // +kubebuilder:object:generate=true type CatalogSpec struct { Type string `json:"type"` @@ -161,6 +181,11 @@ type CatalogSpec struct { Generation string `json:"generation,omitempty"` } +// +kubebuilder:object:generate=true +type CatalogContainerSpec struct { + DisplayName string `json:"displayName,omitempty"` +} + // +kubebuilder:object:generate=true type DeployableStatus struct { Properties map[string]string `json:"properties,omitempty"` diff --git a/k8s/apis/model/v1/zz_generated.deepcopy.go b/k8s/apis/model/v1/zz_generated.deepcopy.go index ba92cf76d..d721fff47 100644 --- a/k8s/apis/model/v1/zz_generated.deepcopy.go +++ b/k8s/apis/model/v1/zz_generated.deepcopy.go @@ -31,6 +31,21 @@ func (in *ActivationSpec) DeepCopy() *ActivationSpec { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *CampaignContainerSpec) DeepCopyInto(out *CampaignContainerSpec) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CampaignContainerSpec. +func (in *CampaignContainerSpec) DeepCopy() *CampaignContainerSpec { + if in == nil { + return nil + } + out := new(CampaignContainerSpec) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *CampaignSpec) DeepCopyInto(out *CampaignSpec) { *out = *in @@ -53,6 +68,21 @@ func (in *CampaignSpec) DeepCopy() *CampaignSpec { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *CatalogContainerSpec) DeepCopyInto(out *CatalogContainerSpec) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CatalogContainerSpec. +func (in *CatalogContainerSpec) DeepCopy() *CatalogContainerSpec { + if in == nil { + return nil + } + out := new(CatalogContainerSpec) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *CatalogSpec) DeepCopyInto(out *CatalogSpec) { *out = *in @@ -148,6 +178,21 @@ func (in *DeployableStatus) DeepCopy() *DeployableStatus { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *InstanceContainerSpec) DeepCopyInto(out *InstanceContainerSpec) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new InstanceContainerSpec. +func (in *InstanceContainerSpec) DeepCopy() *InstanceContainerSpec { + if in == nil { + return nil + } + out := new(InstanceContainerSpec) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *InstanceSpec) DeepCopyInto(out *InstanceSpec) { *out = *in @@ -265,6 +310,21 @@ func (in *SidecarSpec) DeepCopy() *SidecarSpec { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *SolutionContainerSpec) DeepCopyInto(out *SolutionContainerSpec) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SolutionContainerSpec. +func (in *SolutionContainerSpec) DeepCopy() *SolutionContainerSpec { + if in == nil { + return nil + } + out := new(SolutionContainerSpec) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *SolutionSpec) DeepCopyInto(out *SolutionSpec) { *out = *in @@ -316,6 +376,21 @@ func (in *StageSpec) DeepCopy() *StageSpec { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *TargetContainerSpec) DeepCopyInto(out *TargetContainerSpec) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TargetContainerSpec. +func (in *TargetContainerSpec) DeepCopy() *TargetContainerSpec { + if in == nil { + return nil + } + out := new(TargetContainerSpec) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *TargetSpec) DeepCopyInto(out *TargetSpec) { *out = *in diff --git a/k8s/apis/solution/v1/instancecontainer_types.go b/k8s/apis/solution/v1/instancecontainer_types.go new file mode 100644 index 000000000..3eccf6e99 --- /dev/null +++ b/k8s/apis/solution/v1/instancecontainer_types.go @@ -0,0 +1,42 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT license. + * SPDX-License-Identifier: MIT + */ + +package v1 + +import ( + apimodel "github.com/eclipse-symphony/symphony/api/pkg/apis/v1alpha1/model" + k8smodel "github.com/eclipse-symphony/symphony/k8s/apis/model/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" +) + +type InstanceContainerStatus struct { + Properties map[string]string `json:"properties"` + ProvisioningStatus apimodel.ProvisioningStatus `json:"provisioningStatus"` + LastModified metav1.Time `json:"lastModified,omitempty"` +} + +// +kubebuilder:object:root=true +// +kubebuilder:subresource:status +// InstanceContainer is the Schema for the InstanceContainers API +type InstanceContainer struct { + metav1.TypeMeta `json:",inline"` + metav1.ObjectMeta `json:"metadata,omitempty"` + + Spec k8smodel.InstanceContainerSpec `json:"spec,omitempty"` + Status InstanceContainerStatus `json:"status,omitempty"` +} + +// +kubebuilder:object:root=true +// InstanceContainer1List contains a list of InstanceContainer +type InstanceContainerList struct { + metav1.TypeMeta `json:",inline"` + metav1.ListMeta `json:"metadata,omitempty"` + Items []InstanceContainer `json:"items"` +} + +func init() { + SchemeBuilder.Register(&InstanceContainer{}, &InstanceContainerList{}) +} diff --git a/k8s/apis/solution/v1/solutioncontainer_types.go b/k8s/apis/solution/v1/solutioncontainer_types.go new file mode 100644 index 000000000..ab37d6197 --- /dev/null +++ b/k8s/apis/solution/v1/solutioncontainer_types.go @@ -0,0 +1,42 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT license. + * SPDX-License-Identifier: MIT + */ + +package v1 + +import ( + apimodel "github.com/eclipse-symphony/symphony/api/pkg/apis/v1alpha1/model" + k8smodel "github.com/eclipse-symphony/symphony/k8s/apis/model/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" +) + +type SolutionContainerStatus struct { + Properties map[string]string `json:"properties"` + ProvisioningStatus apimodel.ProvisioningStatus `json:"provisioningStatus"` + LastModified metav1.Time `json:"lastModified,omitempty"` +} + +// +kubebuilder:object:root=true +// +kubebuilder:subresource:status +// SolutionContainer is the Schema for the SolutionContainer API +type SolutionContainer struct { + metav1.TypeMeta `json:",inline"` + metav1.ObjectMeta `json:"metadata,omitempty"` + + Spec k8smodel.SolutionContainerSpec `json:"spec,omitempty"` + Status SolutionContainerStatus `json:"status,omitempty"` +} + +// +kubebuilder:object:root=true +// SolutionContainerList contains a list of SolutionContainer +type SolutionContainerList struct { + metav1.TypeMeta `json:",inline"` + metav1.ListMeta `json:"metadata,omitempty"` + Items []SolutionContainer `json:"items"` +} + +func init() { + SchemeBuilder.Register(&SolutionContainer{}, &SolutionContainerList{}) +} diff --git a/k8s/apis/solution/v1/zz_generated.deepcopy.go b/k8s/apis/solution/v1/zz_generated.deepcopy.go index 2857134f2..97e579248 100644 --- a/k8s/apis/solution/v1/zz_generated.deepcopy.go +++ b/k8s/apis/solution/v1/zz_generated.deepcopy.go @@ -42,6 +42,89 @@ func (in *Instance) DeepCopyObject() runtime.Object { return nil } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *InstanceContainer) DeepCopyInto(out *InstanceContainer) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + out.Spec = in.Spec + in.Status.DeepCopyInto(&out.Status) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new InstanceContainer. +func (in *InstanceContainer) DeepCopy() *InstanceContainer { + if in == nil { + return nil + } + out := new(InstanceContainer) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *InstanceContainer) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *InstanceContainerList) DeepCopyInto(out *InstanceContainerList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]InstanceContainer, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new InstanceContainerList. +func (in *InstanceContainerList) DeepCopy() *InstanceContainerList { + if in == nil { + return nil + } + out := new(InstanceContainerList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *InstanceContainerList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *InstanceContainerStatus) DeepCopyInto(out *InstanceContainerStatus) { + *out = *in + if in.Properties != nil { + in, out := &in.Properties, &out.Properties + *out = make(map[string]string, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + in.ProvisioningStatus.DeepCopyInto(&out.ProvisioningStatus) + in.LastModified.DeepCopyInto(&out.LastModified) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new InstanceContainerStatus. +func (in *InstanceContainerStatus) DeepCopy() *InstanceContainerStatus { + if in == nil { + return nil + } + out := new(InstanceContainerStatus) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *InstanceList) DeepCopyInto(out *InstanceList) { *out = *in @@ -101,6 +184,89 @@ func (in *Solution) DeepCopyObject() runtime.Object { return nil } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *SolutionContainer) DeepCopyInto(out *SolutionContainer) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + out.Spec = in.Spec + in.Status.DeepCopyInto(&out.Status) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SolutionContainer. +func (in *SolutionContainer) DeepCopy() *SolutionContainer { + if in == nil { + return nil + } + out := new(SolutionContainer) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *SolutionContainer) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *SolutionContainerList) DeepCopyInto(out *SolutionContainerList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]SolutionContainer, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SolutionContainerList. +func (in *SolutionContainerList) DeepCopy() *SolutionContainerList { + if in == nil { + return nil + } + out := new(SolutionContainerList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *SolutionContainerList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *SolutionContainerStatus) DeepCopyInto(out *SolutionContainerStatus) { + *out = *in + if in.Properties != nil { + in, out := &in.Properties, &out.Properties + *out = make(map[string]string, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + in.ProvisioningStatus.DeepCopyInto(&out.ProvisioningStatus) + in.LastModified.DeepCopyInto(&out.LastModified) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SolutionContainerStatus. +func (in *SolutionContainerStatus) DeepCopy() *SolutionContainerStatus { + if in == nil { + return nil + } + out := new(SolutionContainerStatus) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *SolutionList) DeepCopyInto(out *SolutionList) { *out = *in diff --git a/k8s/apis/workflow/v1/campaigncontainer_types.go b/k8s/apis/workflow/v1/campaigncontainer_types.go new file mode 100644 index 000000000..d21aaae82 --- /dev/null +++ b/k8s/apis/workflow/v1/campaigncontainer_types.go @@ -0,0 +1,41 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT license. + * SPDX-License-Identifier: MIT + */ + +package v1 + +import ( + apimodel "github.com/eclipse-symphony/symphony/api/pkg/apis/v1alpha1/model" + k8smodel "github.com/eclipse-symphony/symphony/k8s/apis/model/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" +) + +type CampaignContainerStatus struct { + Properties map[string]string `json:"properties"` + ProvisioningStatus apimodel.ProvisioningStatus `json:"provisioningStatus"` + LastModified metav1.Time `json:"lastModified,omitempty"` +} + +// +kubebuilder:object:root=true +// CampaignContainer is the Schema for the campaigns API +type CampaignContainer struct { + metav1.TypeMeta `json:",inline"` + metav1.ObjectMeta `json:"metadata,omitempty"` + + Spec k8smodel.CampaignContainerSpec `json:"spec,omitempty"` + Status CampaignContainerStatus `json:"status,omitempty"` +} + +// +kubebuilder:object:root=true +// CampaignContainerList contains a list of Campaign +type CampaignContainerList struct { + metav1.TypeMeta `json:",inline"` + metav1.ListMeta `json:"metadata,omitempty"` + Items []CampaignContainer `json:"items"` +} + +func init() { + SchemeBuilder.Register(&CampaignContainer{}, &CampaignContainerList{}) +} diff --git a/k8s/apis/workflow/v1/zz_generated.deepcopy.go b/k8s/apis/workflow/v1/zz_generated.deepcopy.go index 7cc2e8927..e35d3c07e 100644 --- a/k8s/apis/workflow/v1/zz_generated.deepcopy.go +++ b/k8s/apis/workflow/v1/zz_generated.deepcopy.go @@ -117,6 +117,89 @@ func (in *Campaign) DeepCopyObject() runtime.Object { return nil } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *CampaignContainer) DeepCopyInto(out *CampaignContainer) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + out.Spec = in.Spec + in.Status.DeepCopyInto(&out.Status) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CampaignContainer. +func (in *CampaignContainer) DeepCopy() *CampaignContainer { + if in == nil { + return nil + } + out := new(CampaignContainer) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *CampaignContainer) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *CampaignContainerList) DeepCopyInto(out *CampaignContainerList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]CampaignContainer, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CampaignContainerList. +func (in *CampaignContainerList) DeepCopy() *CampaignContainerList { + if in == nil { + return nil + } + out := new(CampaignContainerList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *CampaignContainerList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *CampaignContainerStatus) DeepCopyInto(out *CampaignContainerStatus) { + *out = *in + if in.Properties != nil { + in, out := &in.Properties, &out.Properties + *out = make(map[string]string, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + in.ProvisioningStatus.DeepCopyInto(&out.ProvisioningStatus) + in.LastModified.DeepCopyInto(&out.LastModified) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CampaignContainerStatus. +func (in *CampaignContainerStatus) DeepCopy() *CampaignContainerStatus { + if in == nil { + return nil + } + out := new(CampaignContainerStatus) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *CampaignList) DeepCopyInto(out *CampaignList) { *out = *in diff --git a/k8s/config/oss/crd/bases/fabric.symphony_targetcontainers.yaml b/k8s/config/oss/crd/bases/fabric.symphony_targetcontainers.yaml new file mode 100644 index 000000000..de18af67b --- /dev/null +++ b/k8s/config/oss/crd/bases/fabric.symphony_targetcontainers.yaml @@ -0,0 +1,119 @@ +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + controller-gen.kubebuilder.io/version: v0.11.1 + creationTimestamp: null + name: targetcontainers.fabric.symphony +spec: + group: fabric.symphony + names: + kind: TargetContainer + listKind: TargetContainerList + plural: targetcontainers + singular: targetcontainer + scope: Namespaced + versions: + - additionalPrinterColumns: + - jsonPath: .status.properties.status + name: Status + type: string + name: v1 + schema: + openAPIV3Schema: + description: Target is the Schema for the targets API + properties: + apiVersion: + description: 'APIVersion defines the versioned schema of this representation + of an object. Servers should convert recognized schemas to the latest + internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' + type: string + kind: + description: 'Kind is a string value representing the REST resource this + object represents. Servers may infer this from the endpoint the client + submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' + type: string + metadata: + type: object + spec: + properties: + displayName: + type: string + type: object + status: + description: TargetContainerStatus defines the observed state of Target + properties: + lastModified: + format: date-time + type: string + properties: + additionalProperties: + type: string + description: 'Important: Run "make" to regenerate code after modifying + this file' + type: object + provisioningStatus: + description: Defines the state of the ARM resource for long running + operations + properties: + error: + description: Defines an error in the ARM resource for long running + operations + properties: + code: + type: string + details: + items: + description: Defines an error for symphony target + properties: + code: + type: string + details: + items: + description: Defines an error for components defined + in symphony + properties: + code: + type: string + message: + type: string + target: + type: string + type: object + type: array + message: + type: string + target: + type: string + type: object + type: array + message: + type: string + target: + type: string + type: object + failureCause: + type: string + logErrors: + type: boolean + operationId: + type: string + output: + additionalProperties: + type: string + type: object + status: + type: string + required: + - operationId + - status + type: object + required: + - provisioningStatus + type: object + type: object + served: true + storage: true + subresources: + status: {} diff --git a/k8s/config/oss/crd/bases/federation.symphony_catalogcontainers.yaml b/k8s/config/oss/crd/bases/federation.symphony_catalogcontainers.yaml new file mode 100644 index 000000000..b0ffbc140 --- /dev/null +++ b/k8s/config/oss/crd/bases/federation.symphony_catalogcontainers.yaml @@ -0,0 +1,113 @@ +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + controller-gen.kubebuilder.io/version: v0.11.1 + creationTimestamp: null + name: catalogcontainers.federation.symphony +spec: + group: federation.symphony + names: + kind: CatalogContainer + listKind: CatalogContainerList + plural: catalogcontainers + singular: catalogcontainer + scope: Namespaced + versions: + - name: v1 + schema: + openAPIV3Schema: + description: CatalogContainer is the Schema for the catalogs API + properties: + apiVersion: + description: 'APIVersion defines the versioned schema of this representation + of an object. Servers should convert recognized schemas to the latest + internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' + type: string + kind: + description: 'Kind is a string value representing the REST resource this + object represents. Servers may infer this from the endpoint the client + submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' + type: string + metadata: + type: object + spec: + properties: + displayName: + type: string + type: object + status: + properties: + lastModified: + format: date-time + type: string + properties: + additionalProperties: + type: string + type: object + provisioningStatus: + description: Defines the state of the ARM resource for long running + operations + properties: + error: + description: Defines an error in the ARM resource for long running + operations + properties: + code: + type: string + details: + items: + description: Defines an error for symphony target + properties: + code: + type: string + details: + items: + description: Defines an error for components defined + in symphony + properties: + code: + type: string + message: + type: string + target: + type: string + type: object + type: array + message: + type: string + target: + type: string + type: object + type: array + message: + type: string + target: + type: string + type: object + failureCause: + type: string + logErrors: + type: boolean + operationId: + type: string + output: + additionalProperties: + type: string + type: object + status: + type: string + required: + - operationId + - status + type: object + required: + - properties + - provisioningStatus + type: object + type: object + served: true + storage: true + subresources: + status: {} diff --git a/k8s/config/oss/crd/bases/solution.symphony_instancecontainers.yaml b/k8s/config/oss/crd/bases/solution.symphony_instancecontainers.yaml new file mode 100644 index 000000000..cf245b870 --- /dev/null +++ b/k8s/config/oss/crd/bases/solution.symphony_instancecontainers.yaml @@ -0,0 +1,113 @@ +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + controller-gen.kubebuilder.io/version: v0.11.1 + creationTimestamp: null + name: instancecontainers.solution.symphony +spec: + group: solution.symphony + names: + kind: InstanceContainer + listKind: InstanceContainerList + plural: instancecontainers + singular: instancecontainer + scope: Namespaced + versions: + - name: v1 + schema: + openAPIV3Schema: + description: InstanceContainer is the Schema for the InstanceContainers API + properties: + apiVersion: + description: 'APIVersion defines the versioned schema of this representation + of an object. Servers should convert recognized schemas to the latest + internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' + type: string + kind: + description: 'Kind is a string value representing the REST resource this + object represents. Servers may infer this from the endpoint the client + submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' + type: string + metadata: + type: object + spec: + properties: + displayName: + type: string + type: object + status: + properties: + lastModified: + format: date-time + type: string + properties: + additionalProperties: + type: string + type: object + provisioningStatus: + description: Defines the state of the ARM resource for long running + operations + properties: + error: + description: Defines an error in the ARM resource for long running + operations + properties: + code: + type: string + details: + items: + description: Defines an error for symphony target + properties: + code: + type: string + details: + items: + description: Defines an error for components defined + in symphony + properties: + code: + type: string + message: + type: string + target: + type: string + type: object + type: array + message: + type: string + target: + type: string + type: object + type: array + message: + type: string + target: + type: string + type: object + failureCause: + type: string + logErrors: + type: boolean + operationId: + type: string + output: + additionalProperties: + type: string + type: object + status: + type: string + required: + - operationId + - status + type: object + required: + - properties + - provisioningStatus + type: object + type: object + served: true + storage: true + subresources: + status: {} diff --git a/k8s/config/oss/crd/bases/solution.symphony_solutioncontainers.yaml b/k8s/config/oss/crd/bases/solution.symphony_solutioncontainers.yaml new file mode 100644 index 000000000..7e2750806 --- /dev/null +++ b/k8s/config/oss/crd/bases/solution.symphony_solutioncontainers.yaml @@ -0,0 +1,113 @@ +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + controller-gen.kubebuilder.io/version: v0.11.1 + creationTimestamp: null + name: solutioncontainers.solution.symphony +spec: + group: solution.symphony + names: + kind: SolutionContainer + listKind: SolutionContainerList + plural: solutioncontainers + singular: solutioncontainer + scope: Namespaced + versions: + - name: v1 + schema: + openAPIV3Schema: + description: SolutionContainer is the Schema for the SolutionContainer API + properties: + apiVersion: + description: 'APIVersion defines the versioned schema of this representation + of an object. Servers should convert recognized schemas to the latest + internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' + type: string + kind: + description: 'Kind is a string value representing the REST resource this + object represents. Servers may infer this from the endpoint the client + submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' + type: string + metadata: + type: object + spec: + properties: + displayName: + type: string + type: object + status: + properties: + lastModified: + format: date-time + type: string + properties: + additionalProperties: + type: string + type: object + provisioningStatus: + description: Defines the state of the ARM resource for long running + operations + properties: + error: + description: Defines an error in the ARM resource for long running + operations + properties: + code: + type: string + details: + items: + description: Defines an error for symphony target + properties: + code: + type: string + details: + items: + description: Defines an error for components defined + in symphony + properties: + code: + type: string + message: + type: string + target: + type: string + type: object + type: array + message: + type: string + target: + type: string + type: object + type: array + message: + type: string + target: + type: string + type: object + failureCause: + type: string + logErrors: + type: boolean + operationId: + type: string + output: + additionalProperties: + type: string + type: object + status: + type: string + required: + - operationId + - status + type: object + required: + - properties + - provisioningStatus + type: object + type: object + served: true + storage: true + subresources: + status: {} diff --git a/k8s/config/oss/crd/bases/workflow.symphony_campaigncontainers.yaml b/k8s/config/oss/crd/bases/workflow.symphony_campaigncontainers.yaml new file mode 100644 index 000000000..81fc7f457 --- /dev/null +++ b/k8s/config/oss/crd/bases/workflow.symphony_campaigncontainers.yaml @@ -0,0 +1,111 @@ +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + controller-gen.kubebuilder.io/version: v0.11.1 + creationTimestamp: null + name: campaigncontainers.workflow.symphony +spec: + group: workflow.symphony + names: + kind: CampaignContainer + listKind: CampaignContainerList + plural: campaigncontainers + singular: campaigncontainer + scope: Namespaced + versions: + - name: v1 + schema: + openAPIV3Schema: + description: CampaignContainer is the Schema for the campaigns API + properties: + apiVersion: + description: 'APIVersion defines the versioned schema of this representation + of an object. Servers should convert recognized schemas to the latest + internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' + type: string + kind: + description: 'Kind is a string value representing the REST resource this + object represents. Servers may infer this from the endpoint the client + submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' + type: string + metadata: + type: object + spec: + properties: + displayName: + type: string + type: object + status: + properties: + lastModified: + format: date-time + type: string + properties: + additionalProperties: + type: string + type: object + provisioningStatus: + description: Defines the state of the ARM resource for long running + operations + properties: + error: + description: Defines an error in the ARM resource for long running + operations + properties: + code: + type: string + details: + items: + description: Defines an error for symphony target + properties: + code: + type: string + details: + items: + description: Defines an error for components defined + in symphony + properties: + code: + type: string + message: + type: string + target: + type: string + type: object + type: array + message: + type: string + target: + type: string + type: object + type: array + message: + type: string + target: + type: string + type: object + failureCause: + type: string + logErrors: + type: boolean + operationId: + type: string + output: + additionalProperties: + type: string + type: object + status: + type: string + required: + - operationId + - status + type: object + required: + - properties + - provisioningStatus + type: object + type: object + served: true + storage: true diff --git a/k8s/config/oss/crd/kustomization.yaml b/k8s/config/oss/crd/kustomization.yaml index ea55942c1..c94d5490c 100644 --- a/k8s/config/oss/crd/kustomization.yaml +++ b/k8s/config/oss/crd/kustomization.yaml @@ -20,6 +20,11 @@ resources: - bases/fabric.symphony_devices.yaml - bases/federation.symphony_sites.yaml - bases/federation.symphony_catalogs.yaml +- bases/solution.symphony_solutioncontainers.yaml +- bases/workflow.symphony_campaigncontainers.yaml +- bases/solution.symphony_instancecontainers.yaml +- bases/fabric.symphony_targetcontainers.yaml +- bases/federation.symphony_catalogcontainers.yaml #+kubebuilder:scaffold:crdkustomizeresource # [WEBHOOK] To enable webhook, uncomment all the sections with [WEBHOOK] prefix. diff --git a/k8s/config/oss/crd/patches/cainjection_in_fabric_targetcontainers.yaml b/k8s/config/oss/crd/patches/cainjection_in_fabric_targetcontainers.yaml new file mode 100644 index 000000000..0dda628e8 --- /dev/null +++ b/k8s/config/oss/crd/patches/cainjection_in_fabric_targetcontainers.yaml @@ -0,0 +1,7 @@ +# The following patch adds a directive for certmanager to inject CA into the CRD +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + cert-manager.io/inject-ca-from: $(CERTIFICATE_NAMESPACE)/$(CERTIFICATE_NAME) + name: targetcontainers.fabric.symphony diff --git a/k8s/config/oss/crd/patches/cainjection_in_federation_catalogcontainers.yaml b/k8s/config/oss/crd/patches/cainjection_in_federation_catalogcontainers.yaml new file mode 100644 index 000000000..0f955e70f --- /dev/null +++ b/k8s/config/oss/crd/patches/cainjection_in_federation_catalogcontainers.yaml @@ -0,0 +1,7 @@ +# The following patch adds a directive for certmanager to inject CA into the CRD +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + cert-manager.io/inject-ca-from: $(CERTIFICATE_NAMESPACE)/$(CERTIFICATE_NAME) + name: catalogcontainers.federation.symphony diff --git a/k8s/config/oss/crd/patches/cainjection_in_solution_instancecontainers.yaml b/k8s/config/oss/crd/patches/cainjection_in_solution_instancecontainers.yaml new file mode 100644 index 000000000..8cd79147b --- /dev/null +++ b/k8s/config/oss/crd/patches/cainjection_in_solution_instancecontainers.yaml @@ -0,0 +1,7 @@ +# The following patch adds a directive for certmanager to inject CA into the CRD +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + cert-manager.io/inject-ca-from: $(CERTIFICATE_NAMESPACE)/$(CERTIFICATE_NAME) + name: instancecontainers.solution.symphony diff --git a/k8s/config/oss/crd/patches/cainjection_in_solution_solutioncontainers.yaml b/k8s/config/oss/crd/patches/cainjection_in_solution_solutioncontainers.yaml new file mode 100644 index 000000000..7e544ebfb --- /dev/null +++ b/k8s/config/oss/crd/patches/cainjection_in_solution_solutioncontainers.yaml @@ -0,0 +1,7 @@ +# The following patch adds a directive for certmanager to inject CA into the CRD +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + cert-manager.io/inject-ca-from: $(CERTIFICATE_NAMESPACE)/$(CERTIFICATE_NAME) + name: solutioncontainers.solution.symphony diff --git a/k8s/config/oss/crd/patches/cainjection_in_workflow_campaigncontainers.yaml b/k8s/config/oss/crd/patches/cainjection_in_workflow_campaigncontainers.yaml new file mode 100644 index 000000000..0ffa26d91 --- /dev/null +++ b/k8s/config/oss/crd/patches/cainjection_in_workflow_campaigncontainers.yaml @@ -0,0 +1,7 @@ +# The following patch adds a directive for certmanager to inject CA into the CRD +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + cert-manager.io/inject-ca-from: $(CERTIFICATE_NAMESPACE)/$(CERTIFICATE_NAME) + name: campaigncontainers.workflow.symphony diff --git a/k8s/config/oss/crd/patches/webhook_in_fabric_targetcontainers.yaml b/k8s/config/oss/crd/patches/webhook_in_fabric_targetcontainers.yaml new file mode 100644 index 000000000..f14432749 --- /dev/null +++ b/k8s/config/oss/crd/patches/webhook_in_fabric_targetcontainers.yaml @@ -0,0 +1,16 @@ +# The following patch enables a conversion webhook for the CRD +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + name: targetcontainers.fabric.symphony +spec: + conversion: + strategy: Webhook + webhook: + clientConfig: + service: + namespace: system + name: webhook-service + path: /convert + conversionReviewVersions: + - v1 diff --git a/k8s/config/oss/crd/patches/webhook_in_federation_catalogcontainers.yaml b/k8s/config/oss/crd/patches/webhook_in_federation_catalogcontainers.yaml new file mode 100644 index 000000000..03b03c49f --- /dev/null +++ b/k8s/config/oss/crd/patches/webhook_in_federation_catalogcontainers.yaml @@ -0,0 +1,16 @@ +# The following patch enables a conversion webhook for the CRD +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + name: catalogcontainers.federation.symphony +spec: + conversion: + strategy: Webhook + webhook: + clientConfig: + service: + namespace: system + name: webhook-service + path: /convert + conversionReviewVersions: + - v1 diff --git a/k8s/config/oss/crd/patches/webhook_in_solution_instancecontainers.yaml b/k8s/config/oss/crd/patches/webhook_in_solution_instancecontainers.yaml new file mode 100644 index 000000000..1a776d61e --- /dev/null +++ b/k8s/config/oss/crd/patches/webhook_in_solution_instancecontainers.yaml @@ -0,0 +1,16 @@ +# The following patch enables a conversion webhook for the CRD +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + name: instancecontainers.solution.symphony +spec: + conversion: + strategy: Webhook + webhook: + clientConfig: + service: + namespace: system + name: webhook-service + path: /convert + conversionReviewVersions: + - v1 diff --git a/k8s/config/oss/crd/patches/webhook_in_solution_solutioncontainers.yaml b/k8s/config/oss/crd/patches/webhook_in_solution_solutioncontainers.yaml new file mode 100644 index 000000000..ea3447dc4 --- /dev/null +++ b/k8s/config/oss/crd/patches/webhook_in_solution_solutioncontainers.yaml @@ -0,0 +1,16 @@ +# The following patch enables a conversion webhook for the CRD +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + name: solutioncontainers.solution.symphony +spec: + conversion: + strategy: Webhook + webhook: + clientConfig: + service: + namespace: system + name: webhook-service + path: /convert + conversionReviewVersions: + - v1 diff --git a/k8s/config/oss/crd/patches/webhook_in_workflow_campaigncontainers.yaml b/k8s/config/oss/crd/patches/webhook_in_workflow_campaigncontainers.yaml new file mode 100644 index 000000000..f3b9a3b0f --- /dev/null +++ b/k8s/config/oss/crd/patches/webhook_in_workflow_campaigncontainers.yaml @@ -0,0 +1,16 @@ +# The following patch enables a conversion webhook for the CRD +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + name: campaigncontainers.workflow.symphony +spec: + conversion: + strategy: Webhook + webhook: + clientConfig: + service: + namespace: system + name: webhook-service + path: /convert + conversionReviewVersions: + - v1 diff --git a/k8s/config/oss/rbac/fabric_targetcontainer_editor_role.yaml b/k8s/config/oss/rbac/fabric_targetcontainer_editor_role.yaml new file mode 100644 index 000000000..89421d54b --- /dev/null +++ b/k8s/config/oss/rbac/fabric_targetcontainer_editor_role.yaml @@ -0,0 +1,31 @@ +# permissions for end users to edit targetcontainers. +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRole +metadata: + labels: + app.kubernetes.io/name: clusterrole + app.kubernetes.io/instance: targetcontainer-editor-role + app.kubernetes.io/component: rbac + app.kubernetes.io/created-by: symphony-k8s + app.kubernetes.io/part-of: symphony-k8s + app.kubernetes.io/managed-by: kustomize + name: targetcontainer-editor-role +rules: +- apiGroups: + - fabric.symphony + resources: + - targetcontainers + verbs: + - create + - delete + - get + - list + - patch + - update + - watch +- apiGroups: + - fabric.symphony + resources: + - targetcontainers/status + verbs: + - get diff --git a/k8s/config/oss/rbac/fabric_targetcontainer_viewer_role.yaml b/k8s/config/oss/rbac/fabric_targetcontainer_viewer_role.yaml new file mode 100644 index 000000000..e18885874 --- /dev/null +++ b/k8s/config/oss/rbac/fabric_targetcontainer_viewer_role.yaml @@ -0,0 +1,33 @@ +## +## Copyright (c) Microsoft Corporation. +## Licensed under the MIT license. +## SPDX-License-Identifier: MIT +## + +# permissions for end users to view targetcontainers. +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRole +metadata: + labels: + app.kubernetes.io/name: clusterrole + app.kubernetes.io/instance: targetcontainer-viewer-role + app.kubernetes.io/component: rbac + app.kubernetes.io/created-by: symphony-k8s + app.kubernetes.io/part-of: symphony-k8s + app.kubernetes.io/managed-by: kustomize + name: targetcontainer-viewer-role +rules: +- apiGroups: + - fabric.symphony + resources: + - targetcontainers + verbs: + - get + - list + - watch +- apiGroups: + - fabric.symphony + resources: + - targetcontainers/status + verbs: + - get diff --git a/k8s/config/oss/rbac/federation_catalogcontainer_editor_role.yaml b/k8s/config/oss/rbac/federation_catalogcontainer_editor_role.yaml new file mode 100644 index 000000000..663ef0af2 --- /dev/null +++ b/k8s/config/oss/rbac/federation_catalogcontainer_editor_role.yaml @@ -0,0 +1,31 @@ +# permissions for end users to edit catalogcontainers. +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRole +metadata: + labels: + app.kubernetes.io/name: clusterrole + app.kubernetes.io/instance: catalogcontainer-editor-role + app.kubernetes.io/component: rbac + app.kubernetes.io/created-by: symphony-k8s + app.kubernetes.io/part-of: symphony-k8s + app.kubernetes.io/managed-by: kustomize + name: catalogcontainer-editor-role +rules: +- apiGroups: + - federation.symphony + resources: + - catalogcontainers + verbs: + - create + - delete + - get + - list + - patch + - update + - watch +- apiGroups: + - federation.symphony + resources: + - catalogcontainers/status + verbs: + - get diff --git a/k8s/config/oss/rbac/federation_catalogcontainer_viewer_role.yaml b/k8s/config/oss/rbac/federation_catalogcontainer_viewer_role.yaml new file mode 100644 index 000000000..37ac285be --- /dev/null +++ b/k8s/config/oss/rbac/federation_catalogcontainer_viewer_role.yaml @@ -0,0 +1,33 @@ +## +## Copyright (c) Microsoft Corporation. +## Licensed under the MIT license. +## SPDX-License-Identifier: MIT +## + +# permissions for end users to view catalogcontainers. +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRole +metadata: + labels: + app.kubernetes.io/name: clusterrole + app.kubernetes.io/instance: catalogcontainer-viewer-role + app.kubernetes.io/component: rbac + app.kubernetes.io/created-by: symphony-k8s + app.kubernetes.io/part-of: symphony-k8s + app.kubernetes.io/managed-by: kustomize + name: catalogcontainer-viewer-role +rules: +- apiGroups: + - federation.symphony + resources: + - catalogcontainers + verbs: + - get + - list + - watch +- apiGroups: + - federation.symphony + resources: + - catalogcontainers/status + verbs: + - get diff --git a/k8s/config/oss/rbac/solution_instancecontainer_editor_role.yaml b/k8s/config/oss/rbac/solution_instancecontainer_editor_role.yaml new file mode 100644 index 000000000..d61c6a749 --- /dev/null +++ b/k8s/config/oss/rbac/solution_instancecontainer_editor_role.yaml @@ -0,0 +1,37 @@ +## +## Copyright (c) Microsoft Corporation. +## Licensed under the MIT license. +## SPDX-License-Identifier: MIT +## + +# permissions for end users to edit instancecontainers. +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRole +metadata: + labels: + app.kubernetes.io/name: clusterrole + app.kubernetes.io/instance: instancecontainer-editor-role + app.kubernetes.io/component: rbac + app.kubernetes.io/created-by: symphony-k8s + app.kubernetes.io/part-of: symphony-k8s + app.kubernetes.io/managed-by: kustomize + name: instancecontainer-editor-role +rules: +- apiGroups: + - solution.symphony + resources: + - instancecontainers + verbs: + - create + - delete + - get + - list + - patch + - update + - watch +- apiGroups: + - solution.symphony + resources: + - instancecontainers/status + verbs: + - get diff --git a/k8s/config/oss/rbac/solution_instancecontainer_viewer_role.yaml b/k8s/config/oss/rbac/solution_instancecontainer_viewer_role.yaml new file mode 100644 index 000000000..0d99bbee5 --- /dev/null +++ b/k8s/config/oss/rbac/solution_instancecontainer_viewer_role.yaml @@ -0,0 +1,33 @@ +## +## Copyright (c) Microsoft Corporation. +## Licensed under the MIT license. +## SPDX-License-Identifier: MIT +## + +# permissions for end users to view instancecontainers. +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRole +metadata: + labels: + app.kubernetes.io/name: clusterrole + app.kubernetes.io/instance: instancecontainer-viewer-role + app.kubernetes.io/component: rbac + app.kubernetes.io/created-by: symphony-k8s + app.kubernetes.io/part-of: symphony-k8s + app.kubernetes.io/managed-by: kustomize + name: instancecontainer-viewer-role +rules: +- apiGroups: + - solution.symphony + resources: + - instancecontainers + verbs: + - get + - list + - watch +- apiGroups: + - solution.symphony + resources: + - instancecontainers/status + verbs: + - get diff --git a/k8s/config/oss/rbac/solution_solutioncontainer_editor_role.yaml b/k8s/config/oss/rbac/solution_solutioncontainer_editor_role.yaml new file mode 100644 index 000000000..f08185272 --- /dev/null +++ b/k8s/config/oss/rbac/solution_solutioncontainer_editor_role.yaml @@ -0,0 +1,31 @@ +# permissions for end users to edit solutioncontainers. +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRole +metadata: + labels: + app.kubernetes.io/name: clusterrole + app.kubernetes.io/instance: solutioncontainer-editor-role + app.kubernetes.io/component: rbac + app.kubernetes.io/created-by: symphony-k8s + app.kubernetes.io/part-of: symphony-k8s + app.kubernetes.io/managed-by: kustomize + name: solutioncontainer-editor-role +rules: +- apiGroups: + - solution.symphony + resources: + - solutioncontainers + verbs: + - create + - delete + - get + - list + - patch + - update + - watch +- apiGroups: + - solution.symphony + resources: + - solutioncontainers/status + verbs: + - get diff --git a/k8s/config/oss/rbac/solution_solutioncontainer_viewer_role.yaml b/k8s/config/oss/rbac/solution_solutioncontainer_viewer_role.yaml new file mode 100644 index 000000000..732b90c8f --- /dev/null +++ b/k8s/config/oss/rbac/solution_solutioncontainer_viewer_role.yaml @@ -0,0 +1,33 @@ +## +## Copyright (c) Microsoft Corporation. +## Licensed under the MIT license. +## SPDX-License-Identifier: MIT +## + +# permissions for end users to view solutioncontainers. +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRole +metadata: + labels: + app.kubernetes.io/name: clusterrole + app.kubernetes.io/instance: solutioncontainer-viewer-role + app.kubernetes.io/component: rbac + app.kubernetes.io/created-by: symphony-k8s + app.kubernetes.io/part-of: symphony-k8s + app.kubernetes.io/managed-by: kustomize + name: solutioncontainer-viewer-role +rules: +- apiGroups: + - solution.symphony + resources: + - solutioncontainers + verbs: + - get + - list + - watch +- apiGroups: + - solution.symphony + resources: + - solutioncontainers/status + verbs: + - get diff --git a/k8s/config/oss/rbac/workflow_campaigncontainer_editor_role.yaml b/k8s/config/oss/rbac/workflow_campaigncontainer_editor_role.yaml new file mode 100644 index 000000000..9b251ff00 --- /dev/null +++ b/k8s/config/oss/rbac/workflow_campaigncontainer_editor_role.yaml @@ -0,0 +1,31 @@ +# permissions for end users to edit campaigncontainers. +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRole +metadata: + labels: + app.kubernetes.io/name: clusterrole + app.kubernetes.io/instance: campaigncontainer-editor-role + app.kubernetes.io/component: rbac + app.kubernetes.io/created-by: symphony-k8s + app.kubernetes.io/part-of: symphony-k8s + app.kubernetes.io/managed-by: kustomize + name: campaigncontainer-editor-role +rules: +- apiGroups: + - workflow.symphony + resources: + - campaigncontainers + verbs: + - create + - delete + - get + - list + - patch + - update + - watch +- apiGroups: + - workflow.symphony + resources: + - campaigncontainers/status + verbs: + - get diff --git a/k8s/config/oss/rbac/workflow_campaigncontainer_viewer_role.yaml b/k8s/config/oss/rbac/workflow_campaigncontainer_viewer_role.yaml new file mode 100644 index 000000000..707e21fd8 --- /dev/null +++ b/k8s/config/oss/rbac/workflow_campaigncontainer_viewer_role.yaml @@ -0,0 +1,33 @@ +## +## Copyright (c) Microsoft Corporation. +## Licensed under the MIT license. +## SPDX-License-Identifier: MIT +## + +# permissions for end users to view campaigncontainers. +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRole +metadata: + labels: + app.kubernetes.io/name: clusterrole + app.kubernetes.io/instance: campaigncontainer-viewer-role + app.kubernetes.io/component: rbac + app.kubernetes.io/created-by: symphony-k8s + app.kubernetes.io/part-of: symphony-k8s + app.kubernetes.io/managed-by: kustomize + name: campaigncontainer-viewer-role +rules: +- apiGroups: + - workflow.symphony + resources: + - campaigncontainers + verbs: + - get + - list + - watch +- apiGroups: + - workflow.symphony + resources: + - campaigncontainers/status + verbs: + - get diff --git a/k8s/config/oss/samples/fabric_v1_targetcontainer.yaml b/k8s/config/oss/samples/fabric_v1_targetcontainer.yaml new file mode 100644 index 000000000..acaf933b7 --- /dev/null +++ b/k8s/config/oss/samples/fabric_v1_targetcontainer.yaml @@ -0,0 +1,12 @@ +apiVersion: fabric.symphony/v1 +kind: TargetContainer +metadata: + labels: + app.kubernetes.io/name: targetcontainer + app.kubernetes.io/instance: targetcontainer-sample + app.kubernetes.io/part-of: symphony-k8s + app.kubernetes.io/managed-by: kustomize + app.kubernetes.io/created-by: symphony-k8s + name: targetcontainer-sample +spec: + # TODO(user): Add fields here diff --git a/k8s/config/oss/samples/federation_v1_catalogcontainer.yaml b/k8s/config/oss/samples/federation_v1_catalogcontainer.yaml new file mode 100644 index 000000000..8950ec6c9 --- /dev/null +++ b/k8s/config/oss/samples/federation_v1_catalogcontainer.yaml @@ -0,0 +1,12 @@ +apiVersion: federation.symphony/v1 +kind: CatalogContainer +metadata: + labels: + app.kubernetes.io/name: catalogcontainer + app.kubernetes.io/instance: catalogcontainer-sample + app.kubernetes.io/part-of: symphony-k8s + app.kubernetes.io/managed-by: kustomize + app.kubernetes.io/created-by: symphony-k8s + name: catalogcontainer-sample +spec: + # TODO(user): Add fields here diff --git a/k8s/config/oss/samples/solution_v1_instancecontainer.yaml b/k8s/config/oss/samples/solution_v1_instancecontainer.yaml new file mode 100644 index 000000000..3289cbb5d --- /dev/null +++ b/k8s/config/oss/samples/solution_v1_instancecontainer.yaml @@ -0,0 +1,12 @@ +apiVersion: solution.symphony/v1 +kind: InstanceContainer +metadata: + labels: + app.kubernetes.io/name: instancecontainer + app.kubernetes.io/instance: instancecontainer-sample + app.kubernetes.io/part-of: symphony-k8s + app.kubernetes.io/managed-by: kustomize + app.kubernetes.io/created-by: symphony-k8s + name: instancecontainer-sample +spec: + # TODO(user): Add fields here diff --git a/k8s/config/oss/samples/solution_v1_solutioncontainer.yaml b/k8s/config/oss/samples/solution_v1_solutioncontainer.yaml new file mode 100644 index 000000000..6b7ca4f89 --- /dev/null +++ b/k8s/config/oss/samples/solution_v1_solutioncontainer.yaml @@ -0,0 +1,12 @@ +apiVersion: solution.symphony/v1 +kind: SolutionContainer +metadata: + labels: + app.kubernetes.io/name: solutioncontainer + app.kubernetes.io/instance: solutioncontainer-sample + app.kubernetes.io/part-of: symphony-k8s + app.kubernetes.io/managed-by: kustomize + app.kubernetes.io/created-by: symphony-k8s + name: solutioncontainer-sample +spec: + # TODO(user): Add fields here diff --git a/k8s/config/oss/samples/workflow_v1_campaigncontainer.yaml b/k8s/config/oss/samples/workflow_v1_campaigncontainer.yaml new file mode 100644 index 000000000..bcbacd494 --- /dev/null +++ b/k8s/config/oss/samples/workflow_v1_campaigncontainer.yaml @@ -0,0 +1,12 @@ +apiVersion: workflow.symphony/v1 +kind: CampaignContainer +metadata: + labels: + app.kubernetes.io/name: campaigncontainer + app.kubernetes.io/instance: campaigncontainer-sample + app.kubernetes.io/part-of: symphony-k8s + app.kubernetes.io/managed-by: kustomize + app.kubernetes.io/created-by: symphony-k8s + name: campaigncontainer-sample +spec: + # TODO(user): Add fields here diff --git a/k8s/controllers/fabric/targetcontainer_controller.go b/k8s/controllers/fabric/targetcontainer_controller.go new file mode 100644 index 000000000..2a8bd527a --- /dev/null +++ b/k8s/controllers/fabric/targetcontainer_controller.go @@ -0,0 +1,52 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT license. + * SPDX-License-Identifier: MIT + */ + +package fabric + +import ( + "context" + + "k8s.io/apimachinery/pkg/runtime" + ctrl "sigs.k8s.io/controller-runtime" + "sigs.k8s.io/controller-runtime/pkg/client" + "sigs.k8s.io/controller-runtime/pkg/log" + + fabricv1 "gopls-workspace/apis/fabric/v1" +) + +// TargetContainerReconciler reconciles a TargetContainer object +type TargetContainerReconciler struct { + client.Client + Scheme *runtime.Scheme +} + +//+kubebuilder:rbac:groups=fabric.symphony,resources=targetcontainers,verbs=get;list;watch;create;update;patch;delete +//+kubebuilder:rbac:groups=fabric.symphony,resources=targetcontainers/status,verbs=get;update;patch +//+kubebuilder:rbac:groups=fabric.symphony,resources=targetcontainers/finalizers,verbs=update + +// Reconcile is part of the main kubernetes reconciliation loop which aims to +// move the current state of the cluster closer to the desired state. +// TODO(user): Modify the Reconcile function to compare the state specified by +// the TargetContainer object against the actual cluster state, and then +// perform operations to make the cluster state reflect the state specified by +// the user. +// +// For more details, check Reconcile and its Result here: +// - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.14.4/pkg/reconcile +func (r *TargetContainerReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error) { + _ = log.FromContext(ctx) + + // TODO(user): your logic here + + return ctrl.Result{}, nil +} + +// SetupWithManager sets up the controller with the Manager. +func (r *TargetContainerReconciler) SetupWithManager(mgr ctrl.Manager) error { + return ctrl.NewControllerManagedBy(mgr). + For(&fabricv1.TargetContainer{}). + Complete(r) +} diff --git a/k8s/controllers/federation/catalogcontainer_controller.go b/k8s/controllers/federation/catalogcontainer_controller.go new file mode 100644 index 000000000..e048d37e6 --- /dev/null +++ b/k8s/controllers/federation/catalogcontainer_controller.go @@ -0,0 +1,52 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT license. + * SPDX-License-Identifier: MIT + */ + +package federation + +import ( + "context" + + "k8s.io/apimachinery/pkg/runtime" + ctrl "sigs.k8s.io/controller-runtime" + "sigs.k8s.io/controller-runtime/pkg/client" + "sigs.k8s.io/controller-runtime/pkg/log" + + federationv1 "gopls-workspace/apis/federation/v1" +) + +// CatalogContainerReconciler reconciles a CatalogContainer object +type CatalogContainerReconciler struct { + client.Client + Scheme *runtime.Scheme +} + +//+kubebuilder:rbac:groups=federation.symphony,resources=catalogcontainers,verbs=get;list;watch;create;update;patch;delete +//+kubebuilder:rbac:groups=federation.symphony,resources=catalogcontainers/status,verbs=get;update;patch +//+kubebuilder:rbac:groups=federation.symphony,resources=catalogcontainers/finalizers,verbs=update + +// Reconcile is part of the main kubernetes reconciliation loop which aims to +// move the current state of the cluster closer to the desired state. +// TODO(user): Modify the Reconcile function to compare the state specified by +// the CatalogContainer object against the actual cluster state, and then +// perform operations to make the cluster state reflect the state specified by +// the user. +// +// For more details, check Reconcile and its Result here: +// - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.14.4/pkg/reconcile +func (r *CatalogContainerReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error) { + _ = log.FromContext(ctx) + + // TODO(user): your logic here + + return ctrl.Result{}, nil +} + +// SetupWithManager sets up the controller with the Manager. +func (r *CatalogContainerReconciler) SetupWithManager(mgr ctrl.Manager) error { + return ctrl.NewControllerManagedBy(mgr). + For(&federationv1.CatalogContainer{}). + Complete(r) +} diff --git a/k8s/controllers/solution/instancecontainer_controller.go b/k8s/controllers/solution/instancecontainer_controller.go new file mode 100644 index 000000000..08a5a3c4d --- /dev/null +++ b/k8s/controllers/solution/instancecontainer_controller.go @@ -0,0 +1,52 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT license. + * SPDX-License-Identifier: MIT + */ + +package solution + +import ( + "context" + + "k8s.io/apimachinery/pkg/runtime" + ctrl "sigs.k8s.io/controller-runtime" + "sigs.k8s.io/controller-runtime/pkg/client" + "sigs.k8s.io/controller-runtime/pkg/log" + + solutionv1 "gopls-workspace/apis/solution/v1" +) + +// InstanceContainerReconciler reconciles a InstanceContainer object +type InstanceContainerReconciler struct { + client.Client + Scheme *runtime.Scheme +} + +//+kubebuilder:rbac:groups=solution.symphony,resources=instancecontainers,verbs=get;list;watch;create;update;patch;delete +//+kubebuilder:rbac:groups=solution.symphony,resources=instancecontainers/status,verbs=get;update;patch +//+kubebuilder:rbac:groups=solution.symphony,resources=instancecontainers/finalizers,verbs=update + +// Reconcile is part of the main kubernetes reconciliation loop which aims to +// move the current state of the cluster closer to the desired state. +// TODO(user): Modify the Reconcile function to compare the state specified by +// the InstanceContainer object against the actual cluster state, and then +// perform operations to make the cluster state reflect the state specified by +// the user. +// +// For more details, check Reconcile and its Result here: +// - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.14.4/pkg/reconcile +func (r *InstanceContainerReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error) { + _ = log.FromContext(ctx) + + // TODO(user): your logic here + + return ctrl.Result{}, nil +} + +// SetupWithManager sets up the controller with the Manager. +func (r *InstanceContainerReconciler) SetupWithManager(mgr ctrl.Manager) error { + return ctrl.NewControllerManagedBy(mgr). + For(&solutionv1.InstanceContainer{}). + Complete(r) +} diff --git a/k8s/controllers/solution/solutioncontainer_controller.go b/k8s/controllers/solution/solutioncontainer_controller.go new file mode 100644 index 000000000..97f0691f4 --- /dev/null +++ b/k8s/controllers/solution/solutioncontainer_controller.go @@ -0,0 +1,52 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT license. + * SPDX-License-Identifier: MIT + */ + +package solution + +import ( + "context" + + solutionv1 "gopls-workspace/apis/solution/v1" + + "k8s.io/apimachinery/pkg/runtime" + ctrl "sigs.k8s.io/controller-runtime" + "sigs.k8s.io/controller-runtime/pkg/client" + "sigs.k8s.io/controller-runtime/pkg/log" +) + +// SolutionContainerReconciler reconciles a SolutionContainer object +type SolutionContainerReconciler struct { + client.Client + Scheme *runtime.Scheme +} + +//+kubebuilder:rbac:groups=solution.symphony,resources=solutioncontainers,verbs=get;list;watch;create;update;patch;delete +//+kubebuilder:rbac:groups=solution.symphony,resources=solutioncontainers/status,verbs=get;update;patch +//+kubebuilder:rbac:groups=solution.symphony,resources=solutioncontainers/finalizers,verbs=update + +// Reconcile is part of the main kubernetes reconciliation loop which aims to +// move the current state of the cluster closer to the desired state. +// TODO(user): Modify the Reconcile function to compare the state specified by +// the SolutionContainer object against the actual cluster state, and then +// perform operations to make the cluster state reflect the state specified by +// the user. +// +// For more details, check Reconcile and its Result here: +// - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.14.4/pkg/reconcile +func (r *SolutionContainerReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error) { + _ = log.FromContext(ctx) + + // TODO(user): your logic here + + return ctrl.Result{}, nil +} + +// SetupWithManager sets up the controller with the Manager. +func (r *SolutionContainerReconciler) SetupWithManager(mgr ctrl.Manager) error { + return ctrl.NewControllerManagedBy(mgr). + For(&solutionv1.SolutionContainer{}). + Complete(r) +} diff --git a/k8s/controllers/workflow/campaigncontainer_controller.go b/k8s/controllers/workflow/campaigncontainer_controller.go new file mode 100644 index 000000000..7bfd80aab --- /dev/null +++ b/k8s/controllers/workflow/campaigncontainer_controller.go @@ -0,0 +1,52 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT license. + * SPDX-License-Identifier: MIT + */ + +package workflow + +import ( + "context" + + "k8s.io/apimachinery/pkg/runtime" + ctrl "sigs.k8s.io/controller-runtime" + "sigs.k8s.io/controller-runtime/pkg/client" + "sigs.k8s.io/controller-runtime/pkg/log" + + workflowv1 "gopls-workspace/apis/workflow/v1" +) + +// CampaignContainerReconciler reconciles a CampaignContainer object +type CampaignContainerReconciler struct { + client.Client + Scheme *runtime.Scheme +} + +//+kubebuilder:rbac:groups=workflow.symphony,resources=campaigncontainers,verbs=get;list;watch;create;update;patch;delete +//+kubebuilder:rbac:groups=workflow.symphony,resources=campaigncontainers/status,verbs=get;update;patch +//+kubebuilder:rbac:groups=workflow.symphony,resources=campaigncontainers/finalizers,verbs=update + +// Reconcile is part of the main kubernetes reconciliation loop which aims to +// move the current state of the cluster closer to the desired state. +// TODO(user): Modify the Reconcile function to compare the state specified by +// the CampaignContainer object against the actual cluster state, and then +// perform operations to make the cluster state reflect the state specified by +// the user. +// +// For more details, check Reconcile and its Result here: +// - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.14.4/pkg/reconcile +func (r *CampaignContainerReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error) { + _ = log.FromContext(ctx) + + // TODO(user): your logic here + + return ctrl.Result{}, nil +} + +// SetupWithManager sets up the controller with the Manager. +func (r *CampaignContainerReconciler) SetupWithManager(mgr ctrl.Manager) error { + return ctrl.NewControllerManagedBy(mgr). + For(&workflowv1.CampaignContainer{}). + Complete(r) +} diff --git a/k8s/main.go b/k8s/main.go index adc91a858..84159ddfd 100644 --- a/k8s/main.go +++ b/k8s/main.go @@ -299,6 +299,41 @@ func main() { os.Exit(1) } } + if err = (&solutioncontrollers.SolutionContainerReconciler{ + Client: mgr.GetClient(), + Scheme: mgr.GetScheme(), + }).SetupWithManager(mgr); err != nil { + setupLog.Error(err, "unable to create controller", "controller", "SolutionContainer") + os.Exit(1) + } + if err = (&federationcontrollers.CatalogContainerReconciler{ + Client: mgr.GetClient(), + Scheme: mgr.GetScheme(), + }).SetupWithManager(mgr); err != nil { + setupLog.Error(err, "unable to create controller", "controller", "CatalogContainer") + os.Exit(1) + } + if err = (&fabriccontrollers.TargetContainerReconciler{ + Client: mgr.GetClient(), + Scheme: mgr.GetScheme(), + }).SetupWithManager(mgr); err != nil { + setupLog.Error(err, "unable to create controller", "controller", "TargetContainer") + os.Exit(1) + } + if err = (&workflowcontrollers.CampaignContainerReconciler{ + Client: mgr.GetClient(), + Scheme: mgr.GetScheme(), + }).SetupWithManager(mgr); err != nil { + setupLog.Error(err, "unable to create controller", "controller", "CampaignContainer") + os.Exit(1) + } + if err = (&solutioncontrollers.InstanceContainerReconciler{ + Client: mgr.GetClient(), + Scheme: mgr.GetScheme(), + }).SetupWithManager(mgr); err != nil { + setupLog.Error(err, "unable to create controller", "controller", "InstanceContainer") + os.Exit(1) + } //+kubebuilder:scaffold:builder if err := mgr.AddHealthzCheck("healthz", healthz.Ping); err != nil { diff --git a/packages/helm/symphony/templates/symphony-core/symphonyk8s.yaml b/packages/helm/symphony/templates/symphony-core/symphonyk8s.yaml index dcd872d7d..72e7999ae 100644 --- a/packages/helm/symphony/templates/symphony-core/symphonyk8s.yaml +++ b/packages/helm/symphony/templates/symphony-core/symphonyk8s.yaml @@ -93,6 +93,117 @@ spec: --- apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition +metadata: + annotations: + controller-gen.kubebuilder.io/version: v0.11.1 + creationTimestamp: null + name: campaigncontainers.workflow.symphony +spec: + group: workflow.symphony + names: + kind: CampaignContainer + listKind: CampaignContainerList + plural: campaigncontainers + singular: campaigncontainer + scope: Namespaced + versions: + - name: v1 + schema: + openAPIV3Schema: + description: CampaignContainer is the Schema for the campaigns API + properties: + apiVersion: + description: 'APIVersion defines the versioned schema of this representation + of an object. Servers should convert recognized schemas to the latest + internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' + type: string + kind: + description: 'Kind is a string value representing the REST resource this + object represents. Servers may infer this from the endpoint the client + submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' + type: string + metadata: + type: object + spec: + properties: + displayName: + type: string + type: object + status: + properties: + lastModified: + format: date-time + type: string + properties: + additionalProperties: + type: string + type: object + provisioningStatus: + description: Defines the state of the ARM resource for long running + operations + properties: + error: + description: Defines an error in the ARM resource for long running + operations + properties: + code: + type: string + details: + items: + description: Defines an error for symphony target + properties: + code: + type: string + details: + items: + description: Defines an error for components defined + in symphony + properties: + code: + type: string + message: + type: string + target: + type: string + type: object + type: array + message: + type: string + target: + type: string + type: object + type: array + message: + type: string + target: + type: string + type: object + failureCause: + type: string + logErrors: + type: boolean + operationId: + type: string + output: + additionalProperties: + type: string + type: object + status: + type: string + required: + - operationId + - status + type: object + required: + - properties + - provisioningStatus + type: object + type: object + served: true + storage: true +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition metadata: annotations: cert-manager.io/inject-ca-from: '{{ .Release.Namespace }}/{{ include "symphony.fullname" @@ -182,6 +293,119 @@ spec: --- apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition +metadata: + annotations: + controller-gen.kubebuilder.io/version: v0.11.1 + creationTimestamp: null + name: catalogcontainers.federation.symphony +spec: + group: federation.symphony + names: + kind: CatalogContainer + listKind: CatalogContainerList + plural: catalogcontainers + singular: catalogcontainer + scope: Namespaced + versions: + - name: v1 + schema: + openAPIV3Schema: + description: CatalogContainer is the Schema for the catalogs API + properties: + apiVersion: + description: 'APIVersion defines the versioned schema of this representation + of an object. Servers should convert recognized schemas to the latest + internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' + type: string + kind: + description: 'Kind is a string value representing the REST resource this + object represents. Servers may infer this from the endpoint the client + submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' + type: string + metadata: + type: object + spec: + properties: + displayName: + type: string + type: object + status: + properties: + lastModified: + format: date-time + type: string + properties: + additionalProperties: + type: string + type: object + provisioningStatus: + description: Defines the state of the ARM resource for long running + operations + properties: + error: + description: Defines an error in the ARM resource for long running + operations + properties: + code: + type: string + details: + items: + description: Defines an error for symphony target + properties: + code: + type: string + details: + items: + description: Defines an error for components defined + in symphony + properties: + code: + type: string + message: + type: string + target: + type: string + type: object + type: array + message: + type: string + target: + type: string + type: object + type: array + message: + type: string + target: + type: string + type: object + failureCause: + type: string + logErrors: + type: boolean + operationId: + type: string + output: + additionalProperties: + type: string + type: object + status: + type: string + required: + - operationId + - status + type: object + required: + - properties + - provisioningStatus + type: object + type: object + served: true + storage: true + subresources: + status: {} +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition metadata: annotations: cert-manager.io/inject-ca-from: '{{ .Release.Namespace }}/{{ include "symphony.fullname" @@ -346,26 +570,139 @@ spec: type: string role: type: string - required: - - provider - - role - type: object - type: array - displayName: - type: string - properties: - additionalProperties: - type: string - type: object - type: object - status: - description: DeviceStatus defines the observed state of Device - properties: - properties: - additionalProperties: - type: string - description: Device properties + required: + - provider + - role + type: object + type: array + displayName: + type: string + properties: + additionalProperties: + type: string + type: object + type: object + status: + description: DeviceStatus defines the observed state of Device + properties: + properties: + additionalProperties: + type: string + description: Device properties + type: object + type: object + type: object + served: true + storage: true + subresources: + status: {} +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + controller-gen.kubebuilder.io/version: v0.11.1 + creationTimestamp: null + name: instancecontainers.solution.symphony +spec: + group: solution.symphony + names: + kind: InstanceContainer + listKind: InstanceContainerList + plural: instancecontainers + singular: instancecontainer + scope: Namespaced + versions: + - name: v1 + schema: + openAPIV3Schema: + description: InstanceContainer is the Schema for the InstanceContainers API + properties: + apiVersion: + description: 'APIVersion defines the versioned schema of this representation + of an object. Servers should convert recognized schemas to the latest + internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' + type: string + kind: + description: 'Kind is a string value representing the REST resource this + object represents. Servers may infer this from the endpoint the client + submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' + type: string + metadata: + type: object + spec: + properties: + displayName: + type: string + type: object + status: + properties: + lastModified: + format: date-time + type: string + properties: + additionalProperties: + type: string + type: object + provisioningStatus: + description: Defines the state of the ARM resource for long running + operations + properties: + error: + description: Defines an error in the ARM resource for long running + operations + properties: + code: + type: string + details: + items: + description: Defines an error for symphony target + properties: + code: + type: string + details: + items: + description: Defines an error for components defined + in symphony + properties: + code: + type: string + message: + type: string + target: + type: string + type: object + type: array + message: + type: string + target: + type: string + type: object + type: array + message: + type: string + target: + type: string + type: object + failureCause: + type: string + logErrors: + type: boolean + operationId: + type: string + output: + additionalProperties: + type: string + type: object + status: + type: string + required: + - operationId + - status type: object + required: + - properties + - provisioningStatus type: object type: object served: true @@ -1080,6 +1417,119 @@ spec: --- apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition +metadata: + annotations: + controller-gen.kubebuilder.io/version: v0.11.1 + creationTimestamp: null + name: solutioncontainers.solution.symphony +spec: + group: solution.symphony + names: + kind: SolutionContainer + listKind: SolutionContainerList + plural: solutioncontainers + singular: solutioncontainer + scope: Namespaced + versions: + - name: v1 + schema: + openAPIV3Schema: + description: SolutionContainer is the Schema for the SolutionContainer API + properties: + apiVersion: + description: 'APIVersion defines the versioned schema of this representation + of an object. Servers should convert recognized schemas to the latest + internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' + type: string + kind: + description: 'Kind is a string value representing the REST resource this + object represents. Servers may infer this from the endpoint the client + submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' + type: string + metadata: + type: object + spec: + properties: + displayName: + type: string + type: object + status: + properties: + lastModified: + format: date-time + type: string + properties: + additionalProperties: + type: string + type: object + provisioningStatus: + description: Defines the state of the ARM resource for long running + operations + properties: + error: + description: Defines an error in the ARM resource for long running + operations + properties: + code: + type: string + details: + items: + description: Defines an error for symphony target + properties: + code: + type: string + details: + items: + description: Defines an error for components defined + in symphony + properties: + code: + type: string + message: + type: string + target: + type: string + type: object + type: array + message: + type: string + target: + type: string + type: object + type: array + message: + type: string + target: + type: string + type: object + failureCause: + type: string + logErrors: + type: boolean + operationId: + type: string + output: + additionalProperties: + type: string + type: object + status: + type: string + required: + - operationId + - status + type: object + required: + - properties + - provisioningStatus + type: object + type: object + served: true + storage: true + subresources: + status: {} +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition metadata: annotations: cert-manager.io/inject-ca-from: '{{ .Release.Namespace }}/{{ include "symphony.fullname" @@ -1226,6 +1676,125 @@ spec: --- apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition +metadata: + annotations: + controller-gen.kubebuilder.io/version: v0.11.1 + creationTimestamp: null + name: targetcontainers.fabric.symphony +spec: + group: fabric.symphony + names: + kind: TargetContainer + listKind: TargetContainerList + plural: targetcontainers + singular: targetcontainer + scope: Namespaced + versions: + - additionalPrinterColumns: + - jsonPath: .status.properties.status + name: Status + type: string + name: v1 + schema: + openAPIV3Schema: + description: Target is the Schema for the targets API + properties: + apiVersion: + description: 'APIVersion defines the versioned schema of this representation + of an object. Servers should convert recognized schemas to the latest + internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' + type: string + kind: + description: 'Kind is a string value representing the REST resource this + object represents. Servers may infer this from the endpoint the client + submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' + type: string + metadata: + type: object + spec: + properties: + displayName: + type: string + type: object + status: + description: TargetContainerStatus defines the observed state of Target + properties: + lastModified: + format: date-time + type: string + properties: + additionalProperties: + type: string + description: 'Important: Run "make" to regenerate code after modifying + this file' + type: object + provisioningStatus: + description: Defines the state of the ARM resource for long running + operations + properties: + error: + description: Defines an error in the ARM resource for long running + operations + properties: + code: + type: string + details: + items: + description: Defines an error for symphony target + properties: + code: + type: string + details: + items: + description: Defines an error for components defined + in symphony + properties: + code: + type: string + message: + type: string + target: + type: string + type: object + type: array + message: + type: string + target: + type: string + type: object + type: array + message: + type: string + target: + type: string + type: object + failureCause: + type: string + logErrors: + type: boolean + operationId: + type: string + output: + additionalProperties: + type: string + type: object + status: + type: string + required: + - operationId + - status + type: object + required: + - provisioningStatus + type: object + type: object + served: true + storage: true + subresources: + status: {} +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition metadata: annotations: cert-manager.io/inject-ca-from: '{{ .Release.Namespace }}/{{ include "symphony.fullname" From 3ab2499350cb50efb1eaf8e9c3779ea176ee0617 Mon Sep 17 00:00:00 2001 From: Xingdong Li Date: Mon, 6 May 2024 15:26:11 +0800 Subject: [PATCH 2/7] Remove CatalogSpec.SiteId (#11) --- api/pkg/apis/v1alpha1/providers/target/staging/staging.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/api/pkg/apis/v1alpha1/providers/target/staging/staging.go b/api/pkg/apis/v1alpha1/providers/target/staging/staging.go index f4daba08d..93475fd8b 100644 --- a/api/pkg/apis/v1alpha1/providers/target/staging/staging.go +++ b/api/pkg/apis/v1alpha1/providers/target/staging/staging.go @@ -181,7 +181,11 @@ func (i *StagingTargetProvider) Apply(ctx context.Context, deployment model.Depl if catalog.Spec == nil { catalog.ObjectMeta.Name = deployment.Instance.ObjectMeta.Name + "-" + i.Config.TargetName catalog.Spec = &model.CatalogSpec{ +<<<<<<< HEAD Type: "staged", +======= + Type: "staged", +>>>>>>> 9e6abf3 (Remove CatalogSpec.SiteId (#11)) } } if catalog.Spec.Properties == nil { From 93c4ac0fff6cda3cc1902544c866df2e3f0556e3 Mon Sep 17 00:00:00 2001 From: Lency Qian Date: Mon, 6 May 2024 20:31:12 +0800 Subject: [PATCH 3/7] fix rbac roles --- k8s/config/oss/rbac/role.yaml | 130 ++++++++++++++++++++++++++++++++++ 1 file changed, 130 insertions(+) diff --git a/k8s/config/oss/rbac/role.yaml b/k8s/config/oss/rbac/role.yaml index e4801774a..4e68b4698 100644 --- a/k8s/config/oss/rbac/role.yaml +++ b/k8s/config/oss/rbac/role.yaml @@ -373,4 +373,134 @@ rules: verbs: - get - patch + - update +- apiGroups: + - workflow.symphony + resources: + - campaigncontainers + verbs: + - create + - delete + - get + - list + - patch + - update + - watch +- apiGroups: + - workflow.symphony + resources: + - campaigncontainers/finalizers + verbs: + - update +- apiGroups: + - workflow.symphony + resources: + - campaigncontainers/status + verbs: + - get + - patch + - update +- apiGroups: + - solution.symphony + resources: + - instancecontainers + verbs: + - create + - delete + - get + - list + - patch + - update + - watch +- apiGroups: + - solution.symphony + resources: + - instancecontainers/finalizers + verbs: + - update +- apiGroups: + - solution.symphony + resources: + - instancecontainers/status + verbs: + - get + - patch + - update +- apiGroups: + - solution.symphony + resources: + - solutioncontainers + verbs: + - create + - delete + - get + - list + - patch + - update + - watch +- apiGroups: + - solution.symphony + resources: + - solutioncontainers/finalizers + verbs: + - update +- apiGroups: + - solution.symphony + resources: + - solutioncontainers/status + verbs: + - get + - patch + - update +- apiGroups: + - fabric.symphony + resources: + - targetcontainers + verbs: + - create + - delete + - get + - list + - patch + - update + - watch +- apiGroups: + - fabric.symphony + resources: + - targetcontainers/finalizers + verbs: + - update +- apiGroups: + - fabric.symphony + resources: + - targetcontainers/status + verbs: + - get + - patch + - update +- apiGroups: + - federation.symphony + resources: + - catalogcontainers + verbs: + - create + - delete + - get + - list + - patch + - update + - watch +- apiGroups: + - federation.symphony + resources: + - catalogcontainers/finalizers + verbs: + - update +- apiGroups: + - federation.symphony + resources: + - catalogcontainers/status + verbs: + - get + - patch - update \ No newline at end of file From 7cb3f50f563af3d0d2d5419a13b2308dc8fcf93e Mon Sep 17 00:00:00 2001 From: Lency Qian Date: Mon, 6 May 2024 21:20:14 +0800 Subject: [PATCH 4/7] generate symphony yaml --- k8s/magefile.go | 2 +- .../templates/symphony-core/symphonyk8s.yaml | 130 ++++++++++++++++++ 2 files changed, 131 insertions(+), 1 deletion(-) diff --git a/k8s/magefile.go b/k8s/magefile.go index cf538fa90..ebdcfd181 100644 --- a/k8s/magefile.go +++ b/k8s/magefile.go @@ -46,7 +46,7 @@ func Manifests() error { mg.Deps(ensureControllerGen) return shellcmd.RunAll( shellcmd.Command("rm -rf config/oss/crd/bases"), - controllerGen.Command("rbac:roleName=manager-role crd webhook paths=./apis/ai/v1 paths=./apis/fabric/v1 paths=./apis/solution/v1 paths=./apis/workflow/v1 paths=./apis/federation/v1 output:crd:artifacts:config=config/oss/crd/bases output:webhook:artifacts:config=config/oss/webhook"), + controllerGen.Command("rbac:roleName=manager-role crd webhook paths=./apis/ai/v1 paths=./apis/fabric/v1 paths=./apis/solution/v1 paths=./apis/workflow/v1 paths=./apis/federation/v1 output:crd:artifacts:config=config/oss/crd/bases output:webhook:artifacts:config=config/oss/webhook output:rbac:artifacts:config=config/oss/rbac"), ) } diff --git a/packages/helm/symphony/templates/symphony-core/symphonyk8s.yaml b/packages/helm/symphony/templates/symphony-core/symphonyk8s.yaml index 72e7999ae..bdc8cafad 100644 --- a/packages/helm/symphony/templates/symphony-core/symphonyk8s.yaml +++ b/packages/helm/symphony/templates/symphony-core/symphonyk8s.yaml @@ -2467,6 +2467,136 @@ rules: - get - patch - update +- apiGroups: + - workflow.symphony + resources: + - campaigncontainers + verbs: + - create + - delete + - get + - list + - patch + - update + - watch +- apiGroups: + - workflow.symphony + resources: + - campaigncontainers/finalizers + verbs: + - update +- apiGroups: + - workflow.symphony + resources: + - campaigncontainers/status + verbs: + - get + - patch + - update +- apiGroups: + - solution.symphony + resources: + - instancecontainers + verbs: + - create + - delete + - get + - list + - patch + - update + - watch +- apiGroups: + - solution.symphony + resources: + - instancecontainers/finalizers + verbs: + - update +- apiGroups: + - solution.symphony + resources: + - instancecontainers/status + verbs: + - get + - patch + - update +- apiGroups: + - solution.symphony + resources: + - solutioncontainers + verbs: + - create + - delete + - get + - list + - patch + - update + - watch +- apiGroups: + - solution.symphony + resources: + - solutioncontainers/finalizers + verbs: + - update +- apiGroups: + - solution.symphony + resources: + - solutioncontainers/status + verbs: + - get + - patch + - update +- apiGroups: + - fabric.symphony + resources: + - targetcontainers + verbs: + - create + - delete + - get + - list + - patch + - update + - watch +- apiGroups: + - fabric.symphony + resources: + - targetcontainers/finalizers + verbs: + - update +- apiGroups: + - fabric.symphony + resources: + - targetcontainers/status + verbs: + - get + - patch + - update +- apiGroups: + - federation.symphony + resources: + - catalogcontainers + verbs: + - create + - delete + - get + - list + - patch + - update + - watch +- apiGroups: + - federation.symphony + resources: + - catalogcontainers/finalizers + verbs: + - update +- apiGroups: + - federation.symphony + resources: + - catalogcontainers/status + verbs: + - get + - patch + - update --- apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRole From e72170f4c7b1d2be7d0bce438e4d67bcdaec042c Mon Sep 17 00:00:00 2001 From: Lency Qian Date: Wed, 8 May 2024 11:06:33 +0800 Subject: [PATCH 5/7] update crds --- api/pkg/apis/v1alpha1/model/campaign.go | 8 +- .../apis/v1alpha1/model/campaigncontainer.go | 19 +- api/pkg/apis/v1alpha1/model/catalog.go | 14 +- .../apis/v1alpha1/model/catalogcontainer.go | 19 +- api/pkg/apis/v1alpha1/model/instance.go | 22 +- .../apis/v1alpha1/model/instancecontainer.go | 19 +- api/pkg/apis/v1alpha1/model/solution.go | 8 +- .../apis/v1alpha1/model/solutioncontainer.go | 19 +- api/pkg/apis/v1alpha1/model/target.go | 2 + .../apis/v1alpha1/model/targetcontainer.go | 19 +- k8s/apis/fabric/v1/targetcontainer_types.go | 6 +- k8s/apis/fabric/v1/zz_generated.deepcopy.go | 2 - .../federation/v1/catalogcontainer_types.go | 5 +- .../federation/v1/zz_generated.deepcopy.go | 2 - k8s/apis/model/v1/common_types.go | 59 +-- .../solution/v1/instancecontainer_types.go | 5 +- .../solution/v1/solutioncontainer_types.go | 5 +- k8s/apis/solution/v1/zz_generated.deepcopy.go | 4 - .../workflow/v1/campaigncontainer_types.go | 6 +- k8s/apis/workflow/v1/zz_generated.deepcopy.go | 2 - .../fabric.symphony_targetcontainers.yaml | 70 +--- .../crd/bases/fabric.symphony_targets.yaml | 4 + ...federation.symphony_catalogcontainers.yaml | 63 ---- .../bases/federation.symphony_catalogs.yaml | 4 + .../solution.symphony_instancecontainers.yaml | 63 ---- .../bases/solution.symphony_instances.yaml | 4 + .../solution.symphony_solutioncontainers.yaml | 63 ---- .../bases/solution.symphony_solutions.yaml | 3 +- .../workflow.symphony_campaigncontainers.yaml | 65 +--- .../bases/workflow.symphony_campaigns.yaml | 4 + .../templates/symphony-core/symphonyk8s.yaml | 343 ++---------------- 31 files changed, 146 insertions(+), 785 deletions(-) diff --git a/api/pkg/apis/v1alpha1/model/campaign.go b/api/pkg/apis/v1alpha1/model/campaign.go index 4c5f22458..80c4f685d 100644 --- a/api/pkg/apis/v1alpha1/model/campaign.go +++ b/api/pkg/apis/v1alpha1/model/campaign.go @@ -126,9 +126,11 @@ func (c ActivationState) DeepEquals(other IDeepEquals) (bool, error) { } type CampaignSpec struct { - FirstStage string `json:"firstStage,omitempty"` - Stages map[string]StageSpec `json:"stages,omitempty"` - SelfDriving bool `json:"selfDriving,omitempty"` + FirstStage string `json:"firstStage,omitempty"` + Stages map[string]StageSpec `json:"stages,omitempty"` + SelfDriving bool `json:"selfDriving,omitempty"` + Version string `json:"version,omitempty"` + RootResource string `json:"rootResource,omitempty"` } func (c CampaignSpec) DeepEquals(other IDeepEquals) (bool, error) { diff --git a/api/pkg/apis/v1alpha1/model/campaigncontainer.go b/api/pkg/apis/v1alpha1/model/campaigncontainer.go index c83928b18..0e67a95d7 100644 --- a/api/pkg/apis/v1alpha1/model/campaigncontainer.go +++ b/api/pkg/apis/v1alpha1/model/campaigncontainer.go @@ -11,24 +11,19 @@ import ( ) type CampaignContainerState struct { - ObjectMeta ObjectMeta `json:"metadata,omitempty"` - Spec *CampaignContainerSpec `json:"spec,omitempty"` + ObjectMeta ObjectMeta `json:"metadata,omitempty"` + Spec *CampaignContainerSpec `json:"spec,omitempty"` + Status *CampaignContainerStatus `json:"status,omitempty"` } type CampaignContainerSpec struct { - Name string `json:"name,omitempty"` } -func (c CampaignContainerSpec) DeepEquals(other IDeepEquals) (bool, error) { - otherC, ok := other.(CampaignContainerSpec) - if !ok { - return false, errors.New("parameter is not a CampaignContainerSpec type") - } - - if c.Name != otherC.Name { - return false, nil - } +type CampaignContainerStatus struct { + Properties map[string]string `json:"properties"` +} +func (c CampaignContainerSpec) DeepEquals(other IDeepEquals) (bool, error) { return true, nil } diff --git a/api/pkg/apis/v1alpha1/model/catalog.go b/api/pkg/apis/v1alpha1/model/catalog.go index 7a912f779..e1ec3eb70 100644 --- a/api/pkg/apis/v1alpha1/model/catalog.go +++ b/api/pkg/apis/v1alpha1/model/catalog.go @@ -31,12 +31,14 @@ type ObjectRef struct { Metadata map[string]string `json:"metadata,omitempty"` } type CatalogSpec struct { - Type string `json:"type"` - Metadata map[string]string `json:"metadata,omitempty"` - Properties map[string]interface{} `json:"properties"` - ParentName string `json:"parentName,omitempty"` - ObjectRef ObjectRef `json:"objectRef,omitempty"` - Generation string `json:"generation,omitempty"` + Type string `json:"type"` + Metadata map[string]string `json:"metadata,omitempty"` + Properties map[string]interface{} `json:"properties"` + ParentName string `json:"parentName,omitempty"` + ObjectRef ObjectRef `json:"objectRef,omitempty"` + Generation string `json:"generation,omitempty"` + Version string `json:"version,omitempty"` + RootResource string `json:"rootResource,omitempty"` } type CatalogStatus struct { diff --git a/api/pkg/apis/v1alpha1/model/catalogcontainer.go b/api/pkg/apis/v1alpha1/model/catalogcontainer.go index 2ed093ae8..1d09582f4 100644 --- a/api/pkg/apis/v1alpha1/model/catalogcontainer.go +++ b/api/pkg/apis/v1alpha1/model/catalogcontainer.go @@ -12,24 +12,19 @@ import ( // TODO: all state objects should converge to this paradigm: id, spec and status type CatalogContainerState struct { - ObjectMeta ObjectMeta `json:"metadata,omitempty"` - Spec *CatalogContainerSpec `json:"spec,omitempty"` + ObjectMeta ObjectMeta `json:"metadata,omitempty"` + Spec *CatalogContainerSpec `json:"spec,omitempty"` + Status *CatalogContainerStatus `json:"status,omitempty"` } type CatalogContainerSpec struct { - Name string `json:"name"` } -func (c CatalogContainerSpec) DeepEquals(other IDeepEquals) (bool, error) { - otherC, ok := other.(CatalogContainerSpec) - if !ok { - return false, errors.New("parameter is not a CatalogContainerSpec type") - } - - if c.Name != otherC.Name { - return false, nil - } +type CatalogContainerStatus struct { + Properties map[string]string `json:"properties"` +} +func (c CatalogContainerSpec) DeepEquals(other IDeepEquals) (bool, error) { return true, nil } diff --git a/api/pkg/apis/v1alpha1/model/instance.go b/api/pkg/apis/v1alpha1/model/instance.go index 66e983a3b..5c46e1ca3 100644 --- a/api/pkg/apis/v1alpha1/model/instance.go +++ b/api/pkg/apis/v1alpha1/model/instance.go @@ -23,16 +23,18 @@ type ( // InstanceSpec defines the spec property of the InstanceState // +kubebuilder:object:generate=true InstanceSpec struct { - DisplayName string `json:"displayName,omitempty"` - Scope string `json:"scope,omitempty"` - Parameters map[string]string `json:"parameters,omitempty"` //TODO: Do we still need this? - Metadata map[string]string `json:"metadata,omitempty"` - Solution string `json:"solution"` - Target TargetSelector `json:"target,omitempty"` - Topologies []TopologySpec `json:"topologies,omitempty"` - Pipelines []PipelineSpec `json:"pipelines,omitempty"` - Arguments map[string]map[string]string `json:"arguments,omitempty"` - Generation string `json:"generation,omitempty"` + DisplayName string `json:"displayName,omitempty"` + Scope string `json:"scope,omitempty"` + Parameters map[string]string `json:"parameters,omitempty"` //TODO: Do we still need this? + Metadata map[string]string `json:"metadata,omitempty"` + Solution string `json:"solution"` + Target TargetSelector `json:"target,omitempty"` + Topologies []TopologySpec `json:"topologies,omitempty"` + Pipelines []PipelineSpec `json:"pipelines,omitempty"` + Arguments map[string]map[string]string `json:"arguments,omitempty"` + Generation string `json:"generation,omitempty"` + Version string `json:"version,omitempty"` + RootResource string `json:"rootResource,omitempty"` } // TargertRefSpec defines the target the instance will deploy to diff --git a/api/pkg/apis/v1alpha1/model/instancecontainer.go b/api/pkg/apis/v1alpha1/model/instancecontainer.go index 81e09bee8..fab36c5f0 100644 --- a/api/pkg/apis/v1alpha1/model/instancecontainer.go +++ b/api/pkg/apis/v1alpha1/model/instancecontainer.go @@ -11,24 +11,19 @@ import ( ) type InstanceContainerState struct { - ObjectMeta ObjectMeta `json:"metadata,omitempty"` - Spec *InstanceContainerSpec `json:"spec,omitempty"` + ObjectMeta ObjectMeta `json:"metadata,omitempty"` + Spec *InstanceContainerSpec `json:"spec,omitempty"` + Status *InstanceContainerStatus `json:"status,omitempty"` } type InstanceContainerSpec struct { - Name string `json:"name,omitempty"` } -func (c InstanceContainerSpec) DeepEquals(other IDeepEquals) (bool, error) { - otherC, ok := other.(InstanceContainerSpec) - if !ok { - return false, errors.New("parameter is not a InstanceContainerSpec type") - } - - if c.Name != otherC.Name { - return false, nil - } +type InstanceContainerStatus struct { + Properties map[string]string `json:"properties"` +} +func (c InstanceContainerSpec) DeepEquals(other IDeepEquals) (bool, error) { return true, nil } diff --git a/api/pkg/apis/v1alpha1/model/solution.go b/api/pkg/apis/v1alpha1/model/solution.go index a266d4e51..0826b0f8d 100644 --- a/api/pkg/apis/v1alpha1/model/solution.go +++ b/api/pkg/apis/v1alpha1/model/solution.go @@ -17,9 +17,11 @@ type ( } SolutionSpec struct { - DisplayName string `json:"displayName,omitempty"` - Metadata map[string]string `json:"metadata,omitempty"` - Components []ComponentSpec `json:"components,omitempty"` + DisplayName string `json:"displayName,omitempty"` + Metadata map[string]string `json:"metadata,omitempty"` + Components []ComponentSpec `json:"components,omitempty"` + Version string `json:"version,omitempty"` + RootResource string `json:"rootResource,omitempty"` } ) diff --git a/api/pkg/apis/v1alpha1/model/solutioncontainer.go b/api/pkg/apis/v1alpha1/model/solutioncontainer.go index c8c325b11..5988e7adb 100644 --- a/api/pkg/apis/v1alpha1/model/solutioncontainer.go +++ b/api/pkg/apis/v1alpha1/model/solutioncontainer.go @@ -11,24 +11,19 @@ import ( ) type SolutionContainerState struct { - ObjectMeta ObjectMeta `json:"metadata,omitempty"` - Spec *SolutionContainerSpec `json:"spec,omitempty"` + ObjectMeta ObjectMeta `json:"metadata,omitempty"` + Spec *SolutionContainerSpec `json:"spec,omitempty"` + Status *SolutionContainerStatus `json:"status,omitempty"` } type SolutionContainerSpec struct { - Name string `json:"name,omitempty"` } -func (c SolutionContainerSpec) DeepEquals(other IDeepEquals) (bool, error) { - otherC, ok := other.(SolutionContainerSpec) - if !ok { - return false, errors.New("parameter is not a SolutionContainerSpec type") - } - - if c.Name != otherC.Name { - return false, nil - } +type SolutionContainerStatus struct { + Properties map[string]string `json:"properties"` +} +func (c SolutionContainerSpec) DeepEquals(other IDeepEquals) (bool, error) { return true, nil } diff --git a/api/pkg/apis/v1alpha1/model/target.go b/api/pkg/apis/v1alpha1/model/target.go index 245451400..1b7cc5f2c 100644 --- a/api/pkg/apis/v1alpha1/model/target.go +++ b/api/pkg/apis/v1alpha1/model/target.go @@ -31,6 +31,8 @@ type ( Topologies []TopologySpec `json:"topologies,omitempty"` ForceRedeploy bool `json:"forceRedeploy,omitempty"` Generation string `json:"generation,omitempty"` + Version string `json:"version,omitempty"` + RootResource string `json:"rootResource,omitempty"` } ) diff --git a/api/pkg/apis/v1alpha1/model/targetcontainer.go b/api/pkg/apis/v1alpha1/model/targetcontainer.go index ff42fe461..ecd25c7a3 100644 --- a/api/pkg/apis/v1alpha1/model/targetcontainer.go +++ b/api/pkg/apis/v1alpha1/model/targetcontainer.go @@ -11,24 +11,19 @@ import ( ) type TargetContainerState struct { - ObjectMeta ObjectMeta `json:"metadata,omitempty"` - Spec *TargetContainerSpec `json:"spec,omitempty"` + ObjectMeta ObjectMeta `json:"metadata,omitempty"` + Spec *TargetContainerSpec `json:"spec,omitempty"` + Status *TargetContainerStatus `json:"status,omitempty"` } type TargetContainerSpec struct { - Name string `json:"name,omitempty"` } -func (c TargetContainerSpec) DeepEquals(other IDeepEquals) (bool, error) { - otherC, ok := other.(TargetContainerSpec) - if !ok { - return false, errors.New("parameter is not a TargetContainerSpec type") - } - - if c.Name != otherC.Name { - return false, nil - } +type TargetContainerStatus struct { + Properties map[string]string `json:"properties"` +} +func (c TargetContainerSpec) DeepEquals(other IDeepEquals) (bool, error) { return true, nil } diff --git a/k8s/apis/fabric/v1/targetcontainer_types.go b/k8s/apis/fabric/v1/targetcontainer_types.go index 331c2ceb7..d14c1d27f 100644 --- a/k8s/apis/fabric/v1/targetcontainer_types.go +++ b/k8s/apis/fabric/v1/targetcontainer_types.go @@ -7,7 +7,6 @@ package v1 import ( - apimodel "github.com/eclipse-symphony/symphony/api/pkg/apis/v1alpha1/model" k8smodel "github.com/eclipse-symphony/symphony/k8s/apis/model/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) @@ -15,14 +14,11 @@ import ( // TargetContainerStatus defines the observed state of Target type TargetContainerStatus struct { // Important: Run "make" to regenerate code after modifying this file - Properties map[string]string `json:"properties,omitempty"` - ProvisioningStatus apimodel.ProvisioningStatus `json:"provisioningStatus"` - LastModified metav1.Time `json:"lastModified,omitempty"` + Properties map[string]string `json:"properties,omitempty"` } // +kubebuilder:object:root=true // +kubebuilder:subresource:status -// +kubebuilder:printcolumn:name="Status",type=string,JSONPath=`.status.properties.status` // Target is the Schema for the targets API type TargetContainer struct { metav1.TypeMeta `json:",inline"` diff --git a/k8s/apis/fabric/v1/zz_generated.deepcopy.go b/k8s/apis/fabric/v1/zz_generated.deepcopy.go index 204669bf4..41d815503 100644 --- a/k8s/apis/fabric/v1/zz_generated.deepcopy.go +++ b/k8s/apis/fabric/v1/zz_generated.deepcopy.go @@ -192,8 +192,6 @@ func (in *TargetContainerStatus) DeepCopyInto(out *TargetContainerStatus) { (*out)[key] = val } } - in.ProvisioningStatus.DeepCopyInto(&out.ProvisioningStatus) - in.LastModified.DeepCopyInto(&out.LastModified) } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TargetContainerStatus. diff --git a/k8s/apis/federation/v1/catalogcontainer_types.go b/k8s/apis/federation/v1/catalogcontainer_types.go index 92fb5cf85..a46b3847c 100644 --- a/k8s/apis/federation/v1/catalogcontainer_types.go +++ b/k8s/apis/federation/v1/catalogcontainer_types.go @@ -7,15 +7,12 @@ package v1 import ( - apimodel "github.com/eclipse-symphony/symphony/api/pkg/apis/v1alpha1/model" k8smodel "github.com/eclipse-symphony/symphony/k8s/apis/model/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) type CatalogContainerStatus struct { - Properties map[string]string `json:"properties"` - ProvisioningStatus apimodel.ProvisioningStatus `json:"provisioningStatus"` - LastModified metav1.Time `json:"lastModified,omitempty"` + Properties map[string]string `json:"properties"` } // +kubebuilder:object:root=true diff --git a/k8s/apis/federation/v1/zz_generated.deepcopy.go b/k8s/apis/federation/v1/zz_generated.deepcopy.go index ec7745262..bb21a54a3 100644 --- a/k8s/apis/federation/v1/zz_generated.deepcopy.go +++ b/k8s/apis/federation/v1/zz_generated.deepcopy.go @@ -111,8 +111,6 @@ func (in *CatalogContainerStatus) DeepCopyInto(out *CatalogContainerStatus) { (*out)[key] = val } } - in.ProvisioningStatus.DeepCopyInto(&out.ProvisioningStatus) - in.LastModified.DeepCopyInto(&out.LastModified) } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CatalogContainerStatus. diff --git a/k8s/apis/model/v1/common_types.go b/k8s/apis/model/v1/common_types.go index f4cd7fd41..427ef06c9 100644 --- a/k8s/apis/model/v1/common_types.go +++ b/k8s/apis/model/v1/common_types.go @@ -73,6 +73,8 @@ type TargetSpec struct { Topologies []model.TopologySpec `json:"topologies,omitempty"` ForceRedeploy bool `json:"forceRedeploy,omitempty"` Generation string `json:"generation,omitempty"` + Version string `json:"version,omitempty"` + RootResource string `json:"rootResource,omitempty"` // Optional ReconcilicationPolicy to specify how target controller should reconcile. // Now only periodic reconciliation is supported. If the interval is 0, it will only reconcile @@ -82,16 +84,18 @@ type TargetSpec struct { // +kubebuilder:object:generate=true type InstanceSpec struct { - DisplayName string `json:"displayName,omitempty"` - Scope string `json:"scope,omitempty"` - Parameters map[string]string `json:"parameters,omitempty"` //TODO: Do we still need this? - Metadata map[string]string `json:"metadata,omitempty"` - Solution string `json:"solution"` - Target model.TargetSelector `json:"target,omitempty"` - Topologies []model.TopologySpec `json:"topologies,omitempty"` - Pipelines []model.PipelineSpec `json:"pipelines,omitempty"` - Arguments map[string]map[string]string `json:"arguments,omitempty"` - Generation string `json:"generation,omitempty"` + DisplayName string `json:"displayName,omitempty"` + Scope string `json:"scope,omitempty"` + Parameters map[string]string `json:"parameters,omitempty"` //TODO: Do we still need this? + Metadata map[string]string `json:"metadata,omitempty"` + Solution string `json:"solution"` + Target model.TargetSelector `json:"target,omitempty"` + Topologies []model.TopologySpec `json:"topologies,omitempty"` + Pipelines []model.PipelineSpec `json:"pipelines,omitempty"` + Arguments map[string]map[string]string `json:"arguments,omitempty"` + Generation string `json:"generation,omitempty"` + Version string `json:"version,omitempty"` + RootResource string `json:"rootResource,omitempty"` // Optional ReconcilicationPolicy to specify how target controller should reconcile. // Now only periodic reconciliation is supported. If the interval is 0, it will only reconcile @@ -101,26 +105,23 @@ type InstanceSpec struct { // +kubebuilder:object:generate=true type TargetContainerSpec struct { - DisplayName string `json:"displayName,omitempty"` } // +kubebuilder:object:generate=true type InstanceContainerSpec struct { - DisplayName string `json:"displayName,omitempty"` } // +kubebuilder:object:generate=true type SolutionSpec struct { - DisplayName string `json:"displayName,omitempty"` - Metadata map[string]string `json:"metadata,omitempty"` - Components []ComponentSpec `json:"components,omitempty"` - // Defines the version of a particular resource - Version string `json:"version,omitempty"` + DisplayName string `json:"displayName,omitempty"` + Metadata map[string]string `json:"metadata,omitempty"` + Components []ComponentSpec `json:"components,omitempty"` + Version string `json:"version,omitempty"` + RootResource string `json:"rootResource,omitempty"` } // +kubebuilder:object:generate=true type SolutionContainerSpec struct { - DisplayName string `json:"displayName,omitempty"` } // +kubebuilder:object:generate=true @@ -158,15 +159,16 @@ type ActivationSpec struct { // +kubebuilder:object:generate=true type CampaignSpec struct { - Name string `json:"name,omitempty"` - FirstStage string `json:"firstStage,omitempty"` - Stages map[string]StageSpec `json:"stages,omitempty"` - SelfDriving bool `json:"selfDriving,omitempty"` + Name string `json:"name,omitempty"` + FirstStage string `json:"firstStage,omitempty"` + Stages map[string]StageSpec `json:"stages,omitempty"` + SelfDriving bool `json:"selfDriving,omitempty"` + Version string `json:"version,omitempty"` + RootResource string `json:"rootResource,omitempty"` } // +kubebuilder:object:generate=true type CampaignContainerSpec struct { - DisplayName string `json:"displayName,omitempty"` } // +kubebuilder:object:generate=true @@ -175,15 +177,16 @@ type CatalogSpec struct { Metadata map[string]string `json:"metadata,omitempty"` // +kubebuilder:pruning:PreserveUnknownFields // +kubebuilder:validation:Schemaless - Properties runtime.RawExtension `json:"properties"` - ParentName string `json:"parentName,omitempty"` - ObjectRef model.ObjectRef `json:"objectRef,omitempty"` - Generation string `json:"generation,omitempty"` + Properties runtime.RawExtension `json:"properties"` + ParentName string `json:"parentName,omitempty"` + ObjectRef model.ObjectRef `json:"objectRef,omitempty"` + Generation string `json:"generation,omitempty"` + Version string `json:"version,omitempty"` + RootResource string `json:"rootResource,omitempty"` } // +kubebuilder:object:generate=true type CatalogContainerSpec struct { - DisplayName string `json:"displayName,omitempty"` } // +kubebuilder:object:generate=true diff --git a/k8s/apis/solution/v1/instancecontainer_types.go b/k8s/apis/solution/v1/instancecontainer_types.go index 3eccf6e99..de0843cc8 100644 --- a/k8s/apis/solution/v1/instancecontainer_types.go +++ b/k8s/apis/solution/v1/instancecontainer_types.go @@ -7,15 +7,12 @@ package v1 import ( - apimodel "github.com/eclipse-symphony/symphony/api/pkg/apis/v1alpha1/model" k8smodel "github.com/eclipse-symphony/symphony/k8s/apis/model/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) type InstanceContainerStatus struct { - Properties map[string]string `json:"properties"` - ProvisioningStatus apimodel.ProvisioningStatus `json:"provisioningStatus"` - LastModified metav1.Time `json:"lastModified,omitempty"` + Properties map[string]string `json:"properties"` } // +kubebuilder:object:root=true diff --git a/k8s/apis/solution/v1/solutioncontainer_types.go b/k8s/apis/solution/v1/solutioncontainer_types.go index ab37d6197..1c2a45907 100644 --- a/k8s/apis/solution/v1/solutioncontainer_types.go +++ b/k8s/apis/solution/v1/solutioncontainer_types.go @@ -7,15 +7,12 @@ package v1 import ( - apimodel "github.com/eclipse-symphony/symphony/api/pkg/apis/v1alpha1/model" k8smodel "github.com/eclipse-symphony/symphony/k8s/apis/model/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) type SolutionContainerStatus struct { - Properties map[string]string `json:"properties"` - ProvisioningStatus apimodel.ProvisioningStatus `json:"provisioningStatus"` - LastModified metav1.Time `json:"lastModified,omitempty"` + Properties map[string]string `json:"properties"` } // +kubebuilder:object:root=true diff --git a/k8s/apis/solution/v1/zz_generated.deepcopy.go b/k8s/apis/solution/v1/zz_generated.deepcopy.go index 97e579248..6e11d6d72 100644 --- a/k8s/apis/solution/v1/zz_generated.deepcopy.go +++ b/k8s/apis/solution/v1/zz_generated.deepcopy.go @@ -111,8 +111,6 @@ func (in *InstanceContainerStatus) DeepCopyInto(out *InstanceContainerStatus) { (*out)[key] = val } } - in.ProvisioningStatus.DeepCopyInto(&out.ProvisioningStatus) - in.LastModified.DeepCopyInto(&out.LastModified) } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new InstanceContainerStatus. @@ -253,8 +251,6 @@ func (in *SolutionContainerStatus) DeepCopyInto(out *SolutionContainerStatus) { (*out)[key] = val } } - in.ProvisioningStatus.DeepCopyInto(&out.ProvisioningStatus) - in.LastModified.DeepCopyInto(&out.LastModified) } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SolutionContainerStatus. diff --git a/k8s/apis/workflow/v1/campaigncontainer_types.go b/k8s/apis/workflow/v1/campaigncontainer_types.go index d21aaae82..8961422b1 100644 --- a/k8s/apis/workflow/v1/campaigncontainer_types.go +++ b/k8s/apis/workflow/v1/campaigncontainer_types.go @@ -7,18 +7,16 @@ package v1 import ( - apimodel "github.com/eclipse-symphony/symphony/api/pkg/apis/v1alpha1/model" k8smodel "github.com/eclipse-symphony/symphony/k8s/apis/model/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) type CampaignContainerStatus struct { - Properties map[string]string `json:"properties"` - ProvisioningStatus apimodel.ProvisioningStatus `json:"provisioningStatus"` - LastModified metav1.Time `json:"lastModified,omitempty"` + Properties map[string]string `json:"properties"` } // +kubebuilder:object:root=true +// +kubebuilder:subresource:status // CampaignContainer is the Schema for the campaigns API type CampaignContainer struct { metav1.TypeMeta `json:",inline"` diff --git a/k8s/apis/workflow/v1/zz_generated.deepcopy.go b/k8s/apis/workflow/v1/zz_generated.deepcopy.go index e35d3c07e..d62bf4553 100644 --- a/k8s/apis/workflow/v1/zz_generated.deepcopy.go +++ b/k8s/apis/workflow/v1/zz_generated.deepcopy.go @@ -186,8 +186,6 @@ func (in *CampaignContainerStatus) DeepCopyInto(out *CampaignContainerStatus) { (*out)[key] = val } } - in.ProvisioningStatus.DeepCopyInto(&out.ProvisioningStatus) - in.LastModified.DeepCopyInto(&out.LastModified) } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CampaignContainerStatus. diff --git a/k8s/config/oss/crd/bases/fabric.symphony_targetcontainers.yaml b/k8s/config/oss/crd/bases/fabric.symphony_targetcontainers.yaml index de18af67b..818efaacb 100644 --- a/k8s/config/oss/crd/bases/fabric.symphony_targetcontainers.yaml +++ b/k8s/config/oss/crd/bases/fabric.symphony_targetcontainers.yaml @@ -15,11 +15,7 @@ spec: singular: targetcontainer scope: Namespaced versions: - - additionalPrinterColumns: - - jsonPath: .status.properties.status - name: Status - type: string - name: v1 + - name: v1 schema: openAPIV3Schema: description: Target is the Schema for the targets API @@ -37,80 +33,16 @@ spec: metadata: type: object spec: - properties: - displayName: - type: string type: object status: description: TargetContainerStatus defines the observed state of Target properties: - lastModified: - format: date-time - type: string properties: additionalProperties: type: string description: 'Important: Run "make" to regenerate code after modifying this file' type: object - provisioningStatus: - description: Defines the state of the ARM resource for long running - operations - properties: - error: - description: Defines an error in the ARM resource for long running - operations - properties: - code: - type: string - details: - items: - description: Defines an error for symphony target - properties: - code: - type: string - details: - items: - description: Defines an error for components defined - in symphony - properties: - code: - type: string - message: - type: string - target: - type: string - type: object - type: array - message: - type: string - target: - type: string - type: object - type: array - message: - type: string - target: - type: string - type: object - failureCause: - type: string - logErrors: - type: boolean - operationId: - type: string - output: - additionalProperties: - type: string - type: object - status: - type: string - required: - - operationId - - status - type: object - required: - - provisioningStatus type: object type: object served: true diff --git a/k8s/config/oss/crd/bases/fabric.symphony_targets.yaml b/k8s/config/oss/crd/bases/fabric.symphony_targets.yaml index e00885f17..9c6a6cfa4 100644 --- a/k8s/config/oss/crd/bases/fabric.symphony_targets.yaml +++ b/k8s/config/oss/crd/bases/fabric.symphony_targets.yaml @@ -142,6 +142,8 @@ spec: required: - state type: object + rootResource: + type: string scope: type: string topologies: @@ -173,6 +175,8 @@ spec: type: object type: object type: array + version: + type: string type: object status: properties: diff --git a/k8s/config/oss/crd/bases/federation.symphony_catalogcontainers.yaml b/k8s/config/oss/crd/bases/federation.symphony_catalogcontainers.yaml index b0ffbc140..9468b49fe 100644 --- a/k8s/config/oss/crd/bases/federation.symphony_catalogcontainers.yaml +++ b/k8s/config/oss/crd/bases/federation.symphony_catalogcontainers.yaml @@ -33,78 +33,15 @@ spec: metadata: type: object spec: - properties: - displayName: - type: string type: object status: properties: - lastModified: - format: date-time - type: string properties: additionalProperties: type: string type: object - provisioningStatus: - description: Defines the state of the ARM resource for long running - operations - properties: - error: - description: Defines an error in the ARM resource for long running - operations - properties: - code: - type: string - details: - items: - description: Defines an error for symphony target - properties: - code: - type: string - details: - items: - description: Defines an error for components defined - in symphony - properties: - code: - type: string - message: - type: string - target: - type: string - type: object - type: array - message: - type: string - target: - type: string - type: object - type: array - message: - type: string - target: - type: string - type: object - failureCause: - type: string - logErrors: - type: boolean - operationId: - type: string - output: - additionalProperties: - type: string - type: object - status: - type: string - required: - - operationId - - status - type: object required: - properties - - provisioningStatus type: object type: object served: true diff --git a/k8s/config/oss/crd/bases/federation.symphony_catalogs.yaml b/k8s/config/oss/crd/bases/federation.symphony_catalogs.yaml index 2cef052cf..0b47782ab 100644 --- a/k8s/config/oss/crd/bases/federation.symphony_catalogs.yaml +++ b/k8s/config/oss/crd/bases/federation.symphony_catalogs.yaml @@ -75,8 +75,12 @@ spec: properties: type: object x-kubernetes-preserve-unknown-fields: true + rootResource: + type: string type: type: string + version: + type: string required: - properties - type diff --git a/k8s/config/oss/crd/bases/solution.symphony_instancecontainers.yaml b/k8s/config/oss/crd/bases/solution.symphony_instancecontainers.yaml index cf245b870..53bc9fe5b 100644 --- a/k8s/config/oss/crd/bases/solution.symphony_instancecontainers.yaml +++ b/k8s/config/oss/crd/bases/solution.symphony_instancecontainers.yaml @@ -33,78 +33,15 @@ spec: metadata: type: object spec: - properties: - displayName: - type: string type: object status: properties: - lastModified: - format: date-time - type: string properties: additionalProperties: type: string type: object - provisioningStatus: - description: Defines the state of the ARM resource for long running - operations - properties: - error: - description: Defines an error in the ARM resource for long running - operations - properties: - code: - type: string - details: - items: - description: Defines an error for symphony target - properties: - code: - type: string - details: - items: - description: Defines an error for components defined - in symphony - properties: - code: - type: string - message: - type: string - target: - type: string - type: object - type: array - message: - type: string - target: - type: string - type: object - type: array - message: - type: string - target: - type: string - type: object - failureCause: - type: string - logErrors: - type: boolean - operationId: - type: string - output: - additionalProperties: - type: string - type: object - status: - type: string - required: - - operationId - - status - type: object required: - properties - - provisioningStatus type: object type: object served: true diff --git a/k8s/config/oss/crd/bases/solution.symphony_instances.yaml b/k8s/config/oss/crd/bases/solution.symphony_instances.yaml index 537952e61..d737b2bec 100644 --- a/k8s/config/oss/crd/bases/solution.symphony_instances.yaml +++ b/k8s/config/oss/crd/bases/solution.symphony_instances.yaml @@ -92,6 +92,8 @@ spec: required: - state type: object + rootResource: + type: string scope: type: string solution: @@ -136,6 +138,8 @@ spec: type: object type: object type: array + version: + type: string required: - solution type: object diff --git a/k8s/config/oss/crd/bases/solution.symphony_solutioncontainers.yaml b/k8s/config/oss/crd/bases/solution.symphony_solutioncontainers.yaml index 7e2750806..04dc88337 100644 --- a/k8s/config/oss/crd/bases/solution.symphony_solutioncontainers.yaml +++ b/k8s/config/oss/crd/bases/solution.symphony_solutioncontainers.yaml @@ -33,78 +33,15 @@ spec: metadata: type: object spec: - properties: - displayName: - type: string type: object status: properties: - lastModified: - format: date-time - type: string properties: additionalProperties: type: string type: object - provisioningStatus: - description: Defines the state of the ARM resource for long running - operations - properties: - error: - description: Defines an error in the ARM resource for long running - operations - properties: - code: - type: string - details: - items: - description: Defines an error for symphony target - properties: - code: - type: string - details: - items: - description: Defines an error for components defined - in symphony - properties: - code: - type: string - message: - type: string - target: - type: string - type: object - type: array - message: - type: string - target: - type: string - type: object - type: array - message: - type: string - target: - type: string - type: object - failureCause: - type: string - logErrors: - type: boolean - operationId: - type: string - output: - additionalProperties: - type: string - type: object - status: - type: string - required: - - operationId - - status - type: object required: - properties - - provisioningStatus type: object type: object served: true diff --git a/k8s/config/oss/crd/bases/solution.symphony_solutions.yaml b/k8s/config/oss/crd/bases/solution.symphony_solutions.yaml index 8231ad562..6241897ee 100644 --- a/k8s/config/oss/crd/bases/solution.symphony_solutions.yaml +++ b/k8s/config/oss/crd/bases/solution.symphony_solutions.yaml @@ -114,8 +114,9 @@ spec: additionalProperties: type: string type: object + rootResource: + type: string version: - description: Defines the version of a particular resource type: string type: object status: diff --git a/k8s/config/oss/crd/bases/workflow.symphony_campaigncontainers.yaml b/k8s/config/oss/crd/bases/workflow.symphony_campaigncontainers.yaml index 81fc7f457..b0a24ab59 100644 --- a/k8s/config/oss/crd/bases/workflow.symphony_campaigncontainers.yaml +++ b/k8s/config/oss/crd/bases/workflow.symphony_campaigncontainers.yaml @@ -33,79 +33,18 @@ spec: metadata: type: object spec: - properties: - displayName: - type: string type: object status: properties: - lastModified: - format: date-time - type: string properties: additionalProperties: type: string type: object - provisioningStatus: - description: Defines the state of the ARM resource for long running - operations - properties: - error: - description: Defines an error in the ARM resource for long running - operations - properties: - code: - type: string - details: - items: - description: Defines an error for symphony target - properties: - code: - type: string - details: - items: - description: Defines an error for components defined - in symphony - properties: - code: - type: string - message: - type: string - target: - type: string - type: object - type: array - message: - type: string - target: - type: string - type: object - type: array - message: - type: string - target: - type: string - type: object - failureCause: - type: string - logErrors: - type: boolean - operationId: - type: string - output: - additionalProperties: - type: string - type: object - status: - type: string - required: - - operationId - - status - type: object required: - properties - - provisioningStatus type: object type: object served: true storage: true + subresources: + status: {} diff --git a/k8s/config/oss/crd/bases/workflow.symphony_campaigns.yaml b/k8s/config/oss/crd/bases/workflow.symphony_campaigns.yaml index 28d8821a9..77e87fb3f 100644 --- a/k8s/config/oss/crd/bases/workflow.symphony_campaigns.yaml +++ b/k8s/config/oss/crd/bases/workflow.symphony_campaigns.yaml @@ -38,6 +38,8 @@ spec: type: string name: type: string + rootResource: + type: string selfDriving: type: boolean stages: @@ -72,6 +74,8 @@ spec: type: string type: object type: object + version: + type: string type: object type: object served: true diff --git a/packages/helm/symphony/templates/symphony-core/symphonyk8s.yaml b/packages/helm/symphony/templates/symphony-core/symphonyk8s.yaml index bdc8cafad..b227968d4 100644 --- a/packages/helm/symphony/templates/symphony-core/symphonyk8s.yaml +++ b/packages/helm/symphony/templates/symphony-core/symphonyk8s.yaml @@ -125,82 +125,21 @@ spec: metadata: type: object spec: - properties: - displayName: - type: string type: object status: properties: - lastModified: - format: date-time - type: string properties: additionalProperties: type: string type: object - provisioningStatus: - description: Defines the state of the ARM resource for long running - operations - properties: - error: - description: Defines an error in the ARM resource for long running - operations - properties: - code: - type: string - details: - items: - description: Defines an error for symphony target - properties: - code: - type: string - details: - items: - description: Defines an error for components defined - in symphony - properties: - code: - type: string - message: - type: string - target: - type: string - type: object - type: array - message: - type: string - target: - type: string - type: object - type: array - message: - type: string - target: - type: string - type: object - failureCause: - type: string - logErrors: - type: boolean - operationId: - type: string - output: - additionalProperties: - type: string - type: object - status: - type: string - required: - - operationId - - status - type: object required: - properties - - provisioningStatus type: object type: object served: true storage: true + subresources: + status: {} --- apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition @@ -252,6 +191,8 @@ spec: type: string name: type: string + rootResource: + type: string selfDriving: type: boolean stages: @@ -286,6 +227,8 @@ spec: type: string type: object type: object + version: + type: string type: object type: object served: true @@ -325,78 +268,15 @@ spec: metadata: type: object spec: - properties: - displayName: - type: string type: object status: properties: - lastModified: - format: date-time - type: string properties: additionalProperties: type: string type: object - provisioningStatus: - description: Defines the state of the ARM resource for long running - operations - properties: - error: - description: Defines an error in the ARM resource for long running - operations - properties: - code: - type: string - details: - items: - description: Defines an error for symphony target - properties: - code: - type: string - details: - items: - description: Defines an error for components defined - in symphony - properties: - code: - type: string - message: - type: string - target: - type: string - type: object - type: array - message: - type: string - target: - type: string - type: object - type: array - message: - type: string - target: - type: string - type: object - failureCause: - type: string - logErrors: - type: boolean - operationId: - type: string - output: - additionalProperties: - type: string - type: object - status: - type: string - required: - - operationId - - status - type: object required: - properties - - provisioningStatus type: object type: object served: true @@ -491,8 +371,12 @@ spec: properties: type: object x-kubernetes-preserve-unknown-fields: true + rootResource: + type: string type: type: string + version: + type: string required: - properties - type @@ -631,78 +515,15 @@ spec: metadata: type: object spec: - properties: - displayName: - type: string type: object status: properties: - lastModified: - format: date-time - type: string properties: additionalProperties: type: string type: object - provisioningStatus: - description: Defines the state of the ARM resource for long running - operations - properties: - error: - description: Defines an error in the ARM resource for long running - operations - properties: - code: - type: string - details: - items: - description: Defines an error for symphony target - properties: - code: - type: string - details: - items: - description: Defines an error for components defined - in symphony - properties: - code: - type: string - message: - type: string - target: - type: string - type: object - type: array - message: - type: string - target: - type: string - type: object - type: array - message: - type: string - target: - type: string - type: object - failureCause: - type: string - logErrors: - type: boolean - operationId: - type: string - output: - additionalProperties: - type: string - type: object - status: - type: string - required: - - operationId - - status - type: object required: - properties - - provisioningStatus type: object type: object served: true @@ -814,6 +635,8 @@ spec: required: - state type: object + rootResource: + type: string scope: type: string solution: @@ -858,6 +681,8 @@ spec: type: object type: object type: array + version: + type: string required: - solution type: object @@ -1449,78 +1274,15 @@ spec: metadata: type: object spec: - properties: - displayName: - type: string type: object status: properties: - lastModified: - format: date-time - type: string properties: additionalProperties: type: string type: object - provisioningStatus: - description: Defines the state of the ARM resource for long running - operations - properties: - error: - description: Defines an error in the ARM resource for long running - operations - properties: - code: - type: string - details: - items: - description: Defines an error for symphony target - properties: - code: - type: string - details: - items: - description: Defines an error for components defined - in symphony - properties: - code: - type: string - message: - type: string - target: - type: string - type: object - type: array - message: - type: string - target: - type: string - type: object - type: array - message: - type: string - target: - type: string - type: object - failureCause: - type: string - logErrors: - type: boolean - operationId: - type: string - output: - additionalProperties: - type: string - type: object - status: - type: string - required: - - operationId - - status - type: object required: - properties - - provisioningStatus type: object type: object served: true @@ -1654,8 +1416,9 @@ spec: additionalProperties: type: string type: object + rootResource: + type: string version: - description: Defines the version of a particular resource type: string type: object status: @@ -1690,11 +1453,7 @@ spec: singular: targetcontainer scope: Namespaced versions: - - additionalPrinterColumns: - - jsonPath: .status.properties.status - name: Status - type: string - name: v1 + - name: v1 schema: openAPIV3Schema: description: Target is the Schema for the targets API @@ -1712,80 +1471,16 @@ spec: metadata: type: object spec: - properties: - displayName: - type: string type: object status: description: TargetContainerStatus defines the observed state of Target properties: - lastModified: - format: date-time - type: string properties: additionalProperties: type: string description: 'Important: Run "make" to regenerate code after modifying this file' type: object - provisioningStatus: - description: Defines the state of the ARM resource for long running - operations - properties: - error: - description: Defines an error in the ARM resource for long running - operations - properties: - code: - type: string - details: - items: - description: Defines an error for symphony target - properties: - code: - type: string - details: - items: - description: Defines an error for components defined - in symphony - properties: - code: - type: string - message: - type: string - target: - type: string - type: object - type: array - message: - type: string - target: - type: string - type: object - type: array - message: - type: string - target: - type: string - type: object - failureCause: - type: string - logErrors: - type: boolean - operationId: - type: string - output: - additionalProperties: - type: string - type: object - status: - type: string - required: - - operationId - - status - type: object - required: - - provisioningStatus type: object type: object served: true @@ -1947,6 +1642,8 @@ spec: required: - state type: object + rootResource: + type: string scope: type: string topologies: @@ -1978,6 +1675,8 @@ spec: type: object type: object type: array + version: + type: string type: object status: properties: From f8e3a8e32e4eb04aec672aba4b7c8414ac650b79 Mon Sep 17 00:00:00 2001 From: Lency Qian Date: Thu, 16 May 2024 17:19:17 +0800 Subject: [PATCH 6/7] rebase fix --- api/pkg/apis/v1alpha1/providers/target/staging/staging.go | 4 ---- 1 file changed, 4 deletions(-) diff --git a/api/pkg/apis/v1alpha1/providers/target/staging/staging.go b/api/pkg/apis/v1alpha1/providers/target/staging/staging.go index 93475fd8b..f4daba08d 100644 --- a/api/pkg/apis/v1alpha1/providers/target/staging/staging.go +++ b/api/pkg/apis/v1alpha1/providers/target/staging/staging.go @@ -181,11 +181,7 @@ func (i *StagingTargetProvider) Apply(ctx context.Context, deployment model.Depl if catalog.Spec == nil { catalog.ObjectMeta.Name = deployment.Instance.ObjectMeta.Name + "-" + i.Config.TargetName catalog.Spec = &model.CatalogSpec{ -<<<<<<< HEAD Type: "staged", -======= - Type: "staged", ->>>>>>> 9e6abf3 (Remove CatalogSpec.SiteId (#11)) } } if catalog.Spec.Properties == nil { From 7438ba07bb5b3730618c86e31242e70605a134f0 Mon Sep 17 00:00:00 2001 From: Lency Qian Date: Thu, 16 May 2024 17:27:32 +0800 Subject: [PATCH 7/7] helmTemplates fix --- k8s/config/oss/helm/manager-patch.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/k8s/config/oss/helm/manager-patch.yaml b/k8s/config/oss/helm/manager-patch.yaml index d44170fea..f752ca20d 100644 --- a/k8s/config/oss/helm/manager-patch.yaml +++ b/k8s/config/oss/helm/manager-patch.yaml @@ -46,7 +46,7 @@ spec: projected: sources: - serviceAccountToken: - audience: '{{ include "symphony.url" . }}' + audience: '{{ include "symphony.httpsUrl" . }}' expirationSeconds: 600 path: symphony-api-token - name: api-ca-cert