diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index c73b862..0101f3f 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -8,8 +8,6 @@ Fixes #? **PR acceptance criteria**: -- [ ] Change Log - - Are all your changes documented under the [upcoming release](https://github.com/devfile/registry-operator/tree/main/CHANGELOG.md#unreleased) entry? - [ ] Test Coverage - Are your changes sufficiently tested, and are any applicable test cases added or updated to cover your changes? - [ ] Gosec scans diff --git a/CHANGELOG.md b/CHANGELOG.md deleted file mode 100644 index a31db14..0000000 --- a/CHANGELOG.md +++ /dev/null @@ -1,65 +0,0 @@ -# Change Log -All notable changes to this project will be documented in this file. - -The format is based on [Keep a Changelog](http://keepachangelog.com/) -and this project adheres to [Semantic Versioning](http://semver.org/). - -## [Unreleased] - -### Added - -### Changed - -### Fixed - -## [0.1.0] - -### Added -- [devfile/api#1106](https://github.com/devfile/api/issues/1106) - Registry operator should be in sync with operator SDK releases - - Addition of `CHANGELOG.md` -- [devfile/api#1233](https://github.com/devfile/api/issues/1233) - - Included `install-cert` as an required step before `install` and `deploy` - -### Changed -- [devfile/api#1233](https://github.com/devfile/api/issues/1233) - Update CONTRIBUTING for registry operator - - Replaced prerequisites with a reference to the [requirements section](README.md#requirements) under the README -- [devfile/api#1211](https://github.com/devfile/api/issues/1211) - Devfile registry operator pre-release to OperatorHub - - Bump version to `v0.1.0` - - Changes to CRs, CRDs, samples, and CSV to provide up to date information on the operator - - Metadata - - Capabilities - - Categories - - Container Image - - Source Repository Link - - Maintainer Organization - - Samples List - - Short Description - - Maintainers List - - Icon - - Display Name - - Long Description - - Version - - Update [README](README.md) with [LICENSE](LICENSE) and [CONTRIBUTING.md](CONTRIBUTING.md) links -- [devfile/api#1106](https://github.com/devfile/api/issues/1106) - Registry operator should be in sync with operator SDK releases - - Syncs changes up to operator sdk v1.28 - - [v1.28.0 changes](https://sdk.operatorframework.io/docs/upgrading-sdk-version/v1.28.0/) - - [v1.25.0 changes](https://sdk.operatorframework.io/docs/upgrading-sdk-version/v1.25.0/) - - [v1.23.0 changes](https://sdk.operatorframework.io/docs/upgrading-sdk-version/v1.23.0/) -- [devfile/api#1015](https://github.com/devfile/api/issues/1015) - Complete documentation coverage of registry operator - - Provided complete documentation on makefile usage - - Provided complete documentation on deployment spec fields -- [devfile/api#881](https://github.com/devfile/api/issues/881) - Update Ginkgo version in registry operator - -### Fixed -- [devfile/api#1106](https://github.com/devfile/api/issues/1106) - Registry operator should be in sync with operator SDK releases - - Registry operator service account changed from `default` to `service-account` to fix permissions error for creating leader election leases -- [devfile/api#1211](https://github.com/devfile/api/issues/1211) - Devfile registry operator pre-release to OperatorHub - - Fixes for links under [PR template](.github/PULL_REQUEST_TEMPLATE.md) \ No newline at end of file diff --git a/VERSION b/VERSION index 6c6aa7c..6da28dd 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -0.1.0 \ No newline at end of file +0.1.1 \ No newline at end of file diff --git a/add_licenses.sh b/add_licenses.sh new file mode 100755 index 0000000..d116872 --- /dev/null +++ b/add_licenses.sh @@ -0,0 +1,29 @@ +#!/bin/bash +# +# +# Copyright Red Hat +# +# 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. + +# This script adds license headers that are missing from go files + + +if ! command -v addlicense 2> /dev/null +then + echo "error addlicense must be installed with this command: go install github.com/google/addlicense@latest" && exit 1 +else + echo 'addlicense -v -f license_header.txt **/*.go' + addlicense -v -f license_header.txt $(find . -not -path '*/\.*' -not -path '*/vendor/*' -not -name 'zz_generated.*.go' -name '*.go') +fi + + diff --git a/api/v1alpha1/clusterdevfileregistrieslist_types.go b/api/v1alpha1/clusterdevfileregistrieslist_types.go index 15fad35..456bc5a 100644 --- a/api/v1alpha1/clusterdevfileregistrieslist_types.go +++ b/api/v1alpha1/clusterdevfileregistrieslist_types.go @@ -1,18 +1,18 @@ -/* -Copyright 2022-2023 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. -*/ +// +// +// Copyright Red Hat +// +// 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 @@ -24,6 +24,7 @@ import ( //+kubebuilder:subresource:status //+kubebuilder:resource:scope=Cluster // +kubebuilder:printcolumn:name="Status",type="string",JSONPath=".status.status",description="The status for the Cluster Devfile Registries List" +// +operator-sdk:csv:customresourcedefinitions:resources={{Deployment,v1,clusterdevfileregistrieslist-deployment}} // ClusterDevfileRegistriesList is a custom resource where cluster admins can add a list of Devfile Registries to allow devfiles to be visible // at the cluster level. In order to be added to the list, the Devfile Registries must be reachable, supports the Devfile v2.0 spec and above, diff --git a/api/v1alpha1/clusterdevfileregistrieslist_webhook.go b/api/v1alpha1/clusterdevfileregistrieslist_webhook.go index 2c84cf9..c811647 100644 --- a/api/v1alpha1/clusterdevfileregistrieslist_webhook.go +++ b/api/v1alpha1/clusterdevfileregistrieslist_webhook.go @@ -1,18 +1,18 @@ -/* -Copyright 2022-2023 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. -*/ +// +// +// Copyright Red Hat +// +// 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 diff --git a/api/v1alpha1/clusterdevfileregistrieslist_webhook_test.go b/api/v1alpha1/clusterdevfileregistrieslist_webhook_test.go index fcbb7fe..c4395cb 100644 --- a/api/v1alpha1/clusterdevfileregistrieslist_webhook_test.go +++ b/api/v1alpha1/clusterdevfileregistrieslist_webhook_test.go @@ -1,6 +1,6 @@ // // -// Copyright 2022-2023 Red Hat, Inc. +// Copyright Red Hat // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/api/v1alpha1/devfileregistrieslist_types.go b/api/v1alpha1/devfileregistrieslist_types.go index a075f0a..3dee2ff 100644 --- a/api/v1alpha1/devfileregistrieslist_types.go +++ b/api/v1alpha1/devfileregistrieslist_types.go @@ -1,18 +1,18 @@ -/* -Copyright 2022-2023 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. -*/ +// +// +// Copyright Red Hat +// +// 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 @@ -29,18 +29,22 @@ type DevfileRegistriesListSpec struct { // Important: Run "make" to regenerate code after modifying this file // DevfileRegistries is a list of devfile registry services - //+optional + // +operator-sdk:csv:customresourcedefinitions:type=spec + // +optional DevfileRegistries []DevfileRegistryService `json:"devfileRegistries"` } // DevfileRegistryService represents the properties used to identify a devfile registry service. type DevfileRegistryService struct { - //Name is the unique Name of the devfile registry. + // Name is the unique Name of the devfile registry. + // +operator-sdk:csv:customresourcedefinitions:type=spec Name string `json:"name"` - //URL is the unique URL of the devfile registry. + // URL is the unique URL of the devfile registry. + // +operator-sdk:csv:customresourcedefinitions:type=spec URL string `json:"url"` - //SkipTLSVerify defaults to false. Set to true in a non-production environment to bypass certificate checking - //+optional + // SkipTLSVerify defaults to false. Set to true in a non-production environment to bypass certificate checking + // +operator-sdk:csv:customresourcedefinitions:type=spec + // +optional SkipTLSVerify bool `json:"skipTLSVerify"` } @@ -48,13 +52,16 @@ type DevfileRegistryService struct { type DevfileRegistriesListStatus struct { // INSERT ADDITIONAL STATUS FIELD - define observed state of cluster // Important: Run "make" to regenerate code after modifying this file - //Status shows the state of this CR's devfile registry list. If registries are no longer reachable, they will be listed here - Status string `json:"status"` + + // Conditions shows the state of this CR's devfile registry list. If registries are no longer reachable, they will be listed here + // +operator-sdk:csv:customresourcedefinitions:type=status + Conditions []metav1.Condition `json:"conditions,omitempty" patchStrategy:"merge" patchMergeKey:"type" protobuf:"bytes,1,rep,name=conditions"` } -//+kubebuilder:object:root=true -//+kubebuilder:subresource:status +// +kubebuilder:object:root=true +// +kubebuilder:subresource:status // +kubebuilder:printcolumn:name="Status",type="string",JSONPath=".status.status",description="The status for the Devfile Registries List" +// +operator-sdk:csv:customresourcedefinitions:resources={{Deployment,v1,devfileregistrieslist-deployment}} // DevfileRegistriesList is a custom resource where namespace users can add a list of Devfile Registries to allow devfiles to be visible // at the namespace level. In order to be added to the list, the Devfile Registries must be reachable, supports the Devfile v2.0 spec diff --git a/api/v1alpha1/devfileregistrieslist_webhook.go b/api/v1alpha1/devfileregistrieslist_webhook.go index b2d47b7..436bf62 100644 --- a/api/v1alpha1/devfileregistrieslist_webhook.go +++ b/api/v1alpha1/devfileregistrieslist_webhook.go @@ -1,18 +1,18 @@ -/* -Copyright 2022-2023 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. -*/ +// +// +// Copyright Red Hat +// +// 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 diff --git a/api/v1alpha1/devfileregistrieslist_webhook_test.go b/api/v1alpha1/devfileregistrieslist_webhook_test.go index 8851b5a..564f1a5 100644 --- a/api/v1alpha1/devfileregistrieslist_webhook_test.go +++ b/api/v1alpha1/devfileregistrieslist_webhook_test.go @@ -1,6 +1,6 @@ // // -// Copyright 2022-2023 Red Hat, Inc. +// Copyright Red Hat // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/api/v1alpha1/devfileregistry_types.go b/api/v1alpha1/devfileregistry_types.go index 6c26d3e..0471df1 100644 --- a/api/v1alpha1/devfileregistry_types.go +++ b/api/v1alpha1/devfileregistry_types.go @@ -1,18 +1,18 @@ -/* -Copyright 2020-2023 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. -*/ +// +// +// Copyright Red Hat +// +// 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 @@ -28,35 +28,46 @@ import ( // DevfileRegistrySpec defines the desired state of DevfileRegistry type DevfileRegistrySpec struct { // Sets the devfile index container spec to be deployed on the Devfile Registry + // +operator-sdk:csv:customresourcedefinitions:type=spec // +optional DevfileIndex DevfileRegistrySpecContainer `json:"devfileIndex,omitempty"` // Sets the OCI registry container spec to be deployed on the Devfile Registry + // +operator-sdk:csv:customresourcedefinitions:type=spec // +optional OciRegistry DevfileRegistrySpecContainer `json:"ociRegistry,omitempty"` // Sets the registry viewer container spec to be deployed on the Devfile Registry + // +operator-sdk:csv:customresourcedefinitions:type=spec // +optional RegistryViewer DevfileRegistrySpecContainer `json:"registryViewer,omitempty"` // Sets the container image containing devfile stacks to be deployed on the Devfile Registry + // +operator-sdk:csv:customresourcedefinitions:type=spec // +optional // +deprecated DevfileIndexImage string `json:"devfileIndexImage,omitempty"` // Overrides the container image used for the OCI registry. // Recommended to leave blank and default to the image specified by the operator. + // +operator-sdk:csv:customresourcedefinitions:type=spec // +optional // +deprecated OciRegistryImage string `json:"ociRegistryImage,omitempty"` // Overrides the container image used for the registry viewer. + // +operator-sdk:csv:customresourcedefinitions:type=spec // +optional // +deprecated RegistryViewerImage string `json:"registryViewerImage,omitempty"` - Storage DevfileRegistrySpecStorage `json:"storage,omitempty"` - TLS DevfileRegistrySpecTLS `json:"tls,omitempty"` - K8s DevfileRegistrySpecK8sOnly `json:"k8s,omitempty"` + // +operator-sdk:csv:customresourcedefinitions:type=spec + Storage DevfileRegistrySpecStorage `json:"storage,omitempty"` + // +operator-sdk:csv:customresourcedefinitions:type=spec + TLS DevfileRegistrySpecTLS `json:"tls,omitempty"` + // +operator-sdk:csv:customresourcedefinitions:type=spec + K8s DevfileRegistrySpecK8sOnly `json:"k8s,omitempty"` + // +operator-sdk:csv:customresourcedefinitions:type=spec Telemetry DevfileRegistrySpecTelemetry `json:"telemetry,omitempty"` // Sets the registry server deployment to run under headless mode + // +operator-sdk:csv:customresourcedefinitions:type=spec // +optional Headless *bool `json:"headless,omitempty"` } @@ -64,9 +75,11 @@ type DevfileRegistrySpec struct { // DevfileRegistrySpecContainer defines the desired state of a container for the DevfileRegistry type DevfileRegistrySpecContainer struct { // Sets the container image + // +operator-sdk:csv:customresourcedefinitions:type=spec // +optional Image string `json:"image,omitempty"` // Sets the image pull policy for the container + // +operator-sdk:csv:customresourcedefinitions:type=spec // +optional ImagePullPolicy corev1.PullPolicy `json:"imagePullPolicy,omitempty"` } @@ -75,11 +88,13 @@ type DevfileRegistrySpecContainer struct { type DevfileRegistrySpecStorage struct { // Instructs the operator to deploy the DevfileRegistry with persistent storage // Disabled by default. + // +operator-sdk:csv:customresourcedefinitions:type=spec // +optional Enabled *bool `json:"enabled,omitempty"` // Configures the size of the devfile registry's persistent volume, if enabled. // Defaults to 1Gi. + // +operator-sdk:csv:customresourcedefinitions:type=spec // +optional RegistryVolumeSize string `json:"registryVolumeSize,omitempty"` } @@ -88,10 +103,12 @@ type DevfileRegistrySpecStorage struct { type DevfileRegistrySpecTLS struct { // Instructs the operator to deploy the DevfileRegistry with TLS enabled. // Enabled by default. Disabling is only recommended for development or test. + // +operator-sdk:csv:customresourcedefinitions:type=spec // +optional Enabled *bool `json:"enabled,omitempty"` // Name of an optional, pre-existing TLS secret to use for TLS termination on ingress/route resources. + // +operator-sdk:csv:customresourcedefinitions:type=spec // +optional SecretName string `json:"secretName,omitempty"` } @@ -99,22 +116,26 @@ type DevfileRegistrySpecTLS struct { // DevfileRegistrySpecK8sOnly defines the desired state of the kubernetes-only fields of the DevfileRegistry type DevfileRegistrySpecK8sOnly struct { // Ingress domain for a Kubernetes cluster. This MUST be explicitly specified on Kubernetes. There are no defaults + // +operator-sdk:csv:customresourcedefinitions:type=spec IngressDomain string `json:"ingressDomain,omitempty"` } // Telemetry defines the desired state for telemetry in the DevfileRegistry type DevfileRegistrySpecTelemetry struct { // The registry name (can be any string) that is used as identifier for devfile telemetry. + // +operator-sdk:csv:customresourcedefinitions:type=spec // +optional RegistryName string `json:"registryName"` // Specify a telemetry key to allow devfile specific data to be sent to a client's own Segment analytics source. // If the write key is specified then telemetry will be enabled + // +operator-sdk:csv:customresourcedefinitions:type=spec // +optional Key string `json:"key,omitempty"` // Specify a telemetry write key for the registry viewer component to allow data to be sent to a client's own Segment analytics source. // If the write key is specified then telemetry for the registry viewer component will be enabled + // +operator-sdk:csv:customresourcedefinitions:type=spec // +optional RegistryViewerWriteKey string `json:"registryViewerWriteKey,omitempty"` } @@ -122,11 +143,17 @@ type DevfileRegistrySpecTelemetry struct { // DevfileRegistryStatus defines the observed state of DevfileRegistry type DevfileRegistryStatus struct { // URL is the exposed URL for the Devfile Registry, and is set in the status after the registry has become available. + // +operator-sdk:csv:customresourcedefinitions:type=status URL string `json:"url"` + + // Conditions shows the state devfile registries. + // +operator-sdk:csv:customresourcedefinitions:type=status + Conditions []metav1.Condition `json:"conditions,omitempty" patchStrategy:"merge" patchMergeKey:"type" protobuf:"bytes,1,rep,name=conditions"` } // +kubebuilder:object:root=true // +kubebuilder:subresource:status +// +operator-sdk:csv:customresourcedefinitions:resources={{Deployment,v1,devfileregistry-deployment}} // DevfileRegistry is a custom resource allows you to create and manage your own index server and registry viewer. // In order to be added, the Devfile Registry must be reachable, supports the Devfile v2.0 spec and above, and is diff --git a/api/v1alpha1/devfileregistry_webhook.go b/api/v1alpha1/devfileregistry_webhook.go index 40f910d..37c08e9 100644 --- a/api/v1alpha1/devfileregistry_webhook.go +++ b/api/v1alpha1/devfileregistry_webhook.go @@ -1,18 +1,18 @@ -/* -Copyright 2023 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. -*/ +// +// +// Copyright Red Hat +// +// 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 diff --git a/api/v1alpha1/devfileregistry_webhook_test.go b/api/v1alpha1/devfileregistry_webhook_test.go index 6dd0efb..a441a42 100644 --- a/api/v1alpha1/devfileregistry_webhook_test.go +++ b/api/v1alpha1/devfileregistry_webhook_test.go @@ -1,18 +1,18 @@ -/* -Copyright 2023 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. -*/ +// +// +// Copyright Red Hat +// +// 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 diff --git a/api/v1alpha1/groupversion_info.go b/api/v1alpha1/groupversion_info.go index 8c99bd0..3ac0550 100644 --- a/api/v1alpha1/groupversion_info.go +++ b/api/v1alpha1/groupversion_info.go @@ -1,18 +1,18 @@ -/* -Copyright 2020-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. -*/ +// +// +// Copyright Red Hat +// +// 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 contains API Schema definitions for the registry v1alpha1 API group // +kubebuilder:object:generate=true diff --git a/api/v1alpha1/validate.go b/api/v1alpha1/validate.go index beb707e..17a45ec 100644 --- a/api/v1alpha1/validate.go +++ b/api/v1alpha1/validate.go @@ -1,18 +1,18 @@ -/* -Copyright 2022-2023 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. -*/ +// +// +// Copyright Red Hat +// +// 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 diff --git a/api/v1alpha1/validate_test.go b/api/v1alpha1/validate_test.go index d162564..a3fc2b9 100644 --- a/api/v1alpha1/validate_test.go +++ b/api/v1alpha1/validate_test.go @@ -1,18 +1,18 @@ -/* -Copyright 2022-2023 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. -*/ +// +// +// Copyright Red Hat +// +// 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 diff --git a/api/v1alpha1/webhook_suite_test.go b/api/v1alpha1/webhook_suite_test.go index b7a2712..44456a3 100644 --- a/api/v1alpha1/webhook_suite_test.go +++ b/api/v1alpha1/webhook_suite_test.go @@ -1,18 +1,18 @@ -/* -Copyright 2020-2023 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. -*/ +// +// +// Copyright Red Hat +// +// 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 diff --git a/api/v1alpha1/zz_generated.deepcopy.go b/api/v1alpha1/zz_generated.deepcopy.go index 6f834dc..e79bbe1 100644 --- a/api/v1alpha1/zz_generated.deepcopy.go +++ b/api/v1alpha1/zz_generated.deepcopy.go @@ -2,7 +2,9 @@ // +build !ignore_autogenerated /* -Copyright 2020-2023 Red Hat, Inc. + + +Copyright Red Hat Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -22,6 +24,7 @@ limitations under the License. package v1alpha1 import ( + "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" ) @@ -31,7 +34,7 @@ func (in *ClusterDevfileRegistriesList) DeepCopyInto(out *ClusterDevfileRegistri out.TypeMeta = in.TypeMeta in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) in.Spec.DeepCopyInto(&out.Spec) - out.Status = in.Status + in.Status.DeepCopyInto(&out.Status) } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterDevfileRegistriesList. @@ -90,7 +93,7 @@ func (in *DevfileRegistriesList) DeepCopyInto(out *DevfileRegistriesList) { out.TypeMeta = in.TypeMeta in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) in.Spec.DeepCopyInto(&out.Spec) - out.Status = in.Status + in.Status.DeepCopyInto(&out.Status) } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DevfileRegistriesList. @@ -166,6 +169,13 @@ func (in *DevfileRegistriesListSpec) DeepCopy() *DevfileRegistriesListSpec { // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *DevfileRegistriesListStatus) DeepCopyInto(out *DevfileRegistriesListStatus) { *out = *in + if in.Conditions != nil { + in, out := &in.Conditions, &out.Conditions + *out = make([]v1.Condition, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DevfileRegistriesListStatus. @@ -184,7 +194,7 @@ func (in *DevfileRegistry) DeepCopyInto(out *DevfileRegistry) { out.TypeMeta = in.TypeMeta in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) in.Spec.DeepCopyInto(&out.Spec) - out.Status = in.Status + in.Status.DeepCopyInto(&out.Status) } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DevfileRegistry. @@ -367,6 +377,13 @@ func (in *DevfileRegistrySpecTelemetry) DeepCopy() *DevfileRegistrySpecTelemetry // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *DevfileRegistryStatus) DeepCopyInto(out *DevfileRegistryStatus) { *out = *in + if in.Conditions != nil { + in, out := &in.Conditions, &out.Conditions + *out = make([]v1.Condition, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DevfileRegistryStatus. diff --git a/bundle.Dockerfile b/bundle.Dockerfile index 00c143b..016d9ff 100644 --- a/bundle.Dockerfile +++ b/bundle.Dockerfile @@ -5,7 +5,7 @@ LABEL operators.operatorframework.io.bundle.mediatype.v1=registry+v1 LABEL operators.operatorframework.io.bundle.manifests.v1=manifests/ LABEL operators.operatorframework.io.bundle.metadata.v1=metadata/ LABEL operators.operatorframework.io.bundle.package.v1=registry-operator -LABEL operators.operatorframework.io.bundle.channels.v1=alpha +LABEL operators.operatorframework.io.bundle.channels.v1=beta LABEL operators.operatorframework.io.metrics.builder=operator-sdk-v1.28.0 LABEL operators.operatorframework.io.metrics.mediatype.v1=metrics+v1 LABEL operators.operatorframework.io.metrics.project_layout=go.kubebuilder.io/v3 diff --git a/bundle/manifests/registry-operator.clusterserviceversion.yaml b/bundle/manifests/registry-operator.clusterserviceversion.yaml index 9b354f7..e5a5654 100644 --- a/bundle/manifests/registry-operator.clusterserviceversion.yaml +++ b/bundle/manifests/registry-operator.clusterserviceversion.yaml @@ -47,17 +47,17 @@ metadata: } } ] - capabilities: Full Lifecycle + capabilities: Basic Install catagories: OpenShift Optional,Developer Tools - containerImage: quay.io/devfile/registry-operator:v0.1.0 - createdAt: "2023-09-06T22:43:40Z" + containerImage: quay.io/devfile/registry-operator:v0.1.1 + createdAt: "2023-09-19T02:26:46Z" description: Deploy and manage Devfile Registries on Kubernetes and OpenShift with the Devfile Registry operator. operators.operatorframework.io/builder: operator-sdk-v1.28.0 operators.operatorframework.io/project_layout: go.kubebuilder.io/v3 repository: https://github.com/devfile/registry-operator support: Red Hat - name: registry-operator.v0.1.0 + name: registry-operator.v0.1.1 namespace: placeholder spec: apiservicedefinitions: {} @@ -71,6 +71,29 @@ spec: displayName: Cluster Devfile Registries List kind: ClusterDevfileRegistriesList name: clusterdevfileregistrieslists.registry.devfile.io + resources: + - kind: Deployment + name: clusterdevfileregistrieslist-deployment + version: v1 + specDescriptors: + - description: DevfileRegistries is a list of devfile registry services + displayName: Devfile Registries + path: devfileRegistries + - description: Name is the unique Name of the devfile registry. + displayName: Name + path: devfileRegistries[0].name + - description: SkipTLSVerify defaults to false. Set to true in a non-production + environment to bypass certificate checking + displayName: Skip TLSVerify + path: devfileRegistries[0].skipTLSVerify + - description: URL is the unique URL of the devfile registry. + displayName: URL + path: devfileRegistries[0].url + statusDescriptors: + - description: Conditions shows the state of this CR's devfile registry list. If + registries are no longer reachable, they will be listed here + displayName: Conditions + path: conditions version: v1alpha1 - description: DevfileRegistry is a custom resource allows you to create and manage your own index server and registry viewer. In order to be added, the Devfile @@ -79,6 +102,107 @@ spec: displayName: Devfile Registry kind: DevfileRegistry name: devfileregistries.registry.devfile.io + resources: + - kind: Deployment + name: devfileregistry-deployment + version: v1 + specDescriptors: + - description: Sets the devfile index container spec to be deployed on the Devfile + Registry + displayName: Devfile Index + path: devfileIndex + - description: Sets the container image + displayName: Image + path: devfileIndex.image + - description: Sets the image pull policy for the container + displayName: Image Pull Policy + path: devfileIndex.imagePullPolicy + - description: Sets the container image containing devfile stacks to be deployed + on the Devfile Registry + displayName: Devfile Index Image + path: devfileIndexImage + - description: Sets the registry server deployment to run under headless mode + displayName: Headless + path: headless + - displayName: K8s + path: k8s + - description: Ingress domain for a Kubernetes cluster. This MUST be explicitly + specified on Kubernetes. There are no defaults + displayName: Ingress Domain + path: k8s.ingressDomain + - description: Sets the OCI registry container spec to be deployed on the Devfile + Registry + displayName: Oci Registry + path: ociRegistry + - description: Sets the container image + displayName: Image + path: ociRegistry.image + - description: Sets the image pull policy for the container + displayName: Image Pull Policy + path: ociRegistry.imagePullPolicy + - description: Overrides the container image used for the OCI registry. Recommended + to leave blank and default to the image specified by the operator. + displayName: Oci Registry Image + path: ociRegistryImage + - description: Sets the registry viewer container spec to be deployed on the + Devfile Registry + displayName: Registry Viewer + path: registryViewer + - description: Sets the container image + displayName: Image + path: registryViewer.image + - description: Sets the image pull policy for the container + displayName: Image Pull Policy + path: registryViewer.imagePullPolicy + - description: Overrides the container image used for the registry viewer. + displayName: Registry Viewer Image + path: registryViewerImage + - displayName: Storage + path: storage + - description: Instructs the operator to deploy the DevfileRegistry with persistent + storage Disabled by default. + displayName: Enabled + path: storage.enabled + - description: Configures the size of the devfile registry's persistent volume, + if enabled. Defaults to 1Gi. + displayName: Registry Volume Size + path: storage.registryVolumeSize + - displayName: Telemetry + path: telemetry + - description: Specify a telemetry key to allow devfile specific data to be + sent to a client's own Segment analytics source. If the write key is specified + then telemetry will be enabled + displayName: Key + path: telemetry.key + - description: The registry name (can be any string) that is used as identifier + for devfile telemetry. + displayName: Registry Name + path: telemetry.registryName + - description: Specify a telemetry write key for the registry viewer component + to allow data to be sent to a client's own Segment analytics source. If + the write key is specified then telemetry for the registry viewer component + will be enabled + displayName: Registry Viewer Write Key + path: telemetry.registryViewerWriteKey + - displayName: TLS + path: tls + - description: Instructs the operator to deploy the DevfileRegistry with TLS + enabled. Enabled by default. Disabling is only recommended for development + or test. + displayName: Enabled + path: tls.enabled + - description: Name of an optional, pre-existing TLS secret to use for TLS termination + on ingress/route resources. + displayName: Secret Name + path: tls.secretName + statusDescriptors: + - description: Conditions shows the state devfile registries. + displayName: Conditions + path: conditions + - description: URL is the exposed URL for the Devfile Registry, and is set in + the status after the registry has become available. + displayName: URL + path: url version: v1alpha1 - description: DevfileRegistriesList is a custom resource where namespace users can add a list of Devfile Registries to allow devfiles to be visible at the @@ -88,6 +212,29 @@ spec: displayName: Devfile Registries List kind: DevfileRegistriesList name: devfileregistrieslists.registry.devfile.io + resources: + - kind: Deployment + name: devfileregistrieslist-deployment + version: v1 + specDescriptors: + - description: DevfileRegistries is a list of devfile registry services + displayName: Devfile Registries + path: devfileRegistries + - description: Name is the unique Name of the devfile registry. + displayName: Name + path: devfileRegistries[0].name + - description: SkipTLSVerify defaults to false. Set to true in a non-production + environment to bypass certificate checking + displayName: Skip TLSVerify + path: devfileRegistries[0].skipTLSVerify + - description: URL is the unique URL of the devfile registry. + displayName: URL + path: devfileRegistries[0].url + statusDescriptors: + - description: Conditions shows the state of this CR's devfile registry list. If + registries are no longer reachable, they will be listed here + displayName: Conditions + path: conditions version: v1alpha1 description: "A devfile registry is a service that stores and provides devfile stacks to Kubernetes developer tools like `odo`, Eclipse Che, and the OpenShift Developer @@ -585,10 +732,11 @@ spec: - email: ktsao@redhat.com name: Kim Tsao maturity: beta + minKubeVersion: 1.25.0 provider: name: Red Hat url: https://redhat.com - version: 0.1.0 + version: 0.1.1 webhookdefinitions: - admissionReviewVersions: - v1 diff --git a/bundle/manifests/registry.devfile.io_clusterdevfileregistrieslists.yaml b/bundle/manifests/registry.devfile.io_clusterdevfileregistrieslists.yaml index 0a7b9f6..b86c06e 100644 --- a/bundle/manifests/registry.devfile.io_clusterdevfileregistrieslists.yaml +++ b/bundle/manifests/registry.devfile.io_clusterdevfileregistrieslists.yaml @@ -15,6 +15,7 @@ spec: name: webhook-service namespace: system path: /convert + port: 443 conversionReviewVersions: - v1 group: registry.devfile.io @@ -80,15 +81,77 @@ spec: description: DevfileRegistriesListStatus defines the observed state of DevfileRegistriesList properties: - status: - description: 'INSERT ADDITIONAL STATUS FIELD - define observed state - of cluster Important: Run "make" to regenerate code after modifying - this file Status shows the state of this CR''s devfile registry + conditions: + description: Conditions shows the state of this CR's devfile registry list. If registries are no longer reachable, they will be listed - here' - type: string - required: - - status + here + 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, + \n 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 }" + 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. + format: date-time + type: string + message: + description: message is a human readable message indicating + details about the transition. This may be an empty string. + maxLength: 32768 + type: string + 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. + format: int64 + minimum: 0 + type: integer + 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. + maxLength: 1024 + minLength: 1 + pattern: ^[A-Za-z]([A-Za-z0-9_,:]*[A-Za-z0-9_])?$ + type: string + status: + description: status of the condition, one of True, False, Unknown. + enum: + - "True" + - "False" + - Unknown + type: string + 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) + 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])$ + type: string + required: + - lastTransitionTime + - message + - reason + - status + - type + type: object + type: array type: object type: object served: true diff --git a/bundle/manifests/registry.devfile.io_devfileregistries.yaml b/bundle/manifests/registry.devfile.io_devfileregistries.yaml index 36f3218..effbb22 100644 --- a/bundle/manifests/registry.devfile.io_devfileregistries.yaml +++ b/bundle/manifests/registry.devfile.io_devfileregistries.yaml @@ -154,6 +154,75 @@ spec: status: description: DevfileRegistryStatus defines the observed state of DevfileRegistry properties: + conditions: + description: Conditions shows the state devfile registries. + 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, + \n 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 }" + 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. + format: date-time + type: string + message: + description: message is a human readable message indicating + details about the transition. This may be an empty string. + maxLength: 32768 + type: string + 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. + format: int64 + minimum: 0 + type: integer + 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. + maxLength: 1024 + minLength: 1 + pattern: ^[A-Za-z]([A-Za-z0-9_,:]*[A-Za-z0-9_])?$ + type: string + status: + description: status of the condition, one of True, False, Unknown. + enum: + - "True" + - "False" + - Unknown + type: string + 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) + 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])$ + type: string + required: + - lastTransitionTime + - message + - reason + - status + - type + type: object + type: array url: description: URL is the exposed URL for the Devfile Registry, and is set in the status after the registry has become available. diff --git a/bundle/manifests/registry.devfile.io_devfileregistrieslists.yaml b/bundle/manifests/registry.devfile.io_devfileregistrieslists.yaml index 064db3b..c5ae6c5 100644 --- a/bundle/manifests/registry.devfile.io_devfileregistrieslists.yaml +++ b/bundle/manifests/registry.devfile.io_devfileregistrieslists.yaml @@ -15,6 +15,7 @@ spec: name: webhook-service namespace: system path: /convert + port: 443 conversionReviewVersions: - v1 group: registry.devfile.io @@ -80,15 +81,77 @@ spec: description: DevfileRegistriesListStatus defines the observed state of DevfileRegistriesList properties: - status: - description: 'INSERT ADDITIONAL STATUS FIELD - define observed state - of cluster Important: Run "make" to regenerate code after modifying - this file Status shows the state of this CR''s devfile registry + conditions: + description: Conditions shows the state of this CR's devfile registry list. If registries are no longer reachable, they will be listed - here' - type: string - required: - - status + here + 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, + \n 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 }" + 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. + format: date-time + type: string + message: + description: message is a human readable message indicating + details about the transition. This may be an empty string. + maxLength: 32768 + type: string + 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. + format: int64 + minimum: 0 + type: integer + 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. + maxLength: 1024 + minLength: 1 + pattern: ^[A-Za-z]([A-Za-z0-9_,:]*[A-Za-z0-9_])?$ + type: string + status: + description: status of the condition, one of True, False, Unknown. + enum: + - "True" + - "False" + - Unknown + type: string + 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) + 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])$ + type: string + required: + - lastTransitionTime + - message + - reason + - status + - type + type: object + type: array type: object type: object served: true diff --git a/bundle/metadata/annotations.yaml b/bundle/metadata/annotations.yaml index 7960e6c..143ee2f 100644 --- a/bundle/metadata/annotations.yaml +++ b/bundle/metadata/annotations.yaml @@ -4,7 +4,7 @@ annotations: operators.operatorframework.io.bundle.manifests.v1: manifests/ operators.operatorframework.io.bundle.metadata.v1: metadata/ operators.operatorframework.io.bundle.package.v1: registry-operator - operators.operatorframework.io.bundle.channels.v1: alpha + operators.operatorframework.io.bundle.channels.v1: beta operators.operatorframework.io.metrics.builder: operator-sdk-v1.28.0 operators.operatorframework.io.metrics.mediatype.v1: metrics+v1 operators.operatorframework.io.metrics.project_layout: go.kubebuilder.io/v3 diff --git a/bundle/tests/scorecard/config.yaml b/bundle/tests/scorecard/config.yaml index ae4870e..c0ffb5a 100644 --- a/bundle/tests/scorecard/config.yaml +++ b/bundle/tests/scorecard/config.yaml @@ -8,7 +8,7 @@ stages: - entrypoint: - scorecard-test - basic-check-spec - image: quay.io/operator-framework/scorecard-test:v1.1.0 + image: quay.io/operator-framework/scorecard-test:v1.28.0 labels: suite: basic test: basic-check-spec-test @@ -18,7 +18,7 @@ stages: - entrypoint: - scorecard-test - olm-bundle-validation - image: quay.io/operator-framework/scorecard-test:v1.1.0 + image: quay.io/operator-framework/scorecard-test:v1.28.0 labels: suite: olm test: olm-bundle-validation-test @@ -28,7 +28,7 @@ stages: - entrypoint: - scorecard-test - olm-crds-have-validation - image: quay.io/operator-framework/scorecard-test:v1.1.0 + image: quay.io/operator-framework/scorecard-test:v1.28.0 labels: suite: olm test: olm-crds-have-validation-test @@ -38,7 +38,7 @@ stages: - entrypoint: - scorecard-test - olm-crds-have-resources - image: quay.io/operator-framework/scorecard-test:v1.1.0 + image: quay.io/operator-framework/scorecard-test:v1.28.0 labels: suite: olm test: olm-crds-have-resources-test @@ -48,7 +48,7 @@ stages: - entrypoint: - scorecard-test - olm-spec-descriptors - image: quay.io/operator-framework/scorecard-test:v1.1.0 + image: quay.io/operator-framework/scorecard-test:v1.28.0 labels: suite: olm test: olm-spec-descriptors-test @@ -58,7 +58,7 @@ stages: - entrypoint: - scorecard-test - olm-status-descriptors - image: quay.io/operator-framework/scorecard-test:v1.1.0 + image: quay.io/operator-framework/scorecard-test:v1.28.0 labels: suite: olm test: olm-status-descriptors-test diff --git a/config/crd/bases/registry.devfile.io_clusterdevfileregistrieslists.yaml b/config/crd/bases/registry.devfile.io_clusterdevfileregistrieslists.yaml index ebdfe3d..ac597b0 100644 --- a/config/crd/bases/registry.devfile.io_clusterdevfileregistrieslists.yaml +++ b/config/crd/bases/registry.devfile.io_clusterdevfileregistrieslists.yaml @@ -70,15 +70,77 @@ spec: description: DevfileRegistriesListStatus defines the observed state of DevfileRegistriesList properties: - status: - description: 'INSERT ADDITIONAL STATUS FIELD - define observed state - of cluster Important: Run "make" to regenerate code after modifying - this file Status shows the state of this CR''s devfile registry + conditions: + description: Conditions shows the state of this CR's devfile registry list. If registries are no longer reachable, they will be listed - here' - type: string - required: - - status + here + 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, + \n 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 }" + 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. + format: date-time + type: string + message: + description: message is a human readable message indicating + details about the transition. This may be an empty string. + maxLength: 32768 + type: string + 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. + format: int64 + minimum: 0 + type: integer + 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. + maxLength: 1024 + minLength: 1 + pattern: ^[A-Za-z]([A-Za-z0-9_,:]*[A-Za-z0-9_])?$ + type: string + status: + description: status of the condition, one of True, False, Unknown. + enum: + - "True" + - "False" + - Unknown + type: string + 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) + 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])$ + type: string + required: + - lastTransitionTime + - message + - reason + - status + - type + type: object + type: array type: object type: object served: true diff --git a/config/crd/bases/registry.devfile.io_devfileregistries.yaml b/config/crd/bases/registry.devfile.io_devfileregistries.yaml index 83af21e..c23924a 100644 --- a/config/crd/bases/registry.devfile.io_devfileregistries.yaml +++ b/config/crd/bases/registry.devfile.io_devfileregistries.yaml @@ -155,6 +155,75 @@ spec: status: description: DevfileRegistryStatus defines the observed state of DevfileRegistry properties: + conditions: + description: Conditions shows the state devfile registries. + 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, + \n 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 }" + 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. + format: date-time + type: string + message: + description: message is a human readable message indicating + details about the transition. This may be an empty string. + maxLength: 32768 + type: string + 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. + format: int64 + minimum: 0 + type: integer + 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. + maxLength: 1024 + minLength: 1 + pattern: ^[A-Za-z]([A-Za-z0-9_,:]*[A-Za-z0-9_])?$ + type: string + status: + description: status of the condition, one of True, False, Unknown. + enum: + - "True" + - "False" + - Unknown + type: string + 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) + 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])$ + type: string + required: + - lastTransitionTime + - message + - reason + - status + - type + type: object + type: array url: description: URL is the exposed URL for the Devfile Registry, and is set in the status after the registry has become available. diff --git a/config/crd/bases/registry.devfile.io_devfileregistrieslists.yaml b/config/crd/bases/registry.devfile.io_devfileregistrieslists.yaml index a1c3b83..10bd0ae 100644 --- a/config/crd/bases/registry.devfile.io_devfileregistrieslists.yaml +++ b/config/crd/bases/registry.devfile.io_devfileregistrieslists.yaml @@ -70,15 +70,77 @@ spec: description: DevfileRegistriesListStatus defines the observed state of DevfileRegistriesList properties: - status: - description: 'INSERT ADDITIONAL STATUS FIELD - define observed state - of cluster Important: Run "make" to regenerate code after modifying - this file Status shows the state of this CR''s devfile registry + conditions: + description: Conditions shows the state of this CR's devfile registry list. If registries are no longer reachable, they will be listed - here' - type: string - required: - - status + here + 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, + \n 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 }" + 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. + format: date-time + type: string + message: + description: message is a human readable message indicating + details about the transition. This may be an empty string. + maxLength: 32768 + type: string + 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. + format: int64 + minimum: 0 + type: integer + 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. + maxLength: 1024 + minLength: 1 + pattern: ^[A-Za-z]([A-Za-z0-9_,:]*[A-Za-z0-9_])?$ + type: string + status: + description: status of the condition, one of True, False, Unknown. + enum: + - "True" + - "False" + - Unknown + type: string + 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) + 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])$ + type: string + required: + - lastTransitionTime + - message + - reason + - status + - type + type: object + type: array type: object type: object served: true diff --git a/config/crd/patches/webhook_in_clusterdevfileregistrieslists.yaml b/config/crd/patches/webhook_in_clusterdevfileregistrieslists.yaml index 8e6d9d2..21b3d6f 100644 --- a/config/crd/patches/webhook_in_clusterdevfileregistrieslists.yaml +++ b/config/crd/patches/webhook_in_clusterdevfileregistrieslists.yaml @@ -12,5 +12,6 @@ spec: namespace: system name: webhook-service path: /convert + port: 443 conversionReviewVersions: - v1 diff --git a/config/crd/patches/webhook_in_devfileregistries.yaml b/config/crd/patches/webhook_in_devfileregistries.yaml index 0bad056..cbb9b90 100644 --- a/config/crd/patches/webhook_in_devfileregistries.yaml +++ b/config/crd/patches/webhook_in_devfileregistries.yaml @@ -16,6 +16,7 @@ spec: namespace: system name: webhook-service path: /convert + port: 443 conversionReviewVersions: - v1 group: registry.devfile.io diff --git a/config/crd/patches/webhook_in_devfileregistrieslists.yaml b/config/crd/patches/webhook_in_devfileregistrieslists.yaml index 4102bc3..565c772 100644 --- a/config/crd/patches/webhook_in_devfileregistrieslists.yaml +++ b/config/crd/patches/webhook_in_devfileregistrieslists.yaml @@ -12,6 +12,7 @@ spec: namespace: system name: webhook-service path: /convert + port: 443 conversionReviewVersions: - v1 diff --git a/config/manifests/bases/registry-operator.clusterserviceversion.yaml b/config/manifests/bases/registry-operator.clusterserviceversion.yaml index c12559e..0715689 100644 --- a/config/manifests/bases/registry-operator.clusterserviceversion.yaml +++ b/config/manifests/bases/registry-operator.clusterserviceversion.yaml @@ -11,7 +11,9 @@ metadata: "name": "sample-devfileregistry" }, "spec": { - "devfileIndexImage": "quay.io/devfile/devfile-index:next" + "devfileIndex": { + "image": "quay.io/devfile/devfile-index:next" + } } }, { @@ -45,15 +47,15 @@ metadata: } } ] - capabilities: Full Lifecycle + capabilities: Basic Install catagories: OpenShift Optional,Developer Tools - containerImage: quay.io/devfile/registry-operator:v0.1.0 + containerImage: quay.io/devfile/registry-operator:v0.1.1 createdAt: "2023-09-06T19:45:06Z" description: Deploy and manage Devfile Registries on Kubernetes and OpenShift with the Devfile Registry operator. repository: https://github.com/devfile/registry-operator support: Red Hat - name: registry-operator.v0.1.0 + name: registry-operator.v0.1.1 namespace: placeholder spec: apiservicedefinitions: {} @@ -67,6 +69,29 @@ spec: displayName: Cluster Devfile Registries List kind: ClusterDevfileRegistriesList name: clusterdevfileregistrieslists.registry.devfile.io + resources: + - kind: Deployment + name: clusterdevfileregistrieslist-deployment + version: v1 + specDescriptors: + - description: DevfileRegistries is a list of devfile registry services + displayName: Devfile Registries + path: devfileRegistries + - description: Name is the unique Name of the devfile registry. + displayName: Name + path: devfileRegistries[0].name + - description: SkipTLSVerify defaults to false. Set to true in a non-production + environment to bypass certificate checking + displayName: Skip TLSVerify + path: devfileRegistries[0].skipTLSVerify + - description: URL is the unique URL of the devfile registry. + displayName: URL + path: devfileRegistries[0].url + statusDescriptors: + - description: Conditions shows the state of this CR's devfile registry list. If + registries are no longer reachable, they will be listed here + displayName: Conditions + path: conditions version: v1alpha1 - description: DevfileRegistry is a custom resource allows you to create and manage your own index server and registry viewer. In order to be added, the Devfile @@ -75,6 +100,107 @@ spec: displayName: Devfile Registry kind: DevfileRegistry name: devfileregistries.registry.devfile.io + resources: + - kind: Deployment + name: devfileregistry-deployment + version: v1 + specDescriptors: + - description: Sets the devfile index container spec to be deployed on the Devfile + Registry + displayName: Devfile Index + path: devfileIndex + - description: Sets the container image + displayName: Image + path: devfileIndex.image + - description: Sets the image pull policy for the container + displayName: Image Pull Policy + path: devfileIndex.imagePullPolicy + - description: Sets the container image containing devfile stacks to be deployed + on the Devfile Registry + displayName: Devfile Index Image + path: devfileIndexImage + - description: Sets the registry server deployment to run under headless mode + displayName: Headless + path: headless + - displayName: K8s + path: k8s + - description: Ingress domain for a Kubernetes cluster. This MUST be explicitly + specified on Kubernetes. There are no defaults + displayName: Ingress Domain + path: k8s.ingressDomain + - description: Sets the OCI registry container spec to be deployed on the Devfile + Registry + displayName: Oci Registry + path: ociRegistry + - description: Sets the container image + displayName: Image + path: ociRegistry.image + - description: Sets the image pull policy for the container + displayName: Image Pull Policy + path: ociRegistry.imagePullPolicy + - description: Overrides the container image used for the OCI registry. Recommended + to leave blank and default to the image specified by the operator. + displayName: Oci Registry Image + path: ociRegistryImage + - description: Sets the registry viewer container spec to be deployed on the + Devfile Registry + displayName: Registry Viewer + path: registryViewer + - description: Sets the container image + displayName: Image + path: registryViewer.image + - description: Sets the image pull policy for the container + displayName: Image Pull Policy + path: registryViewer.imagePullPolicy + - description: Overrides the container image used for the registry viewer. + displayName: Registry Viewer Image + path: registryViewerImage + - displayName: Storage + path: storage + - description: Instructs the operator to deploy the DevfileRegistry with persistent + storage Disabled by default. + displayName: Enabled + path: storage.enabled + - description: Configures the size of the devfile registry's persistent volume, + if enabled. Defaults to 1Gi. + displayName: Registry Volume Size + path: storage.registryVolumeSize + - displayName: Telemetry + path: telemetry + - description: Specify a telemetry key to allow devfile specific data to be + sent to a client's own Segment analytics source. If the write key is specified + then telemetry will be enabled + displayName: Key + path: telemetry.key + - description: The registry name (can be any string) that is used as identifier + for devfile telemetry. + displayName: Registry Name + path: telemetry.registryName + - description: Specify a telemetry write key for the registry viewer component + to allow data to be sent to a client's own Segment analytics source. If + the write key is specified then telemetry for the registry viewer component + will be enabled + displayName: Registry Viewer Write Key + path: telemetry.registryViewerWriteKey + - displayName: TLS + path: tls + - description: Instructs the operator to deploy the DevfileRegistry with TLS + enabled. Enabled by default. Disabling is only recommended for development + or test. + displayName: Enabled + path: tls.enabled + - description: Name of an optional, pre-existing TLS secret to use for TLS termination + on ingress/route resources. + displayName: Secret Name + path: tls.secretName + statusDescriptors: + - description: Conditions shows the state devfile registries. + displayName: Conditions + path: conditions + - description: URL is the exposed URL for the Devfile Registry, and is set in + the status after the registry has become available. + displayName: URL + path: url version: v1alpha1 - description: DevfileRegistriesList is a custom resource where namespace users can add a list of Devfile Registries to allow devfiles to be visible at the @@ -84,6 +210,29 @@ spec: displayName: Devfile Registries List kind: DevfileRegistriesList name: devfileregistrieslists.registry.devfile.io + resources: + - kind: Deployment + name: devfileregistrieslist-deployment + version: v1 + specDescriptors: + - description: DevfileRegistries is a list of devfile registry services + displayName: Devfile Registries + path: devfileRegistries + - description: Name is the unique Name of the devfile registry. + displayName: Name + path: devfileRegistries[0].name + - description: SkipTLSVerify defaults to false. Set to true in a non-production + environment to bypass certificate checking + displayName: Skip TLSVerify + path: devfileRegistries[0].skipTLSVerify + - description: URL is the unique URL of the devfile registry. + displayName: URL + path: devfileRegistries[0].url + statusDescriptors: + - description: Conditions shows the state of this CR's devfile registry list. If + registries are no longer reachable, they will be listed here + displayName: Conditions + path: conditions version: v1alpha1 description: "A devfile registry is a service that stores and provides devfile stacks to Kubernetes developer tools like `odo`, Eclipse Che, and the OpenShift Developer @@ -304,7 +453,8 @@ spec: - email: ktsao@redhat.com name: Kim Tsao maturity: beta + minKubeVersion: 1.25.0 provider: name: Red Hat url: https://redhat.com - version: 0.1.0 + version: 0.1.1 diff --git a/config/scorecard/patches/basic.config.yaml b/config/scorecard/patches/basic.config.yaml index 39576a5..2f27744 100644 --- a/config/scorecard/patches/basic.config.yaml +++ b/config/scorecard/patches/basic.config.yaml @@ -4,7 +4,7 @@ entrypoint: - scorecard-test - basic-check-spec - image: quay.io/operator-framework/scorecard-test:v1.1.0 + image: quay.io/operator-framework/scorecard-test:v1.28.0 labels: suite: basic test: basic-check-spec-test diff --git a/config/scorecard/patches/olm.config.yaml b/config/scorecard/patches/olm.config.yaml index 8102e4d..ace0a1a 100644 --- a/config/scorecard/patches/olm.config.yaml +++ b/config/scorecard/patches/olm.config.yaml @@ -4,7 +4,7 @@ entrypoint: - scorecard-test - olm-bundle-validation - image: quay.io/operator-framework/scorecard-test:v1.1.0 + image: quay.io/operator-framework/scorecard-test:v1.28.0 labels: suite: olm test: olm-bundle-validation-test @@ -14,7 +14,7 @@ entrypoint: - scorecard-test - olm-crds-have-validation - image: quay.io/operator-framework/scorecard-test:v1.1.0 + image: quay.io/operator-framework/scorecard-test:v1.28.0 labels: suite: olm test: olm-crds-have-validation-test @@ -24,7 +24,7 @@ entrypoint: - scorecard-test - olm-crds-have-resources - image: quay.io/operator-framework/scorecard-test:v1.1.0 + image: quay.io/operator-framework/scorecard-test:v1.28.0 labels: suite: olm test: olm-crds-have-resources-test @@ -34,7 +34,7 @@ entrypoint: - scorecard-test - olm-spec-descriptors - image: quay.io/operator-framework/scorecard-test:v1.1.0 + image: quay.io/operator-framework/scorecard-test:v1.28.0 labels: suite: olm test: olm-spec-descriptors-test @@ -44,7 +44,7 @@ entrypoint: - scorecard-test - olm-status-descriptors - image: quay.io/operator-framework/scorecard-test:v1.1.0 + image: quay.io/operator-framework/scorecard-test:v1.28.0 labels: suite: olm test: olm-status-descriptors-test diff --git a/controllers/clusterdevfileregistrieslist_controller.go b/controllers/clusterdevfileregistrieslist_controller.go index 5be3018..ebc14f7 100644 --- a/controllers/clusterdevfileregistrieslist_controller.go +++ b/controllers/clusterdevfileregistrieslist_controller.go @@ -1,18 +1,18 @@ -/* -Copyright 2022-2023 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. -*/ +// +// +// Copyright Red Hat +// +// 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 controllers @@ -21,6 +21,9 @@ import ( "time" "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/api/meta" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/client-go/util/retry" "github.com/go-logr/logr" @@ -68,12 +71,27 @@ func (r *ClusterDevfileRegistriesListReconciler) Reconcile(ctx context.Context, return ctrl.Result{}, err } - clusterDevfileRegistries := clusterDevfileRegistriesList.Spec.DevfileRegistries - clusterDevfileRegistriesList.Status.Status = validateDevfileRegistries(clusterDevfileRegistries) - err = r.Status().Update(ctx, clusterDevfileRegistriesList) - if err != nil { + if clusterDevfileRegistriesList.Status.Conditions == nil || len(clusterDevfileRegistriesList.Status.Conditions) == 0 { + err = retry.RetryOnConflict(retry.DefaultRetry, func() error { + meta.SetStatusCondition(&clusterDevfileRegistriesList.Status.Conditions, metav1.Condition{ + Type: typeUpdateDevfileRegistries, + Status: metav1.ConditionUnknown, + Reason: "NotReady", + Message: "Starting reconciliation", + }) + + return r.Status().Update(ctx, clusterDevfileRegistriesList) + }) + + if err != nil { + log.Error(err, "Failed to update ClusterDevfileRegistriesList status") + return ctrl.Result{}, err + } + } + + if err = r.SetValidateDevfileRegistriesConditionAndUpdateCR(ctx, req, clusterDevfileRegistriesList, nil); err != nil { log.Error(err, "Failed to update ClusterDevfileRegistriesList status") - return ctrl.Result{Requeue: true}, err + return ctrl.Result{}, err } return ctrl.Result{RequeueAfter: time.Hour}, nil diff --git a/controllers/clusterdevfileregistrieslist_controller_conditions.go b/controllers/clusterdevfileregistrieslist_controller_conditions.go new file mode 100644 index 0000000..524bc30 --- /dev/null +++ b/controllers/clusterdevfileregistrieslist_controller_conditions.go @@ -0,0 +1,67 @@ +// +// +// Copyright Red Hat +// +// 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 controllers + +import ( + "context" + "fmt" + + "github.com/devfile/registry-operator/api/v1alpha1" + "k8s.io/apimachinery/pkg/api/meta" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/client-go/util/retry" + ctrl "sigs.k8s.io/controller-runtime" +) + +// SetValidateDevfileRegistriesConditionAndUpdateCR sets the condition of the cluster devfile registries list validation +func (r *ClusterDevfileRegistriesListReconciler) SetValidateDevfileRegistriesConditionAndUpdateCR(ctx context.Context, req ctrl.Request, clusterDevfileRegistriesList *v1alpha1.ClusterDevfileRegistriesList, validateError error) error { + log := ctrl.LoggerFrom(ctx) + var ( + condition metav1.Condition + err error + ) + + if validateError == nil { + condition = metav1.Condition{ + Type: typeValidateDevfileRegistries, + Status: metav1.ConditionTrue, + Reason: "Ready", + Message: allRegistriesReachable, + } + } else { + condition = metav1.Condition{ + Type: typeValidateDevfileRegistries, + Status: metav1.ConditionFalse, + Reason: "NotReady", + Message: fmt.Sprintf("Cluster devfile registries list failed to validate: %v", validateError), + } + } + + err = retry.RetryOnConflict(retry.DefaultRetry, func() error { + validateDevfileRegistriesAndUpdateCondition(clusterDevfileRegistriesList.Spec.DevfileRegistries, condition, func(c metav1.Condition) { + meta.SetStatusCondition(&clusterDevfileRegistriesList.Status.Conditions, c) + }) + return r.Status().Update(ctx, clusterDevfileRegistriesList) + }) + + if err != nil { + log.Error(err, "Unable to update cluster devfile registries list") + return err + } + + return nil +} diff --git a/controllers/clusterdevfileregistrieslist_controller_test.go b/controllers/clusterdevfileregistrieslist_controller_test.go index ae97917..76591ef 100644 --- a/controllers/clusterdevfileregistrieslist_controller_test.go +++ b/controllers/clusterdevfileregistrieslist_controller_test.go @@ -1,6 +1,6 @@ // // -// Copyright 2022-2023 Red Hat, Inc. +// Copyright Red Hat // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/controllers/condition_types.go b/controllers/condition_types.go new file mode 100644 index 0000000..3e4321f --- /dev/null +++ b/controllers/condition_types.go @@ -0,0 +1,23 @@ +// +// +// Copyright Red Hat +// +// 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 controllers + +const ( + typeValidateDevfileRegistries = "ValidateDevfileRegistries" + typeUpdateDevfileRegistries = "UpdateDevfileRegistries" + typeUpdateDevfileRegistry = "UpdateDevfileRegistry" +) diff --git a/controllers/devfileregistrieslist_controller.go b/controllers/devfileregistrieslist_controller.go index 05e8569..dfca72b 100644 --- a/controllers/devfileregistrieslist_controller.go +++ b/controllers/devfileregistrieslist_controller.go @@ -1,28 +1,30 @@ -/* -Copyright 2022-2023 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. -*/ +// +// +// Copyright Red Hat +// +// 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 controllers import ( "context" - "fmt" "time" "github.com/go-logr/logr" "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/api/meta" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/client-go/util/retry" registryv1alpha1 "github.com/devfile/registry-operator/api/v1alpha1" "k8s.io/apimachinery/pkg/runtime" @@ -52,8 +54,8 @@ type DevfileRegistriesListReconciler struct { func (r *DevfileRegistriesListReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error) { log := r.Log.WithValues("devfileregistrieslist", req.NamespacedName) // Fetch the DevfileRegistriesList instance - devfileRegistriesList := registryv1alpha1.DevfileRegistriesList{} - err := r.Get(ctx, req.NamespacedName, &devfileRegistriesList) + devfileRegistriesList := ®istryv1alpha1.DevfileRegistriesList{} + err := r.Get(ctx, req.NamespacedName, devfileRegistriesList) if err != nil { if errors.IsNotFound(err) { // Request object not found, could have been deleted after reconcile request. @@ -67,14 +69,27 @@ func (r *DevfileRegistriesListReconciler) Reconcile(ctx context.Context, req ctr return ctrl.Result{}, err } - // check the list of registries and report on the state - devfileRegistries := devfileRegistriesList.Spec.DevfileRegistries - devfileRegistriesList.Status.Status = validateDevfileRegistries(devfileRegistries) - log.Info(fmt.Sprintf("Status is being updated %s ", devfileRegistriesList.Status.Status)) - err = r.Status().Update(ctx, &devfileRegistriesList) - if err != nil { + if devfileRegistriesList.Status.Conditions == nil || len(devfileRegistriesList.Status.Conditions) == 0 { + err = retry.RetryOnConflict(retry.DefaultRetry, func() error { + meta.SetStatusCondition(&devfileRegistriesList.Status.Conditions, metav1.Condition{ + Type: typeUpdateDevfileRegistries, + Status: metav1.ConditionUnknown, + Reason: "NotReady", + Message: "Starting reconciliation", + }) + + return r.Status().Update(ctx, devfileRegistriesList) + }) + + if err != nil { + log.Error(err, "Failed to update DevfileRegistriesList status") + return ctrl.Result{}, err + } + } + + if err = r.SetValidateDevfileRegistriesConditionAndUpdateCR(ctx, req, devfileRegistriesList, nil); err != nil { log.Error(err, "Failed to update DevfileRegistriesList status") - return ctrl.Result{Requeue: true}, err + return ctrl.Result{}, err } return ctrl.Result{RequeueAfter: time.Hour}, nil diff --git a/controllers/devfileregistrieslist_controller_conditions.go b/controllers/devfileregistrieslist_controller_conditions.go new file mode 100644 index 0000000..2fd5820 --- /dev/null +++ b/controllers/devfileregistrieslist_controller_conditions.go @@ -0,0 +1,67 @@ +// +// +// Copyright Red Hat +// +// 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 controllers + +import ( + "context" + "fmt" + + "github.com/devfile/registry-operator/api/v1alpha1" + "k8s.io/apimachinery/pkg/api/meta" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/client-go/util/retry" + ctrl "sigs.k8s.io/controller-runtime" +) + +// SetValidateDevfileRegistriesConditionAndUpdateCR sets the condition of the namespaced devfile registries list validation +func (r *DevfileRegistriesListReconciler) SetValidateDevfileRegistriesConditionAndUpdateCR(ctx context.Context, req ctrl.Request, devfileRegistriesList *v1alpha1.DevfileRegistriesList, validateError error) error { + log := ctrl.LoggerFrom(ctx) + var ( + condition metav1.Condition + err error + ) + + if validateError == nil { + condition = metav1.Condition{ + Type: typeValidateDevfileRegistries, + Status: metav1.ConditionTrue, + Reason: "Ready", + Message: allRegistriesReachable, + } + } else { + condition = metav1.Condition{ + Type: typeValidateDevfileRegistries, + Status: metav1.ConditionFalse, + Reason: "NotReady", + Message: fmt.Sprintf("Namespaced devfile registries list failed to validate: %v", validateError), + } + } + + err = retry.RetryOnConflict(retry.DefaultRetry, func() error { + validateDevfileRegistriesAndUpdateCondition(devfileRegistriesList.Spec.DevfileRegistries, condition, func(c metav1.Condition) { + meta.SetStatusCondition(&devfileRegistriesList.Status.Conditions, c) + }) + return r.Status().Update(ctx, devfileRegistriesList) + }) + + if err != nil { + log.Error(err, "Unable to update namespaced devfile registries list") + return err + } + + return nil +} diff --git a/controllers/devfileregistrieslist_controller_test.go b/controllers/devfileregistrieslist_controller_test.go index bedc4ad..b6e800c 100644 --- a/controllers/devfileregistrieslist_controller_test.go +++ b/controllers/devfileregistrieslist_controller_test.go @@ -1,6 +1,6 @@ // // -// Copyright 2022-2023 Red Hat, Inc. +// Copyright Red Hat // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/controllers/devfileregistry_controller.go b/controllers/devfileregistry_controller.go index 4d3e9fa..caa5019 100644 --- a/controllers/devfileregistry_controller.go +++ b/controllers/devfileregistry_controller.go @@ -1,18 +1,18 @@ -/* -Copyright 2020-2023 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. -*/ +// +// +// Copyright Red Hat +// +// 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 controllers @@ -26,8 +26,11 @@ import ( corev1 "k8s.io/api/core/v1" networkingv1 "k8s.io/api/networking/v1" "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/api/meta" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/types" + "k8s.io/client-go/util/retry" ctrl "sigs.k8s.io/controller-runtime" "sigs.k8s.io/controller-runtime/pkg/client" @@ -72,6 +75,24 @@ func (r *DevfileRegistryReconciler) Reconcile(ctx context.Context, req ctrl.Requ return ctrl.Result{}, err } + if devfileRegistry.Status.Conditions == nil || len(devfileRegistry.Status.Conditions) == 0 { + err = retry.RetryOnConflict(retry.DefaultRetry, func() error { + meta.SetStatusCondition(&devfileRegistry.Status.Conditions, metav1.Condition{ + Type: typeUpdateDevfileRegistry, + Status: metav1.ConditionUnknown, + Reason: "NotReady", + Message: "Starting reconciliation", + }) + + return r.Status().Update(ctx, devfileRegistry) + }) + + if err != nil { + log.Error(err, "Failed to update DevfileRegistriesList status") + return ctrl.Result{}, err + } + } + // Generate labels for any subresources generated by the operator labels := registry.LabelsForDevfileRegistry(devfileRegistry.Name) @@ -171,6 +192,22 @@ func (r *DevfileRegistryReconciler) Reconcile(ctx context.Context, req ctrl.Requ } + // Update condition status + err = retry.RetryOnConflict(retry.DefaultRetry, func() error { + meta.SetStatusCondition(&devfileRegistry.Status.Conditions, metav1.Condition{ + Type: typeUpdateDevfileRegistry, + Status: metav1.ConditionTrue, + Reason: "Ready", + Message: "Devfile Registry deployed", + }) + return r.Status().Update(ctx, devfileRegistry) + }) + + if err != nil { + log.Error(err, "Failed to update DevfileRegistry status") + return ctrl.Result{}, err + } + return ctrl.Result{}, nil } diff --git a/controllers/ensure.go b/controllers/ensure.go index d0eedcd..f63c26b 100644 --- a/controllers/ensure.go +++ b/controllers/ensure.go @@ -1,18 +1,18 @@ -/* -Copyright 2020-2023 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. -*/ +// +// +// Copyright Red Hat +// +// 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 controllers diff --git a/controllers/suite_test.go b/controllers/suite_test.go index bf8f951..67fe0b3 100644 --- a/controllers/suite_test.go +++ b/controllers/suite_test.go @@ -1,18 +1,18 @@ -/* -Copyright 2020-2023 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. -*/ +// +// +// Copyright Red Hat +// +// 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 controllers @@ -22,6 +22,7 @@ import ( . "github.com/devfile/registry-operator/api/v1alpha1" . "github.com/devfile/registry-operator/pkg/test" + "k8s.io/apimachinery/pkg/api/meta" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/types" ctrl "sigs.k8s.io/controller-runtime" @@ -202,10 +203,18 @@ func validateStatus(lookupKey types.NamespacedName, lType ListType, expectedStat Eventually(func() string { if lType == NamespaceListType { k8sClient.Get(ctx, lookupKey, &nl) - status = nl.Status.Status + if condition := meta.FindStatusCondition(nl.Status.Conditions, typeValidateDevfileRegistries); condition != nil { + status = condition.Message + } else { + status = "" + } } else { k8sClient.Get(ctx, lookupKey, &cl) - status = cl.Status.Status + if condition := meta.FindStatusCondition(cl.Status.Conditions, typeValidateDevfileRegistries); condition != nil { + status = condition.Message + } else { + status = "" + } } return status }, Timeout, Interval).Should(ContainSubstring(expectedStatus)) diff --git a/controllers/update.go b/controllers/update.go index bcbf0f2..3437808 100644 --- a/controllers/update.go +++ b/controllers/update.go @@ -1,18 +1,18 @@ -/* -Copyright 2020-2023 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. -*/ +// +// +// Copyright Red Hat +// +// 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 controllers diff --git a/controllers/validate.go b/controllers/validate.go index f17c569..70ea72d 100644 --- a/controllers/validate.go +++ b/controllers/validate.go @@ -1,18 +1,18 @@ -/* -Copyright 2022-2023 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. -*/ +// +// +// Copyright Red Hat +// +// 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 controllers @@ -21,6 +21,7 @@ import ( "strings" "github.com/devfile/registry-operator/api/v1alpha1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) const ( @@ -55,3 +56,17 @@ func validateDevfileRegistries(devfileRegistries []v1alpha1.DevfileRegistryServi return strings.Join(updatedStatus, "") } + +// validateDevfileRegistriesAndUpdateCondition runs validateDevfileRegistries and updates a status condition based on the result +func validateDevfileRegistriesAndUpdateCondition(devfileRegistries []v1alpha1.DevfileRegistryService, condition metav1.Condition, updateConditionFn func(metav1.Condition)) { + validateMessage := validateDevfileRegistries(devfileRegistries) + + condition.Message = validateMessage + if validateMessage != allRegistriesReachable { + condition.Status = metav1.ConditionFalse + } else { + condition.Status = metav1.ConditionTrue + } + + updateConditionFn(condition) +} diff --git a/hack/boilerplate.go.txt b/hack/boilerplate.go.txt index 0eb1ac5..0591355 100644 --- a/hack/boilerplate.go.txt +++ b/hack/boilerplate.go.txt @@ -1,5 +1,7 @@ /* -Copyright 2020-2023 Red Hat, Inc. + + +Copyright Red Hat Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/main.go b/main.go index 9662614..b8ec491 100644 --- a/main.go +++ b/main.go @@ -1,18 +1,18 @@ -/* -Copyright 2020-2023 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. -*/ +// +// +// Copyright Red Hat +// +// 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 main diff --git a/pkg/cluster/info.go b/pkg/cluster/info.go index 46d3d9b..a553a03 100644 --- a/pkg/cluster/info.go +++ b/pkg/cluster/info.go @@ -1,18 +1,18 @@ -/* -Copyright 2020-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. -*/ +// +// +// Copyright Red Hat +// +// 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 cluster diff --git a/pkg/config/config.go b/pkg/config/config.go index b6774e6..4391ab1 100644 --- a/pkg/config/config.go +++ b/pkg/config/config.go @@ -1,18 +1,18 @@ -/* -Copyright 2020-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. -*/ +// +// +// Copyright Red Hat +// +// 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 config diff --git a/pkg/registry/configmap.go b/pkg/registry/configmap.go index 214b03b..9963ff3 100644 --- a/pkg/registry/configmap.go +++ b/pkg/registry/configmap.go @@ -1,18 +1,18 @@ -/* -Copyright 2020-2023 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. -*/ +// +// +// Copyright Red Hat +// +// 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 registry diff --git a/pkg/registry/defaults.go b/pkg/registry/defaults.go index 0c1e306..37993d4 100644 --- a/pkg/registry/defaults.go +++ b/pkg/registry/defaults.go @@ -1,18 +1,18 @@ -/* -Copyright 2020-2023 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. -*/ +// +// +// Copyright Red Hat +// +// 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 registry diff --git a/pkg/registry/defaults_test.go b/pkg/registry/defaults_test.go index e804412..893d34e 100644 --- a/pkg/registry/defaults_test.go +++ b/pkg/registry/defaults_test.go @@ -1,18 +1,18 @@ -/* -Copyright 2020-2023 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. -*/ +// +// +// Copyright Red Hat +// +// 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 registry diff --git a/pkg/registry/deployment.go b/pkg/registry/deployment.go index 8f8acad..fcca3b6 100644 --- a/pkg/registry/deployment.go +++ b/pkg/registry/deployment.go @@ -1,18 +1,18 @@ -/* -Copyright 2020-2023 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. -*/ +// +// +// Copyright Red Hat +// +// 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 registry diff --git a/pkg/registry/ingress.go b/pkg/registry/ingress.go index d79e374..e50b98b 100644 --- a/pkg/registry/ingress.go +++ b/pkg/registry/ingress.go @@ -1,18 +1,18 @@ -/* -Copyright 2020-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. -*/ +// +// +// Copyright Red Hat +// +// 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 registry diff --git a/pkg/registry/naming.go b/pkg/registry/naming.go index 9ec9902..57255f3 100644 --- a/pkg/registry/naming.go +++ b/pkg/registry/naming.go @@ -1,18 +1,18 @@ -/* -Copyright 2020-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. -*/ +// +// +// Copyright Red Hat +// +// 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 registry diff --git a/pkg/registry/route.go b/pkg/registry/route.go index 216131b..24a6c08 100644 --- a/pkg/registry/route.go +++ b/pkg/registry/route.go @@ -1,18 +1,18 @@ -/* -Copyright 2020-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. -*/ +// +// +// Copyright Red Hat +// +// 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 registry diff --git a/pkg/registry/service.go b/pkg/registry/service.go index 90aaf27..0ac4c60 100644 --- a/pkg/registry/service.go +++ b/pkg/registry/service.go @@ -1,18 +1,18 @@ -/* -Copyright 2020-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. -*/ +// +// +// Copyright Red Hat +// +// 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 registry diff --git a/pkg/registry/util.go b/pkg/registry/util.go index 6b2eaab..29f0402 100644 --- a/pkg/registry/util.go +++ b/pkg/registry/util.go @@ -1,18 +1,18 @@ -/* -Copyright 2020-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. -*/ +// +// +// Copyright Red Hat +// +// 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 registry diff --git a/pkg/registry/volume.go b/pkg/registry/volume.go index 669d1a4..1d4e10e 100644 --- a/pkg/registry/volume.go +++ b/pkg/registry/volume.go @@ -1,18 +1,18 @@ -/* -Copyright 2020-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. -*/ +// +// +// Copyright Red Hat +// +// 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 registry diff --git a/pkg/test/test_utils.go b/pkg/test/test_utils.go index 1709e24..f360929 100644 --- a/pkg/test/test_utils.go +++ b/pkg/test/test_utils.go @@ -1,6 +1,6 @@ // // -// Copyright 2022 Red Hat, Inc. +// Copyright Red Hat // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/pkg/util/util.go b/pkg/util/util.go index 31c66dc..654d5bb 100644 --- a/pkg/util/util.go +++ b/pkg/util/util.go @@ -1,18 +1,18 @@ -/* -Copyright 2020-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. -*/ +// +// +// Copyright Red Hat +// +// 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 util diff --git a/tests/integration/cmd/devfileregistry_test.go b/tests/integration/cmd/devfileregistry_test.go index f70898c..4969e98 100644 --- a/tests/integration/cmd/devfileregistry_test.go +++ b/tests/integration/cmd/devfileregistry_test.go @@ -1,18 +1,18 @@ -/* -Copyright 2020-2023 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. -*/ +// +// +// Copyright Red Hat +// +// 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 cmd diff --git a/tests/integration/pkg/client/client.go b/tests/integration/pkg/client/client.go index d21323b..565aeb2 100644 --- a/tests/integration/pkg/client/client.go +++ b/tests/integration/pkg/client/client.go @@ -1,18 +1,18 @@ -/* -Copyright 2020-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. -*/ +// +// +// Copyright Red Hat +// +// 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 client diff --git a/tests/integration/pkg/client/oc.go b/tests/integration/pkg/client/oc.go index 0ef3027..6716655 100644 --- a/tests/integration/pkg/client/oc.go +++ b/tests/integration/pkg/client/oc.go @@ -1,18 +1,18 @@ -/* -Copyright 2020-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. -*/ +// +// +// Copyright Red Hat +// +// 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 client diff --git a/tests/integration/pkg/client/pod.go b/tests/integration/pkg/client/pod.go index 98228ad..cb65019 100644 --- a/tests/integration/pkg/client/pod.go +++ b/tests/integration/pkg/client/pod.go @@ -1,18 +1,18 @@ -/* -Copyright 2020-2023 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. -*/ +// +// +// Copyright Red Hat +// +// 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 client diff --git a/tests/integration/pkg/client/registry.go b/tests/integration/pkg/client/registry.go index 57de3f8..e6e581f 100644 --- a/tests/integration/pkg/client/registry.go +++ b/tests/integration/pkg/client/registry.go @@ -1,18 +1,18 @@ -/* -Copyright 2020-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. -*/ +// +// +// Copyright Red Hat +// +// 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 client diff --git a/tests/integration/pkg/config/config.go b/tests/integration/pkg/config/config.go index 225a386..13cc8c9 100644 --- a/tests/integration/pkg/config/config.go +++ b/tests/integration/pkg/config/config.go @@ -1,18 +1,18 @@ -/* -Copyright 2020-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. -*/ +// +// +// Copyright Red Hat +// +// 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 config diff --git a/tests/integration/pkg/deploy/controller.go b/tests/integration/pkg/deploy/controller.go index eb72c11..ec8d715 100644 --- a/tests/integration/pkg/deploy/controller.go +++ b/tests/integration/pkg/deploy/controller.go @@ -1,18 +1,18 @@ -/* -Copyright 2020-2023 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. -*/ +// +// +// Copyright Red Hat +// +// 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 deploy diff --git a/tests/integration/pkg/deploy/deploy.go b/tests/integration/pkg/deploy/deploy.go index 4530959..020ff45 100644 --- a/tests/integration/pkg/deploy/deploy.go +++ b/tests/integration/pkg/deploy/deploy.go @@ -1,18 +1,18 @@ -/* -Copyright 2020-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. -*/ +// +// +// Copyright Red Hat +// +// 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 deploy diff --git a/tests/integration/pkg/tests/devfileregistry_tests.go b/tests/integration/pkg/tests/devfileregistry_tests.go index 52e85b7..545a599 100644 --- a/tests/integration/pkg/tests/devfileregistry_tests.go +++ b/tests/integration/pkg/tests/devfileregistry_tests.go @@ -1,18 +1,18 @@ -/* -Copyright 2020-2023 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. -*/ +// +// +// Copyright Red Hat +// +// 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 tests