Skip to content

Commit

Permalink
Merge pull request #124 from red-hat-storage/sync_ds--main
Browse files Browse the repository at this point in the history
Syncing latest changes from main for ocs-client-operator
  • Loading branch information
openshift-merge-bot[bot] authored Mar 28, 2024
2 parents bbb6b76 + a79f241 commit 4f45d99
Show file tree
Hide file tree
Showing 426 changed files with 33,971 additions and 22,760 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/codespell.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ jobs:
name: codespell
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4

- name: codespell
uses: codespell-project/actions-codespell@master
uses: codespell-project/actions-codespell@v2
with:
exclude_file: go.sum
check_filenames: true
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/commitlint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@ jobs:
name: commitlint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
with:
fetch-depth: 0

- name: run commitlint
uses: wagoid/commitlint-github-action@v4
uses: wagoid/commitlint-github-action@v5
with:
configFile: './.github/workflows/conf/commitlintrc.json'
helpURL: |
Expand Down
36 changes: 12 additions & 24 deletions .github/workflows/docker-build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,50 +11,38 @@ jobs:
container-build:
name: operator-build
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
go: ["1.20", "1.21"]
steps:
- uses: actions/setup-go@v2
with:
go-version: ${{ matrix.go }}
- uses: actions/checkout@v4

- uses: actions/checkout@v2
- uses: actions/setup-go@v5
with:
go-version-file: go.mod

- name: Build operator container image
run: make build

bundle-build:
name: bundle-build
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
go: ["1.20", "1.21"]
steps:
- uses: actions/setup-go@v2
with:
go-version: ${{ matrix.go }}
- uses: actions/checkout@v4

- uses: actions/checkout@v2
- uses: actions/setup-go@v5
with:
go-version-file: go.mod

- name: Build operator bundle container image
run: make bundle-build

catalog-build:
name: catalog-build
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
go: ["1.20", "1.21"]
steps:
- uses: actions/setup-go@v2
with:
go-version: ${{ matrix.go }}
- uses: actions/checkout@v4

- uses: actions/checkout@v2
- uses: actions/setup-go@v5
with:
go-version-file: go.mod

- name: Build catalog container image
env:
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/docker-push.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,16 @@ jobs:
name: docker-push
runs-on: ubuntu-latest
steps:
- uses: actions/setup-go@v2
- uses: actions/checkout@v4
with:
go-version: '1.18'
fetch-depth: 0

- uses: actions/checkout@v2
- uses: actions/setup-go@v5
with:
fetch-depth: 0
go-version-file: go.mod

- name: Login to Quay
uses: docker/login-action@v1
uses: docker/login-action@v3
with:
registry: quay.io
username: ${{ secrets.QUAY_USERNAME }}
Expand Down
17 changes: 5 additions & 12 deletions .github/workflows/golangci-lint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,19 +11,15 @@ jobs:
golangci-lint:
name: golangci-lint
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
go: ["1.20", "1.21"]
steps:
- uses: actions/setup-go@v2
with:
go-version: ${{ matrix.go }}
- uses: actions/checkout@v4

- uses: actions/checkout@v2
- uses: actions/setup-go@v5
with:
go-version-file: go.mod

- name: golangci-lint
uses: golangci/golangci-lint-action@v2
uses: golangci/golangci-lint-action@v4
with:
# Optional: version of golangci-lint to use in form of v1.2 or
# v1.2.3 or `latest` to use the latest version
Expand All @@ -45,9 +41,6 @@ jobs:
# The default value is `false`.
# only-new-issues: true

# Optional: if set to true then the action will use pre-installed Go.
skip-go-installation: true

# Optional: if set to true then the action don't cache or
# restore ~/go/pkg.
# skip-pkg-cache: true
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/verify-generated.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
os: [ubuntu-latest, macos-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Verify changes to CSI images manifest
run: make verify-csi-images-manifest
2 changes: 1 addition & 1 deletion .github/workflows/yamllint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
name: yamllint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: yamllint
uses: ibiqlik/action-yamllint@v3
with:
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Build the manager binary
FROM golang:1.20 as builder
FROM golang:1.21 as builder

WORKDIR /workspace

Expand Down
14 changes: 13 additions & 1 deletion 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: openshift.io
layout:
- go.kubebuilder.io/v3
Expand All @@ -19,10 +23,18 @@ resources:
- api:
crdVersion: v1
namespaced: true
controller: true
domain: openshift.io
group: ocs
kind: StorageClassClaim
path: github.com/red-hat-storage/ocs-client-operator/api/v1alpha1
version: v1alpha1
- api:
crdVersion: v1
namespaced: true
controller: true
domain: openshift.io
group: ocs
kind: StorageClaim
path: github.com/red-hat-storage/ocs-client-operator/api/v1alpha1
version: v1alpha1
version: "3"
92 changes: 92 additions & 0 deletions api/v1alpha1/storageclaim_types.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
/*
Copyright 2022 Red Hat, Inc.
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 v1alpha1

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

type storageClaimState string

const (
// StorageClaimInitializing represents Initializing state of StorageClaim
StorageClaimInitializing storageClaimState = "Initializing"
// StorageClaimValidating represents Validating state of StorageClaim
StorageClaimValidating storageClaimState = "Validating"
// StorageClaimFailed represents Failed state of StorageClaim
StorageClaimFailed storageClaimState = "Failed"
// StorageClaimCreating represents Configuring state of StorageClaim
StorageClaimCreating storageClaimState = "Creating"
// StorageClaimConfiguring represents Configuring state of StorageClaim
StorageClaimConfiguring storageClaimState = "Configuring"
// StorageClaimReady represents Ready state of StorageClaim
StorageClaimReady storageClaimState = "Ready"
// StorageClaimDeleting represents Deleting state of StorageClaim
StorageClaimDeleting storageClaimState = "Deleting"
)

// StorageClaimStatus defines the observed state of StorageClaim
type StorageClaimStatus struct {
Phase storageClaimState `json:"phase,omitempty"`
}

type StorageClientNamespacedName struct {
Name string `json:"name"`
Namespace string `json:"namespace"`
}

// StorageClaimSpec defines the desired state of StorageClaim
type StorageClaimSpec struct {
//+kubebuilder:validation:Enum=block;sharedfile
Type string `json:"type"`
EncryptionMethod string `json:"encryptionMethod,omitempty"`
StorageProfile string `json:"storageProfile,omitempty"`
StorageClient *StorageClientNamespacedName `json:"storageClient"`
}

//+kubebuilder:object:root=true
//+kubebuilder:subresource:status
//+kubebuilder:resource:scope=Cluster
//+kubebuilder:printcolumn:name="StorageType",type="string",JSONPath=".spec.type"
//+kubebuilder:printcolumn:name="StorageProfile",type="string",JSONPath=".spec.storageProfile"
//+kubebuilder:printcolumn:name="StorageClientName",type="string",JSONPath=".spec.storageClient.name"
//+kubebuilder:printcolumn:name="StorageClientNamespace",type="string",JSONPath=".spec.storageClient.namespace"
//+kubebuilder:printcolumn:name="Phase",type="string",JSONPath=".status.phase"

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

//+kubebuilder:validation:Required
//+kubebuilder:validation:XValidation:rule="oldSelf == self",message="spec is immutable"
Spec StorageClaimSpec `json:"spec,omitempty"`
Status StorageClaimStatus `json:"status,omitempty"`
}

//+kubebuilder:object:root=true

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

func init() {
SchemeBuilder.Register(&StorageClaim{}, &StorageClaimList{})
}
6 changes: 1 addition & 5 deletions api/v1alpha1/storageclassclaim_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,6 @@ type StorageClassClaimStatus struct {
SecretNames []string `json:"secretNames,omitempty"`
}

type StorageClientNamespacedName struct {
Name string `json:"name"`
Namespace string `json:"namespace"`
}

// StorageClassClaimSpec defines the desired state of StorageClassClaim
type StorageClassClaimSpec struct {
//+kubebuilder:validation:Enum=blockpool;sharedfilesystem
Expand All @@ -69,6 +64,7 @@ type StorageClassClaimSpec struct {
//+kubebuilder:printcolumn:name="Phase",type="string",JSONPath=".status.phase"

// StorageClassClaim is the Schema for the storageclassclaims API
//+kubebuilder:deprecatedversion:warning="StorageClassClaim API is deprecated and will be removed in future version, please use StorageClaim API instead."
type StorageClassClaim struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
Expand Down
Loading

0 comments on commit 4f45d99

Please sign in to comment.