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

Bump go1.22 and update bootstrap version #155

Merged
merged 5 commits into from
Nov 5, 2024
Merged
Show file tree
Hide file tree
Changes from 4 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
11 changes: 2 additions & 9 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,13 @@
################################################################################

# Name of this service/application

SERVICE_NAME := casskop

BUILD_FOLDER = .
MOUNTDIR = $(PWD)

BOOTSTRAP_IMAGE ?= ghcr.io/cscetbon/casskop-bootstrap:0.1.16
BOOTSTRAP_IMAGE ?= ghcr.io/cscetbon/casskop-bootstrap:0.1.19
TELEPRESENCE_REGISTRY ?= datawire
KUBESQUASH_REGISTRY:=
KUBECONFIG ?= ~/.kube/config
Expand All @@ -47,14 +48,6 @@ update-crds:
@yq -i e '$(SPEC_PROPS).config.type = "object"' config/crd/bases/db.orange.com_cassandraclusters.yaml
@yq -i e '$(SPEC_PROPS).topology.properties.dc.items.properties.config.type = "object"' config/crd/bases/db.orange.com_cassandraclusters.yaml
@yq -i e '$(SPEC_PROPS).topology.properties.dc.items.properties.rack.items.properties.config.type = "object"' config/crd/bases/db.orange.com_cassandraclusters.yaml
for crd in config/crd/bases/*.yaml; do \
crdname=$$(basename $$crd); \
end=$$(expr $$(grep -n ^status $$crd|cut -f1 -d:) - 1); \
cat $$(echo v1-crds/$$crdname|sed 's/.yaml/_crd.yaml/') > /tmp/$$crdname; \
sed -e '1,/versions/d' -e "1,$${end}s/^..//" $$crd >> /tmp/$$crdname; \
cp /tmp/$$crdname $$crd; \
yq -i e '$(FIRST_VERSION).storage = false' $$crd; \
done
for chart in $(shell ls charts); do \
cp -v config/crd/bases/*.yaml charts/$$chart/crds/; \
done
Expand Down
1 change: 1 addition & 0 deletions api/v2/cassandrabackup_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@

// CassandraBackup is the Schema for the cassandrabackups API
// +k8s:openapi-gen=true
// +kubebuilder:subresource:status
type CassandraBackup struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
Expand All @@ -82,10 +83,10 @@

func (cb *CassandraBackup) PreventBackupDeletion(value bool) {
if value {
cb.SetFinalizers([]string{"kubernetes.io/unschedule-needed"})

Check failure on line 86 in api/v2/cassandrabackup_types.go

View workflow job for this annotation

GitHub Actions / lint

cb.SetFinalizers undefined (type *CassandraBackup has no field or method SetFinalizers) (typecheck)
return
}
cb.SetFinalizers([]string{})

Check failure on line 89 in api/v2/cassandrabackup_types.go

View workflow job for this annotation

GitHub Actions / lint

cb.SetFinalizers undefined (type *CassandraBackup has no field or method SetFinalizers) (typecheck)
}

func (cb *CassandraBackup) IsScheduled() bool {
Expand All @@ -98,16 +99,16 @@
func (cb *CassandraBackup) ComputeLastAppliedAnnotation() (string, error) {
lastcb := cb.DeepCopy()
//remove unnecessary fields
lastcb.Annotations = nil

Check failure on line 102 in api/v2/cassandrabackup_types.go

View workflow job for this annotation

GitHub Actions / lint

lastcb.Annotations undefined (type *CassandraBackup has no field or method Annotations) (typecheck)
lastcb.ResourceVersion = ""

Check failure on line 103 in api/v2/cassandrabackup_types.go

View workflow job for this annotation

GitHub Actions / lint

lastcb.ResourceVersion undefined (type *CassandraBackup has no field or method ResourceVersion) (typecheck)
lastcb.Status = BackRestStatus{}
lastcb.Finalizers = nil

Check failure on line 105 in api/v2/cassandrabackup_types.go

View workflow job for this annotation

GitHub Actions / lint

lastcb.Finalizers undefined (type *CassandraBackup has no field or method Finalizers) (typecheck)
lastcb.ObjectMeta = metav1.ObjectMeta{Name: lastcb.Name, Namespace: lastcb.Namespace,

Check failure on line 106 in api/v2/cassandrabackup_types.go

View workflow job for this annotation

GitHub Actions / lint

lastcb.Name undefined (type *CassandraBackup has no field or method Name) (typecheck)

Check failure on line 106 in api/v2/cassandrabackup_types.go

View workflow job for this annotation

GitHub Actions / lint

lastcb.Namespace undefined (type *CassandraBackup has no field or method Namespace) (typecheck)
CreationTimestamp: lastcb.CreationTimestamp}

Check failure on line 107 in api/v2/cassandrabackup_types.go

View workflow job for this annotation

GitHub Actions / lint

lastcb.CreationTimestamp undefined (type *CassandraBackup has no field or method CreationTimestamp) (typecheck)

lastApplied, err := json.Marshal(lastcb)
if err != nil {
logrus.Errorf("[%s]: Cannot create last-applied-configuration = %v", cb.Name, err)

Check failure on line 111 in api/v2/cassandrabackup_types.go

View workflow job for this annotation

GitHub Actions / lint

cb.Name undefined (type *CassandraBackup has no field or method Name) (typecheck)
}
return string(lastApplied), err
}
Expand Down
3 changes: 2 additions & 1 deletion api/v2/cassandracluster_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
DefaultReadinessHealthCheckPeriod int32 = 10

defaultCassandraImage = "cassandra:3.11.10"
defaultBootstrapImage = "ghcr.io/cscetbon/casskop-bootstrap:0.1.16"
defaultBootstrapImage = "ghcr.io/cscetbon/casskop-bootstrap:0.1.19"
defaultConfigBuilderImage = "datastax/cass-config-builder:1.0.4"

DefaultBackRestImage = "ghcr.io/cscetbon/instaclustr-icarus:1.1.3"
Expand Down Expand Up @@ -172,7 +172,7 @@
if len(cc.Status.Phase) == 0 {
cc.Status.Phase = ClusterPhaseInitial.Name
if cc.InitCassandraRackList() < 1 {
logrus.Errorf("[%s]: We should have at list One Rack, Please correct the Error", cc.Name)

Check failure on line 175 in api/v2/cassandracluster_types.go

View workflow job for this annotation

GitHub Actions / lint

cc.Name undefined (type *CassandraCluster has no field or method Name) (typecheck)
}
if cc.Status.SeedList == nil {
cc.Status.SeedList = cc.InitSeedList()
Expand Down Expand Up @@ -1001,6 +1001,7 @@
// CassandraCluster is the Schema for the cassandraclusters API
// +k8s:openapi-gen=true
// +kubebuilder:storageversion
// +kubebuilder:subresource:status
// +kubebuilder:resource:path=cassandraclusters,scope=Namespaced,shortName=cassc;casscs
type CassandraCluster struct {
metav1.TypeMeta `json:",inline"`
Expand Down
2 changes: 1 addition & 1 deletion api/v2/cassandrarestore_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ type CassandraRestoreSpec struct {
// +genclient:noStatus
// +resourceName=cassandrarestores
// +kubebuilder:object:root=true

// +kubebuilder:subresource:status
// CassandraRestore is a Casskop Operator resource that represents the restoration of a backup of a Cassandra cluster
type CassandraRestore struct {
metav1.TypeMeta `json:",inline"`
Expand Down
4 changes: 2 additions & 2 deletions api/v2/zz_generated.deepcopy.go

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

144 changes: 35 additions & 109 deletions charts/casskop/crds/db.orange.com_cassandrabackups.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.16.5
name: cassandrabackups.db.orange.com
spec:
group: db.orange.com
Expand All @@ -11,101 +13,6 @@ spec:
singular: cassandrabackup
scope: Namespaced
versions:
- name: v1alpha1
schema:
openAPIV3Schema:
description: Defines a backup operation and its details
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:
properties:
bandwidth:
description: Specify the bandwidth to not exceed when uploading files to the cloud. Format supported is \d+[KMG] case insensitive. You can use values like 10M (meaning 10MB), 1024, 1024K, 2G, etc...
type: string
cassandraCluster:
description: Name of the CassandraCluster to backup
type: string
concurrentConnections:
description: Maximum number of threads used to download files from the cloud. Defaults to 10
format: int32
type: integer
datacenter:
description: Cassandra DC name to back up, used to find the cassandra nodes in the CassandraCluster
type: string
duration:
description: Specify a duration the backup should try to last. See https://golang.org/pkg/time/#ParseDuration for an exhaustive list of the supported units. You can use values like .25h, 15m, 900s all meaning 15 minutes
type: string
entities:
description: Database entities to backup, it might be either only keyspaces or only tables prefixed by their respective keyspace, e.g. 'k1,k2' if one wants to backup whole keyspaces or 'ks1.t1,ks2.t2' if one wants to restore specific tables. These formats are mutually exclusive so 'k1,k2.t2' is invalid. An empty field will backup all keyspaces
type: string
schedule:
description: Specify a schedule to assigned to the backup. The schedule doesn't enforce anything so if you schedule multiple backups around the same time they would conflict. See https://godoc.org/github.com/robfig/cron for more information regarding the supported formats
type: string
secret:
description: Name of Secret to use when accessing cloud storage providers
type: string
snapshotTag:
description: name of snapshot to make so this snapshot will be uploaded to storage location. If not specified, the name of snapshot will be automatically generated and it will have name 'autosnap-milliseconds-since-epoch'
type: string
storageLocation:
description: URI for the backup target location e.g. s3 bucket, filepath
type: string
required:
- cassandraCluster
- snapshotTag
- storageLocation
type: object
status:
properties:
condition:
description: BackRestCondition describes the observed state of a Restore at a certain point
properties:
failureCause:
items:
properties:
message:
description: message explaining the error
type: string
source:
description: hostame of a node where this error has occurred
type: string
type: object
type: array
lastTransitionTime:
type: string
type:
type: string
required:
- type
type: object
coordinatorMember:
description: Name of the pod the restore operation is executed on
type: string
id:
description: unique identifier of an operation, a random id is assigned to each operation after a request is submitted, from caller's perspective, an id is sent back as a response to his request so he can further query state of that operation, referencing id, by operations/{id} endpoint
type: string
progress:
description: Progress is a percentage, 100% means the operation is completed, either successfully or with errors
type: string
timeCompleted:
type: string
timeCreated:
type: string
timeStarted:
type: string
type: object
required:
- spec
type: object
served: true
storage: false
- name: v2
schema:
openAPIV3Schema:
Expand All @@ -115,10 +22,19 @@ spec:
- spec
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'
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'
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
Expand All @@ -130,7 +46,9 @@ spec:
- storageLocation
properties:
bandwidth:
description: Specify the bandwidth to not exceed when uploading files to the cloud. Format supported is \d+[KMG] case insensitive. You can use values like 10M (meaning 10MB), 1024, 1024K, 2G, etc...
description: |-
Specify the bandwidth to not exceed when uploading files to the cloud. Format supported is \d+[KMG] case
insensitive. You can use values like 10M (meaning 10MB), 1024, 1024K, 2G, etc...
type: string
cassandraCluster:
description: Name of the CassandraCluster to backup
Expand All @@ -143,19 +61,28 @@ spec:
description: Cassandra DC name to back up, used to find the cassandra nodes in the CassandraCluster
type: string
duration:
description: Specify a duration the backup should try to last. See https://golang.org/pkg/time/#ParseDuration for an exhaustive list of the supported units. You can use values like .25h, 15m, 900s all meaning 15 minutes
description: |-
Specify a duration the backup should try to last. See https://golang.org/pkg/time/#ParseDuration for an
exhaustive list of the supported units. You can use values like .25h, 15m, 900s all meaning 15 minutes
type: string
entities:
description: Database entities to backup, it might be either only keyspaces or only tables prefixed by their respective keyspace, e.g. 'k1,k2' if one wants to backup whole keyspaces or 'ks1.t1,ks2.t2' if one wants to restore specific tables. These formats are mutually exclusive so 'k1,k2.t2' is invalid. An empty field will backup all keyspaces
description: |-
Database entities to backup, it might be either only keyspaces or only tables prefixed by their respective
keyspace, e.g. 'k1,k2' if one wants to backup whole keyspaces or 'ks1.t1,ks2.t2' if one wants to restore specific
tables. These formats are mutually exclusive so 'k1,k2.t2' is invalid. An empty field will backup all keyspaces
type: string
schedule:
description: Specify a schedule to assigned to the backup. The schedule doesn't enforce anything so if you schedule multiple backups around the same time they would conflict. See https://godoc.org/github.com/robfig/cron for more information regarding the supported formats
description: |-
Specify a schedule to assigned to the backup. The schedule doesn't enforce anything so if you schedule multiple
backups around the same time they would conflict. See https://godoc.org/github.com/robfig/cron for more information regarding the supported formats
type: string
secret:
description: Name of Secret to use when accessing cloud storage providers
type: string
snapshotTag:
description: name of snapshot to make so this snapshot will be uploaded to storage location. If not specified, the name of snapshot will be automatically generated and it will have name 'autosnap-milliseconds-since-epoch'
description: |-
name of snapshot to make so this snapshot will be uploaded to storage location. If not specified, the name of
snapshot will be automatically generated and it will have name 'autosnap-milliseconds-since-epoch'
type: string
storageLocation:
description: URI for the backup target location e.g. s3 bucket, filepath
Expand Down Expand Up @@ -188,7 +115,10 @@ spec:
description: Name of the pod the restore operation is executed on
type: string
id:
description: unique identifier of an operation, a random id is assigned to each operation after a request is submitted, from caller's perspective, an id is sent back as a response to his request so he can further query state of that operation, referencing id, by operations/{id} endpoint
description: |-
unique identifier of an operation, a random id is assigned to each operation after a request is submitted,
from caller's perspective, an id is sent back as a response to his request so he can further query state of that operation,
referencing id, by operations/{id} endpoint
type: string
progress:
description: Progress is a percentage, 100% means the operation is completed, either successfully or with errors
Expand All @@ -201,9 +131,5 @@ spec:
type: string
served: true
storage: true
status:
acceptedNames:
kind: ""
plural: ""
conditions: []
storedVersions: []
subresources:
status: {}
Loading
Loading