Skip to content
This repository was archived by the owner on Jun 26, 2023. It is now read-only.

Commit bc0ba5f

Browse files
authored
Merge pull request #637 from yiqigao217/doc
Update condition code documentation
2 parents 6723c03 + af29bef commit bc0ba5f

File tree

2 files changed

+30
-18
lines changed

2 files changed

+30
-18
lines changed

incubator/hnc/api/v1alpha1/hierarchy_types.go

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,8 @@ const (
4242
CritParentInvalid Code = "CritParentInvalid"
4343
CritAncestor Code = "CritAncestor"
4444
HNSMissing Code = "HNSMissing"
45-
CannotUpdate Code = "CannotUpdateObject"
4645
CannotPropagate Code = "CannotPropagateObject"
46+
CannotUpdate Code = "CannotUpdateObject"
4747
)
4848

4949
// EDIT THIS FILE! THIS IS SCAFFOLDING FOR YOU TO OWN!
@@ -104,7 +104,7 @@ type Condition struct {
104104
// shown below, but new values may be added over time. This field is always present in a
105105
// condition.
106106
//
107-
// All codes that begin with the prefix `CRIT_` indicate that all HNC activities (e.g. propagating
107+
// All codes that begin with the prefix `Crit` indicate that all HNC activities (e.g. propagating
108108
// objects, updating labels) have been paused in this namespaces. HNC will resume updating the
109109
// namespace once the condition has been resolved. Non-critical conditions typically indicate some
110110
// kind of error that HNC itself can ignore, but likely indicates that the hierarchical structure
@@ -116,17 +116,23 @@ type Condition struct {
116116
//
117117
// Currently, the supported values are:
118118
//
119-
// - "CRIT_PARENT_MISSING": the specified parent is missing
119+
// - "CritParentMissing": the specified parent is missing
120120
//
121-
// - "CRIT_PARENT_INVALID": the specified parent is invalid (e.g., would cause a cycle)
121+
// - "CritParentInvalid": the specified parent is invalid (e.g., would cause a cycle)
122122
//
123-
// - "CRIT_ANCESTOR": a critical error exists in an ancestor namespace, so this namespace is no
123+
// - "CritAncestor": a critical error exists in an ancestor namespace, so this namespace is no
124124
// longer being updated either.
125125
//
126-
// - "REQUIRED_CHILD_CONFLICT": this namespace has a required child, but a namespace of the same
127-
// name already exists and is not a child of this namespace. Note that the condition is _not_
128-
// annotated onto the other namespace; it is considered an error _only_ for the would-be parent
129-
// namespace.
126+
// - "HNSMissing": this namespace is an owned namespace (created by reconciling an hns instance),
127+
// but the hns instance is missing in its owner (referenced in its owner annotation) or the owner
128+
// namespace is missing.
129+
//
130+
// - "CannotPropagateObject": this namespace contains an object that couldn't be propagated to
131+
// one or more of its descendants. The condition's affect objects will include a list of the
132+
// copies that couldn't be updated.
133+
//
134+
// - "CannotUpdateObject": this namespace has an error when updating a propagated object from its
135+
// source. The condition's affected object will point to the source object.
130136
Code Code `json:"code"`
131137

132138
// A human-readable description of the condition, if the `code` and `affects` fields are not

incubator/hnc/config/crd/bases/hnc.x-k8s.io_hierarchyconfigurations.yaml

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ spec:
7979
description: "Describes the condition in a machine-readable string
8080
value. The currently valid values are shown below, but new values
8181
may be added over time. This field is always present in a condition.
82-
\n All codes that begin with the prefix `CRIT_` indicate that
82+
\n All codes that begin with the prefix `Crit` indicate that
8383
all HNC activities (e.g. propagating objects, updating labels)
8484
have been paused in this namespaces. HNC will resume updating
8585
the namespace once the condition has been resolved. Non-critical
@@ -90,15 +90,21 @@ spec:
9090
any conditions on any namespaces, although some may appear transiently
9191
when the HNC controller is restarted. These should quickly resolve
9292
themselves (<30s). \n Currently, the supported values are: \n
93-
- \"CRIT_PARENT_MISSING\": the specified parent is missing \n
94-
- \"CRIT_PARENT_INVALID\": the specified parent is invalid (e.g.,
95-
would cause a cycle) \n - \"CRIT_ANCESTOR\": a critical error
93+
- \"CritParentMissing\": the specified parent is missing \n
94+
- \"CritParentInvalid\": the specified parent is invalid (e.g.,
95+
would cause a cycle) \n - \"CritAncestor\": a critical error
9696
exists in an ancestor namespace, so this namespace is no longer
97-
being updated either. \n - \"REQUIRED_CHILD_CONFLICT\": this
98-
namespace has a required child, but a namespace of the same
99-
name already exists and is not a child of this namespace. Note
100-
that the condition is _not_ annotated onto the other namespace;
101-
it is considered an error _only_ for the would-be parent namespace."
97+
being updated either. \n - \"HNSMissing\": this namespace is
98+
an owned namespace (created by reconciling an hns instance),
99+
but the hns instance is missing in its owner (referenced in
100+
its owner annotation) or the owner namespace is missing. \n
101+
- \"CannotPropagateObject\": this namespace contains an object
102+
that couldn't be propagated to one or more of its descendants.
103+
The condition's affect objects will include a list of the copies
104+
that couldn't be updated. \n - \"CannotUpdateObject\": this
105+
namespace has an error when updating a propagated object from
106+
its source. The condition's affected object will point to the
107+
source object."
102108
type: string
103109
msg:
104110
description: A human-readable description of the condition, if

0 commit comments

Comments
 (0)