Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ require (
github.com/google/uuid v1.1.2
github.com/onsi/ginkgo v1.16.5
github.com/onsi/gomega v1.17.0
github.com/openshift/api v0.0.0-20220204103739-31ffd77a8f02
github.com/openshift/api v0.0.0-20220222102030-354aa98a475c
github.com/openshift/client-go v0.0.0-20211209144617-7385dd6338e3
github.com/openshift/library-go v0.0.0-20220121154930-b7889002d63e
github.com/operator-framework/operator-sdk v0.5.1-0.20190301204940-c2efe6f74e7b
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -535,8 +535,8 @@ github.com/opencontainers/go-digest v1.0.0-rc1/go.mod h1:cMLVZDEM3+U2I4VmLI6N8jQ
github.com/opencontainers/go-digest v1.0.0/go.mod h1:0JzlMkj0TRzQZfJkVvzbP0HBR3IKzErnv2BNG4W4MAM=
github.com/opencontainers/image-spec v1.0.1/go.mod h1:BtxoFyWECRxE4U/7sNtV5W15zMzWCbyJoFRP3s7yZA0=
github.com/openshift/api v0.0.0-20211209135129-c58d9f695577/go.mod h1:DoslCwtqUpr3d/gsbq4ZlkaMEdYqKxuypsDjorcHhME=
github.com/openshift/api v0.0.0-20220204103739-31ffd77a8f02 h1:827CBqmcsUWM9KuwRPirEcUBjq8elzGoBZLKx3NT2xk=
github.com/openshift/api v0.0.0-20220204103739-31ffd77a8f02/go.mod h1:F/eU6jgr6Q2VhMu1mSpMmygxAELd7+BUxs3NHZ25jV4=
github.com/openshift/api v0.0.0-20220222102030-354aa98a475c h1:teP/Es0/vieKbpRde+xwoM0F1cWO5ZFLS4ihJ2WG7BQ=
github.com/openshift/api v0.0.0-20220222102030-354aa98a475c/go.mod h1:F/eU6jgr6Q2VhMu1mSpMmygxAELd7+BUxs3NHZ25jV4=
github.com/openshift/build-machinery-go v0.0.0-20210712174854-1bb7fd1518d3/go.mod h1:b1BuldmJlbA/xYtdZvKi+7j5YGB44qJUJDZ9zwiNCfE=
github.com/openshift/build-machinery-go v0.0.0-20211213093930-7e33a7eb4ce3/go.mod h1:b1BuldmJlbA/xYtdZvKi+7j5YGB44qJUJDZ9zwiNCfE=
github.com/openshift/client-go v0.0.0-20211209144617-7385dd6338e3 h1:SG1aqwleU6bGD0X4mhkTNupjVnByMYYuW4XbnCPavQU=
Expand Down
9 changes: 5 additions & 4 deletions hack/crds-sync.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,13 @@
set -euo pipefail

# map names of CRD files between the vendored openshift/api repository and the ./install directory
CRDS_MAPPING=( "0000_10_machine.crd.yaml:0000_30_machine-api-operator_02_machine.crd.yaml"
"0000_10_machineset.crd.yaml:0000_30_machine-api-operator_03_machineset.crd.yaml"
"0000_10_machinehealthcheck.yaml:0000_30_machine-api-operator_07_machinehealthcheck.crd.yaml" )
CRDS_MAPPING=( "v1beta1/0000_10_machine.crd.yaml:0000_30_machine-api-operator_02_machine.crd.yaml"
"v1beta1/0000_10_machineset.crd.yaml:0000_30_machine-api-operator_03_machineset.crd.yaml"
"v1beta1/0000_10_machinehealthcheck.yaml:0000_30_machine-api-operator_07_machinehealthcheck.crd.yaml"
"v1/0000_10_awsplacementgroup.crd.yaml:0000_30_machine-api-operator_04_awsplacementgroup.crd.yaml")

for crd in "${CRDS_MAPPING[@]}" ; do
SRC="${crd%%:*}"
DES="${crd##*:}"
cp "vendor/github.com/openshift/api/machine/v1beta1/$SRC" "install/$DES"
cp "vendor/github.com/openshift/api/machine/$SRC" "install/$DES"
done
187 changes: 187 additions & 0 deletions install/0000_30_machine-api-operator_04_awsplacementgroup.crd.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,187 @@
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
exclude.release.openshift.io/internal-openshift-hosted: "true"
include.release.openshift.io/self-managed-high-availability: "true"
include.release.openshift.io/single-node-developer: "true"
api-approved.openshift.io: https://github.com/openshift/api/pull/1091
name: awsplacementgroups.machine.openshift.io
spec:
group: machine.openshift.io
names:
kind: AWSPlacementGroup
listKind: AWSPlacementGroupList
plural: awsplacementgroups
singular: awsplacementgroup
scope: Namespaced
versions:
- additionalPrinterColumns:
- description: Placement Group Type
jsonPath: .status.observedConfiguration.groupType
name: Type
type: string
- description: Management State
jsonPath: .spec.managementSpec.managementState
name: Management
type: string
- description: EC2 Replicas within the Placement Group
jsonPath: .status.replicas
name: Replicas
type: integer
- description: AWSPlacementGroup age
jsonPath: .metadata.creationTimestamp
name: Age
type: date
name: v1
schema:
openAPIV3Schema:
description: 'AWSPlacementGroup ensures that a placement group matching the given configuration exists within AWS Compatibility level 1: Stable within a major release for a minimum of 12 months or 3 minor releases (whichever is longer).'
type: object
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:
type: object
required:
- managementSpec
properties:
credentialsSecret:
description: CredentialsSecret is a reference to the secret with AWS credentials. The secret must reside in the same namespace as the AWSPlacementGroup resource. Otherwise, the controller will leverage the EC2 instance assigned IAM Role, in OpenShift this will always be the Control Plane Machine IAM Role.
type: object
properties:
name:
description: Name of the Secret.
type: string
managementSpec:
description: AWSPlacementGroupManagementSpec defines the configuration for a managed or unmanaged placement group.
type: object
required:
- managementState
properties:
managed:
description: Managed defines the configuration for the placement groups to be created. Updates to the configuration will not be observed as placement groups are immutable after creation.
type: object
required:
- groupType
properties:
groupType:
description: 'GroupType specifies the type of AWS placement group to use for this Machine. This parameter is only used when a Machine is being created and the named placement group does not exist. Valid values are "Cluster", "Partition", "Spread". This value is required and, in case a placement group already exists, will be validated against the existing placement group. Note: If the value of this field is "Spread", Machines created within the group may no have placement.tenancy set to "dedicated".'
type: string
enum:
- Cluster
- Partition
- Spread
partition:
description: Partition defines the configuration of a partition placement group.
type: object
properties:
count:
description: 'Count specifies the number of partitions for a Partition placement group. This value is only observed when creating a placement group and only when the `groupType` is set to `Partition`. Note the partition count of a placement group cannot be changed after creation. If unset, AWS will provide a default partition count. This default is currently 2. Note: When using more than 2 partitions, the "dedicated" tenancy option on Machines created within the group is unavailable.'
type: integer
format: int32
maximum: 7
minimum: 1
managementState:
description: ManagementState determines whether the placement group is expected to be managed by this CRD or whether it is user managed. A managed placement group may be moved to unmanaged, however an unmanaged group may not be moved back to managed.
type: string
status:
type: object
properties:
conditions:
description: 'Conditions represents the observations of the AWSPlacementGroup''s current state. Known .status.conditions.type are: Ready, Deleting'
type: array
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 }"
type: object
required:
- lastTransitionTime
- message
- reason
- status
- type
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.
type: string
format: date-time
message:
description: message is a human readable message indicating details about the transition. This may be an empty string.
type: string
maxLength: 32768
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.
type: integer
format: int64
minimum: 0
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.
type: string
maxLength: 1024
minLength: 1
pattern: ^[A-Za-z]([A-Za-z0-9_,:]*[A-Za-z0-9_])?$
status:
description: status of the condition, one of True, False, Unknown.
type: string
enum:
- "True"
- "False"
- Unknown
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)
type: string
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])$
x-kubernetes-list-map-keys:
- type
x-kubernetes-list-type: map
expiresAt:
description: ExpiresAt identifies when the observed configuration is valid until. The observed configuration should not be trusted if this time has passed. The AWSPlacementGroup controller will attempt to update the status before it expires.
type: string
format: date-time
managementState:
description: ManagementState determines whether the placement group is expected to be managed by this CRD or whether it is user managed. A managed placement group may be moved to unmanaged, however an unmanaged group may not be moved back to managed. This value is owned by the controller and may differ from the spec in cases when a user attempts to manage a previously unmanaged placement group.
type: string
observedConfiguration:
description: ObservedConfiguration represents the configuration present on the placement group on AWS.
type: object
required:
- groupType
properties:
groupType:
description: 'GroupType specifies the type of AWS placement group to use for this Machine. This parameter is only used when a Machine is being created and the named placement group does not exist. Valid values are "Cluster", "Partition", "Spread". This value is required and, in case a placement group already exists, will be validated against the existing placement group. Note: If the value of this field is "Spread", Machines created within the group may no have placement.tenancy set to "dedicated".'
type: string
enum:
- Cluster
- Partition
- Spread
partition:
description: Partition defines the configuration of a partition placement group.
type: object
properties:
count:
description: 'Count specifies the number of partitions for a Partition placement group. This value is only observed when creating a placement group and only when the `groupType` is set to `Partition`. Note the partition count of a placement group cannot be changed after creation. If unset, AWS will provide a default partition count. This default is currently 2. Note: When using more than 2 partitions, the "dedicated" tenancy option on Machines created within the group is unavailable.'
type: integer
format: int32
maximum: 7
minimum: 1
replicas:
description: 'Replicas counts how many AWS EC2 instances are present within the placement group. Note: This is a pointer to be able to distinguish between an empty placement group and the status having not yet been observed.'
type: integer
format: int32
served: true
storage: true
subresources:
status: {}
status:
acceptedNames:
kind: ""
plural: ""
conditions: []
storedVersions: []
6 changes: 6 additions & 0 deletions tools.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
package tools

import (
// Import the v1 API so that we can sync the CRD into the install folder
_ "github.com/openshift/api/machine/v1"
)

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading