Skip to content

Commit 4635b1c

Browse files
Merge pull request #277 from openshift-bot/synchronize-upstream
NO-ISSUE: Synchronize From Upstream Repositories
2 parents c51eb00 + c3b9432 commit 4635b1c

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+1040
-1129
lines changed

Makefile

Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -118,14 +118,20 @@ KUSTOMIZE_CATD_RBAC_DIR := config/base/catalogd/rbac
118118
KUSTOMIZE_CATD_WEBHOOKS_DIR := config/base/catalogd/manager/webhook
119119
KUSTOMIZE_OPCON_CRDS_DIR := config/base/operator-controller/crd/bases
120120
KUSTOMIZE_OPCON_RBAC_DIR := config/base/operator-controller/rbac
121+
CRD_WORKING_DIR := crd_work_dir
122+
# Due to https://github.com/kubernetes-sigs/controller-tools/issues/837 we can't specify individual files
123+
# So we have to generate them together and then move them into place
121124
manifests: $(CONTROLLER_GEN) #EXHELP Generate WebhookConfiguration, ClusterRole, and CustomResourceDefinition objects.
122-
# Generate the operator-controller manifests
123-
rm -rf $(KUSTOMIZE_OPCON_CRDS_DIR) && $(CONTROLLER_GEN) crd paths=./api/... output:crd:artifacts:config=$(KUSTOMIZE_OPCON_CRDS_DIR)
124-
rm -f $(KUSTOMIZE_OPCON_RBAC_DIR)/role.yaml && $(CONTROLLER_GEN) rbac:roleName=manager-role paths=./internal/operator-controller/... output:rbac:artifacts:config=$(KUSTOMIZE_OPCON_RBAC_DIR)
125-
# Generate the catalogd manifests
126-
rm -rf $(KUSTOMIZE_CATD_CRDS_DIR) && $(CONTROLLER_GEN) crd paths="./catalogd/api/..." output:crd:artifacts:config=$(KUSTOMIZE_CATD_CRDS_DIR)
127-
rm -f $(KUSTOMIZE_CATD_RBAC_DIR)/role.yaml && $(CONTROLLER_GEN) rbac:roleName=manager-role paths="./internal/catalogd/..." output:rbac:artifacts:config=$(KUSTOMIZE_CATD_RBAC_DIR)
128-
rm -f $(KUSTOMIZE_CATD_WEBHOOKS_DIR)/manifests.yaml && $(CONTROLLER_GEN) webhook paths="./internal/catalogd/..." output:webhook:artifacts:config=$(KUSTOMIZE_CATD_WEBHOOKS_DIR)
125+
mkdir $(CRD_WORKING_DIR)
126+
$(CONTROLLER_GEN) crd paths="./api/v1/..." output:crd:artifacts:config=$(CRD_WORKING_DIR)
127+
mv $(CRD_WORKING_DIR)/olm.operatorframework.io_clusterextensions.yaml $(KUSTOMIZE_OPCON_CRDS_DIR)
128+
mv $(CRD_WORKING_DIR)/olm.operatorframework.io_clustercatalogs.yaml $(KUSTOMIZE_CATD_CRDS_DIR)
129+
rmdir $(CRD_WORKING_DIR)
130+
# Generate the remaining operator-controller manifests
131+
$(CONTROLLER_GEN) rbac:roleName=manager-role paths="./internal/operator-controller/..." output:rbac:artifacts:config=$(KUSTOMIZE_OPCON_RBAC_DIR)
132+
# Generate the remaining catalogd manifests
133+
$(CONTROLLER_GEN) rbac:roleName=manager-role paths="./internal/catalogd/..." output:rbac:artifacts:config=$(KUSTOMIZE_CATD_RBAC_DIR)
134+
$(CONTROLLER_GEN) webhook paths="./internal/catalogd/..." output:webhook:artifacts:config=$(KUSTOMIZE_CATD_WEBHOOKS_DIR)
129135

