Skip to content

Commit

Permalink
Update CRD status names
Browse files Browse the repository at this point in the history
  • Loading branch information
jonathan-innis committed Jun 13, 2021
1 parent 4de79eb commit 166aac4
Show file tree
Hide file tree
Showing 4 changed files with 110 additions and 120 deletions.
8 changes: 2 additions & 6 deletions api/v1alpha1/appgroup_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -188,11 +188,7 @@ type ApplicationStatus struct {
type ApplicationGroupStatus struct {
// Applications status
// +optional
Applications []ApplicationStatus `json:"status,omitempty"`

// Phase is the reconciliation phase
// +optional
Update bool `json:"update,omitempty"`
Applications []ApplicationStatus `json:"applications,omitempty"`

// ObservedGeneration captures the last generation
// that was captured and completed by the reconciler
Expand Down Expand Up @@ -249,7 +245,7 @@ func (in *ApplicationGroup) ReadySucceeded() {
// WorkflowFailed sets the meta.ReadyCondition to 'False' and
// meta.ReadyWorkflowFailed reason and message
func (in *ApplicationGroup) WorkflowFailed(message string) {
meta.SetResourceCondition(in, meta.ReadyCondition, metav1.ConditionFalse, meta.WorkflowStepFailedReason, message)
meta.SetResourceCondition(in, meta.ReadyCondition, metav1.ConditionFalse, meta.WorkflowFailedReason, message)
}

// ChartPullFailed sets the meta.ReadyCondition to 'False' and
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -274,59 +274,7 @@ spec:
status:
description: ApplicationGroupStatus defines the observed state of ApplicationGroup
properties:
conditions:
description: Conditions holds the conditions of the ApplicationGroup
items:
description: "Condition contains details for one aspect of the current state of this API Resource. --- This struct is intended for direct use as an array at the field path .status.conditions. For example, type FooStatus struct{ // Represents the observations of a foo's current state. // Known .status.conditions.type are: \"Available\", \"Progressing\", and \"Degraded\" // +patchMergeKey=type // +patchStrategy=merge // +listType=map // +listMapKey=type Conditions []metav1.Condition `json:\"conditions,omitempty\" patchStrategy:\"merge\" patchMergeKey:\"type\" protobuf:\"bytes,1,rep,name=conditions\"` \n // other fields }"
properties:
lastTransitionTime:
description: lastTransitionTime is the last time the condition transitioned from one status to another. This should be when the underlying condition changed. If that is not known, then using the time when the API field changed is acceptable.
format: date-time
type: string
message:
description: message is a human readable message indicating details about the transition. This may be an empty string.
maxLength: 32768
type: string
observedGeneration:
description: observedGeneration represents the .metadata.generation that the condition was set based upon. For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date with respect to the current state of the instance.
format: int64
minimum: 0
type: integer
reason:
description: reason contains a programmatic identifier indicating the reason for the condition's last transition. Producers of specific condition types may define expected values and meanings for this field, and whether the values are considered a guaranteed API. The value should be a CamelCase string. This field may not be empty.
maxLength: 1024
minLength: 1
pattern: ^[A-Za-z]([A-Za-z0-9_,:]*[A-Za-z0-9_])?$
type: string
status:
description: status of the condition, one of True, False, Unknown.
enum:
- "True"
- "False"
- Unknown
type: string
type:
description: type of condition in CamelCase or in foo.example.com/CamelCase. --- Many .condition.type values are consistent across resources like Available, but because arbitrary conditions can be useful (see .node.status.conditions), the ability to deconflict is important. The regex it matches is (dns1123SubdomainFmt/)?(qualifiedNameFmt)
maxLength: 316
pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$
type: string
required:
- lastTransitionTime
- message
- reason
- status
- type
type: object
type: array
lastSucceededGeneration:
description: LastSucceededGeneration captures the last generation that has successfully completed a full workflow rollout of the application group
format: int64
type: integer
observedGeneration:
description: ObservedGeneration captures the last generation that was captured and completed by the reconciler
format: int64
type: integer
status:
applications:
description: Applications status
items:
description: ApplicationStatus shows the current status of the application helm release
Expand Down Expand Up @@ -449,9 +397,58 @@ spec:
type: string
type: object
type: array
update:
description: Phase is the reconciliation phase
type: boolean
conditions:
description: Conditions holds the conditions of the ApplicationGroup
items:
description: "Condition contains details for one aspect of the current state of this API Resource. --- This struct is intended for direct use as an array at the field path .status.conditions. For example, type FooStatus struct{ // Represents the observations of a foo's current state. // Known .status.conditions.type are: \"Available\", \"Progressing\", and \"Degraded\" // +patchMergeKey=type // +patchStrategy=merge // +listType=map // +listMapKey=type Conditions []metav1.Condition `json:\"conditions,omitempty\" patchStrategy:\"merge\" patchMergeKey:\"type\" protobuf:\"bytes,1,rep,name=conditions\"` \n // other fields }"
properties:
lastTransitionTime:
description: lastTransitionTime is the last time the condition transitioned from one status to another. This should be when the underlying condition changed. If that is not known, then using the time when the API field changed is acceptable.
format: date-time
type: string
message:
description: message is a human readable message indicating details about the transition. This may be an empty string.
maxLength: 32768
type: string
observedGeneration:
description: observedGeneration represents the .metadata.generation that the condition was set based upon. For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date with respect to the current state of the instance.
format: int64
minimum: 0
type: integer
reason:
description: reason contains a programmatic identifier indicating the reason for the condition's last transition. Producers of specific condition types may define expected values and meanings for this field, and whether the values are considered a guaranteed API. The value should be a CamelCase string. This field may not be empty.
maxLength: 1024
minLength: 1
pattern: ^[A-Za-z]([A-Za-z0-9_,:]*[A-Za-z0-9_])?$
type: string
status:
description: status of the condition, one of True, False, Unknown.
enum:
- "True"
- "False"
- Unknown
type: string
type:
description: type of condition in CamelCase or in foo.example.com/CamelCase. --- Many .condition.type values are consistent across resources like Available, but because arbitrary conditions can be useful (see .node.status.conditions), the ability to deconflict is important. The regex it matches is (dns1123SubdomainFmt/)?(qualifiedNameFmt)
maxLength: 316
pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$
type: string
required:
- lastTransitionTime
- message
- reason
- status
- type
type: object
type: array
lastSucceededGeneration:
description: LastSucceededGeneration captures the last generation that has successfully completed a full workflow rollout of the application group
format: int64
type: integer
observedGeneration:
description: ObservedGeneration captures the last generation that was captured and completed by the reconciler
format: int64
type: integer
type: object
type: object
served: true
Expand Down
109 changes: 53 additions & 56 deletions config/crd/bases/orkestra.azure.microsoft.com_applicationgroups.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -274,59 +274,7 @@ spec:
status:
description: ApplicationGroupStatus defines the observed state of ApplicationGroup
properties:
conditions:
description: Conditions holds the conditions of the ApplicationGroup
items:
description: "Condition contains details for one aspect of the current state of this API Resource. --- This struct is intended for direct use as an array at the field path .status.conditions. For example, type FooStatus struct{ // Represents the observations of a foo's current state. // Known .status.conditions.type are: \"Available\", \"Progressing\", and \"Degraded\" // +patchMergeKey=type // +patchStrategy=merge // +listType=map // +listMapKey=type Conditions []metav1.Condition `json:\"conditions,omitempty\" patchStrategy:\"merge\" patchMergeKey:\"type\" protobuf:\"bytes,1,rep,name=conditions\"` \n // other fields }"
properties:
lastTransitionTime:
description: lastTransitionTime is the last time the condition transitioned from one status to another. This should be when the underlying condition changed. If that is not known, then using the time when the API field changed is acceptable.
format: date-time
type: string
message:
description: message is a human readable message indicating details about the transition. This may be an empty string.
maxLength: 32768
type: string
observedGeneration:
description: observedGeneration represents the .metadata.generation that the condition was set based upon. For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date with respect to the current state of the instance.
format: int64
minimum: 0
type: integer
reason:
description: reason contains a programmatic identifier indicating the reason for the condition's last transition. Producers of specific condition types may define expected values and meanings for this field, and whether the values are considered a guaranteed API. The value should be a CamelCase string. This field may not be empty.
maxLength: 1024
minLength: 1
pattern: ^[A-Za-z]([A-Za-z0-9_,:]*[A-Za-z0-9_])?$
type: string
status:
description: status of the condition, one of True, False, Unknown.
enum:
- "True"
- "False"
- Unknown
type: string
type:
description: type of condition in CamelCase or in foo.example.com/CamelCase. --- Many .condition.type values are consistent across resources like Available, but because arbitrary conditions can be useful (see .node.status.conditions), the ability to deconflict is important. The regex it matches is (dns1123SubdomainFmt/)?(qualifiedNameFmt)
maxLength: 316
pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$
type: string
required:
- lastTransitionTime
- message
- reason
- status
- type
type: object
type: array
lastSucceededGeneration:
description: LastSucceededGeneration captures the last generation that has successfully completed a full workflow rollout of the application group
format: int64
type: integer
observedGeneration:
description: ObservedGeneration captures the last generation that was captured and completed by the reconciler
format: int64
type: integer
status:
applications:
description: Applications status
items:
description: ApplicationStatus shows the current status of the application helm release
Expand Down Expand Up @@ -449,9 +397,58 @@ spec:
type: string
type: object
type: array
update:
description: Phase is the reconciliation phase
type: boolean
conditions:
description: Conditions holds the conditions of the ApplicationGroup
items:
description: "Condition contains details for one aspect of the current state of this API Resource. --- This struct is intended for direct use as an array at the field path .status.conditions. For example, type FooStatus struct{ // Represents the observations of a foo's current state. // Known .status.conditions.type are: \"Available\", \"Progressing\", and \"Degraded\" // +patchMergeKey=type // +patchStrategy=merge // +listType=map // +listMapKey=type Conditions []metav1.Condition `json:\"conditions,omitempty\" patchStrategy:\"merge\" patchMergeKey:\"type\" protobuf:\"bytes,1,rep,name=conditions\"` \n // other fields }"
properties:
lastTransitionTime:
description: lastTransitionTime is the last time the condition transitioned from one status to another. This should be when the underlying condition changed. If that is not known, then using the time when the API field changed is acceptable.
format: date-time
type: string
message:
description: message is a human readable message indicating details about the transition. This may be an empty string.
maxLength: 32768
type: string
observedGeneration:
description: observedGeneration represents the .metadata.generation that the condition was set based upon. For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date with respect to the current state of the instance.
format: int64
minimum: 0
type: integer
reason:
description: reason contains a programmatic identifier indicating the reason for the condition's last transition. Producers of specific condition types may define expected values and meanings for this field, and whether the values are considered a guaranteed API. The value should be a CamelCase string. This field may not be empty.
maxLength: 1024
minLength: 1
pattern: ^[A-Za-z]([A-Za-z0-9_,:]*[A-Za-z0-9_])?$
type: string
status:
description: status of the condition, one of True, False, Unknown.
enum:
- "True"
- "False"
- Unknown
type: string
type:
description: type of condition in CamelCase or in foo.example.com/CamelCase. --- Many .condition.type values are consistent across resources like Available, but because arbitrary conditions can be useful (see .node.status.conditions), the ability to deconflict is important. The regex it matches is (dns1123SubdomainFmt/)?(qualifiedNameFmt)
maxLength: 316
pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$
type: string
required:
- lastTransitionTime
- message
- reason
- status
- type
type: object
type: array
lastSucceededGeneration:
description: LastSucceededGeneration captures the last generation that has successfully completed a full workflow rollout of the application group
format: int64
type: integer
observedGeneration:
description: ObservedGeneration captures the last generation that was captured and completed by the reconciler
format: int64
type: integer
type: object
type: object
served: true
Expand Down
4 changes: 2 additions & 2 deletions pkg/meta/conditions.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,9 @@ const (
// was unable to pull from the chart repo specified
ChartPullFailedReason string = "ChartPullFailed"

// WorkflowStepFailedReason represents the fact that a workflow step failed and is the reason
// WorkflowFailedReason represents the fact that a workflow step failed and is the reason
// why the application group was unable to successfully reconcile
WorkflowStepFailedReason string = "WorkflowStepFailed"
WorkflowFailedReason string = "WorkflowFailed"

// TemplateGenerationFailedReason represents the fact that the application group was unable
// to generate the templates for the workflow reconciliation
Expand Down

0 comments on commit 166aac4

Please sign in to comment.