Skip to content

Commit

Permalink
apis: update target-type constants (#4531)
Browse files Browse the repository at this point in the history
  • Loading branch information
nicks committed May 7, 2021
1 parent 241811e commit 63a0865
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 11 deletions.
23 changes: 18 additions & 5 deletions pkg/apis/core/v1alpha1/uiresource_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -176,13 +176,26 @@ type UIResourceLink struct {
Name string `json:"name,omitempty" protobuf:"bytes,2,opt,name=name"`
}

// UIResourceTargetType identifies the different categories of
// task in a resource.
type UIResourceTargetType string

const UIResourceTargetTypeUnspecified = UIResourceTargetType("unspecified")
const UIResourceTargetTypeImage = UIResourceTargetType("image")
const UIResourceTargetTypeKubernetes = UIResourceTargetType("k8s")
const UIResourceTargetTypeDockerCompose = UIResourceTargetType("docker-compose")
const UIResourceTargetTypeLocal = UIResourceTargetType("local")
const (
// The target type is unspecified.
UIResourceTargetTypeUnspecified UIResourceTargetType = "unspecified"

// The target is a container image build.
UIResourceTargetTypeImage UIResourceTargetType = "image"

// The target is a Kubernetes resource deployment.
UIResourceTargetTypeKubernetes UIResourceTargetType = "k8s"

// The target is a Docker Compose service deployment.
UIResourceTargetTypeDockerCompose UIResourceTargetType = "docker-compose"

// The target is a local command or server.
UIResourceTargetTypeLocal UIResourceTargetType = "local"
)

// UIResourceTargetSpec represents the spec of a build or deploy that a resource summarizes.
type UIResourceTargetSpec struct {
Expand Down
12 changes: 6 additions & 6 deletions web/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,13 +56,13 @@ export enum ResourceStatus {
None, // e.g., a manual build that has never executed
}

// These constants are generated by the Go proto code.
// These constants are duplicated from the Go constants.
export enum TargetType {
Unspecified = "TARGET_TYPE_UNSPECIFIED",
Image = "TARGET_TYPE_IMAGE",
K8s = "TARGET_TYPE_K8S",
DockerCompose = "TARGET_TYPE_DOCKER_COMPOSE",
Local = "TARGET_TYPE_LOCAL",
Unspecified = "unspecified",
Image = "image",
K8s = "k8s",
DockerCompose = "docker-compose",
Local = "local",
}

export type SnapshotHighlight = {
Expand Down

0 comments on commit 63a0865

Please sign in to comment.