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
99 changes: 99 additions & 0 deletions assets/crd/storage_version_migration.crd.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
name: storageversionmigrations.migration.k8s.io
annotations:
"api-approved.kubernetes.io": "https://github.com/kubernetes/community/pull/2524"
include.release.openshift.io/ibm-cloud-managed: "true"
include.release.openshift.io/self-managed-high-availability: "true"
spec:
group: migration.k8s.io
names:
kind: StorageVersionMigration
listKind: StorageVersionMigrationList
plural: storageversionmigrations
singular: storageversionmigration
scope: Cluster
preserveUnknownFields: false
versions:
- name: v1alpha1
served: true
storage: true
subresources:
status: {}
schema:
openAPIV3Schema:
description: StorageVersionMigration represents a migration of stored data
to the latest storage version.
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:
description: Specification of the migration.
type: object
required:
- resource
properties:
continueToken:
description: The token used in the list options to get the next chunk
of objects to migrate. When the .status.conditions indicates the
migration is "Running", users can use this token to check the progress
of the migration.
type: string
resource:
description: The resource that is being migrated. The migrator sends
requests to the endpoint serving the resource. Immutable.
type: object
properties:
group:
description: The name of the group.
type: string
resource:
description: The name of the resource.
type: string
version:
description: The name of the version.
type: string
status:
description: Status of the migration.
type: object
properties:
conditions:
description: The latest available observations of the migration's
current state.
type: array
items:
description: Describes the state of a migration at a certain point.
type: object
required:
- status
- type
properties:
lastUpdateTime:
description: The last time this condition was updated.
type: string
format: date-time
message:
description: A human readable message indicating details about
the transition.
type: string
reason:
description: The reason for the condition's last transition.
type: string
status:
description: Status of the condition, one of True, False, Unknown.
type: string
type:
description: Type of the condition.
type: string
86 changes: 86 additions & 0 deletions assets/crd/storage_version_state.crd.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
api-approved.kubernetes.io: https://github.com/kubernetes/enhancements/pull/747
include.release.openshift.io/ibm-cloud-managed: "true"
include.release.openshift.io/self-managed-high-availability: "true"
name: storagestates.migration.k8s.io
spec:
group: migration.k8s.io
names:
kind: StorageState
listKind: StorageStateList
plural: storagestates
singular: storagestate
preserveUnknownFields: false
scope: Cluster
versions:
- name: v1alpha1
schema:
openAPIV3Schema:
description: The state of the storage of a specific resource.
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:
properties:
name:
description: name must be "<.spec.resource.resouce>.<.spec.resource.group>".
type: string
type: object
spec:
description: Specification of the storage state.
properties:
resource:
description: The resource this storageState is about.
properties:
group:
description: The name of the group.
type: string
resource:
description: The name of the resource.
type: string
type: object
type: object
status:
description: Status of the storage state.
properties:
currentStorageVersionHash:
description: The hash value of the current storage version, as shown
in the discovery document served by the API server. Storage Version
is the version to which objects are converted to before persisted.
type: string
lastHeartbeatTime:
description: LastHeartbeatTime is the last time the storage migration
triggering controller checks the storage version hash of this resource
in the discovery document and updates this field.
format: date-time
type: string
persistedStorageVersionHashes:
description: The hash values of storage versions that persisted instances
of spec.resource might still be encoded in. "Unknown" is a valid
value in the list, and is the default value. It is not safe to upgrade
or downgrade to an apiserver binary that does not support all versions
listed in this field, or if "Unknown" is listed. Once the storage
version migration for this resource has completed, the value of
this field is refined to only contain the currentStorageVersionHash.
Once the apiserver has changed the storage version, the new storage
version is appended to the list.
items:
type: string
type: array
type: object
type: object
served: true
storage: true
subresources:
status: {}
28 changes: 28 additions & 0 deletions etcd/vendor/github.com/openshift/microshift/pkg/util/util.go

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

8 changes: 6 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,10 @@ require (
sigs.k8s.io/yaml v1.3.0
)

require sigs.k8s.io/kustomize/api v0.13.2
require (
sigs.k8s.io/kube-storage-version-migrator v0.0.4
sigs.k8s.io/kustomize/api v0.13.2
)

require (
cloud.google.com/go v0.97.0 // indirect
Expand Down Expand Up @@ -222,7 +225,6 @@ require (
k8s.io/utils v0.0.0-20230505201702-9f6742963106 // indirect
sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.1.2 // indirect
sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect
sigs.k8s.io/kube-storage-version-migrator v0.0.4 // indirect
sigs.k8s.io/kustomize/kyaml v0.14.1 // indirect
sigs.k8s.io/structured-merge-diff/v4 v4.2.3 // indirect
)
Expand Down Expand Up @@ -260,3 +262,5 @@ replace (
k8s.io/sample-cli-plugin => github.com/openshift/kubernetes/staging/src/k8s.io/sample-cli-plugin v0.0.0-20230704094550-e8b13aaf3b13 // from kubernetes
k8s.io/sample-controller => github.com/openshift/kubernetes/staging/src/k8s.io/sample-controller v0.0.0-20230704094550-e8b13aaf3b13 // from kubernetes
)

replace sigs.k8s.io/kube-storage-version-migrator => github.com/openshift/kubernetes-kube-storage-version-migrator v0.0.3-0.20230525153147-77c90ab82b46
Loading