diff --git a/go.mod b/go.mod index 0d4aaf54c..6382ed29e 100644 --- a/go.mod +++ b/go.mod @@ -42,7 +42,7 @@ require ( github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect github.com/modern-go/reflect2 v1.0.2 // indirect github.com/nxadm/tail v1.4.8 // indirect - github.com/openshift/api v0.0.0-20231002140248-174e989c9ee1 + github.com/openshift/api v0.0.0-20231006150950-bbe1a26bbafc github.com/openshift/library-go v0.0.0-20230927113136-405c34317fa4 github.com/openshift/machine-config-operator v0.0.1-0.20230815171034-c2bb862bc08a github.com/pborman/uuid v1.2.1 @@ -136,6 +136,6 @@ require ( ) replace ( - github.com/openshift/api => github.com/openshift/api v0.0.0-20231002140248-174e989c9ee1 + github.com/openshift/api => github.com/openshift/api v0.0.0-20231006150950-bbe1a26bbafc github.com/openshift/client-go => github.com/openshift/client-go v0.0.0-20230926161409-848405da69e1 ) diff --git a/go.sum b/go.sum index 06337fbdb..250eba23c 100644 --- a/go.sum +++ b/go.sum @@ -196,6 +196,8 @@ github.com/onsi/gomega v1.27.10 h1:naR28SdDFlqrG6kScpT8VWpu1xWY5nJRCF3XaYyBjhI= github.com/onsi/gomega v1.27.10/go.mod h1:RsS8tutOdbdgzbPtzzATp12yT7kM5I5aElG3evPbQ0M= github.com/openshift/api v0.0.0-20231002140248-174e989c9ee1 h1:a50eFxcKkdrH+tVjou4zOKH0RgSRmeeNdzucSqJlJ4I= github.com/openshift/api v0.0.0-20231002140248-174e989c9ee1/go.mod h1:qNtV0315F+f8ld52TLtPvrfivZpdimOzTi3kn9IVbtU= +github.com/openshift/api v0.0.0-20231006150950-bbe1a26bbafc h1:WRrKcPMtTuk6AIJA7EPEnbAJhbB82b4JeZlPMxuL8gs= +github.com/openshift/api v0.0.0-20231006150950-bbe1a26bbafc/go.mod h1:qNtV0315F+f8ld52TLtPvrfivZpdimOzTi3kn9IVbtU= github.com/openshift/client-go v0.0.0-20230926161409-848405da69e1 h1:W1N/3nVciqmjPjn2xldHjb0AwwCQzlGxLvX5BCgE8H4= github.com/openshift/client-go v0.0.0-20230926161409-848405da69e1/go.mod h1:ihUJrhBcYAGYQrJu/gP2OMgfVds5f5z5kbeLNBqjHLo= github.com/openshift/library-go v0.0.0-20230927113136-405c34317fa4 h1:nNPH6wOCPP6XLDyHECflAlgW7xLorcUq7wl0vqyRQ34= diff --git a/vendor/github.com/openshift/api/config/v1/0000_00_cluster-version-operator_01_clusterversion.crd.yaml b/vendor/github.com/openshift/api/config/v1/0000_00_cluster-version-operator_01_clusterversion.crd.yaml index b3e5c9dbc..7cf29c2a8 100644 --- a/vendor/github.com/openshift/api/config/v1/0000_00_cluster-version-operator_01_clusterversion.crd.yaml +++ b/vendor/github.com/openshift/api/config/v1/0000_00_cluster-version-operator_01_clusterversion.crd.yaml @@ -75,6 +75,7 @@ spec: - Build - DeploymentConfig - ImageRegistry + - OperatorLifecycleManager x-kubernetes-list-type: atomic baselineCapabilitySet: description: baselineCapabilitySet selects an initial set of optional capabilities to enable, which can be extended via additionalEnabledCapabilities. If unset, the cluster will choose a default, and the default may change over time. The current default is vCurrent. @@ -201,6 +202,7 @@ spec: - Build - DeploymentConfig - ImageRegistry + - OperatorLifecycleManager x-kubernetes-list-type: atomic knownCapabilities: description: knownCapabilities lists all the capabilities known to the current cluster. @@ -221,6 +223,7 @@ spec: - Build - DeploymentConfig - ImageRegistry + - OperatorLifecycleManager x-kubernetes-list-type: atomic conditionalUpdates: description: conditionalUpdates contains the list of updates that may be recommended for this cluster if it meets specific required conditions. Consumers interested in the set of updates that are actually recommended for this cluster should use availableUpdates. This list may be empty if no updates are recommended, if the update service is unavailable, or if an empty or invalid channel has been specified. @@ -445,6 +448,8 @@ spec: x-kubernetes-validations: - rule: 'has(self.spec.capabilities) && has(self.spec.capabilities.additionalEnabledCapabilities) && self.spec.capabilities.baselineCapabilitySet == ''None'' && ''baremetal'' in self.spec.capabilities.additionalEnabledCapabilities ? ''MachineAPI'' in self.spec.capabilities.additionalEnabledCapabilities || (has(self.status) && has(self.status.capabilities) && has(self.status.capabilities.enabledCapabilities) && ''MachineAPI'' in self.status.capabilities.enabledCapabilities) : true' message: the `baremetal` capability requires the `MachineAPI` capability, which is neither explicitly or implicitly enabled in this cluster, please enable the `MachineAPI` capability + - rule: 'has(self.spec.capabilities) && has(self.spec.capabilities.additionalEnabledCapabilities) && self.spec.capabilities.baselineCapabilitySet == ''None'' && ''marketplace'' in self.spec.capabilities.additionalEnabledCapabilities ? ''OperatorLifecycleManager'' in self.spec.capabilities.additionalEnabledCapabilities || (has(self.status) && has(self.status.capabilities) && has(self.status.capabilities.enabledCapabilities) && ''OperatorLifecycleManager'' in self.status.capabilities.enabledCapabilities) : true' + message: the `marketplace` capability requires the `OperatorLifecycleManager` capability, which is neither explicitly or implicitly enabled in this cluster, please enable the `OperatorLifecycleManager` capability served: true storage: true subresources: diff --git a/vendor/github.com/openshift/api/config/v1/stable.clusterversion.testsuite.yaml b/vendor/github.com/openshift/api/config/v1/stable.clusterversion.testsuite.yaml index 914d06d12..50bb3e027 100644 --- a/vendor/github.com/openshift/api/config/v1/stable.clusterversion.testsuite.yaml +++ b/vendor/github.com/openshift/api/config/v1/stable.clusterversion.testsuite.yaml @@ -130,6 +130,38 @@ tests: additionalEnabledCapabilities: - baremetal expectedError: the `baremetal` capability requires the `MachineAPI` capability, which is neither explicitly or implicitly enabled in this cluster, please enable the `MachineAPI` capability + - name: Should be able to create a ClusterVersion with base capability None, and additional capabilities marketplace and OperatorLifecycleManager + initial: | + apiVersion: config.openshift.io/v1 + kind: ClusterVersion + spec: + clusterID: foo + capabilities: + baselineCapabilitySet: None + additionalEnabledCapabilities: + - marketplace + - OperatorLifecycleManager + expected: | + apiVersion: config.openshift.io/v1 + kind: ClusterVersion + spec: + clusterID: foo + capabilities: + baselineCapabilitySet: None + additionalEnabledCapabilities: + - marketplace + - OperatorLifecycleManager + - name: Should not be able to create a ClusterVersion with base capability None, and additional capabilities marketplace without OperatorLifecycleManager + initial: | + apiVersion: config.openshift.io/v1 + kind: ClusterVersion + spec: + clusterID: foo + capabilities: + baselineCapabilitySet: None + additionalEnabledCapabilities: + - marketplace + expectedError: the `marketplace` capability requires the `OperatorLifecycleManager` capability, which is neither explicitly or implicitly enabled in this cluster, please enable the `OperatorLifecycleManager` capability onUpdate: - name: Should not allow image to be set if architecture set initial: | @@ -276,3 +308,111 @@ tests: additionalEnabledCapabilities: - baremetal expectedError: the `baremetal` capability requires the `MachineAPI` capability, which is neither explicitly or implicitly enabled in this cluster, please enable the `MachineAPI` capability + - name: Should be able to add the marketplace capability with a ClusterVersion with base capability None, and implicitly enabled OperatorLifecycleManager + initial: | + apiVersion: config.openshift.io/v1 + kind: ClusterVersion + spec: + clusterID: foo + capabilities: + baselineCapabilitySet: None + status: + desired: + version: foo + image: foo + observedGeneration: 1 + versionHash: foo + availableUpdates: + - version: foo + image: foo + capabilities: + enabledCapabilities: + - OperatorLifecycleManager + updated: | + apiVersion: config.openshift.io/v1 + kind: ClusterVersion + spec: + clusterID: foo + capabilities: + baselineCapabilitySet: None + additionalEnabledCapabilities: + - marketplace + status: + desired: + version: foo + image: foo + observedGeneration: 1 + versionHash: foo + availableUpdates: + - version: foo + image: foo + capabilities: + enabledCapabilities: + - OperatorLifecycleManager + expected: | + apiVersion: config.openshift.io/v1 + kind: ClusterVersion + spec: + clusterID: foo + capabilities: + baselineCapabilitySet: None + additionalEnabledCapabilities: + - marketplace + status: + desired: + version: foo + image: foo + observedGeneration: 1 + versionHash: foo + availableUpdates: + - version: foo + image: foo + capabilities: + enabledCapabilities: + - OperatorLifecycleManager + - name: Should be able to add the marketplace capability with a ClusterVersion with base capability None, with the OperatorLifecycleManager capability + initial: | + apiVersion: config.openshift.io/v1 + kind: ClusterVersion + spec: + clusterID: foo + capabilities: + baselineCapabilitySet: None + updated: | + apiVersion: config.openshift.io/v1 + kind: ClusterVersion + spec: + clusterID: foo + capabilities: + baselineCapabilitySet: None + additionalEnabledCapabilities: + - marketplace + - OperatorLifecycleManager + expected: | + apiVersion: config.openshift.io/v1 + kind: ClusterVersion + spec: + clusterID: foo + capabilities: + baselineCapabilitySet: None + additionalEnabledCapabilities: + - marketplace + - OperatorLifecycleManager + - name: Should not be able to add the marketplace capability with a ClusterVersion with base capability None, and without OperatorLifecycleManager + initial: | + apiVersion: config.openshift.io/v1 + kind: ClusterVersion + spec: + clusterID: foo + capabilities: + baselineCapabilitySet: None + updated: | + apiVersion: config.openshift.io/v1 + kind: ClusterVersion + spec: + clusterID: foo + capabilities: + baselineCapabilitySet: None + additionalEnabledCapabilities: + - marketplace + expectedError: the `marketplace` capability requires the `OperatorLifecycleManager` capability, which is neither explicitly or implicitly enabled in this cluster, please enable the `OperatorLifecycleManager` capability diff --git a/vendor/github.com/openshift/api/config/v1/types_cluster_version.go b/vendor/github.com/openshift/api/config/v1/types_cluster_version.go index 3fbe39e4d..a9bade6fe 100644 --- a/vendor/github.com/openshift/api/config/v1/types_cluster_version.go +++ b/vendor/github.com/openshift/api/config/v1/types_cluster_version.go @@ -14,6 +14,7 @@ import ( // Compatibility level 1: Stable within a major release for a minimum of 12 months or 3 minor releases (whichever is longer). // +openshift:compatibility-gen:level=1 // +kubebuilder:validation:XValidation:rule="has(self.spec.capabilities) && has(self.spec.capabilities.additionalEnabledCapabilities) && self.spec.capabilities.baselineCapabilitySet == 'None' && 'baremetal' in self.spec.capabilities.additionalEnabledCapabilities ? 'MachineAPI' in self.spec.capabilities.additionalEnabledCapabilities || (has(self.status) && has(self.status.capabilities) && has(self.status.capabilities.enabledCapabilities) && 'MachineAPI' in self.status.capabilities.enabledCapabilities) : true",message="the `baremetal` capability requires the `MachineAPI` capability, which is neither explicitly or implicitly enabled in this cluster, please enable the `MachineAPI` capability" +// +kubebuilder:validation:XValidation:rule="has(self.spec.capabilities) && has(self.spec.capabilities.additionalEnabledCapabilities) && self.spec.capabilities.baselineCapabilitySet == 'None' && 'marketplace' in self.spec.capabilities.additionalEnabledCapabilities ? 'OperatorLifecycleManager' in self.spec.capabilities.additionalEnabledCapabilities || (has(self.status) && has(self.status.capabilities) && has(self.status.capabilities.enabledCapabilities) && 'OperatorLifecycleManager' in self.status.capabilities.enabledCapabilities) : true",message="the `marketplace` capability requires the `OperatorLifecycleManager` capability, which is neither explicitly or implicitly enabled in this cluster, please enable the `OperatorLifecycleManager` capability" type ClusterVersion struct { metav1.TypeMeta `json:",inline"` @@ -248,7 +249,7 @@ const ( ) // ClusterVersionCapability enumerates optional, core cluster components. -// +kubebuilder:validation:Enum=openshift-samples;baremetal;marketplace;Console;Insights;Storage;CSISnapshot;NodeTuning;MachineAPI;Build;DeploymentConfig;ImageRegistry +// +kubebuilder:validation:Enum=openshift-samples;baremetal;marketplace;Console;Insights;Storage;CSISnapshot;NodeTuning;MachineAPI;Build;DeploymentConfig;ImageRegistry;OperatorLifecycleManager type ClusterVersionCapability string const ( @@ -267,6 +268,9 @@ const ( // ClusterVersionCapabilityMarketplace manages the Marketplace operator which // supplies Operator Lifecycle Manager (OLM) users with default catalogs of // "optional" operators. + // + // Note that Marketplace has a hard requirement on OLM. OLM can not be disabled + // while Marketplace is enabled. ClusterVersionCapabilityMarketplace ClusterVersionCapability = "marketplace" // ClusterVersionCapabilityConsole manages the Console operator which @@ -331,9 +335,14 @@ const ( // The following resources are taken into account: // - deploymentconfigs ClusterVersionCapabilityDeploymentConfig ClusterVersionCapability = "DeploymentConfig" + // ClusterVersionCapabilityImageRegistry manages the image registry which // allows to distribute Docker images ClusterVersionCapabilityImageRegistry ClusterVersionCapability = "ImageRegistry" + + // ClusterVersionCapabilityOperatorLifecycleManager manages the Operator Lifecycle Manager + // which itself manages the lifecycle of operators + ClusterVersionCapabilityOperatorLifecycleManager ClusterVersionCapability = "OperatorLifecycleManager" ) // KnownClusterVersionCapabilities includes all known optional, core cluster components. @@ -350,6 +359,7 @@ var KnownClusterVersionCapabilities = []ClusterVersionCapability{ ClusterVersionCapabilityBuild, ClusterVersionCapabilityDeploymentConfig, ClusterVersionCapabilityImageRegistry, + ClusterVersionCapabilityOperatorLifecycleManager, } // ClusterVersionCapabilitySet defines sets of cluster version capabilities. @@ -448,6 +458,7 @@ var ClusterVersionCapabilitySets = map[ClusterVersionCapabilitySet][]ClusterVers ClusterVersionCapabilityBuild, ClusterVersionCapabilityDeploymentConfig, ClusterVersionCapabilityImageRegistry, + ClusterVersionCapabilityOperatorLifecycleManager, }, } diff --git a/vendor/github.com/openshift/api/operator/v1/0000_50_ingress-operator_00-ingresscontroller.crd.yaml b/vendor/github.com/openshift/api/operator/v1/0000_50_ingress-operator_00-ingresscontroller.crd.yaml index 4ff57e35a..a5be103ac 100644 --- a/vendor/github.com/openshift/api/operator/v1/0000_50_ingress-operator_00-ingresscontroller.crd.yaml +++ b/vendor/github.com/openshift/api/operator/v1/0000_50_ingress-operator_00-ingresscontroller.crd.yaml @@ -507,6 +507,11 @@ spec: required: - type type: object + x-kubernetes-validations: + - message: container cannot be specified unless type is Container + rule: '!has(self.type) || self.type == "Container" || !has(self.container) || !has(self.container.maxLength) || self.container.maxLength == 1024' + - message: container and syslog cannot both be specified at the same time + rule: '!has(self.container) || !has(self.container.maxLength) || self.container.maxLength == 1024 || !has(self.syslog)' httpCaptureCookies: description: httpCaptureCookies specifies HTTP cookies that should be captured in access logs. If this field is empty, no cookies are captured. items: diff --git a/vendor/github.com/openshift/api/operator/v1/stable.ingresscontroller.testsuite.yaml b/vendor/github.com/openshift/api/operator/v1/stable.ingresscontroller.testsuite.yaml index 903d8e60c..6a816ee72 100644 --- a/vendor/github.com/openshift/api/operator/v1/stable.ingresscontroller.testsuite.yaml +++ b/vendor/github.com/openshift/api/operator/v1/stable.ingresscontroller.testsuite.yaml @@ -476,3 +476,305 @@ tests: set: value: DENY expectedError: 'IngressController.operator.openshift.io "default-not-allowed-values" is invalid: [spec.httpHeaders.actions.response[0].action.type: Required value, : Invalid value: "null": some validation rules were not checked because the object was invalid; correct the existing errors to complete validation]' + + - name: "Should require spec.logging.access.destination if spec.logging.access is not null" + initial: | + apiVersion: operator.openshift.io/v1 + kind: IngressController + metadata: + name: access-logging-null-destination + namespace: openshift-ingress-operator + spec: + logging: + access: {} + expectedError: "spec.logging.access.destination: Required value" + - name: "Should require spec.logging.access.destination.type if spec.logging.access.destination is not null" + initial: | + apiVersion: operator.openshift.io/v1 + kind: IngressController + metadata: + name: access-logging-empty-destination-type + namespace: openshift-ingress-operator + spec: + logging: + access: + destination: + container: {} + expectedError: "spec.logging.access.destination.type: Required value" + - name: "Should be able to specify empty spec.logging.access.destination.container with type: Container" + initial: | + apiVersion: operator.openshift.io/v1 + kind: IngressController + metadata: + name: container-logging-empty-settings + namespace: openshift-ingress-operator + spec: + logging: + access: + destination: + type: Container + container: {} + expected: | + apiVersion: operator.openshift.io/v1 + kind: IngressController + metadata: + name: container-logging-empty-settings + namespace: openshift-ingress-operator + spec: + httpEmptyRequestsPolicy: Respond + logging: + access: + destination: + type: Container + container: + maxLength: 1024 + logEmptyRequests: Log + - name: "Should be able to omit spec.logging.access.destination.container with type: Container" + initial: | + apiVersion: operator.openshift.io/v1 + kind: IngressController + metadata: + name: container-logging-null-settings + namespace: openshift-ingress-operator + spec: + logging: + access: + destination: + type: Container + expected: | + apiVersion: operator.openshift.io/v1 + kind: IngressController + metadata: + name: container-logging-null-settings + namespace: openshift-ingress-operator + spec: + httpEmptyRequestsPolicy: Respond + logging: + access: + destination: + type: Container + logEmptyRequests: Log + - name: "Should be able to specify spec.logging.access.destination.syslog with type: Syslog" + initial: | + apiVersion: operator.openshift.io/v1 + kind: IngressController + metadata: + name: syslog + namespace: openshift-ingress-operator + spec: + logging: + access: + destination: + type: Syslog + syslog: + address: 1.2.3.4 + port: 514 + expected: | + apiVersion: operator.openshift.io/v1 + kind: IngressController + metadata: + name: syslog + namespace: openshift-ingress-operator + spec: + httpEmptyRequestsPolicy: Respond + logging: + access: + destination: + type: Syslog + syslog: + address: 1.2.3.4 + maxLength: 1024 + port: 514 + logEmptyRequests: Log + - name: "Should not be able to specify empty spec.logging.access.destination.syslog with type: Syslog" + initial: | + apiVersion: operator.openshift.io/v1 + kind: IngressController + metadata: + name: syslog-empty-settings + namespace: openshift-ingress-operator + spec: + logging: + access: + destination: + type: Syslog + syslog: {} + expectedError: "address: Required value" + # OpenShift 4.5 added the access logging API without validation to prevent + # null spec.logging.access.destination.syslog with type: Syslog, so validation + # must forevermore allow this combination. (The ingress operator doesn't + # actually enable syslog logging if the syslog field is null.) + - name: "Should be able to omit spec.logging.access.destination.syslog with type: Syslog" + initial: | + apiVersion: operator.openshift.io/v1 + kind: IngressController + metadata: + name: syslog-null-settings + namespace: openshift-ingress-operator + spec: + logging: + access: + destination: + type: Syslog + expected: | + apiVersion: operator.openshift.io/v1 + kind: IngressController + metadata: + name: syslog-null-settings + namespace: openshift-ingress-operator + spec: + httpEmptyRequestsPolicy: Respond + logging: + access: + destination: + type: Syslog + logEmptyRequests: Log + # OpenShift 4.5 added the access logging API without validation to prevent + # specifying spec.logging.access.destination.syslog with type: Container, so + # validation must forevermore allow this combination. (The ingress operator + # enables container logging and ignores the syslog settings in this case.) + - name: "Should be able to specify spec.logging.access.destination.syslog with type: Container" + initial: | + apiVersion: operator.openshift.io/v1 + kind: IngressController + metadata: + name: container-logging-with-bogus-syslog-configuration + namespace: openshift-ingress-operator + spec: + logging: + access: + destination: + type: Container + container: {} + syslog: + address: 1.2.3.4 + maxLength: 1024 + port: 514 + expected: | + apiVersion: operator.openshift.io/v1 + kind: IngressController + metadata: + name: container-logging-with-bogus-syslog-configuration + namespace: openshift-ingress-operator + spec: + httpEmptyRequestsPolicy: Respond + logging: + access: + destination: + type: Container + container: + maxLength: 1024 + syslog: + address: 1.2.3.4 + maxLength: 1024 + port: 514 + logEmptyRequests: Log + - name: "Should be able to specify spec.logging.access.destination.container with type: Syslog" + initial: | + apiVersion: operator.openshift.io/v1 + kind: IngressController + metadata: + name: syslog-logging-with-bogus-container-configuration + namespace: openshift-ingress-operator + spec: + logging: + access: + destination: + type: Syslog + container: {} + syslog: + address: 1.2.3.4 + maxLength: 1024 + port: 514 + expected: | + apiVersion: operator.openshift.io/v1 + kind: IngressController + metadata: + name: syslog-logging-with-bogus-container-configuration + namespace: openshift-ingress-operator + spec: + httpEmptyRequestsPolicy: Respond + logging: + access: + destination: + type: Syslog + container: + maxLength: 1024 + syslog: + address: 1.2.3.4 + maxLength: 1024 + port: 514 + logEmptyRequests: Log + # OpenShift 4.14 added the spec.logging.access.destination.container.maxLength + # field. As noted above, we must allow + # spec.logging.access.destination.container when type: Syslog is specified. + # Also, due to defaulting, we must allow + # spec.logging.access.destination.container.maxLength with the default value + # because the default value gets set automatically when + # spec.logging.access.destination.container is not null. However, we do not + # need to allow spec.logging.access.destination.container.maxLength with a + # non-default value when type: Syslog is specified. + - name: "Should be able to specify the default value for spec.logging.access.destination.container.maxLength with type: Syslog" + initial: | + apiVersion: operator.openshift.io/v1 + kind: IngressController + metadata: + name: syslog-logging-with-default-container-maxlength + namespace: openshift-ingress-operator + spec: + logging: + access: + destination: + type: Syslog + container: + maxLength: 1024 + expected: | + apiVersion: operator.openshift.io/v1 + kind: IngressController + metadata: + name: syslog-logging-with-default-container-maxlength + namespace: openshift-ingress-operator + spec: + httpEmptyRequestsPolicy: Respond + logging: + access: + destination: + type: Syslog + container: + maxLength: 1024 + logEmptyRequests: Log + - name: "Should not be able to specify a non-default value for spec.logging.access.destination.container.maxLength with type: Syslog" + initial: | + apiVersion: operator.openshift.io/v1 + kind: IngressController + metadata: + name: syslog-logging-with-non-default-container-maxlength + namespace: openshift-ingress-operator + spec: + logging: + access: + destination: + type: Syslog + container: + maxLength: 2048 + expectedError: "container cannot be specified unless type is Container" + - name: "Should not be able to specify spec.logging.access.destination.syslog and a non-default value for spec.logging.access.destination.container.maxLength" + initial: | + apiVersion: operator.openshift.io/v1 + kind: IngressController + metadata: + name: container-logging-with-non-default-syslog-maxlength + namespace: openshift-ingress-operator + spec: + httpEmptyRequestsPolicy: Respond + logging: + access: + destination: + type: Container + container: + maxLength: 2048 + syslog: + address: 1.2.3.4 + maxLength: 1024 + port: 514 + expectedError: "container and syslog cannot both be specified at the same time" diff --git a/vendor/github.com/openshift/api/operator/v1/types_ingress.go b/vendor/github.com/openshift/api/operator/v1/types_ingress.go index 3d9f512a9..c28b73ed9 100644 --- a/vendor/github.com/openshift/api/operator/v1/types_ingress.go +++ b/vendor/github.com/openshift/api/operator/v1/types_ingress.go @@ -1054,6 +1054,22 @@ type ContainerLoggingDestinationParameters struct { } // LoggingDestination describes a destination for log messages. +// + --- +// + We added the spec.logging.access.destination.container and +// + spec.logging.access.destination.syslog fields in OpenShift 4.5 without any +// + validation rules to prevent the user from specifying both fields at the +// + same time. Adding such validation rules in a subsequent release would +// + break API compatibility between releases. +// + +// + We added the spec.logging.access.destination.container.maxLength field in +// + OpenShift 4.14, and we added the following validation rules in the same +// + release, so they do not break compatibility between releases. Note that +// + API defaulting requires us to allow the default value for +// + container.maxLength if container is non-null even when type is Syslog. +// + +// +kubebuilder:validation:XValidation:rule=`!has(self.type) || self.type == "Container" || !has(self.container) || !has(self.container.maxLength) || self.container.maxLength == 1024`,message="container cannot be specified unless type is Container" +// +kubebuilder:validation:XValidation:rule=`!has(self.container) || !has(self.container.maxLength) || self.container.maxLength == 1024 || !has(self.syslog)`,message="container and syslog cannot both be specified at the same time" +// // +union type LoggingDestination struct { // type is the type of destination for logs. It must be one of the diff --git a/vendor/github.com/openshift/api/operator/v1/zz_generated.swagger_doc_generated.go b/vendor/github.com/openshift/api/operator/v1/zz_generated.swagger_doc_generated.go index adf062fd2..96122157d 100644 --- a/vendor/github.com/openshift/api/operator/v1/zz_generated.swagger_doc_generated.go +++ b/vendor/github.com/openshift/api/operator/v1/zz_generated.swagger_doc_generated.go @@ -1012,7 +1012,7 @@ func (LoadBalancerStrategy) SwaggerDoc() map[string]string { } var map_LoggingDestination = map[string]string{ - "": "LoggingDestination describes a destination for log messages.", + "": "LoggingDestination describes a destination for log messages. ", "type": "type is the type of destination for logs. It must be one of the following:\n\n* Container\n\nThe ingress operator configures the sidecar container named \"logs\" on the ingress controller pod and configures the ingress controller to write logs to the sidecar. The logs are then available as container logs. The expectation is that the administrator configures a custom logging solution that reads logs from this sidecar. Note that using container logs means that logs may be dropped if the rate of logs exceeds the container runtime's or the custom logging solution's capacity.\n\n* Syslog\n\nLogs are sent to a syslog endpoint. The administrator must specify an endpoint that can receive syslog messages. The expectation is that the administrator has configured a custom syslog instance.", "syslog": "syslog holds parameters for a syslog endpoint. Present only if type is Syslog.", "container": "container holds parameters for the Container logging destination. Present only if type is Container.", diff --git a/vendor/modules.txt b/vendor/modules.txt index 5129f6b11..867f68e10 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -299,7 +299,7 @@ github.com/onsi/gomega/matchers/support/goraph/edge github.com/onsi/gomega/matchers/support/goraph/node github.com/onsi/gomega/matchers/support/goraph/util github.com/onsi/gomega/types -# github.com/openshift/api v0.0.0-20231002140248-174e989c9ee1 => github.com/openshift/api v0.0.0-20231002140248-174e989c9ee1 +# github.com/openshift/api v0.0.0-20231006150950-bbe1a26bbafc => github.com/openshift/api v0.0.0-20231006150950-bbe1a26bbafc ## explicit; go 1.20 github.com/openshift/api github.com/openshift/api/apiserver @@ -1218,5 +1218,5 @@ sigs.k8s.io/structured-merge-diff/v4/value # sigs.k8s.io/yaml v1.3.0 ## explicit; go 1.12 sigs.k8s.io/yaml -# github.com/openshift/api => github.com/openshift/api v0.0.0-20231002140248-174e989c9ee1 +# github.com/openshift/api => github.com/openshift/api v0.0.0-20231006150950-bbe1a26bbafc # github.com/openshift/client-go => github.com/openshift/client-go v0.0.0-20230926161409-848405da69e1