Skip to content

Commit

Permalink
remove unused cluster refs
Browse files Browse the repository at this point in the history
  • Loading branch information
maciaszczykm committed Jan 8, 2024
1 parent 2b656d4 commit dd4ac90
Show file tree
Hide file tree
Showing 6 changed files with 128 additions and 113 deletions.
6 changes: 0 additions & 6 deletions controller/api/v1alpha1/pipeline_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,19 +46,13 @@ type PipelineStage struct {
// PipelineStageService is the configuration of a service within a pipeline stage,
// including optional promotion criteria.
type PipelineStageService struct {
// ClusterRef of this service.
ClusterRef *v1.ObjectReference `json:"clusterRef,omitempty"`

ServiceRef *v1.ObjectReference `json:"serviceRef,omitempty"`

Criteria *PipelineStageServicePromotionCriteria `json:"criteria,omitempty"`
}

// PipelineStageServicePromotionCriteria represents actions to perform if this stage service were promoted.
type PipelineStageServicePromotionCriteria struct {
// ClusterRef of the Cluster for the source service.
ClusterRef *v1.ObjectReference `json:"clusterRef,omitempty"`

// ServiceRef pointing to source service to promote from.
ServiceRef *v1.ObjectReference `json:"serviceRef,omitempty"`

Expand Down
25 changes: 13 additions & 12 deletions controller/api/v1alpha1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

88 changes: 2 additions & 86 deletions controller/config/crd/bases/deployments.plural.sh_pipelines.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -202,96 +202,10 @@ spec:
a service within a pipeline stage, including optional promotion
criteria.
properties:
clusterRef:
description: ClusterRef of this service.
properties:
apiVersion:
description: API version of the referent.
type: string
fieldPath:
description: 'If referring to a piece of an object
instead of an entire object, this string should
contain a valid JSON/Go field access statement,
such as desiredState.manifest.containers[2]. For
example, if the object reference is to a container
within a pod, this would take on a value like: "spec.containers{name}"
(where "name" refers to the name of the container
that triggered the event) or if no container name
is specified "spec.containers[2]" (container with
index 2 in this pod). This syntax is chosen only
to have some well-defined way of referencing a part
of an object. TODO: this design is not final and
this field is subject to change in the future.'
type: string
kind:
description: 'Kind of the referent. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
type: string
name:
description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names'
type: string
namespace:
description: 'Namespace of the referent. More info:
https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/'
type: string
resourceVersion:
description: 'Specific resourceVersion to which this
reference is made, if any. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency'
type: string
uid:
description: 'UID of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids'
type: string
type: object
x-kubernetes-map-type: atomic
criteria:
description: PipelineStageServicePromotionCriteria represents
actions to perform if this stage service were promoted.
properties:
clusterRef:
description: ClusterRef of the Cluster for the source
service.
properties:
apiVersion:
description: API version of the referent.
type: string
fieldPath:
description: 'If referring to a piece of an object
instead of an entire object, this string should
contain a valid JSON/Go field access statement,
such as desiredState.manifest.containers[2].
For example, if the object reference is to a
container within a pod, this would take on a
value like: "spec.containers{name}" (where "name"
refers to the name of the container that triggered
the event) or if no container name is specified
"spec.containers[2]" (container with index 2
in this pod). This syntax is chosen only to
have some well-defined way of referencing a
part of an object. TODO: this design is not
final and this field is subject to change in
the future.'
type: string
kind:
description: 'Kind of the referent. More info:
https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
type: string
name:
description: 'Name of the referent. More info:
https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names'
type: string
namespace:
description: 'Namespace of the referent. More
info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/'
type: string
resourceVersion:
description: 'Specific resourceVersion to which
this reference is made, if any. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency'
type: string
uid:
description: 'UID of the referent. More info:
https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids'
type: string
type: object
x-kubernetes-map-type: atomic
secrets:
description: Secrets to copy over in a promotion.
items:
Expand Down Expand Up @@ -343,6 +257,8 @@ spec:
type: string
type: object
x-kubernetes-map-type: atomic
sourceID:
type: string
type: object
serviceRef:
description: "ObjectReference contains enough information
Expand Down
2 changes: 1 addition & 1 deletion controller/internal/client/console.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ type ConsoleClient interface {
UpdateRepository(id string, attrs console.GitAttributes) (*console.UpdateGitRepository, error)
DeleteRepository(id string) error
GetRepository(url *string) (*console.GetGitRepository, error)
CreateService(clusterId *string, attributes console.ServiceDeploymentAttributes) (*console.ServiceDeploymentFragment, error)
CreateService(clusterId *string, attributes console.ServiceDeploymentAttributes) (*console.ServiceDeploymentExtended, error)
GetCluster(id *string) (*console.ClusterFragment, error)
GetClusterByHandle(handle *string) (*console.ClusterFragment, error)
CreateCluster(attrs console.ClusterAttributes) (*console.ClusterFragment, error)
Expand Down
2 changes: 1 addition & 1 deletion controller/internal/client/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ func (c *client) GetService(clusterID, serviceName string) (*console.ServiceDepl
return resp.ServiceDeployment, nil
}

func (c *client) CreateService(clusterId *string, attributes console.ServiceDeploymentAttributes) (*console.ServiceDeploymentFragment, error) {
func (c *client) CreateService(clusterId *string, attributes console.ServiceDeploymentAttributes) (*console.ServiceDeploymentExtended, error) {
if clusterId == nil {
return nil, fmt.Errorf("clusterId and clusterName can not be null")
}
Expand Down
118 changes: 111 additions & 7 deletions controller/internal/test/mocks/ConsoleClient_mock.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit dd4ac90

Please sign in to comment.