Skip to content

Commit

Permalink
[create-pull-request] automated change
Browse files Browse the repository at this point in the history
  • Loading branch information
niedbalski authored Oct 20, 2023
1 parent 16d00d2 commit d764a21
Show file tree
Hide file tree
Showing 5 changed files with 108 additions and 34 deletions.
50 changes: 49 additions & 1 deletion spec/open-api.yml
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,14 @@ components:
- failed
- running
- ok
PipelinePortKind:
type: string
description: The kind/type of the service associated to this port.
default: LoadBalancer
enum:
- LoadBalancer
- ClusterIP
- NodePort
PipelinePortProtocol:
type: string
description: Valid protocol types defined for a pipelines.
Expand Down Expand Up @@ -1564,6 +1572,8 @@ components:
protocol:
type: string
example: tcp
kind:
$ref: "#/components/schemas/PipelinePortKind"
frontendPort:
type: integer
format: int32
Expand Down Expand Up @@ -1598,6 +1608,7 @@ components:
required:
- id
- protocol
- kind
- frontendPort
- backendPort
- endpoint
Expand Down Expand Up @@ -2083,6 +2094,8 @@ components:
type: integer
format: int32
minimum: 0
healthCheckPipelinePortKind:
$ref: "#/components/schemas/PipelinePortKind"
metadata:
type: object
nullable: true
Expand All @@ -2104,6 +2117,7 @@ components:
- version
- addHealthCheckPipeline
- healthCheckPipelinePort
- healthCheckPipelinePortKind
UpdateAggregator:
description: Update aggregator request body.
type: object
Expand Down Expand Up @@ -2349,6 +2363,14 @@ components:
nullable: true
default: null
additionalProperties: true
portKind:
type: string
description: Kind of service for the service/ports created under this pipeline.
default: LoadBalancer
enum:
- LoadBalancer
- ClusterIP
- NodePort
required:
- name
- replicasCount
Expand All @@ -2358,6 +2380,7 @@ components:
- files
- resourceProfile
- skipConfigValidation
- portKind
UpdatePipeline:
description: Update pipeline request body.
type: object
Expand Down Expand Up @@ -2475,7 +2498,16 @@ components:
- STARTED
- SCALING
- CHECKS_OK
- CHECKS_FAILED
- CHECKS_FAILED -
portKind:
type: string
description: Kind of service for the service/ports created for this pipeline.
default: null
nullable: true
enum:
- LoadBalancer
- ClusterIP
- NodePort
events:
type: array
nullable: true
Expand Down Expand Up @@ -2701,11 +2733,14 @@ components:
minimum: 0
endpoint:
type: string
kind:
$ref: "#/components/schemas/PipelinePortKind"
required:
- protocol
- frontendPort
- backendPort
- endpoint
- kind
UpdatePipelinePort:
description: Update pipeline port request body.
type: object
Expand All @@ -2729,6 +2764,15 @@ components:
type: string
nullable: true
default: null
kind:
type: string
description: The kind/type of the service associated to this port.
default: null
nullable: true
enum:
- LoadBalancer
- ClusterIP
- NodePort
ValidatingConfig:
description: Validating configuration request body.
type: object
Expand Down Expand Up @@ -3002,6 +3046,10 @@ components:
id:
type: string
format: uuid
kind:
type: string
default: null
nullable: true
pluginID:
type: string
nullable: true
Expand Down
23 changes: 12 additions & 11 deletions types/core_instance.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
)

const (
DefaultCoreInstanceVersion = "v0.1.12"
DefaultCoreInstanceVersion = "v2.0-dev"
)

