Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Version update #631

Closed
wants to merge 2 commits into from
Closed
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 Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# To re-generate a bundle for another specific version without changing the standard setup, you can:
# - use the VERSION as arg of the bundle target (e.g make bundle VERSION=0.0.2)
# - use environment variables to overwrite this value (e.g export VERSION=0.0.2)
VERSION ?= 0.0.1
VERSION ?= 0.0.2

# CHANNELS define the bundle channels used in the bundle.
# Add a new line here if you would like to change its default config. (E.g CHANNELS = "candidate,fast,stable")
Expand Down
13 changes: 13 additions & 0 deletions PROJECT
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# Code generated by tool. DO NOT EDIT.
# This file is used to track the info used to scaffold your project
# and allow the plugins properly work.
# More info: https://book.kubebuilder.io/reference/project-config.html
domain: openstack.org
layout:
- go.kubebuilder.io/v3
Expand Down Expand Up @@ -29,4 +33,13 @@ resources:
kind: OpenStackClient
path: github.com/openstack-k8s-operators/openstack-operator/apis/client/v1beta1
version: v1beta1
- api:
crdVersion: v1
namespaced: true
controller: true
domain: openstack.org
group: core
kind: OpenStackVersion
path: github.com/openstack-k8s-operators/openstack-operator/apis/core/v1beta1
version: v1beta1
version: "3"
80 changes: 80 additions & 0 deletions apis/bases/core.openstack.org_openstackversions.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
---
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.11.1
creationTimestamp: null
name: openstackversions.core.openstack.org
spec:
group: core.openstack.org
names:
kind: OpenStackVersion
listKind: OpenStackVersionList
plural: openstackversions
singular: openstackversion
scope: Namespaced
versions:
- additionalPrinterColumns:
- jsonPath: .spec.targetVersion
name: Target Version
type: string
- jsonPath: .status.availableVersion
name: Available Version
type: string
name: v1beta1
schema:
openAPIV3Schema:
properties:
apiVersion:
type: string
kind:
type: string
metadata:
type: object
spec:
properties:
cinderVolumeExcludes:
items:
type: string
type: array
openstackControlPlaneName:
default: openstack
type: string
serviceExcludes:
items:
type: string
type: array
targetVersion:
type: string
type: object
status:
properties:
availableService:
items:
type: string
type: array
availableVersion:
type: string
targetVersion:
type: string
updateApplied:
items:
properties:
name:
type: string
type: object
type: array
updateNeeded:
items:
properties:
name:
type: string
type: object
type: array
type: object
type: object
served: true
storage: true
subresources:
status: {}
105 changes: 105 additions & 0 deletions apis/core/v1beta1/openstackversion_types.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
/*
Copyright 2023.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

package v1beta1

import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)

// OpenStackVersionSpec defines the desired state of OpenStackVersion
type OpenStackVersionSpec struct {

// Strategy -
//Strategy UpdateStrategy `json:"strategy,omitempty"`

// 1.0.1 --> 1.0.2
TargetVersion string `json:"targetVersion,omitempty"`

// +kubebuilder:default="openstack"
OpenStackControlPlaneName string `json:"openstackControlPlaneName,omitempty"`

// ServiceExcludes is a list of services to exclude from the update. Any named service here will be excluded from the update.
ServiceExcludes []string `json:"serviceExcludes,omitempty"`

// CinderVolumeExcludes is a list of cinder volumes to exclude from the update. Any named Cinder volume instance here will be excluded.
CinderVolumeExcludes []string `json:"cinderVolumeExcludes,omitempty"`

//FIXME: add parameters for other custom service maps (Neutron, etc)
}

// UpdateStrategy defines the strategy used to roll out updates to the OpenStack services
/*
type UpdateStrategy struct {

// +kubebuilder:default="automatic"
UpdateType string `json:"updateType,omitempty"`


// Type serial or parallel
// +kubebuilder:default="serial"
//Type string `json:"type"`
}*/

type ServiceVersionURL struct {
ServiceName string `json:"name,omitempty"`
ContainerImageUrl string `json:"containerImageUrl,omitempty"`
}

type OpenStackService struct {
ServiceName string `json:"name,omitempty"`
}

// OpenStackVersionStatus defines the observed state of OpenStackVersion
type OpenStackVersionStatus struct {
ServicesNeedingUpdates []OpenStackService `json:"updateNeeded,omitempty"`

DeployedVersions []OpenStackService `json:"updateApplied,omitempty"`

TargetVersion string `json:"targetVersion,omitempty"`

AvailableVersion string `json:"availableVersion,omitempty"`

AvailableServices []string `json:"availableService,omitempty"`
}

//+kubebuilder:object:root=true
//+kubebuilder:subresource:status
// +operator-sdk:csv:customresourcedefinitions:displayName="OpenStack Version"
// +kubebuilder:printcolumn:name="Target Version",type=string,JSONPath=`.spec.targetVersion`
// +kubebuilder:printcolumn:name="Available Version",type=string,JSONPath=`.status.availableVersion`

// OpenStackVersion is the Schema for the openstackversionupdates API
type OpenStackVersion struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`

Spec OpenStackVersionSpec `json:"spec,omitempty"`
Status OpenStackVersionStatus `json:"status,omitempty"`
}

//+kubebuilder:object:root=true

// OpenStackVersionList contains a list of OpenStackVersion
type OpenStackVersionList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata,omitempty"`
Items []OpenStackVersion `json:"items"`
}

func init() {
SchemeBuilder.Register(&OpenStackVersion{}, &OpenStackVersionList{})
}
144 changes: 144 additions & 0 deletions apis/core/v1beta1/zz_generated.deepcopy.go

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

Loading