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

Commit

Permalink
Merge pull request #637 from yiqigao217/doc
Browse files Browse the repository at this point in the history
Update condition code documentation
  • Loading branch information
k8s-ci-robot authored Apr 9, 2020
2 parents 6723c03 + af29bef commit bc0ba5f
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 18 deletions.
24 changes: 15 additions & 9 deletions incubator/hnc/api/v1alpha1/hierarchy_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ const (
CritParentInvalid Code = "CritParentInvalid"
CritAncestor Code = "CritAncestor"
HNSMissing Code = "HNSMissing"
CannotUpdate Code = "CannotUpdateObject"
CannotPropagate Code = "CannotPropagateObject"
CannotUpdate Code = "CannotUpdateObject"
)

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

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

0 comments on commit bc0ba5f

Please sign in to comment.