130136
.PHONY: generate
131137
generate: $(CONTROLLER_GEN) #EXHELP Generate code containing DeepCopy, DeepCopyInto, and DeepCopyObject method implementations.
@@ -353,20 +359,13 @@ quickstart: $(KUSTOMIZE) manifests #EXHELP Generate the unified installation rel
353359

354360
.PHONY: crd-ref-docs
355361
OPERATOR_CONTROLLER_API_REFERENCE_FILENAME := operator-controller-api-reference.md
356-
CATALOGD_API_REFERENCE_FILENAME := catalogd-api-reference.md
357362
API_REFERENCE_DIR := $(ROOT_DIR)/docs/api-reference
358-
359363
crd-ref-docs: $(CRD_REF_DOCS) #EXHELP Generate the API Reference Documents.
360364
rm -f $(API_REFERENCE_DIR)/$(OPERATOR_CONTROLLER_API_REFERENCE_FILENAME)
361-
$(CRD_REF_DOCS) --source-path=$(ROOT_DIR)/api \
365+
$(CRD_REF_DOCS) --source-path=$(ROOT_DIR)/api/ \
362366
--config=$(API_REFERENCE_DIR)/crd-ref-docs-gen-config.yaml \
363367
--renderer=markdown --output-path=$(API_REFERENCE_DIR)/$(OPERATOR_CONTROLLER_API_REFERENCE_FILENAME);
364368

365-
rm -f $(API_REFERENCE_DIR)/$(CATALOGD_API_REFERENCE_FILENAME)
366-
$(CRD_REF_DOCS) --source-path=$(ROOT_DIR)/catalogd/api \
367-
--config=$(API_REFERENCE_DIR)/crd-ref-docs-gen-config.yaml \
368-
--renderer=markdown --output-path=$(API_REFERENCE_DIR)/$(CATALOGD_API_REFERENCE_FILENAME);
369-
370369
VENVDIR := $(abspath docs/.venv)
371370

372371
.PHONY: build-docs

Tiltfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ operator_controller = {
66
'binaries': {
77
'./cmd/operator-controller': 'operator-controller-controller-manager',
88
},
9-
'deps': ['api', 'cmd/operator-controller', 'internal', 'pkg', 'go.mod', 'go.sum'],
9+
'deps': ['api', 'cmd/operator-controller', 'internal/operator-controller', 'internal/shared', 'go.mod', 'go.sum'],
1010
'starting_debug_port': 30000,
1111
}
1212
deploy_repo('operator-controller', operator_controller, '-tags containers_image_openpgp')
@@ -17,7 +17,7 @@ catalogd = {
1717
'binaries': {
1818
'./catalogd/cmd/catalogd': 'catalogd-controller-manager',
1919
},
20-
'deps': ['catalogd/api', 'catalogd/cmd/catalogd', 'catalogd/internal', 'catalogd/pkg', 'go.mod', 'go.sum'],
20+
'deps': ['api', 'catalogd/cmd/catalogd', 'internal/catalogd', 'internal/shared', 'go.mod', 'go.sum'],
2121
'starting_debug_port': 20000,
2222
}
2323

