Skip to content
This repository has been archived by the owner on Oct 25, 2023. It is now read-only.

Commit

Permalink
feat(dlq): update kubejob entropy model
Browse files Browse the repository at this point in the history
  • Loading branch information
StewartJingga committed Sep 29, 2023
1 parent 2d232ac commit c689eb6
Show file tree
Hide file tree
Showing 5 changed files with 92 additions and 41 deletions.
39 changes: 39 additions & 0 deletions entropy/job.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
package entropy

type JobConfig struct {
Stopped bool `json:"stopped,omitempty"`
Replicas int32 `json:"replicas"`
Namespace string `json:"namespace,omitempty"`
Name string `json:"name,omitempty"`
Containers []JobContainer `json:"containers,omitempty"`
JobLabels map[string]string `json:"job_labels,omitempty"`
Volumes []JobVolume `json:"volumes,omitempty"`
}

type JobVolume struct {
Name string
Kind string // secret or config-map. secret is for gcs/bq credential
}

type JobContainer struct {
Name string `json:"name"`
Image string `json:"image"`
ImagePullPolicy string `json:"image_pull_policy,omitempty"`
Command []string `json:"command,omitempty"`
SecretsVolumes []JobSecret `json:"secrets_volumes,omitempty"`
ConfigMapsVolumes []JobConfigMap `json:"config_maps_volumes,omitempty"`
Limits *UsageSpec `json:"limits,omitempty"`
Requests *UsageSpec `json:"requests,omitempty"`
EnvConfigMaps []string `json:"env_config_maps,omitempty"`
EnvVariables map[string]string `json:"env_variables,omitempty"`
}

type JobSecret struct {
Name string `json:"name"`
Mount string `json:"mount"`
}

type JobConfigMap struct {
Name string `json:"name"`
Mount string `json:"mount"`
}
6 changes: 6 additions & 0 deletions entropy/kind.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
package entropy

const (
ResourceKindFirehose = "firehose"
ResourceKindJob = "job"
)
39 changes: 0 additions & 39 deletions entropy/kube_job.go

This file was deleted.

46 changes: 45 additions & 1 deletion generated/models/dlq_job.go

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

3 changes: 2 additions & 1 deletion swagger.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1242,7 +1242,8 @@ definitions:
type: string
resource_type:
type: string
default: firehose
enum:
- firehose
error_types:
type: string
description: "List of firehose error types, comma separated"
Expand Down

0 comments on commit c689eb6

Please sign in to comment.