Skip to content

Commit

Permalink
adopt metav1 condition
Browse files Browse the repository at this point in the history
  • Loading branch information
qiujian16 committed Sep 14, 2020
1 parent e63f54e commit 0ae1908
Show file tree
Hide file tree
Showing 1,166 changed files with 42,911 additions and 68,243 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM docker.io/openshift/origin-release:golang-1.13 AS builder
FROM docker.io/openshift/origin-release:golang-1.14 AS builder
WORKDIR /go/src/github.com/open-cluster-management/multicloud-operators-foundation
COPY . .
ENV GO_PACKAGE github.com/open-cluster-management/multicloud-operators-foundation
Expand Down
1 change: 0 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,6 @@ generate: ensure-controller-gen
$(CONTROLLER_GEN) object:headerFile="hack/custom-boilerplate.go.txt" paths="./pkg/apis/inventory/v1alpha1"
$(CONTROLLER_GEN) object:headerFile="hack/custom-boilerplate.go.txt" paths="./pkg/apis/cluster/v1alpha1"
$(CONTROLLER_GEN) object:headerFile="hack/custom-boilerplate.go.txt" paths="./pkg/apis/internal.open-cluster-management.io/v1beta1"
$(CONTROLLER_GEN) object:headerFile="hack/custom-boilerplate.go.txt" paths="./pkg/apis/conditions"

# Ensure kubebuilder
ensure-kubebuilder:
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,211 @@

---
apiVersion: apiextensions.k8s.io/v1beta1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.2.5
creationTimestamp: null
name: mirroredmanagedclusters.cluster.open-cluster-management.io
spec:
additionalPrinterColumns:
- JSONPath: .spec.hubAcceptsClient
name: Hub Accepted
type: boolean
- JSONPath: .spec.managedClusterClientConfigs[*].url
name: Managed Cluster URLs
type: string
- JSONPath: .status.conditions[?(@.type=="ManagedClusterJoined")].status
name: Joined
type: string
- JSONPath: .status.conditions[?(@.type=="ManagedClusterConditionAvailable")].status
name: Available
type: string
- JSONPath: .metadata.creationTimestamp
name: Age
type: date
group: cluster.open-cluster-management.io
names:
kind: MirroredManagedCluster
listKind: MirroredManagedClusterList
plural: mirroredmanagedclusters
singular: mirroredmanagedcluster
scope: Namespaced
subresources:
status: {}
validation:
openAPIV3Schema:
description: MirroredManagedCluster is a mirror of a managed cluster in namespace
scope. It is ready only and keeps synced with the managed cluster it mirrored.
properties:
apiVersion:
description: 'APIVersion defines the versioned schema of this representation
of an object. Servers should convert recognized schemas to the latest
internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
type: string
kind:
description: 'Kind is a string value representing the REST resource this
object represents. Servers may infer this from the endpoint the client
submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
type: string
metadata:
type: object
spec:
description: Spec represents a desired configuration for the agent on the
managed cluster.
properties:
hubAcceptsClient:
description: hubAcceptsClient represents that hub accepts the join of
Klusterlet agent on the managed cluster to the hub. The default value
is false, and can only be set true when the user on hub has an RBAC
rule to UPDATE on the virtual subresource of managedclusters/accept.
When the value is set true, a namespace whose name is same as the
name of ManagedCluster is created on hub representing the managed
cluster, also role/rolebinding is created on the namespace to grant
the permision of access from agent on managed cluster. When the value
is set false, the namespace representing the managed cluster is deleted.
type: boolean
leaseDurationSeconds:
description: LeaseDurationSeconds is used to coordinate the lease update
time of Klusterlet agents on the managed cluster. If its value is
zero, the Klusterlet agent will update its lease every 60s by default
format: int32
type: integer
managedClusterClientConfigs:
description: ManagedClusterClientConfigs represents a list of the apiserver
address of the managed cluster. If it is empty, managed cluster has
no accessible address to be visited from hub.
items:
description: ClientConfig represents the apiserver address of the
managed cluster. TODO include credential to connect to managed cluster
kube-apiserver
properties:
caBundle:
description: CABundle is the ca bundle to connect to apiserver
of the managed cluster. System certs are used if it is not set.
format: byte
type: string
url:
description: URL is the url of apiserver endpoint of the managed
cluster.
type: string
type: object
type: array
type: object
status:
description: Status represents the current status of joined managed cluster
properties:
allocatable:
additionalProperties:
anyOf:
- type: integer
- type: string
pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
x-kubernetes-int-or-string: true
description: Allocatable represents the total allocatable resources
on the managed cluster.
type: object
capacity:
additionalProperties:
anyOf:
- type: integer
- type: string
pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
x-kubernetes-int-or-string: true
description: Capacity represents the total resource capacity from all
nodeStatuses on the managed cluster.
type: object
conditions:
description: Conditions contains the different condition statuses for
this managed cluster.
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
version:
description: Version represents the kubernetes version of the managed
cluster.
properties:
kubernetes:
description: Kubernetes is the kubernetes version of managed cluster.
type: string
type: object
type: object
required:
- spec
type: object
version: v1alpha1
versions:
- name: v1alpha1
served: true
storage: true
status:
acceptedNames:
kind: ""
plural: ""
conditions: []
storedVersions: []
Original file line number Diff line number Diff line change
Expand Up @@ -64,23 +64,69 @@ spec:
description: Conditions represents the conditions of this resource on
managed cluster
items:
description: Condition represents the state of the operator's reconciliation
functionality.
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: ConditionType is the state of the operator's reconciliation
functionality.
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
Expand Down
Loading

0 comments on commit 0ae1908

Please sign in to comment.