catalogd/api/v1/clustercatalog_types.go renamed to api/v1/clustercatalog_types.go

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -30,19 +30,6 @@ type AvailabilityMode string
3030
const (
3131
SourceTypeImage SourceType = "Image"
3232

33-
TypeProgressing = "Progressing"
34-
TypeServing = "Serving"
35-
36-
// Serving reasons
37-
ReasonAvailable = "Available"
38-
ReasonUnavailable = "Unavailable"
39-
ReasonUserSpecifiedUnavailable = "UserSpecifiedUnavailable"
40-
41-
// Progressing reasons
42-
ReasonSucceeded = "Succeeded"
43-
ReasonRetrying = "Retrying"
44-
ReasonBlocked = "Blocked"
45-
4633
MetadataNameLabel = "olm.operatorframework.io/metadata.name"
4734

4835
AvailabilityModeAvailable AvailabilityMode = "Available"

catalogd/api/v1/clustercatalog_types_test.go renamed to api/v1/clustercatalog_types_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ import (
2020
"sigs.k8s.io/yaml"
2121
)
2222

23-
const crdFilePath = "../../../config/base/catalogd/crd/bases/olm.operatorframework.io_clustercatalogs.yaml"
23+
const crdFilePath = "../../config/base/catalogd/crd/bases/olm.operatorframework.io_clustercatalogs.yaml"
2424

2525
func TestImageSourceCELValidationRules(t *testing.T) {
2626
validators := fieldValidatorsFromFile(t, crdFilePath)

api/v1/clusterextension_types.go

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ type SourceConfig struct {
119119
// This field is required when sourceType is "Catalog", and forbidden otherwise.
120120
//
121121
// +optional
122-
Catalog *CatalogSource `json:"catalog,omitempty"`
122+
Catalog *CatalogFilter `json:"catalog,omitempty"`
123123
}
124124

125125
// ClusterExtensionInstallConfig is a union which selects the clusterExtension installation config.
@@ -138,8 +138,8 @@ type ClusterExtensionInstallConfig struct {
138138
Preflight *PreflightConfig `json:"preflight,omitempty"`
139139
}
140140

141-
// CatalogSource defines the attributes used to identify and filter content from a catalog.
142-
type CatalogSource struct {
141+
// CatalogFilter defines the attributes used to identify and filter content from a catalog.
142+
type CatalogFilter struct {
143143
// packageName is a reference to the name of the package to be installed
144144
// and is used to filter the content from catalogs.
145145
//
@@ -391,22 +391,13 @@ type CRDUpgradeSafetyPreflightConfig struct {
391391
}
392392

393393
const (
394-
TypeInstalled = "Installed"
395-
TypeProgressing = "Progressing"
396-
397394
// TypeDeprecated is a rollup condition that is present when
398395
// any of the deprecated conditions are present.
399396
TypeDeprecated = "Deprecated"
400397
TypePackageDeprecated = "PackageDeprecated"
401398
TypeChannelDeprecated = "ChannelDeprecated"
402399
TypeBundleDeprecated = "BundleDeprecated"
403400

404-
ReasonSucceeded = "Succeeded"
405-
ReasonDeprecated = "Deprecated"
406-
ReasonFailed = "Failed"
407-
ReasonBlocked = "Blocked"
408-
ReasonRetrying = "Retrying"
409-
410401
// None will not perform CRD upgrade safety checks.
411402
CRDUpgradeSafetyEnforcementNone CRDUpgradeSafetyEnforcement = "None"
412403
// Strict will enforce the CRD upgrade safety check and block the upgrade if the CRD would not pass the check.

catalogd/api/doc.go renamed to api/v1/common_types.go

Lines changed: 20 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
Copyright 2022.
2+
Copyright 2024.
33
44
Licensed under the Apache License, Version 2.0 (the "License");
55
you may not use this file except in compliance with the License.
@@ -14,9 +14,24 @@ See the License for the specific language governing permissions and
1414
limitations under the License.
1515
*/
1616

17-
//go:generate apiregister-gen --input-dirs ./... -h ../../boilerplate.go.txt
17+
package v1
1818

19-
//
20-
// +domain=operatorframework.io
19+
const (
20+
TypeInstalled = "Installed"
21+
TypeProgressing = "Progressing"
22+
TypeServing = "Serving"
2123

22-
package api
24+
// Progressing reasons
25+
ReasonSucceeded = "Succeeded"
26+
ReasonRetrying = "Retrying"
27+
ReasonBlocked = "Blocked"
28+
29+
// Terminal reasons
30+
ReasonDeprecated = "Deprecated"
31+
ReasonFailed = "Failed"
32+
33+
// Serving reasons
34+
ReasonAvailable = "Available"
35+
ReasonUnavailable = "Unavailable"
36+
ReasonUserSpecifiedUnavailable = "UserSpecifiedUnavailable"
37+
)

0 commit comments

Comments
 (0)