// CoreInstance model.
Expand Down Expand Up @@ -156,16 +156,17 @@ type MetadataGCP struct {

// CreateCoreInstance request payload for creating a new core instance.
type CreateCoreInstance struct {
Name string `json:"name"`
Version string `json:"version"`
AddHealthCheckPipeline bool `json:"addHealthCheckPipeline"`
HealthCheckPipelinePort uint `json:"healthCheckPipelinePort"`
ClusterLogging bool `json:"clusterLogging"`
Tags []string `json:"tags"`
Image *string `json:"image"`
Metadata CoreInstanceMetadata `json:"metadata"`
EnvironmentID string `json:"environmentID"`
SkipServiceCreation bool `json:"skipServiceCreation"`
Name string `json:"name"`
Version string `json:"version"`
AddHealthCheckPipeline bool `json:"addHealthCheckPipeline"`
HealthCheckPipelinePort uint `json:"healthCheckPipelinePort"`
HealthCheckPipelinePortKind PipelinePortKind `json:"healthCheckPipelinePortKind"`
ClusterLogging bool `json:"clusterLogging"`
Tags []string `json:"tags"`
Image *string `json:"image"`
Metadata CoreInstanceMetadata `json:"metadata"`
EnvironmentID string `json:"environmentID"`
SkipServiceCreation bool `json:"skipServiceCreation"`

id string
signingKey []byte
Expand Down
1 change: 1 addition & 0 deletions types/errs/pipeline_port.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ const (
InvalidPipelinePortProtocol = InvalidArgumentError("invalid pipeline port protocol")
InvalidPipelinePortNumber = InvalidArgumentError("invalid pipeline port number")
InvalidPipelinePortEndpoint = InvalidArgumentError("invalid pipeline port endpoint")
InvalidPipelinePortKind = InvalidArgumentError("invalid pipeline port type")
PipelinePortNotFound = NotFoundError("pipeline port not found")
PipelinePortInUse = ConflictError("pipeline port already in use")
)
Expand Down
4 changes: 4 additions & 0 deletions types/pipeline.go
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,9 @@ type CreatePipeline struct {
// will be executed.
WaitForChecksBeforeDeploying bool `json:"waitForChecksBeforeDeploying"`

// The default portKind to be used for input ports that belongs to this pipeline.
PortKind PipelinePortKind `json:"portKind"`

status PipelineStatusKind
// Internal denotes that this pipeline was created by the system.
// That's the case for the "health-check-*" automated pipeline
Expand Down Expand Up @@ -251,6 +254,7 @@ type UpdatePipeline struct {
Status *PipelineStatusKind `json:"status"`
ConfigFormat *ConfigFormat `json:"configFormat"`
DeploymentStrategy *DeploymentStrategy `json:"deploymentStrategy"`
PortKind *PipelinePortKind `json:"portKind"`
ReplicasCount *uint `json:"replicasCount"`
RawConfig *string `json:"rawConfig"`
ResourceProfile *string `json:"resourceProfile"`
Expand Down
64 changes: 42 additions & 22 deletions types/pipeline_port.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,18 +16,33 @@ var AllPipelinePortProtocols = [...]PipelinePortProtocol{
PipelineProtocolUDP,
}

type PipelinePortKind string

const (
PipelinePortKindClusterIP PipelinePortKind = "ClusterIP"
PipelinePortKindLoadBalancer PipelinePortKind = "LoadBalancer"
PipelinePortKindNodePort PipelinePortKind = "NodePort"
)

var AllValidPipelinePortKinds = [...]PipelinePortKind{
PipelinePortKindClusterIP,
PipelinePortKindLoadBalancer,
PipelinePortKindNodePort,
}

// PipelinePort model.
type PipelinePort struct {
ID string `json:"id" yaml:"id"`
Protocol string `json:"protocol" yaml:"protocol"`
FrontendPort uint `json:"frontendPort" yaml:"frontendPort"`
BackendPort uint `json:"backendPort" yaml:"backendPort"`
Endpoint string `json:"endpoint" yaml:"endpoint"`
PluginID *string `json:"pluginID" yaml:"pluginID"`
PluginName *string `json:"pluginName" yaml:"pluginName"`
PluginAlias *string `json:"pluginAlias" yaml:"pluginAlias"`
CreatedAt time.Time `json:"createdAt" yaml:"createdAt"`
UpdatedAt time.Time `json:"updatedAt" yaml:"updatedAt"`
ID string `json:"id" yaml:"id"`
Protocol string `json:"protocol" yaml:"protocol"`
FrontendPort uint `json:"frontendPort" yaml:"frontendPort"`
BackendPort uint `json:"backendPort" yaml:"backendPort"`
Kind PipelinePortKind `json:"kind" yaml:"kind"`
Endpoint string `json:"endpoint" yaml:"endpoint"`
PluginID *string `json:"pluginID" yaml:"pluginID"`
PluginName *string `json:"pluginName" yaml:"pluginName"`
PluginAlias *string `json:"pluginAlias" yaml:"pluginAlias"`
CreatedAt time.Time `json:"createdAt" yaml:"createdAt"`
UpdatedAt time.Time `json:"updatedAt" yaml:"updatedAt"`
}

// PipelinePorts paginated list.
Expand All @@ -38,14 +53,14 @@ type PipelinePorts struct {

// CreatePipelinePort request payload for creating a pipeline port.
type CreatePipelinePort struct {
Protocol string `json:"protocol"`
FrontendPort uint `json:"frontendPort"`
BackendPort uint `json:"backendPort"`
Endpoint string `json:"endpoint"`

pluginID *string
pluginName *string
pluginAlias *string
Protocol string `json:"protocol"`
FrontendPort uint `json:"frontendPort"`
BackendPort uint `json:"backendPort"`
Endpoint string `json:"endpoint"`
Kind PipelinePortKind `json:"kind"`
pluginID *string
pluginName *string
pluginAlias *string
}

func CreatePipelinePortWithOpts(base CreatePipelinePort, pluginID, pluginName, pluginAlias *string) CreatePipelinePort {
Expand All @@ -63,6 +78,10 @@ func (in *CreatePipelinePort) SetPluginName(pluginName string) {
in.pluginName = &pluginName
}

func (in *CreatePipelinePort) SetPortKind(kind PipelinePortKind) {
in.Kind = kind
}

func (in *CreatePipelinePort) SetPluginAlias(pluginAlias string) {
in.pluginAlias = &pluginAlias
}
Expand Down Expand Up @@ -96,8 +115,9 @@ type PipelinePortsParams struct {

// UpdatePipelinePort request payload for updating a pipeline port.
type UpdatePipelinePort struct {
Protocol *string `json:"protocol"`
FrontendPort *uint `json:"frontendPort"`
BackendPort *uint `json:"backendPort"`
Endpoint *string `json:"endpoint"`
Protocol *string `json:"protocol"`
FrontendPort *uint `json:"frontendPort"`
BackendPort *uint `json:"backendPort"`
Endpoint *string `json:"endpoint"`
Kind *PipelinePortKind `json:"kind"`
}

0 comments on commit d764a21

Please sign in to comment.