Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions api/pkg/apis/v1alpha1/model/campaign.go
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
47 changes: 47 additions & 0 deletions api/pkg/apis/v1alpha1/model/campaigncontainer.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
/*
* 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"`
Status *CampaignContainerStatus `json:"status,omitempty"`
}

type CampaignContainerSpec struct {
}

type CampaignContainerStatus struct {
Properties map[string]string `json:"properties"`
}

func (c CampaignContainerSpec) DeepEquals(other IDeepEquals) (bool, error) {
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
}
14 changes: 8 additions & 6 deletions api/pkg/apis/v1alpha1/model/catalog.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
48 changes: 48 additions & 0 deletions api/pkg/apis/v1alpha1/model/catalogcontainer.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
/*
* 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"`
Status *CatalogContainerStatus `json:"status,omitempty"`
}

type CatalogContainerSpec struct {
}

type CatalogContainerStatus struct {
Properties map[string]string `json:"properties"`
}

func (c CatalogContainerSpec) DeepEquals(other IDeepEquals) (bool, error) {
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
}
22 changes: 12 additions & 10 deletions api/pkg/apis/v1alpha1/model/instance.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
47 changes: 47 additions & 0 deletions api/pkg/apis/v1alpha1/model/instancecontainer.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
/*
* 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"`
Status *InstanceContainerStatus `json:"status,omitempty"`
}

type InstanceContainerSpec struct {
}

type InstanceContainerStatus struct {
Properties map[string]string `json:"properties"`
}

func (c InstanceContainerSpec) DeepEquals(other IDeepEquals) (bool, error) {
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
}
8 changes: 5 additions & 3 deletions api/pkg/apis/v1alpha1/model/solution.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"`
}
)

Expand Down
47 changes: 47 additions & 0 deletions api/pkg/apis/v1alpha1/model/solutioncontainer.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
/*
* 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"`
Status *SolutionContainerStatus `json:"status,omitempty"`
}

type SolutionContainerSpec struct {
}

type SolutionContainerStatus struct {
Properties map[string]string `json:"properties"`
}

func (c SolutionContainerSpec) DeepEquals(other IDeepEquals) (bool, error) {
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
}
2 changes: 2 additions & 0 deletions api/pkg/apis/v1alpha1/model/target.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"`
}
)

Expand Down
47 changes: 47 additions & 0 deletions api/pkg/apis/v1alpha1/model/targetcontainer.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
/*
* 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"`
Status *TargetContainerStatus `json:"status,omitempty"`
}

type TargetContainerSpec struct {
}

type TargetContainerStatus struct {
Properties map[string]string `json:"properties"`
}

func (c TargetContainerSpec) DeepEquals(other IDeepEquals) (bool, error) {
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
}
45 changes: 45 additions & 0 deletions k8s/PROJECT
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Loading