From 9e00b2ae7fdc90a3f96f6ec7b25317cb4bc80981 Mon Sep 17 00:00:00 2001 From: "red-hat-konflux[bot]" <126015336+red-hat-konflux[bot]@users.noreply.github.com> Date: Thu, 9 Oct 2025 00:13:16 +0000 Subject: [PATCH] NO-ISSUE: Update github.com/openshift/assisted-service/models digest to ed1e534 Signed-off-by: red-hat-konflux <126015336+red-hat-konflux[bot]@users.noreply.github.com> --- go.mod | 7 +- go.sum | 7 +- .../openshift/assisted-service/LICENSE | 201 ----------- .../openshift/assisted-service/models/boot.go | 107 +++++- .../assisted-service/models/bundle.go | 62 ++++ .../assisted-service/models/cluster.go | 93 +++++- .../models/cluster_create_params.go | 78 ++++- .../models/cluster_validation_id.go | 68 +++- .../models/connectivity_remote_host.go | 57 ++++ .../models/create_manifest_params.go | 4 +- .../assisted-service/models/custom.go | 6 +- .../disconnected_cluster_create_params.go | 98 ++++++ .../openshift/assisted-service/models/disk.go | 49 +++ .../models/disk_encryption.go | 27 +- .../models/domain_resolution_response.go | 3 + .../assisted-service/models/feature.go | 242 ++++++++++++++ .../models/feature_support_level_id.go | 77 ++++- .../models/fencing_credentials_params.go | 156 +++++++++ .../models/finalizing_stage.go | 5 +- .../openshift/assisted-service/models/host.go | 3 + .../assisted-service/models/host_role.go | 5 +- .../models/host_role_update_params.go | 5 +- .../models/host_update_params.go | 53 ++- .../models/host_validation_id.go | 71 +++- .../assisted-service/models/image_type.go | 5 +- .../models/incompatibility_reason.go | 84 +++++ .../models/infra_env_update_params.go | 3 + .../models/install_cmd_request.go | 62 +--- .../assisted-service/models/iscsi.go | 50 +++ .../assisted-service/models/load_balancer.go | 114 +++++++ .../assisted-service/models/manifest.go | 50 +++ .../models/monitored_operator.go | 7 + .../assisted-service/models/mtu_report.go | 56 ++++ .../assisted-service/models/operator.go | 311 ++++++++++++++++++ .../models/secure_boot_state.go | 84 +++++ .../models/update_manifest_params.go | 8 +- .../models/v2_cluster_update_params.go | 78 ++++- .../models/validations/dns_validation.go | 50 +++ .../models/versioned_host_requirements.go | 46 +++ .../pkg/validations/validations.go | 209 ------------ vendor/modules.txt | 18 +- 41 files changed, 2192 insertions(+), 527 deletions(-) delete mode 100644 vendor/github.com/openshift/assisted-service/LICENSE create mode 100644 vendor/github.com/openshift/assisted-service/models/bundle.go create mode 100644 vendor/github.com/openshift/assisted-service/models/disconnected_cluster_create_params.go create mode 100644 vendor/github.com/openshift/assisted-service/models/feature.go create mode 100644 vendor/github.com/openshift/assisted-service/models/fencing_credentials_params.go create mode 100644 vendor/github.com/openshift/assisted-service/models/incompatibility_reason.go create mode 100644 vendor/github.com/openshift/assisted-service/models/iscsi.go create mode 100644 vendor/github.com/openshift/assisted-service/models/load_balancer.go create mode 100644 vendor/github.com/openshift/assisted-service/models/mtu_report.go create mode 100644 vendor/github.com/openshift/assisted-service/models/operator.go create mode 100644 vendor/github.com/openshift/assisted-service/models/secure_boot_state.go create mode 100644 vendor/github.com/openshift/assisted-service/models/validations/dns_validation.go delete mode 100644 vendor/github.com/openshift/assisted-service/pkg/validations/validations.go diff --git a/go.mod b/go.mod index 1ed41d1b0..67fa12001 100644 --- a/go.mod +++ b/go.mod @@ -79,12 +79,12 @@ require ( github.com/nxadm/tail v1.4.8 // indirect github.com/oklog/ulid v1.3.1 // indirect github.com/openshift/api v0.0.0-20231031181504-3be12e93388f // indirect - github.com/openshift/assisted-service v1.0.10-0.20240506174859-4577ef6f4cf1 // indirect github.com/prometheus/client_golang v1.17.0 // indirect github.com/prometheus/client_model v0.5.0 // indirect github.com/prometheus/common v0.45.0 // indirect github.com/prometheus/procfs v0.12.0 // indirect github.com/spf13/pflag v1.0.6-0.20210604193023-d5e0c0615ace // indirect + github.com/stretchr/testify v1.9.0 // indirect github.com/vincent-petithory/dataurl v1.0.0 // indirect go.mongodb.org/mongo-driver v1.10.0 // indirect go.uber.org/multierr v1.11.0 // indirect @@ -97,6 +97,8 @@ require ( golang.org/x/text v0.21.0 // indirect golang.org/x/time v0.3.0 // indirect gomodules.xyz/jsonpatch/v2 v2.4.0 // indirect + google.golang.org/genproto/googleapis/api v0.0.0-20230711160842-782d3b101e98 // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20230711160842-782d3b101e98 // indirect google.golang.org/protobuf v1.31.0 // indirect gopkg.in/inf.v0 v0.9.1 // indirect gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 // indirect @@ -104,6 +106,7 @@ require ( gopkg.in/yaml.v3 v3.0.1 // indirect gorm.io/gorm v1.25.7 // indirect k8s.io/apiextensions-apiserver v0.28.2 // indirect + k8s.io/apiserver v0.28.4 // indirect k8s.io/component-base v0.28.4 // indirect k8s.io/klog/v2 v2.100.1 // indirect k8s.io/kube-openapi v0.0.0-20230918164632-68afd615200d // indirect @@ -114,7 +117,7 @@ require ( replace ( github.com/openshift/assisted-service/api => github.com/openshift/assisted-service/api v0.0.0-20240506174859-4577ef6f4cf1 - github.com/openshift/assisted-service/models => github.com/openshift/assisted-service/models v0.0.0-20240506174859-4577ef6f4cf1 + github.com/openshift/assisted-service/models => github.com/openshift/assisted-service/models v0.0.0-20251008122257-ed1e53465867 github.com/openshift/cluster-api-provider-agent/api => ./api // CVE-2025-22868 // This is from tag v0.26.openshift.1 diff --git a/go.sum b/go.sum index 7f2bc6927..b2b8eba98 100644 --- a/go.sum +++ b/go.sum @@ -366,12 +366,10 @@ github.com/opencontainers/go-digest v1.0.0 h1:apOUWs51W5PlhuyGyz9FCeeBIOUDA/6nW8 github.com/opencontainers/go-digest v1.0.0/go.mod h1:0JzlMkj0TRzQZfJkVvzbP0HBR3IKzErnv2BNG4W4MAM= github.com/openshift/api v0.0.0-20231031181504-3be12e93388f h1:j7QYl057TBD/lxWAGCr4IrbdG7IMg2U60DFK+BKt3VI= github.com/openshift/api v0.0.0-20231031181504-3be12e93388f/go.mod h1:yimSGmjsI+XF1mr+AKBs2//fSXIOhhetHGbMlBEfXbs= -github.com/openshift/assisted-service v1.0.10-0.20240506174859-4577ef6f4cf1 h1:aIzWCog7xMizJF6zpvI48jbJ6/oxewayQYrhOeucbgc= -github.com/openshift/assisted-service v1.0.10-0.20240506174859-4577ef6f4cf1/go.mod h1:6HPEu9ojkGtKZQtkR9Uk8GTGm9OxryQjrUYYpln1FSY= github.com/openshift/assisted-service/api v0.0.0-20240506174859-4577ef6f4cf1 h1:dhuAkkV6V53w2TwX8bqPW0aEmYVM0roiAKTiv1mUk88= github.com/openshift/assisted-service/api v0.0.0-20240506174859-4577ef6f4cf1/go.mod h1:PbxcQ9Cwxvp/l7hVEIkG5flQnfWSn4QEw6DmaTIqpM8= -github.com/openshift/assisted-service/models v0.0.0-20240506174859-4577ef6f4cf1 h1:cfoG6S4uAwcWqgR8CCfK1H1u8j7iqRqgfZkryBwXp54= -github.com/openshift/assisted-service/models v0.0.0-20240506174859-4577ef6f4cf1/go.mod h1:xd9WEj3m/k1cwZRyBTDa61BfDsHucQuArDsFgEFvv2s= +github.com/openshift/assisted-service/models v0.0.0-20251008122257-ed1e53465867 h1:Jvl7KzDW65zXXF8+S52fZe0ASfVHfQbECjXmYNog7EI= +github.com/openshift/assisted-service/models v0.0.0-20251008122257-ed1e53465867/go.mod h1:5EkIueBSaLnt64HR8drgSewdm+GeuE7W5mr9pa2JXXk= github.com/openshift/custom-resource-status v1.1.2 h1:C3DL44LEbvlbItfd8mT5jWrqPfHnSOQoQf/sypqA6A4= github.com/openshift/custom-resource-status v1.1.2/go.mod h1:DB/Mf2oTeiAmVVX1gN+NEqweonAPY0TKUwADizj8+ZA= github.com/openshift/golang-oauth2 v0.26.1-0.20250310184649-06a918c6239d h1:iQfTKBmMcwFTxxVWV7U/C6GqgIIWTKD8l5HXslvn53s= @@ -741,7 +739,6 @@ google.golang.org/genproto v0.0.0-20200603110839-e855014d5736/go.mod h1:jDfRM7Fc google.golang.org/genproto v0.0.0-20200608115520-7c474a2e3482/go.mod h1:jDfRM7FcilCzHH/e9qn6dsT145K34l5v+OpcnNgKAAA= google.golang.org/genproto v0.0.0-20200610104632-a5b850bcf112/go.mod h1:jDfRM7FcilCzHH/e9qn6dsT145K34l5v+OpcnNgKAAA= google.golang.org/genproto v0.0.0-20201019141844-1ed22bb0c154/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20230711160842-782d3b101e98 h1:Z0hjGZePRE0ZBWotvtrwxFNrNE9CUAGtplaDK5NNI/g= google.golang.org/genproto/googleapis/api v0.0.0-20230711160842-782d3b101e98 h1:FmF5cCW94Ij59cfpoLiwTgodWmm60eEV0CjlsVg2fuw= google.golang.org/genproto/googleapis/api v0.0.0-20230711160842-782d3b101e98/go.mod h1:rsr7RhLuwsDKL7RmgDDCUc6yaGr1iqceVb5Wv6f6YvQ= google.golang.org/genproto/googleapis/rpc v0.0.0-20230711160842-782d3b101e98 h1:bVf09lpb+OJbByTj913DRJioFFAjf/ZGxEz7MajTp2U= diff --git a/vendor/github.com/openshift/assisted-service/LICENSE b/vendor/github.com/openshift/assisted-service/LICENSE deleted file mode 100644 index 261eeb9e9..000000000 --- a/vendor/github.com/openshift/assisted-service/LICENSE +++ /dev/null @@ -1,201 +0,0 @@ - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - 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. diff --git a/vendor/github.com/openshift/assisted-service/models/boot.go b/vendor/github.com/openshift/assisted-service/models/boot.go index 8b7defc95..782d47fb3 100644 --- a/vendor/github.com/openshift/assisted-service/models/boot.go +++ b/vendor/github.com/openshift/assisted-service/models/boot.go @@ -7,9 +7,12 @@ package models import ( "context" + "encoding/json" + "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" + "github.com/go-openapi/validate" ) // Boot boot @@ -23,17 +26,119 @@ type Boot struct { // current boot mode CurrentBootMode string `json:"current_boot_mode,omitempty"` + // device type + // Enum: [persistent ephemeral] + DeviceType string `json:"device_type,omitempty"` + // pxe interface PxeInterface string `json:"pxe_interface,omitempty"` + + // secure boot state + SecureBootState SecureBootState `json:"secure_boot_state,omitempty"` } // Validate validates this boot func (m *Boot) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateDeviceType(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSecureBootState(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } return nil } -// ContextValidate validates this boot based on context it is used +var bootTypeDeviceTypePropEnum []interface{} + +func init() { + var res []string + if err := json.Unmarshal([]byte(`["persistent","ephemeral"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + bootTypeDeviceTypePropEnum = append(bootTypeDeviceTypePropEnum, v) + } +} + +const ( + + // BootDeviceTypePersistent captures enum value "persistent" + BootDeviceTypePersistent string = "persistent" + + // BootDeviceTypeEphemeral captures enum value "ephemeral" + BootDeviceTypeEphemeral string = "ephemeral" +) + +// prop value enum +func (m *Boot) validateDeviceTypeEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, bootTypeDeviceTypePropEnum, true); err != nil { + return err + } + return nil +} + +func (m *Boot) validateDeviceType(formats strfmt.Registry) error { + if swag.IsZero(m.DeviceType) { // not required + return nil + } + + // value enum + if err := m.validateDeviceTypeEnum("device_type", "body", m.DeviceType); err != nil { + return err + } + + return nil +} + +func (m *Boot) validateSecureBootState(formats strfmt.Registry) error { + if swag.IsZero(m.SecureBootState) { // not required + return nil + } + + if err := m.SecureBootState.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("secure_boot_state") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("secure_boot_state") + } + return err + } + + return nil +} + +// ContextValidate validate this boot based on the context it is used func (m *Boot) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateSecureBootState(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *Boot) contextValidateSecureBootState(ctx context.Context, formats strfmt.Registry) error { + + if err := m.SecureBootState.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("secure_boot_state") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("secure_boot_state") + } + return err + } + return nil } diff --git a/vendor/github.com/openshift/assisted-service/models/bundle.go b/vendor/github.com/openshift/assisted-service/models/bundle.go new file mode 100644 index 000000000..a653d18ef --- /dev/null +++ b/vendor/github.com/openshift/assisted-service/models/bundle.go @@ -0,0 +1,62 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// Bundle bundle +// +// swagger:model bundle +type Bundle struct { + + // Longer human friendly description for the bundle, usually one or more sentences. + // + Description string `json:"description,omitempty"` + + // Unique identifier of the bundle, for example `virtualization` or `openshift-ai-nvidia`. + ID string `json:"id,omitempty"` + + // List of operators associated with the bundle. + Operators []string `json:"operators"` + + // Short human friendly description for the bundle, usually only a few words, for example `Virtualization` or + // `OpenShift AI (NVIDIA)`. + // + Title string `json:"title,omitempty"` +} + +// Validate validates this bundle +func (m *Bundle) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this bundle based on context it is used +func (m *Bundle) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *Bundle) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *Bundle) UnmarshalBinary(b []byte) error { + var res Bundle + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/vendor/github.com/openshift/assisted-service/models/cluster.go b/vendor/github.com/openshift/assisted-service/models/cluster.go index 2ef415d20..c75142b44 100644 --- a/vendor/github.com/openshift/assisted-service/models/cluster.go +++ b/vendor/github.com/openshift/assisted-service/models/cluster.go @@ -54,6 +54,9 @@ type Cluster struct { // Json formatted string containing the majority groups for connectivity checks. ConnectivityMajorityGroups string `json:"connectivity_majority_groups,omitempty" gorm:"type:text"` + // Specifies the required number of control plane nodes that should be part of the cluster. + ControlPlaneCount int64 `json:"control_plane_count,omitempty"` + // controller logs collected at // Format: date-time ControllerLogsCollectedAt strfmt.DateTime `json:"controller_logs_collected_at,omitempty" gorm:"type:timestamp with time zone"` @@ -85,7 +88,7 @@ type Cluster struct { // JSON-formatted string containing the usage information by feature name FeatureUsage string `json:"feature_usage,omitempty" gorm:"type:text"` - // Guaranteed availability of the installed cluster. 'Full' installs a Highly-Available cluster + // (DEPRECATED) Please use 'control_plane_count' instead. Guaranteed availability of the installed cluster. 'Full' installs a Highly-Available cluster // over multiple master nodes whereas 'None' installs a full cluster over one node. // // Enum: [Full None] @@ -111,8 +114,8 @@ type Cluster struct { // HTTPSProxy string `json:"https_proxy,omitempty" gorm:"column:https_proxy"` - // Enable/disable hyperthreading on master nodes, worker nodes, or all nodes - // Enum: [masters workers all none] + // Enable/disable hyperthreading on master nodes, arbiter nodes, worker nodes, or a combination of them. + // Enum: [none masters arbiters workers masters,arbiters masters,workers arbiters,workers masters,arbiters,workers all] Hyperthreading string `json:"hyperthreading,omitempty"` // Unique identifier of the object. @@ -163,14 +166,18 @@ type Cluster struct { // Indicates the type of this object. Will be 'Cluster' if this is a complete object, // 'AddHostsCluster' for cluster that add hosts to existing OCP cluster, + // 'DisconnectedCluster' for clusters with embedded ignition for offline installation, // // Required: true - // Enum: [Cluster AddHostsCluster] + // Enum: [Cluster AddHostsCluster DisconnectedCluster] Kind *string `json:"kind"` // last installation preparation LastInstallationPreparation LastInstallationPreparation `json:"last-installation-preparation,omitempty" gorm:"embedded;embeddedPrefix:last_installation_preparation_"` + // load balancer + LoadBalancer *LoadBalancer `json:"load_balancer,omitempty" gorm:"embedded;embeddedPrefix:load_balancer_"` + // The progress of log collection or empty if logs are not applicable LogsInfo LogsState `json:"logs_info,omitempty" gorm:"type:varchar(2048)"` @@ -242,7 +249,7 @@ type Cluster struct { // Status of the OpenShift cluster. // Required: true - // Enum: [insufficient ready error preparing-for-installation pending-for-input installing finalizing installed adding-hosts cancelled installing-pending-user-action] + // Enum: [insufficient ready error preparing-for-installation pending-for-input installing finalizing installed adding-hosts cancelled installing-pending-user-action unmonitored] Status *string `json:"status"` // Additional information pertaining to the status of the OpenShift cluster. @@ -372,6 +379,10 @@ func (m *Cluster) Validate(formats strfmt.Registry) error { res = append(res, err) } + if err := m.validateLoadBalancer(formats); err != nil { + res = append(res, err) + } + if err := m.validateLogsInfo(formats); err != nil { res = append(res, err) } @@ -742,7 +753,7 @@ var clusterTypeHyperthreadingPropEnum []interface{} func init() { var res []string - if err := json.Unmarshal([]byte(`["masters","workers","all","none"]`), &res); err != nil { + if err := json.Unmarshal([]byte(`["none","masters","arbiters","workers","masters,arbiters","masters,workers","arbiters,workers","masters,arbiters,workers","all"]`), &res); err != nil { panic(err) } for _, v := range res { @@ -752,17 +763,32 @@ func init() { const ( + // ClusterHyperthreadingNone captures enum value "none" + ClusterHyperthreadingNone string = "none" + // ClusterHyperthreadingMasters captures enum value "masters" ClusterHyperthreadingMasters string = "masters" + // ClusterHyperthreadingArbiters captures enum value "arbiters" + ClusterHyperthreadingArbiters string = "arbiters" + // ClusterHyperthreadingWorkers captures enum value "workers" ClusterHyperthreadingWorkers string = "workers" + // ClusterHyperthreadingMastersArbiters captures enum value "masters,arbiters" + ClusterHyperthreadingMastersArbiters string = "masters,arbiters" + + // ClusterHyperthreadingMastersWorkers captures enum value "masters,workers" + ClusterHyperthreadingMastersWorkers string = "masters,workers" + + // ClusterHyperthreadingArbitersWorkers captures enum value "arbiters,workers" + ClusterHyperthreadingArbitersWorkers string = "arbiters,workers" + + // ClusterHyperthreadingMastersArbitersWorkers captures enum value "masters,arbiters,workers" + ClusterHyperthreadingMastersArbitersWorkers string = "masters,arbiters,workers" + // ClusterHyperthreadingAll captures enum value "all" ClusterHyperthreadingAll string = "all" - - // ClusterHyperthreadingNone captures enum value "none" - ClusterHyperthreadingNone string = "none" ) // prop value enum @@ -892,7 +918,7 @@ var clusterTypeKindPropEnum []interface{} func init() { var res []string - if err := json.Unmarshal([]byte(`["Cluster","AddHostsCluster"]`), &res); err != nil { + if err := json.Unmarshal([]byte(`["Cluster","AddHostsCluster","DisconnectedCluster"]`), &res); err != nil { panic(err) } for _, v := range res { @@ -907,6 +933,9 @@ const ( // ClusterKindAddHostsCluster captures enum value "AddHostsCluster" ClusterKindAddHostsCluster string = "AddHostsCluster" + + // ClusterKindDisconnectedCluster captures enum value "DisconnectedCluster" + ClusterKindDisconnectedCluster string = "DisconnectedCluster" ) // prop value enum @@ -948,6 +977,25 @@ func (m *Cluster) validateLastInstallationPreparation(formats strfmt.Registry) e return nil } +func (m *Cluster) validateLoadBalancer(formats strfmt.Registry) error { + if swag.IsZero(m.LoadBalancer) { // not required + return nil + } + + if m.LoadBalancer != nil { + if err := m.LoadBalancer.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("load_balancer") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("load_balancer") + } + return err + } + } + + return nil +} + func (m *Cluster) validateLogsInfo(formats strfmt.Registry) error { if swag.IsZero(m.LogsInfo) { // not required return nil @@ -1163,7 +1211,7 @@ var clusterTypeStatusPropEnum []interface{} func init() { var res []string - if err := json.Unmarshal([]byte(`["insufficient","ready","error","preparing-for-installation","pending-for-input","installing","finalizing","installed","adding-hosts","cancelled","installing-pending-user-action"]`), &res); err != nil { + if err := json.Unmarshal([]byte(`["insufficient","ready","error","preparing-for-installation","pending-for-input","installing","finalizing","installed","adding-hosts","cancelled","installing-pending-user-action","unmonitored"]`), &res); err != nil { panic(err) } for _, v := range res { @@ -1205,6 +1253,9 @@ const ( // ClusterStatusInstallingPendingUserAction captures enum value "installing-pending-user-action" ClusterStatusInstallingPendingUserAction string = "installing-pending-user-action" + + // ClusterStatusUnmonitored captures enum value "unmonitored" + ClusterStatusUnmonitored string = "unmonitored" ) // prop value enum @@ -1302,6 +1353,10 @@ func (m *Cluster) ContextValidate(ctx context.Context, formats strfmt.Registry) res = append(res, err) } + if err := m.contextValidateLoadBalancer(ctx, formats); err != nil { + res = append(res, err) + } + if err := m.contextValidateLogsInfo(ctx, formats); err != nil { res = append(res, err) } @@ -1494,6 +1549,22 @@ func (m *Cluster) contextValidateLastInstallationPreparation(ctx context.Context return nil } +func (m *Cluster) contextValidateLoadBalancer(ctx context.Context, formats strfmt.Registry) error { + + if m.LoadBalancer != nil { + if err := m.LoadBalancer.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("load_balancer") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("load_balancer") + } + return err + } + } + + return nil +} + func (m *Cluster) contextValidateLogsInfo(ctx context.Context, formats strfmt.Registry) error { if err := m.LogsInfo.ContextValidate(ctx, formats); err != nil { diff --git a/vendor/github.com/openshift/assisted-service/models/cluster_create_params.go b/vendor/github.com/openshift/assisted-service/models/cluster_create_params.go index 3eeade9fc..c9d97b83b 100644 --- a/vendor/github.com/openshift/assisted-service/models/cluster_create_params.go +++ b/vendor/github.com/openshift/assisted-service/models/cluster_create_params.go @@ -42,6 +42,9 @@ type ClusterCreateParams struct { // Cluster networks that are associated with this cluster. ClusterNetworks []*ClusterNetwork `json:"cluster_networks"` + // Specifies the required number of control plane nodes that should be part of the cluster. + ControlPlaneCount *int64 `json:"control_plane_count,omitempty"` + // The CPU architecture of the image (x86_64/arm64/etc). // Enum: [x86_64 aarch64 arm64 ppc64le s390x multi] CPUArchitecture string `json:"cpu_architecture,omitempty"` @@ -49,7 +52,7 @@ type ClusterCreateParams struct { // Installation disks encryption mode and host roles to be applied. DiskEncryption *DiskEncryption `json:"disk_encryption,omitempty" gorm:"embedded;embeddedPrefix:disk_encryption_"` - // Guaranteed availability of the installed cluster. 'Full' installs a Highly-Available cluster + // (DEPRECATED) Please use 'control_plane_count' instead. Guaranteed availability of the installed cluster. 'Full' installs a Highly-Available cluster // over multiple master nodes whereas 'None' installs a full cluster over one node. // // Enum: [Full None] @@ -65,8 +68,8 @@ type ClusterCreateParams struct { // HTTPSProxy *string `json:"https_proxy,omitempty"` - // Enable/disable hyperthreading on master nodes, worker nodes, or all nodes. - // Enum: [masters workers none all] + // Enable/disable hyperthreading on master nodes, arbiter nodes, worker nodes, or a combination of them. + // Enum: [none masters arbiters workers masters,arbiters masters,workers arbiters,workers masters,arbiters,workers all] Hyperthreading *string `json:"hyperthreading,omitempty"` // Explicit ignition endpoint overrides the default ignition endpoint. @@ -75,6 +78,9 @@ type ClusterCreateParams struct { // The virtual IPs used for cluster ingress traffic. Enter one IP address for single-stack clusters, or up to two for dual-stack clusters (at most one IP address per IP stack used). The order of stacks should be the same as order of subnets in Cluster Networks, Service Networks, and Machine Networks. IngressVips []*IngressVip `json:"ingress_vips"` + // load balancer + LoadBalancer *LoadBalancer `json:"load_balancer,omitempty" gorm:"embedded;embeddedPrefix:load_balancer_"` + // Machine networks that are associated with this cluster. MachineNetworks []*MachineNetwork `json:"machine_networks"` @@ -95,6 +101,8 @@ type ClusterCreateParams struct { OcpReleaseImage string `json:"ocp_release_image,omitempty"` // List of OLM operators to be installed. + // For the full list of supported operators, check the endpoint `/v2/supported-operators`: + // OlmOperators []*OperatorCreateParams `json:"olm_operators"` // Version of the OpenShift cluster. @@ -175,6 +183,10 @@ func (m *ClusterCreateParams) Validate(formats strfmt.Registry) error { res = append(res, err) } + if err := m.validateLoadBalancer(formats); err != nil { + res = append(res, err) + } + if err := m.validateMachineNetworks(formats); err != nil { res = append(res, err) } @@ -416,7 +428,7 @@ var clusterCreateParamsTypeHyperthreadingPropEnum []interface{} func init() { var res []string - if err := json.Unmarshal([]byte(`["masters","workers","none","all"]`), &res); err != nil { + if err := json.Unmarshal([]byte(`["none","masters","arbiters","workers","masters,arbiters","masters,workers","arbiters,workers","masters,arbiters,workers","all"]`), &res); err != nil { panic(err) } for _, v := range res { @@ -426,14 +438,29 @@ func init() { const ( + // ClusterCreateParamsHyperthreadingNone captures enum value "none" + ClusterCreateParamsHyperthreadingNone string = "none" + // ClusterCreateParamsHyperthreadingMasters captures enum value "masters" ClusterCreateParamsHyperthreadingMasters string = "masters" + // ClusterCreateParamsHyperthreadingArbiters captures enum value "arbiters" + ClusterCreateParamsHyperthreadingArbiters string = "arbiters" + // ClusterCreateParamsHyperthreadingWorkers captures enum value "workers" ClusterCreateParamsHyperthreadingWorkers string = "workers" - // ClusterCreateParamsHyperthreadingNone captures enum value "none" - ClusterCreateParamsHyperthreadingNone string = "none" + // ClusterCreateParamsHyperthreadingMastersArbiters captures enum value "masters,arbiters" + ClusterCreateParamsHyperthreadingMastersArbiters string = "masters,arbiters" + + // ClusterCreateParamsHyperthreadingMastersWorkers captures enum value "masters,workers" + ClusterCreateParamsHyperthreadingMastersWorkers string = "masters,workers" + + // ClusterCreateParamsHyperthreadingArbitersWorkers captures enum value "arbiters,workers" + ClusterCreateParamsHyperthreadingArbitersWorkers string = "arbiters,workers" + + // ClusterCreateParamsHyperthreadingMastersArbitersWorkers captures enum value "masters,arbiters,workers" + ClusterCreateParamsHyperthreadingMastersArbitersWorkers string = "masters,arbiters,workers" // ClusterCreateParamsHyperthreadingAll captures enum value "all" ClusterCreateParamsHyperthreadingAll string = "all" @@ -505,6 +532,25 @@ func (m *ClusterCreateParams) validateIngressVips(formats strfmt.Registry) error return nil } +func (m *ClusterCreateParams) validateLoadBalancer(formats strfmt.Registry) error { + if swag.IsZero(m.LoadBalancer) { // not required + return nil + } + + if m.LoadBalancer != nil { + if err := m.LoadBalancer.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("load_balancer") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("load_balancer") + } + return err + } + } + + return nil +} + func (m *ClusterCreateParams) validateMachineNetworks(formats strfmt.Registry) error { if swag.IsZero(m.MachineNetworks) { // not required return nil @@ -715,6 +761,10 @@ func (m *ClusterCreateParams) ContextValidate(ctx context.Context, formats strfm res = append(res, err) } + if err := m.contextValidateLoadBalancer(ctx, formats); err != nil { + res = append(res, err) + } + if err := m.contextValidateMachineNetworks(ctx, formats); err != nil { res = append(res, err) } @@ -829,6 +879,22 @@ func (m *ClusterCreateParams) contextValidateIngressVips(ctx context.Context, fo return nil } +func (m *ClusterCreateParams) contextValidateLoadBalancer(ctx context.Context, formats strfmt.Registry) error { + + if m.LoadBalancer != nil { + if err := m.LoadBalancer.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("load_balancer") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("load_balancer") + } + return err + } + } + + return nil +} + func (m *ClusterCreateParams) contextValidateMachineNetworks(ctx context.Context, formats strfmt.Registry) error { for i := 0; i < len(m.MachineNetworks); i++ { diff --git a/vendor/github.com/openshift/assisted-service/models/cluster_validation_id.go b/vendor/github.com/openshift/assisted-service/models/cluster_validation_id.go index d489c32df..0b8d4daef 100644 --- a/vendor/github.com/openshift/assisted-service/models/cluster_validation_id.go +++ b/vendor/github.com/openshift/assisted-service/models/cluster_validation_id.go @@ -96,11 +96,77 @@ const ( // ClusterValidationIDMceRequirementsSatisfied captures enum value "mce-requirements-satisfied" ClusterValidationIDMceRequirementsSatisfied ClusterValidationID = "mce-requirements-satisfied" + // ClusterValidationIDMtvRequirementsSatisfied captures enum value "mtv-requirements-satisfied" + ClusterValidationIDMtvRequirementsSatisfied ClusterValidationID = "mtv-requirements-satisfied" + + // ClusterValidationIDOscRequirementsSatisfied captures enum value "osc-requirements-satisfied" + ClusterValidationIDOscRequirementsSatisfied ClusterValidationID = "osc-requirements-satisfied" + // ClusterValidationIDNetworkTypeValid captures enum value "network-type-valid" ClusterValidationIDNetworkTypeValid ClusterValidationID = "network-type-valid" // ClusterValidationIDPlatformRequirementsSatisfied captures enum value "platform-requirements-satisfied" ClusterValidationIDPlatformRequirementsSatisfied ClusterValidationID = "platform-requirements-satisfied" + + // ClusterValidationIDNodeFeatureDiscoveryRequirementsSatisfied captures enum value "node-feature-discovery-requirements-satisfied" + ClusterValidationIDNodeFeatureDiscoveryRequirementsSatisfied ClusterValidationID = "node-feature-discovery-requirements-satisfied" + + // ClusterValidationIDNvidiaGpuRequirementsSatisfied captures enum value "nvidia-gpu-requirements-satisfied" + ClusterValidationIDNvidiaGpuRequirementsSatisfied ClusterValidationID = "nvidia-gpu-requirements-satisfied" + + // ClusterValidationIDPipelinesRequirementsSatisfied captures enum value "pipelines-requirements-satisfied" + ClusterValidationIDPipelinesRequirementsSatisfied ClusterValidationID = "pipelines-requirements-satisfied" + + // ClusterValidationIDServicemeshRequirementsSatisfied captures enum value "servicemesh-requirements-satisfied" + ClusterValidationIDServicemeshRequirementsSatisfied ClusterValidationID = "servicemesh-requirements-satisfied" + + // ClusterValidationIDServerlessRequirementsSatisfied captures enum value "serverless-requirements-satisfied" + ClusterValidationIDServerlessRequirementsSatisfied ClusterValidationID = "serverless-requirements-satisfied" + + // ClusterValidationIDOpenshiftAiRequirementsSatisfied captures enum value "openshift-ai-requirements-satisfied" + ClusterValidationIDOpenshiftAiRequirementsSatisfied ClusterValidationID = "openshift-ai-requirements-satisfied" + + // ClusterValidationIDOpenshiftAiGpuRequirementsSatisfied captures enum value "openshift-ai-gpu-requirements-satisfied" + ClusterValidationIDOpenshiftAiGpuRequirementsSatisfied ClusterValidationID = "openshift-ai-gpu-requirements-satisfied" + + // ClusterValidationIDAuthorinoRequirementsSatisfied captures enum value "authorino-requirements-satisfied" + ClusterValidationIDAuthorinoRequirementsSatisfied ClusterValidationID = "authorino-requirements-satisfied" + + // ClusterValidationIDNmstateRequirementsSatisfied captures enum value "nmstate-requirements-satisfied" + ClusterValidationIDNmstateRequirementsSatisfied ClusterValidationID = "nmstate-requirements-satisfied" + + // ClusterValidationIDAmdGpuRequirementsSatisfied captures enum value "amd-gpu-requirements-satisfied" + ClusterValidationIDAmdGpuRequirementsSatisfied ClusterValidationID = "amd-gpu-requirements-satisfied" + + // ClusterValidationIDKmmRequirementsSatisfied captures enum value "kmm-requirements-satisfied" + ClusterValidationIDKmmRequirementsSatisfied ClusterValidationID = "kmm-requirements-satisfied" + + // ClusterValidationIDNodeHealthcheckRequirementsSatisfied captures enum value "node-healthcheck-requirements-satisfied" + ClusterValidationIDNodeHealthcheckRequirementsSatisfied ClusterValidationID = "node-healthcheck-requirements-satisfied" + + // ClusterValidationIDSelfNodeRemediationRequirementsSatisfied captures enum value "self-node-remediation-requirements-satisfied" + ClusterValidationIDSelfNodeRemediationRequirementsSatisfied ClusterValidationID = "self-node-remediation-requirements-satisfied" + + // ClusterValidationIDFenceAgentsRemediationRequirementsSatisfied captures enum value "fence-agents-remediation-requirements-satisfied" + ClusterValidationIDFenceAgentsRemediationRequirementsSatisfied ClusterValidationID = "fence-agents-remediation-requirements-satisfied" + + // ClusterValidationIDNodeMaintenanceRequirementsSatisfied captures enum value "node-maintenance-requirements-satisfied" + ClusterValidationIDNodeMaintenanceRequirementsSatisfied ClusterValidationID = "node-maintenance-requirements-satisfied" + + // ClusterValidationIDKubeDeschedulerRequirementsSatisfied captures enum value "kube-descheduler-requirements-satisfied" + ClusterValidationIDKubeDeschedulerRequirementsSatisfied ClusterValidationID = "kube-descheduler-requirements-satisfied" + + // ClusterValidationIDClusterObservabilityRequirementsSatisfied captures enum value "cluster-observability-requirements-satisfied" + ClusterValidationIDClusterObservabilityRequirementsSatisfied ClusterValidationID = "cluster-observability-requirements-satisfied" + + // ClusterValidationIDNumaResourcesRequirementsSatisfied captures enum value "numa-resources-requirements-satisfied" + ClusterValidationIDNumaResourcesRequirementsSatisfied ClusterValidationID = "numa-resources-requirements-satisfied" + + // ClusterValidationIDOadpRequirementsSatisfied captures enum value "oadp-requirements-satisfied" + ClusterValidationIDOadpRequirementsSatisfied ClusterValidationID = "oadp-requirements-satisfied" + + // ClusterValidationIDMetallbRequirementsSatisfied captures enum value "metallb-requirements-satisfied" + ClusterValidationIDMetallbRequirementsSatisfied ClusterValidationID = "metallb-requirements-satisfied" ) // for schema @@ -108,7 +174,7 @@ var clusterValidationIdEnum []interface{} func init() { var res []ClusterValidationID - if err := json.Unmarshal([]byte(`["machine-cidr-defined","cluster-cidr-defined","service-cidr-defined","no-cidrs-overlapping","networks-same-address-families","network-prefix-valid","machine-cidr-equals-to-calculated-cidr","api-vips-defined","api-vips-valid","ingress-vips-defined","ingress-vips-valid","all-hosts-are-ready-to-install","sufficient-masters-count","dns-domain-defined","pull-secret-set","ntp-server-configured","lso-requirements-satisfied","ocs-requirements-satisfied","odf-requirements-satisfied","cnv-requirements-satisfied","lvm-requirements-satisfied","mce-requirements-satisfied","network-type-valid","platform-requirements-satisfied"]`), &res); err != nil { + if err := json.Unmarshal([]byte(`["machine-cidr-defined","cluster-cidr-defined","service-cidr-defined","no-cidrs-overlapping","networks-same-address-families","network-prefix-valid","machine-cidr-equals-to-calculated-cidr","api-vips-defined","api-vips-valid","ingress-vips-defined","ingress-vips-valid","all-hosts-are-ready-to-install","sufficient-masters-count","dns-domain-defined","pull-secret-set","ntp-server-configured","lso-requirements-satisfied","ocs-requirements-satisfied","odf-requirements-satisfied","cnv-requirements-satisfied","lvm-requirements-satisfied","mce-requirements-satisfied","mtv-requirements-satisfied","osc-requirements-satisfied","network-type-valid","platform-requirements-satisfied","node-feature-discovery-requirements-satisfied","nvidia-gpu-requirements-satisfied","pipelines-requirements-satisfied","servicemesh-requirements-satisfied","serverless-requirements-satisfied","openshift-ai-requirements-satisfied","openshift-ai-gpu-requirements-satisfied","authorino-requirements-satisfied","nmstate-requirements-satisfied","amd-gpu-requirements-satisfied","kmm-requirements-satisfied","node-healthcheck-requirements-satisfied","self-node-remediation-requirements-satisfied","fence-agents-remediation-requirements-satisfied","node-maintenance-requirements-satisfied","kube-descheduler-requirements-satisfied","cluster-observability-requirements-satisfied","numa-resources-requirements-satisfied","oadp-requirements-satisfied","metallb-requirements-satisfied"]`), &res); err != nil { panic(err) } for _, v := range res { diff --git a/vendor/github.com/openshift/assisted-service/models/connectivity_remote_host.go b/vendor/github.com/openshift/assisted-service/models/connectivity_remote_host.go index c2c37752f..6280943b9 100644 --- a/vendor/github.com/openshift/assisted-service/models/connectivity_remote_host.go +++ b/vendor/github.com/openshift/assisted-service/models/connectivity_remote_host.go @@ -29,6 +29,9 @@ type ConnectivityRemoteHost struct { // l3 connectivity L3Connectivity []*L3Connectivity `json:"l3_connectivity"` + + // mtu report + MtuReport []*MtuReport `json:"mtu_report"` } // Validate validates this connectivity remote host @@ -47,6 +50,10 @@ func (m *ConnectivityRemoteHost) Validate(formats strfmt.Registry) error { res = append(res, err) } + if err := m.validateMtuReport(formats); err != nil { + res = append(res, err) + } + if len(res) > 0 { return errors.CompositeValidationError(res...) } @@ -117,6 +124,32 @@ func (m *ConnectivityRemoteHost) validateL3Connectivity(formats strfmt.Registry) return nil } +func (m *ConnectivityRemoteHost) validateMtuReport(formats strfmt.Registry) error { + if swag.IsZero(m.MtuReport) { // not required + return nil + } + + for i := 0; i < len(m.MtuReport); i++ { + if swag.IsZero(m.MtuReport[i]) { // not required + continue + } + + if m.MtuReport[i] != nil { + if err := m.MtuReport[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("mtu_report" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("mtu_report" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + // ContextValidate validate this connectivity remote host based on the context it is used func (m *ConnectivityRemoteHost) ContextValidate(ctx context.Context, formats strfmt.Registry) error { var res []error @@ -129,6 +162,10 @@ func (m *ConnectivityRemoteHost) ContextValidate(ctx context.Context, formats st res = append(res, err) } + if err := m.contextValidateMtuReport(ctx, formats); err != nil { + res = append(res, err) + } + if len(res) > 0 { return errors.CompositeValidationError(res...) } @@ -175,6 +212,26 @@ func (m *ConnectivityRemoteHost) contextValidateL3Connectivity(ctx context.Conte return nil } +func (m *ConnectivityRemoteHost) contextValidateMtuReport(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.MtuReport); i++ { + + if m.MtuReport[i] != nil { + if err := m.MtuReport[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("mtu_report" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("mtu_report" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + // MarshalBinary interface implementation func (m *ConnectivityRemoteHost) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/vendor/github.com/openshift/assisted-service/models/create_manifest_params.go b/vendor/github.com/openshift/assisted-service/models/create_manifest_params.go index 6bd6bd2bd..edbaa3ab7 100644 --- a/vendor/github.com/openshift/assisted-service/models/create_manifest_params.go +++ b/vendor/github.com/openshift/assisted-service/models/create_manifest_params.go @@ -26,7 +26,7 @@ type CreateManifestParams struct { // The name of the manifest to customize the installed OCP cluster. // Required: true - // Pattern: ^[^/]*\.(yaml|yml|json|yaml.patch.*|yml.patch.*)$ + // Pattern: ^[^\/]*\.(json|ya?ml(\.patch_?[a-zA-Z0-9_]*)?)$ FileName *string `json:"file_name"` // The folder that contains the files. Manifests can be placed in 'manifests' or 'openshift' directories. @@ -71,7 +71,7 @@ func (m *CreateManifestParams) validateFileName(formats strfmt.Registry) error { return err } - if err := validate.Pattern("file_name", "body", *m.FileName, `^[^/]*\.(yaml|yml|json|yaml.patch.*|yml.patch.*)$`); err != nil { + if err := validate.Pattern("file_name", "body", *m.FileName, `^[^\/]*\.(json|ya?ml(\.patch_?[a-zA-Z0-9_]*)?)$`); err != nil { return err } diff --git a/vendor/github.com/openshift/assisted-service/models/custom.go b/vendor/github.com/openshift/assisted-service/models/custom.go index a1ad42b71..3c28dc11b 100644 --- a/vendor/github.com/openshift/assisted-service/models/custom.go +++ b/vendor/github.com/openshift/assisted-service/models/custom.go @@ -9,7 +9,7 @@ import ( "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" "github.com/go-openapi/validate" - "github.com/openshift/assisted-service/pkg/validations" + modelvalidations "github.com/openshift/assisted-service/models/validations" ) // DomainResolutionRequestDomain is a struct to hold the domain resolution request domain @@ -32,12 +32,12 @@ func (m *DomainResolutionRequestDomain) Validate(formats strfmt.Registry) error // validateDomainName ensures that the required DomainName field exists and that the // DomainName is valid -func (m *DomainResolutionRequestDomain) validateDomainName(formats strfmt.Registry) error { +func (m *DomainResolutionRequestDomain) validateDomainName(_ strfmt.Registry) error { if err := validate.Required("domain_name", "body", m.DomainName); err != nil { return err } - if _, err := validations.ValidateDomainNameFormat(*m.DomainName); err != nil { + if _, err := modelvalidations.ValidateDomainNameFormat(*m.DomainName); err != nil { return err } diff --git a/vendor/github.com/openshift/assisted-service/models/disconnected_cluster_create_params.go b/vendor/github.com/openshift/assisted-service/models/disconnected_cluster_create_params.go new file mode 100644 index 000000000..9ff6aab6c --- /dev/null +++ b/vendor/github.com/openshift/assisted-service/models/disconnected_cluster_create_params.go @@ -0,0 +1,98 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// DisconnectedClusterCreateParams disconnected cluster create params +// +// swagger:model disconnected-cluster-create-params +type DisconnectedClusterCreateParams struct { + + // Name of the OpenShift cluster. + // Required: true + // Max Length: 54 + // Min Length: 1 + Name *string `json:"name"` + + // Version of the OpenShift cluster. + // Required: true + OpenshiftVersion *string `json:"openshift_version"` +} + +// Validate validates this disconnected cluster create params +func (m *DisconnectedClusterCreateParams) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateName(formats); err != nil { + res = append(res, err) + } + + if err := m.validateOpenshiftVersion(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *DisconnectedClusterCreateParams) validateName(formats strfmt.Registry) error { + + if err := validate.Required("name", "body", m.Name); err != nil { + return err + } + + if err := validate.MinLength("name", "body", *m.Name, 1); err != nil { + return err + } + + if err := validate.MaxLength("name", "body", *m.Name, 54); err != nil { + return err + } + + return nil +} + +func (m *DisconnectedClusterCreateParams) validateOpenshiftVersion(formats strfmt.Registry) error { + + if err := validate.Required("openshift_version", "body", m.OpenshiftVersion); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this disconnected cluster create params based on context it is used +func (m *DisconnectedClusterCreateParams) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *DisconnectedClusterCreateParams) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *DisconnectedClusterCreateParams) UnmarshalBinary(b []byte) error { + var res DisconnectedClusterCreateParams + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/vendor/github.com/openshift/assisted-service/models/disk.go b/vendor/github.com/openshift/assisted-service/models/disk.go index 631c97a15..7574de9e7 100644 --- a/vendor/github.com/openshift/assisted-service/models/disk.go +++ b/vendor/github.com/openshift/assisted-service/models/disk.go @@ -51,12 +51,18 @@ type Disk struct { // Whether the disk appears to be an installation media or not IsInstallationMedia bool `json:"is_installation_media,omitempty"` + // iscsi + Iscsi *Iscsi `json:"iscsi,omitempty"` + // model Model string `json:"model,omitempty"` // name Name string `json:"name,omitempty"` + // partition types + PartitionTypes string `json:"partitionTypes,omitempty"` + // path Path string `json:"path,omitempty"` @@ -95,6 +101,10 @@ func (m *Disk) Validate(formats strfmt.Registry) error { res = append(res, err) } + if err := m.validateIscsi(formats); err != nil { + res = append(res, err) + } + if len(res) > 0 { return errors.CompositeValidationError(res...) } @@ -154,6 +164,25 @@ func (m *Disk) validateIoPerf(formats strfmt.Registry) error { return nil } +func (m *Disk) validateIscsi(formats strfmt.Registry) error { + if swag.IsZero(m.Iscsi) { // not required + return nil + } + + if m.Iscsi != nil { + if err := m.Iscsi.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("iscsi") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("iscsi") + } + return err + } + } + + return nil +} + // ContextValidate validate this disk based on the context it is used func (m *Disk) ContextValidate(ctx context.Context, formats strfmt.Registry) error { var res []error @@ -170,6 +199,10 @@ func (m *Disk) ContextValidate(ctx context.Context, formats strfmt.Registry) err res = append(res, err) } + if err := m.contextValidateIscsi(ctx, formats); err != nil { + res = append(res, err) + } + if len(res) > 0 { return errors.CompositeValidationError(res...) } @@ -220,6 +253,22 @@ func (m *Disk) contextValidateIoPerf(ctx context.Context, formats strfmt.Registr return nil } +func (m *Disk) contextValidateIscsi(ctx context.Context, formats strfmt.Registry) error { + + if m.Iscsi != nil { + if err := m.Iscsi.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("iscsi") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("iscsi") + } + return err + } + } + + return nil +} + // MarshalBinary interface implementation func (m *Disk) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/vendor/github.com/openshift/assisted-service/models/disk_encryption.go b/vendor/github.com/openshift/assisted-service/models/disk_encryption.go index 7a276489f..cd80102d9 100644 --- a/vendor/github.com/openshift/assisted-service/models/disk_encryption.go +++ b/vendor/github.com/openshift/assisted-service/models/disk_encryption.go @@ -20,8 +20,8 @@ import ( // swagger:model disk-encryption type DiskEncryption struct { - // Enable/disable disk encryption on master nodes, worker nodes, or all nodes. - // Enum: [none all masters workers] + // Enable/disable disk encryption on master nodes, arbiter nodes, worker nodes, or a combination of them. + // Enum: [none masters arbiters workers masters,arbiters masters,workers arbiters,workers masters,arbiters,workers all] EnableOn *string `json:"enable_on,omitempty"` // The disk encryption mode to use. @@ -55,7 +55,7 @@ var diskEncryptionTypeEnableOnPropEnum []interface{} func init() { var res []string - if err := json.Unmarshal([]byte(`["none","all","masters","workers"]`), &res); err != nil { + if err := json.Unmarshal([]byte(`["none","masters","arbiters","workers","masters,arbiters","masters,workers","arbiters,workers","masters,arbiters,workers","all"]`), &res); err != nil { panic(err) } for _, v := range res { @@ -68,14 +68,29 @@ const ( // DiskEncryptionEnableOnNone captures enum value "none" DiskEncryptionEnableOnNone string = "none" - // DiskEncryptionEnableOnAll captures enum value "all" - DiskEncryptionEnableOnAll string = "all" - // DiskEncryptionEnableOnMasters captures enum value "masters" DiskEncryptionEnableOnMasters string = "masters" + // DiskEncryptionEnableOnArbiters captures enum value "arbiters" + DiskEncryptionEnableOnArbiters string = "arbiters" + // DiskEncryptionEnableOnWorkers captures enum value "workers" DiskEncryptionEnableOnWorkers string = "workers" + + // DiskEncryptionEnableOnMastersArbiters captures enum value "masters,arbiters" + DiskEncryptionEnableOnMastersArbiters string = "masters,arbiters" + + // DiskEncryptionEnableOnMastersWorkers captures enum value "masters,workers" + DiskEncryptionEnableOnMastersWorkers string = "masters,workers" + + // DiskEncryptionEnableOnArbitersWorkers captures enum value "arbiters,workers" + DiskEncryptionEnableOnArbitersWorkers string = "arbiters,workers" + + // DiskEncryptionEnableOnMastersArbitersWorkers captures enum value "masters,arbiters,workers" + DiskEncryptionEnableOnMastersArbitersWorkers string = "masters,arbiters,workers" + + // DiskEncryptionEnableOnAll captures enum value "all" + DiskEncryptionEnableOnAll string = "all" ) // prop value enum diff --git a/vendor/github.com/openshift/assisted-service/models/domain_resolution_response.go b/vendor/github.com/openshift/assisted-service/models/domain_resolution_response.go index 79a1027fa..4c8cb297a 100644 --- a/vendor/github.com/openshift/assisted-service/models/domain_resolution_response.go +++ b/vendor/github.com/openshift/assisted-service/models/domain_resolution_response.go @@ -123,6 +123,9 @@ func (m *DomainResolutionResponse) UnmarshalBinary(b []byte) error { // swagger:model DomainResolutionResponseDomain type DomainResolutionResponseDomain struct { + // The cnames that were resolved for the domain, empty if none + Cnames []string `json:"cnames"` + // The domain that was resolved // Required: true DomainName *string `json:"domain_name"` diff --git a/vendor/github.com/openshift/assisted-service/models/feature.go b/vendor/github.com/openshift/assisted-service/models/feature.go new file mode 100644 index 000000000..f2bd8c204 --- /dev/null +++ b/vendor/github.com/openshift/assisted-service/models/feature.go @@ -0,0 +1,242 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// Feature feature +// +// swagger:model feature +type Feature struct { + + // feature support level id + // Required: true + FeatureSupportLevelID FeatureSupportLevelID `json:"feature-support-level-id"` + + // incompatibilities + // Required: true + Incompatibilities []FeatureSupportLevelID `json:"incompatibilities"` + + // reason + Reason IncompatibilityReason `json:"reason,omitempty"` + + // support level + // Required: true + SupportLevel SupportLevel `json:"support_level"` +} + +// Validate validates this feature +func (m *Feature) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateFeatureSupportLevelID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateIncompatibilities(formats); err != nil { + res = append(res, err) + } + + if err := m.validateReason(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSupportLevel(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *Feature) validateFeatureSupportLevelID(formats strfmt.Registry) error { + + if err := validate.Required("feature-support-level-id", "body", FeatureSupportLevelID(m.FeatureSupportLevelID)); err != nil { + return err + } + + if err := m.FeatureSupportLevelID.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("feature-support-level-id") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("feature-support-level-id") + } + return err + } + + return nil +} + +func (m *Feature) validateIncompatibilities(formats strfmt.Registry) error { + + if err := validate.Required("incompatibilities", "body", m.Incompatibilities); err != nil { + return err + } + + for i := 0; i < len(m.Incompatibilities); i++ { + + if err := m.Incompatibilities[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("incompatibilities" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("incompatibilities" + "." + strconv.Itoa(i)) + } + return err + } + + } + + return nil +} + +func (m *Feature) validateReason(formats strfmt.Registry) error { + if swag.IsZero(m.Reason) { // not required + return nil + } + + if err := m.Reason.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("reason") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("reason") + } + return err + } + + return nil +} + +func (m *Feature) validateSupportLevel(formats strfmt.Registry) error { + + if err := validate.Required("support_level", "body", SupportLevel(m.SupportLevel)); err != nil { + return err + } + + if err := m.SupportLevel.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("support_level") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("support_level") + } + return err + } + + return nil +} + +// ContextValidate validate this feature based on the context it is used +func (m *Feature) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateFeatureSupportLevelID(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateIncompatibilities(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateReason(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateSupportLevel(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *Feature) contextValidateFeatureSupportLevelID(ctx context.Context, formats strfmt.Registry) error { + + if err := m.FeatureSupportLevelID.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("feature-support-level-id") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("feature-support-level-id") + } + return err + } + + return nil +} + +func (m *Feature) contextValidateIncompatibilities(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Incompatibilities); i++ { + + if err := m.Incompatibilities[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("incompatibilities" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("incompatibilities" + "." + strconv.Itoa(i)) + } + return err + } + + } + + return nil +} + +func (m *Feature) contextValidateReason(ctx context.Context, formats strfmt.Registry) error { + + if err := m.Reason.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("reason") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("reason") + } + return err + } + + return nil +} + +func (m *Feature) contextValidateSupportLevel(ctx context.Context, formats strfmt.Registry) error { + + if err := m.SupportLevel.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("support_level") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("support_level") + } + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *Feature) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *Feature) UnmarshalBinary(b []byte) error { + var res Feature + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/vendor/github.com/openshift/assisted-service/models/feature_support_level_id.go b/vendor/github.com/openshift/assisted-service/models/feature_support_level_id.go index c5909e0af..ebe77231f 100644 --- a/vendor/github.com/openshift/assisted-service/models/feature_support_level_id.go +++ b/vendor/github.com/openshift/assisted-service/models/feature_support_level_id.go @@ -33,6 +33,9 @@ const ( // FeatureSupportLevelIDSNO captures enum value "SNO" FeatureSupportLevelIDSNO FeatureSupportLevelID = "SNO" + // FeatureSupportLevelIDTNA captures enum value "TNA" + FeatureSupportLevelIDTNA FeatureSupportLevelID = "TNA" + // FeatureSupportLevelIDVIPAUTOALLOC captures enum value "VIP_AUTO_ALLOC" FeatureSupportLevelIDVIPAUTOALLOC FeatureSupportLevelID = "VIP_AUTO_ALLOC" @@ -57,6 +60,12 @@ const ( // FeatureSupportLevelIDMCE captures enum value "MCE" FeatureSupportLevelIDMCE FeatureSupportLevelID = "MCE" + // FeatureSupportLevelIDMTV captures enum value "MTV" + FeatureSupportLevelIDMTV FeatureSupportLevelID = "MTV" + + // FeatureSupportLevelIDOSC captures enum value "OSC" + FeatureSupportLevelIDOSC FeatureSupportLevelID = "OSC" + // FeatureSupportLevelIDNUTANIXINTEGRATION captures enum value "NUTANIX_INTEGRATION" FeatureSupportLevelIDNUTANIXINTEGRATION FeatureSupportLevelID = "NUTANIX_INTEGRATION" @@ -93,9 +102,6 @@ const ( // FeatureSupportLevelIDPLATFORMMANAGEDNETWORKING captures enum value "PLATFORM_MANAGED_NETWORKING" FeatureSupportLevelIDPLATFORMMANAGEDNETWORKING FeatureSupportLevelID = "PLATFORM_MANAGED_NETWORKING" - // FeatureSupportLevelIDSKIPMCOREBOOT captures enum value "SKIP_MCO_REBOOT" - FeatureSupportLevelIDSKIPMCOREBOOT FeatureSupportLevelID = "SKIP_MCO_REBOOT" - // FeatureSupportLevelIDEXTERNALPLATFORM captures enum value "EXTERNAL_PLATFORM" FeatureSupportLevelIDEXTERNALPLATFORM FeatureSupportLevelID = "EXTERNAL_PLATFORM" @@ -104,6 +110,69 @@ const ( // FeatureSupportLevelIDSDNNETWORKTYPE captures enum value "SDN_NETWORK_TYPE" FeatureSupportLevelIDSDNNETWORKTYPE FeatureSupportLevelID = "SDN_NETWORK_TYPE" + + // FeatureSupportLevelIDNODEFEATUREDISCOVERY captures enum value "NODE_FEATURE_DISCOVERY" + FeatureSupportLevelIDNODEFEATUREDISCOVERY FeatureSupportLevelID = "NODE_FEATURE_DISCOVERY" + + // FeatureSupportLevelIDNVIDIAGPU captures enum value "NVIDIA_GPU" + FeatureSupportLevelIDNVIDIAGPU FeatureSupportLevelID = "NVIDIA_GPU" + + // FeatureSupportLevelIDPIPELINES captures enum value "PIPELINES" + FeatureSupportLevelIDPIPELINES FeatureSupportLevelID = "PIPELINES" + + // FeatureSupportLevelIDSERVICEMESH captures enum value "SERVICEMESH" + FeatureSupportLevelIDSERVICEMESH FeatureSupportLevelID = "SERVICEMESH" + + // FeatureSupportLevelIDSERVERLESS captures enum value "SERVERLESS" + FeatureSupportLevelIDSERVERLESS FeatureSupportLevelID = "SERVERLESS" + + // FeatureSupportLevelIDOPENSHIFTAI captures enum value "OPENSHIFT_AI" + FeatureSupportLevelIDOPENSHIFTAI FeatureSupportLevelID = "OPENSHIFT_AI" + + // FeatureSupportLevelIDNONSTANDARDHACONTROLPLANE captures enum value "NON_STANDARD_HA_CONTROL_PLANE" + FeatureSupportLevelIDNONSTANDARDHACONTROLPLANE FeatureSupportLevelID = "NON_STANDARD_HA_CONTROL_PLANE" + + // FeatureSupportLevelIDAUTHORINO captures enum value "AUTHORINO" + FeatureSupportLevelIDAUTHORINO FeatureSupportLevelID = "AUTHORINO" + + // FeatureSupportLevelIDUSERMANAGEDLOADBALANCER captures enum value "USER_MANAGED_LOAD_BALANCER" + FeatureSupportLevelIDUSERMANAGEDLOADBALANCER FeatureSupportLevelID = "USER_MANAGED_LOAD_BALANCER" + + // FeatureSupportLevelIDNMSTATE captures enum value "NMSTATE" + FeatureSupportLevelIDNMSTATE FeatureSupportLevelID = "NMSTATE" + + // FeatureSupportLevelIDAMDGPU captures enum value "AMD_GPU" + FeatureSupportLevelIDAMDGPU FeatureSupportLevelID = "AMD_GPU" + + // FeatureSupportLevelIDKMM captures enum value "KMM" + FeatureSupportLevelIDKMM FeatureSupportLevelID = "KMM" + + // FeatureSupportLevelIDNODEHEALTHCHECK captures enum value "NODE_HEALTHCHECK" + FeatureSupportLevelIDNODEHEALTHCHECK FeatureSupportLevelID = "NODE_HEALTHCHECK" + + // FeatureSupportLevelIDSELFNODEREMEDIATION captures enum value "SELF_NODE_REMEDIATION" + FeatureSupportLevelIDSELFNODEREMEDIATION FeatureSupportLevelID = "SELF_NODE_REMEDIATION" + + // FeatureSupportLevelIDFENCEAGENTSREMEDIATION captures enum value "FENCE_AGENTS_REMEDIATION" + FeatureSupportLevelIDFENCEAGENTSREMEDIATION FeatureSupportLevelID = "FENCE_AGENTS_REMEDIATION" + + // FeatureSupportLevelIDNODEMAINTENANCE captures enum value "NODE_MAINTENANCE" + FeatureSupportLevelIDNODEMAINTENANCE FeatureSupportLevelID = "NODE_MAINTENANCE" + + // FeatureSupportLevelIDKUBEDESCHEDULER captures enum value "KUBE_DESCHEDULER" + FeatureSupportLevelIDKUBEDESCHEDULER FeatureSupportLevelID = "KUBE_DESCHEDULER" + + // FeatureSupportLevelIDCLUSTEROBSERVABILITY captures enum value "CLUSTER_OBSERVABILITY" + FeatureSupportLevelIDCLUSTEROBSERVABILITY FeatureSupportLevelID = "CLUSTER_OBSERVABILITY" + + // FeatureSupportLevelIDNUMARESOURCES captures enum value "NUMA_RESOURCES" + FeatureSupportLevelIDNUMARESOURCES FeatureSupportLevelID = "NUMA_RESOURCES" + + // FeatureSupportLevelIDOADP captures enum value "OADP" + FeatureSupportLevelIDOADP FeatureSupportLevelID = "OADP" + + // FeatureSupportLevelIDMETALLB captures enum value "METALLB" + FeatureSupportLevelIDMETALLB FeatureSupportLevelID = "METALLB" ) // for schema @@ -111,7 +180,7 @@ var featureSupportLevelIdEnum []interface{} func init() { var res []FeatureSupportLevelID - if err := json.Unmarshal([]byte(`["SNO","VIP_AUTO_ALLOC","CUSTOM_MANIFEST","SINGLE_NODE_EXPANSION","LVM","ODF","LSO","CNV","MCE","NUTANIX_INTEGRATION","BAREMETAL_PLATFORM","NONE_PLATFORM","VSPHERE_INTEGRATION","DUAL_STACK_VIPS","CLUSTER_MANAGED_NETWORKING","USER_MANAGED_NETWORKING","MINIMAL_ISO","FULL_ISO","EXTERNAL_PLATFORM_OCI","DUAL_STACK","PLATFORM_MANAGED_NETWORKING","SKIP_MCO_REBOOT","EXTERNAL_PLATFORM","OVN_NETWORK_TYPE","SDN_NETWORK_TYPE"]`), &res); err != nil { + if err := json.Unmarshal([]byte(`["SNO","TNA","VIP_AUTO_ALLOC","CUSTOM_MANIFEST","SINGLE_NODE_EXPANSION","LVM","ODF","LSO","CNV","MCE","MTV","OSC","NUTANIX_INTEGRATION","BAREMETAL_PLATFORM","NONE_PLATFORM","VSPHERE_INTEGRATION","DUAL_STACK_VIPS","CLUSTER_MANAGED_NETWORKING","USER_MANAGED_NETWORKING","MINIMAL_ISO","FULL_ISO","EXTERNAL_PLATFORM_OCI","DUAL_STACK","PLATFORM_MANAGED_NETWORKING","EXTERNAL_PLATFORM","OVN_NETWORK_TYPE","SDN_NETWORK_TYPE","NODE_FEATURE_DISCOVERY","NVIDIA_GPU","PIPELINES","SERVICEMESH","SERVERLESS","OPENSHIFT_AI","NON_STANDARD_HA_CONTROL_PLANE","AUTHORINO","USER_MANAGED_LOAD_BALANCER","NMSTATE","AMD_GPU","KMM","NODE_HEALTHCHECK","SELF_NODE_REMEDIATION","FENCE_AGENTS_REMEDIATION","NODE_MAINTENANCE","KUBE_DESCHEDULER","CLUSTER_OBSERVABILITY","NUMA_RESOURCES","OADP","METALLB"]`), &res); err != nil { panic(err) } for _, v := range res { diff --git a/vendor/github.com/openshift/assisted-service/models/fencing_credentials_params.go b/vendor/github.com/openshift/assisted-service/models/fencing_credentials_params.go new file mode 100644 index 000000000..7e53c1b03 --- /dev/null +++ b/vendor/github.com/openshift/assisted-service/models/fencing_credentials_params.go @@ -0,0 +1,156 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "encoding/json" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// FencingCredentialsParams fencing credentials params +// +// swagger:model fencing-credentials-params +type FencingCredentialsParams struct { + + // The URL of the host's BMC, for example https://bmc1.example.com. + // Required: true + Address *string `json:"address"` + + // Whether to enable or disable certificate verification when connecting to the host's BMC. + // Enum: [Enabled Disabled] + CertificateVerification *string `json:"certificate_verification,omitempty"` + + // The password to connect to the host's BMC. + // Required: true + Password *string `json:"password"` + + // The username to connect to the host's BMC. + // Required: true + Username *string `json:"username"` +} + +// Validate validates this fencing credentials params +func (m *FencingCredentialsParams) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateAddress(formats); err != nil { + res = append(res, err) + } + + if err := m.validateCertificateVerification(formats); err != nil { + res = append(res, err) + } + + if err := m.validatePassword(formats); err != nil { + res = append(res, err) + } + + if err := m.validateUsername(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *FencingCredentialsParams) validateAddress(formats strfmt.Registry) error { + + if err := validate.Required("address", "body", m.Address); err != nil { + return err + } + + return nil +} + +var fencingCredentialsParamsTypeCertificateVerificationPropEnum []interface{} + +func init() { + var res []string + if err := json.Unmarshal([]byte(`["Enabled","Disabled"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + fencingCredentialsParamsTypeCertificateVerificationPropEnum = append(fencingCredentialsParamsTypeCertificateVerificationPropEnum, v) + } +} + +const ( + + // FencingCredentialsParamsCertificateVerificationEnabled captures enum value "Enabled" + FencingCredentialsParamsCertificateVerificationEnabled string = "Enabled" + + // FencingCredentialsParamsCertificateVerificationDisabled captures enum value "Disabled" + FencingCredentialsParamsCertificateVerificationDisabled string = "Disabled" +) + +// prop value enum +func (m *FencingCredentialsParams) validateCertificateVerificationEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, fencingCredentialsParamsTypeCertificateVerificationPropEnum, true); err != nil { + return err + } + return nil +} + +func (m *FencingCredentialsParams) validateCertificateVerification(formats strfmt.Registry) error { + if swag.IsZero(m.CertificateVerification) { // not required + return nil + } + + // value enum + if err := m.validateCertificateVerificationEnum("certificate_verification", "body", *m.CertificateVerification); err != nil { + return err + } + + return nil +} + +func (m *FencingCredentialsParams) validatePassword(formats strfmt.Registry) error { + + if err := validate.Required("password", "body", m.Password); err != nil { + return err + } + + return nil +} + +func (m *FencingCredentialsParams) validateUsername(formats strfmt.Registry) error { + + if err := validate.Required("username", "body", m.Username); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this fencing credentials params based on context it is used +func (m *FencingCredentialsParams) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *FencingCredentialsParams) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *FencingCredentialsParams) UnmarshalBinary(b []byte) error { + var res FencingCredentialsParams + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/vendor/github.com/openshift/assisted-service/models/finalizing_stage.go b/vendor/github.com/openshift/assisted-service/models/finalizing_stage.go index b475cc586..4feed2997 100644 --- a/vendor/github.com/openshift/assisted-service/models/finalizing_stage.go +++ b/vendor/github.com/openshift/assisted-service/models/finalizing_stage.go @@ -45,6 +45,9 @@ const ( // FinalizingStageWaitingForOlmOperatorsCsv captures enum value "Waiting for olm operators csv" FinalizingStageWaitingForOlmOperatorsCsv FinalizingStage = "Waiting for olm operators csv" + // FinalizingStageWaitingForOLMOperatorSetupJobs captures enum value "Waiting for OLM operator setup jobs" + FinalizingStageWaitingForOLMOperatorSetupJobs FinalizingStage = "Waiting for OLM operator setup jobs" + // FinalizingStageDone captures enum value "Done" FinalizingStageDone FinalizingStage = "Done" ) @@ -54,7 +57,7 @@ var finalizingStageEnum []interface{} func init() { var res []FinalizingStage - if err := json.Unmarshal([]byte(`["Waiting for cluster operators","Adding router ca","Applying olm manifests","Waiting for olm operators csv initialization","Waiting for olm operators csv","Done"]`), &res); err != nil { + if err := json.Unmarshal([]byte(`["Waiting for cluster operators","Adding router ca","Applying olm manifests","Waiting for olm operators csv initialization","Waiting for olm operators csv","Waiting for OLM operator setup jobs","Done"]`), &res); err != nil { panic(err) } for _, v := range res { diff --git a/vendor/github.com/openshift/assisted-service/models/host.go b/vendor/github.com/openshift/assisted-service/models/host.go index e304fdea5..1bac98c54 100644 --- a/vendor/github.com/openshift/assisted-service/models/host.go +++ b/vendor/github.com/openshift/assisted-service/models/host.go @@ -66,6 +66,9 @@ type Host struct { // The domain name resolution result. DomainNameResolutions string `json:"domain_name_resolutions,omitempty" gorm:"type:text"` + // The host's BMC credentials that will be used in TNF. + FencingCredentials string `json:"fencing_credentials,omitempty" gorm:"type:text"` + // free addresses FreeAddresses string `json:"free_addresses,omitempty" gorm:"type:text"` diff --git a/vendor/github.com/openshift/assisted-service/models/host_role.go b/vendor/github.com/openshift/assisted-service/models/host_role.go index fad00d87b..1e434ceae 100644 --- a/vendor/github.com/openshift/assisted-service/models/host_role.go +++ b/vendor/github.com/openshift/assisted-service/models/host_role.go @@ -36,6 +36,9 @@ const ( // HostRoleMaster captures enum value "master" HostRoleMaster HostRole = "master" + // HostRoleArbiter captures enum value "arbiter" + HostRoleArbiter HostRole = "arbiter" + // HostRoleWorker captures enum value "worker" HostRoleWorker HostRole = "worker" @@ -48,7 +51,7 @@ var hostRoleEnum []interface{} func init() { var res []HostRole - if err := json.Unmarshal([]byte(`["auto-assign","master","worker","bootstrap"]`), &res); err != nil { + if err := json.Unmarshal([]byte(`["auto-assign","master","arbiter","worker","bootstrap"]`), &res); err != nil { panic(err) } for _, v := range res { diff --git a/vendor/github.com/openshift/assisted-service/models/host_role_update_params.go b/vendor/github.com/openshift/assisted-service/models/host_role_update_params.go index 5867eb481..7e39ee6ca 100644 --- a/vendor/github.com/openshift/assisted-service/models/host_role_update_params.go +++ b/vendor/github.com/openshift/assisted-service/models/host_role_update_params.go @@ -36,6 +36,9 @@ const ( // HostRoleUpdateParamsMaster captures enum value "master" HostRoleUpdateParamsMaster HostRoleUpdateParams = "master" + // HostRoleUpdateParamsArbiter captures enum value "arbiter" + HostRoleUpdateParamsArbiter HostRoleUpdateParams = "arbiter" + // HostRoleUpdateParamsWorker captures enum value "worker" HostRoleUpdateParamsWorker HostRoleUpdateParams = "worker" ) @@ -45,7 +48,7 @@ var hostRoleUpdateParamsEnum []interface{} func init() { var res []HostRoleUpdateParams - if err := json.Unmarshal([]byte(`["auto-assign","master","worker"]`), &res); err != nil { + if err := json.Unmarshal([]byte(`["auto-assign","master","arbiter","worker"]`), &res); err != nil { panic(err) } for _, v := range res { diff --git a/vendor/github.com/openshift/assisted-service/models/host_update_params.go b/vendor/github.com/openshift/assisted-service/models/host_update_params.go index c14be9b46..efb91d3a7 100644 --- a/vendor/github.com/openshift/assisted-service/models/host_update_params.go +++ b/vendor/github.com/openshift/assisted-service/models/host_update_params.go @@ -27,11 +27,14 @@ type HostUpdateParams struct { // Allows changing the host's skip_formatting_disks parameter DisksSkipFormatting []*DiskSkipFormattingParams `json:"disks_skip_formatting"` + // The host's BMC credentials that will be used in TNF. + FencingCredentials *FencingCredentialsParams `json:"fencing_credentials,omitempty"` + // host name HostName *string `json:"host_name,omitempty"` // host role - // Enum: [auto-assign master worker] + // Enum: [auto-assign master arbiter worker] HostRole *string `json:"host_role,omitempty"` // JSON-formatted string of additional HTTP headers when fetching the ignition. @@ -59,6 +62,10 @@ func (m *HostUpdateParams) Validate(formats strfmt.Registry) error { res = append(res, err) } + if err := m.validateFencingCredentials(formats); err != nil { + res = append(res, err) + } + if err := m.validateHostRole(formats); err != nil { res = append(res, err) } @@ -129,11 +136,30 @@ func (m *HostUpdateParams) validateDisksSkipFormatting(formats strfmt.Registry) return nil } +func (m *HostUpdateParams) validateFencingCredentials(formats strfmt.Registry) error { + if swag.IsZero(m.FencingCredentials) { // not required + return nil + } + + if m.FencingCredentials != nil { + if err := m.FencingCredentials.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("fencing_credentials") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("fencing_credentials") + } + return err + } + } + + return nil +} + var hostUpdateParamsTypeHostRolePropEnum []interface{} func init() { var res []string - if err := json.Unmarshal([]byte(`["auto-assign","master","worker"]`), &res); err != nil { + if err := json.Unmarshal([]byte(`["auto-assign","master","arbiter","worker"]`), &res); err != nil { panic(err) } for _, v := range res { @@ -149,6 +175,9 @@ const ( // HostUpdateParamsHostRoleMaster captures enum value "master" HostUpdateParamsHostRoleMaster string = "master" + // HostUpdateParamsHostRoleArbiter captures enum value "arbiter" + HostUpdateParamsHostRoleArbiter string = "arbiter" + // HostUpdateParamsHostRoleWorker captures enum value "worker" HostUpdateParamsHostRoleWorker string = "worker" ) @@ -238,6 +267,10 @@ func (m *HostUpdateParams) ContextValidate(ctx context.Context, formats strfmt.R res = append(res, err) } + if err := m.contextValidateFencingCredentials(ctx, formats); err != nil { + res = append(res, err) + } + if err := m.contextValidateIgnitionEndpointHTTPHeaders(ctx, formats); err != nil { res = append(res, err) } @@ -292,6 +325,22 @@ func (m *HostUpdateParams) contextValidateDisksSkipFormatting(ctx context.Contex return nil } +func (m *HostUpdateParams) contextValidateFencingCredentials(ctx context.Context, formats strfmt.Registry) error { + + if m.FencingCredentials != nil { + if err := m.FencingCredentials.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("fencing_credentials") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("fencing_credentials") + } + return err + } + } + + return nil +} + func (m *HostUpdateParams) contextValidateIgnitionEndpointHTTPHeaders(ctx context.Context, formats strfmt.Registry) error { for i := 0; i < len(m.IgnitionEndpointHTTPHeaders); i++ { diff --git a/vendor/github.com/openshift/assisted-service/models/host_validation_id.go b/vendor/github.com/openshift/assisted-service/models/host_validation_id.go index 9ab77d10d..08aa9b7a1 100644 --- a/vendor/github.com/openshift/assisted-service/models/host_validation_id.go +++ b/vendor/github.com/openshift/assisted-service/models/host_validation_id.go @@ -99,6 +99,12 @@ const ( // HostValidationIDMceRequirementsSatisfied captures enum value "mce-requirements-satisfied" HostValidationIDMceRequirementsSatisfied HostValidationID = "mce-requirements-satisfied" + // HostValidationIDMtvRequirementsSatisfied captures enum value "mtv-requirements-satisfied" + HostValidationIDMtvRequirementsSatisfied HostValidationID = "mtv-requirements-satisfied" + + // HostValidationIDOscRequirementsSatisfied captures enum value "osc-requirements-satisfied" + HostValidationIDOscRequirementsSatisfied HostValidationID = "osc-requirements-satisfied" + // HostValidationIDSufficientInstallationDiskSpeed captures enum value "sufficient-installation-disk-speed" HostValidationIDSufficientInstallationDiskSpeed HostValidationID = "sufficient-installation-disk-speed" @@ -152,6 +158,69 @@ const ( // HostValidationIDNoIPCollisionsInNetwork captures enum value "no-ip-collisions-in-network" HostValidationIDNoIPCollisionsInNetwork HostValidationID = "no-ip-collisions-in-network" + + // HostValidationIDNoIscsiNicBelongsToMachineCidr captures enum value "no-iscsi-nic-belongs-to-machine-cidr" + HostValidationIDNoIscsiNicBelongsToMachineCidr HostValidationID = "no-iscsi-nic-belongs-to-machine-cidr" + + // HostValidationIDNodeFeatureDiscoveryRequirementsSatisfied captures enum value "node-feature-discovery-requirements-satisfied" + HostValidationIDNodeFeatureDiscoveryRequirementsSatisfied HostValidationID = "node-feature-discovery-requirements-satisfied" + + // HostValidationIDNvidiaGpuRequirementsSatisfied captures enum value "nvidia-gpu-requirements-satisfied" + HostValidationIDNvidiaGpuRequirementsSatisfied HostValidationID = "nvidia-gpu-requirements-satisfied" + + // HostValidationIDPipelinesRequirementsSatisfied captures enum value "pipelines-requirements-satisfied" + HostValidationIDPipelinesRequirementsSatisfied HostValidationID = "pipelines-requirements-satisfied" + + // HostValidationIDServicemeshRequirementsSatisfied captures enum value "servicemesh-requirements-satisfied" + HostValidationIDServicemeshRequirementsSatisfied HostValidationID = "servicemesh-requirements-satisfied" + + // HostValidationIDServerlessRequirementsSatisfied captures enum value "serverless-requirements-satisfied" + HostValidationIDServerlessRequirementsSatisfied HostValidationID = "serverless-requirements-satisfied" + + // HostValidationIDOpenshiftAiRequirementsSatisfied captures enum value "openshift-ai-requirements-satisfied" + HostValidationIDOpenshiftAiRequirementsSatisfied HostValidationID = "openshift-ai-requirements-satisfied" + + // HostValidationIDAuthorinoRequirementsSatisfied captures enum value "authorino-requirements-satisfied" + HostValidationIDAuthorinoRequirementsSatisfied HostValidationID = "authorino-requirements-satisfied" + + // HostValidationIDMtuValid captures enum value "mtu-valid" + HostValidationIDMtuValid HostValidationID = "mtu-valid" + + // HostValidationIDNmstateRequirementsSatisfied captures enum value "nmstate-requirements-satisfied" + HostValidationIDNmstateRequirementsSatisfied HostValidationID = "nmstate-requirements-satisfied" + + // HostValidationIDAmdGpuRequirementsSatisfied captures enum value "amd-gpu-requirements-satisfied" + HostValidationIDAmdGpuRequirementsSatisfied HostValidationID = "amd-gpu-requirements-satisfied" + + // HostValidationIDKmmRequirementsSatisfied captures enum value "kmm-requirements-satisfied" + HostValidationIDKmmRequirementsSatisfied HostValidationID = "kmm-requirements-satisfied" + + // HostValidationIDNodeHealthcheckRequirementsSatisfied captures enum value "node-healthcheck-requirements-satisfied" + HostValidationIDNodeHealthcheckRequirementsSatisfied HostValidationID = "node-healthcheck-requirements-satisfied" + + // HostValidationIDSelfNodeRemediationRequirementsSatisfied captures enum value "self-node-remediation-requirements-satisfied" + HostValidationIDSelfNodeRemediationRequirementsSatisfied HostValidationID = "self-node-remediation-requirements-satisfied" + + // HostValidationIDFenceAgentsRemediationRequirementsSatisfied captures enum value "fence-agents-remediation-requirements-satisfied" + HostValidationIDFenceAgentsRemediationRequirementsSatisfied HostValidationID = "fence-agents-remediation-requirements-satisfied" + + // HostValidationIDNodeMaintenanceRequirementsSatisfied captures enum value "node-maintenance-requirements-satisfied" + HostValidationIDNodeMaintenanceRequirementsSatisfied HostValidationID = "node-maintenance-requirements-satisfied" + + // HostValidationIDKubeDeschedulerRequirementsSatisfied captures enum value "kube-descheduler-requirements-satisfied" + HostValidationIDKubeDeschedulerRequirementsSatisfied HostValidationID = "kube-descheduler-requirements-satisfied" + + // HostValidationIDClusterObservabilityRequirementsSatisfied captures enum value "cluster-observability-requirements-satisfied" + HostValidationIDClusterObservabilityRequirementsSatisfied HostValidationID = "cluster-observability-requirements-satisfied" + + // HostValidationIDNumaResourcesRequirementsSatisfied captures enum value "numa-resources-requirements-satisfied" + HostValidationIDNumaResourcesRequirementsSatisfied HostValidationID = "numa-resources-requirements-satisfied" + + // HostValidationIDOadpRequirementsSatisfied captures enum value "oadp-requirements-satisfied" + HostValidationIDOadpRequirementsSatisfied HostValidationID = "oadp-requirements-satisfied" + + // HostValidationIDMetallbRequirementsSatisfied captures enum value "metallb-requirements-satisfied" + HostValidationIDMetallbRequirementsSatisfied HostValidationID = "metallb-requirements-satisfied" ) // for schema @@ -159,7 +228,7 @@ var hostValidationIdEnum []interface{} func init() { var res []HostValidationID - if err := json.Unmarshal([]byte(`["connected","media-connected","has-inventory","has-min-cpu-cores","has-min-valid-disks","has-min-memory","machine-cidr-defined","has-cpu-cores-for-role","has-memory-for-role","hostname-unique","hostname-valid","belongs-to-machine-cidr","ignition-downloadable","belongs-to-majority-group","valid-platform-network-settings","ntp-synced","time-synced-between-host-and-service","container-images-available","lso-requirements-satisfied","ocs-requirements-satisfied","odf-requirements-satisfied","lvm-requirements-satisfied","mce-requirements-satisfied","sufficient-installation-disk-speed","cnv-requirements-satisfied","sufficient-network-latency-requirement-for-role","sufficient-packet-loss-requirement-for-role","has-default-route","api-domain-name-resolved-correctly","api-int-domain-name-resolved-correctly","apps-domain-name-resolved-correctly","release-domain-name-resolved-correctly","compatible-with-cluster-platform","dns-wildcard-not-configured","disk-encryption-requirements-satisfied","non-overlapping-subnets","vsphere-disk-uuid-enabled","compatible-agent","no-skip-installation-disk","no-skip-missing-disk","no-ip-collisions-in-network"]`), &res); err != nil { + if err := json.Unmarshal([]byte(`["connected","media-connected","has-inventory","has-min-cpu-cores","has-min-valid-disks","has-min-memory","machine-cidr-defined","has-cpu-cores-for-role","has-memory-for-role","hostname-unique","hostname-valid","belongs-to-machine-cidr","ignition-downloadable","belongs-to-majority-group","valid-platform-network-settings","ntp-synced","time-synced-between-host-and-service","container-images-available","lso-requirements-satisfied","ocs-requirements-satisfied","odf-requirements-satisfied","lvm-requirements-satisfied","mce-requirements-satisfied","mtv-requirements-satisfied","osc-requirements-satisfied","sufficient-installation-disk-speed","cnv-requirements-satisfied","sufficient-network-latency-requirement-for-role","sufficient-packet-loss-requirement-for-role","has-default-route","api-domain-name-resolved-correctly","api-int-domain-name-resolved-correctly","apps-domain-name-resolved-correctly","release-domain-name-resolved-correctly","compatible-with-cluster-platform","dns-wildcard-not-configured","disk-encryption-requirements-satisfied","non-overlapping-subnets","vsphere-disk-uuid-enabled","compatible-agent","no-skip-installation-disk","no-skip-missing-disk","no-ip-collisions-in-network","no-iscsi-nic-belongs-to-machine-cidr","node-feature-discovery-requirements-satisfied","nvidia-gpu-requirements-satisfied","pipelines-requirements-satisfied","servicemesh-requirements-satisfied","serverless-requirements-satisfied","openshift-ai-requirements-satisfied","authorino-requirements-satisfied","mtu-valid","nmstate-requirements-satisfied","amd-gpu-requirements-satisfied","kmm-requirements-satisfied","node-healthcheck-requirements-satisfied","self-node-remediation-requirements-satisfied","fence-agents-remediation-requirements-satisfied","node-maintenance-requirements-satisfied","kube-descheduler-requirements-satisfied","cluster-observability-requirements-satisfied","numa-resources-requirements-satisfied","oadp-requirements-satisfied","metallb-requirements-satisfied"]`), &res); err != nil { panic(err) } for _, v := range res { diff --git a/vendor/github.com/openshift/assisted-service/models/image_type.go b/vendor/github.com/openshift/assisted-service/models/image_type.go index 77e903499..97959258a 100644 --- a/vendor/github.com/openshift/assisted-service/models/image_type.go +++ b/vendor/github.com/openshift/assisted-service/models/image_type.go @@ -35,6 +35,9 @@ const ( // ImageTypeMinimalIso captures enum value "minimal-iso" ImageTypeMinimalIso ImageType = "minimal-iso" + + // ImageTypeDisconnectedIso captures enum value "disconnected-iso" + ImageTypeDisconnectedIso ImageType = "disconnected-iso" ) // for schema @@ -42,7 +45,7 @@ var imageTypeEnum []interface{} func init() { var res []ImageType - if err := json.Unmarshal([]byte(`["full-iso","minimal-iso"]`), &res); err != nil { + if err := json.Unmarshal([]byte(`["full-iso","minimal-iso","disconnected-iso"]`), &res); err != nil { panic(err) } for _, v := range res { diff --git a/vendor/github.com/openshift/assisted-service/models/incompatibility_reason.go b/vendor/github.com/openshift/assisted-service/models/incompatibility_reason.go new file mode 100644 index 000000000..677f48493 --- /dev/null +++ b/vendor/github.com/openshift/assisted-service/models/incompatibility_reason.go @@ -0,0 +1,84 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "encoding/json" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" +) + +// IncompatibilityReason incompatibility reason +// +// swagger:model incompatibility-reason +type IncompatibilityReason string + +func NewIncompatibilityReason(value IncompatibilityReason) *IncompatibilityReason { + return &value +} + +// Pointer returns a pointer to a freshly-allocated IncompatibilityReason. +func (m IncompatibilityReason) Pointer() *IncompatibilityReason { + return &m +} + +const ( + + // IncompatibilityReasonCPUArchitecture captures enum value "cpuArchitecture" + IncompatibilityReasonCPUArchitecture IncompatibilityReason = "cpuArchitecture" + + // IncompatibilityReasonPlatform captures enum value "platform" + IncompatibilityReasonPlatform IncompatibilityReason = "platform" + + // IncompatibilityReasonOpenshiftVersion captures enum value "openshiftVersion" + IncompatibilityReasonOpenshiftVersion IncompatibilityReason = "openshiftVersion" + + // IncompatibilityReasonOciExternalIntegrationDisabled captures enum value "ociExternalIntegrationDisabled" + IncompatibilityReasonOciExternalIntegrationDisabled IncompatibilityReason = "ociExternalIntegrationDisabled" +) + +// for schema +var incompatibilityReasonEnum []interface{} + +func init() { + var res []IncompatibilityReason + if err := json.Unmarshal([]byte(`["cpuArchitecture","platform","openshiftVersion","ociExternalIntegrationDisabled"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + incompatibilityReasonEnum = append(incompatibilityReasonEnum, v) + } +} + +func (m IncompatibilityReason) validateIncompatibilityReasonEnum(path, location string, value IncompatibilityReason) error { + if err := validate.EnumCase(path, location, value, incompatibilityReasonEnum, true); err != nil { + return err + } + return nil +} + +// Validate validates this incompatibility reason +func (m IncompatibilityReason) Validate(formats strfmt.Registry) error { + var res []error + + // value enum + if err := m.validateIncompatibilityReasonEnum("", "body", m); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// ContextValidate validates this incompatibility reason based on context it is used +func (m IncompatibilityReason) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} diff --git a/vendor/github.com/openshift/assisted-service/models/infra_env_update_params.go b/vendor/github.com/openshift/assisted-service/models/infra_env_update_params.go index fa7c21885..a80b0fbb3 100644 --- a/vendor/github.com/openshift/assisted-service/models/infra_env_update_params.go +++ b/vendor/github.com/openshift/assisted-service/models/infra_env_update_params.go @@ -36,6 +36,9 @@ type InfraEnvUpdateParams struct { // kernel arguments KernelArguments KernelArguments `json:"kernel_arguments"` + // Version of the OS image + OpenshiftVersion *string `json:"openshift_version,omitempty"` + // proxy Proxy *Proxy `json:"proxy,omitempty" gorm:"embedded;embeddedPrefix:proxy_"` diff --git a/vendor/github.com/openshift/assisted-service/models/install_cmd_request.go b/vendor/github.com/openshift/assisted-service/models/install_cmd_request.go index 917cfc813..ac0cdbb9a 100644 --- a/vendor/github.com/openshift/assisted-service/models/install_cmd_request.go +++ b/vendor/github.com/openshift/assisted-service/models/install_cmd_request.go @@ -7,7 +7,6 @@ package models import ( "context" - "encoding/json" "strconv" "github.com/go-openapi/errors" @@ -33,23 +32,23 @@ type InstallCmdRequest struct { // Format: uuid ClusterID *strfmt.UUID `json:"cluster_id"` + // Specifies the required number of control plane nodes that should be part of the cluster. + ControlPlaneCount int64 `json:"control_plane_count,omitempty"` + // Assisted installer controller image // Required: true // Pattern: ^(([a-zA-Z0-9\-\.]+)(:[0-9]+)?\/)?[a-z0-9\._\-\/@]+[?::a-zA-Z0-9_\-.]+$ ControllerImage *string `json:"controller_image"` + // CoreOS container image to use if installing to the local device + CoreosImage string `json:"coreos_image,omitempty"` + // List of disks to format DisksToFormat []string `json:"disks_to_format"` // If true, assisted service will attempt to skip MCO reboot EnableSkipMcoReboot bool `json:"enable_skip_mco_reboot,omitempty"` - // Guaranteed availability of the installed cluster. 'Full' installs a Highly-Available cluster - // over multiple master nodes whereas 'None' installs a full cluster over one node. - // - // Enum: [Full None] - HighAvailabilityMode *string `json:"high_availability_mode,omitempty"` - // Host id // Required: true // Format: uuid @@ -75,6 +74,9 @@ type InstallCmdRequest struct { // Must-gather images to use MustGatherImage string `json:"must_gather_image,omitempty"` + // If true, notify number of reboots by assisted controller + NotifyNumReboots bool `json:"notify_num_reboots,omitempty"` + // Version of the OpenShift cluster. OpenshiftVersion string `json:"openshift_version,omitempty"` @@ -108,10 +110,6 @@ func (m *InstallCmdRequest) Validate(formats strfmt.Registry) error { res = append(res, err) } - if err := m.validateHighAvailabilityMode(formats); err != nil { - res = append(res, err) - } - if err := m.validateHostID(formats); err != nil { res = append(res, err) } @@ -181,48 +179,6 @@ func (m *InstallCmdRequest) validateControllerImage(formats strfmt.Registry) err return nil } -var installCmdRequestTypeHighAvailabilityModePropEnum []interface{} - -func init() { - var res []string - if err := json.Unmarshal([]byte(`["Full","None"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - installCmdRequestTypeHighAvailabilityModePropEnum = append(installCmdRequestTypeHighAvailabilityModePropEnum, v) - } -} - -const ( - - // InstallCmdRequestHighAvailabilityModeFull captures enum value "Full" - InstallCmdRequestHighAvailabilityModeFull string = "Full" - - // InstallCmdRequestHighAvailabilityModeNone captures enum value "None" - InstallCmdRequestHighAvailabilityModeNone string = "None" -) - -// prop value enum -func (m *InstallCmdRequest) validateHighAvailabilityModeEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, installCmdRequestTypeHighAvailabilityModePropEnum, true); err != nil { - return err - } - return nil -} - -func (m *InstallCmdRequest) validateHighAvailabilityMode(formats strfmt.Registry) error { - if swag.IsZero(m.HighAvailabilityMode) { // not required - return nil - } - - // value enum - if err := m.validateHighAvailabilityModeEnum("high_availability_mode", "body", *m.HighAvailabilityMode); err != nil { - return err - } - - return nil -} - func (m *InstallCmdRequest) validateHostID(formats strfmt.Registry) error { if err := validate.Required("host_id", "body", m.HostID); err != nil { diff --git a/vendor/github.com/openshift/assisted-service/models/iscsi.go b/vendor/github.com/openshift/assisted-service/models/iscsi.go new file mode 100644 index 000000000..865d1ca20 --- /dev/null +++ b/vendor/github.com/openshift/assisted-service/models/iscsi.go @@ -0,0 +1,50 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// Iscsi iscsi +// +// swagger:model iscsi +type Iscsi struct { + + // Host IP address used to reach iSCSI target + HostIPAddress string `json:"host_ip_address,omitempty"` +} + +// Validate validates this iscsi +func (m *Iscsi) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this iscsi based on context it is used +func (m *Iscsi) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *Iscsi) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *Iscsi) UnmarshalBinary(b []byte) error { + var res Iscsi + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/vendor/github.com/openshift/assisted-service/models/load_balancer.go b/vendor/github.com/openshift/assisted-service/models/load_balancer.go new file mode 100644 index 000000000..8d4a4fe21 --- /dev/null +++ b/vendor/github.com/openshift/assisted-service/models/load_balancer.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "encoding/json" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// LoadBalancer load balancer +// +// swagger:model load_balancer +type LoadBalancer struct { + + // Indicates if the load balancer will be managed by the cluster or by the user. This is optional and The + // default is `cluster-managed`. + // + // `cluster-managed` means that the cluster will start the components that assign the API and ingress VIPs to the + // nodes of the cluster automatically. + // + // `user-managed` means that the user is responsible for configuring an external load balancer and assign the + // API and ingress VIPs to it. Note that this configuration needs to be completed before starting the + // installation of the cluster, as it is needed during the installation process. + // + // Enum: [cluster-managed user-managed] + Type string `json:"type,omitempty" gorm:"not null;check:load_balancer_type in ('cluster-managed', 'user-managed');default:'cluster-managed'"` +} + +// Validate validates this load balancer +func (m *LoadBalancer) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateType(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +var loadBalancerTypeTypePropEnum []interface{} + +func init() { + var res []string + if err := json.Unmarshal([]byte(`["cluster-managed","user-managed"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + loadBalancerTypeTypePropEnum = append(loadBalancerTypeTypePropEnum, v) + } +} + +const ( + + // LoadBalancerTypeClusterManaged captures enum value "cluster-managed" + LoadBalancerTypeClusterManaged string = "cluster-managed" + + // LoadBalancerTypeUserManaged captures enum value "user-managed" + LoadBalancerTypeUserManaged string = "user-managed" +) + +// prop value enum +func (m *LoadBalancer) validateTypeEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, loadBalancerTypeTypePropEnum, true); err != nil { + return err + } + return nil +} + +func (m *LoadBalancer) validateType(formats strfmt.Registry) error { + if swag.IsZero(m.Type) { // not required + return nil + } + + // value enum + if err := m.validateTypeEnum("type", "body", m.Type); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this load balancer based on context it is used +func (m *LoadBalancer) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *LoadBalancer) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *LoadBalancer) UnmarshalBinary(b []byte) error { + var res LoadBalancer + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/vendor/github.com/openshift/assisted-service/models/manifest.go b/vendor/github.com/openshift/assisted-service/models/manifest.go index df07b411d..2e61abf46 100644 --- a/vendor/github.com/openshift/assisted-service/models/manifest.go +++ b/vendor/github.com/openshift/assisted-service/models/manifest.go @@ -26,6 +26,10 @@ type Manifest struct { // The folder that contains the files. Manifests can be placed in 'manifests' or 'openshift' directories. // Enum: [manifests openshift] Folder string `json:"folder,omitempty"` + + // Describes whether manifest is sourced from a user or created by the system. + // Enum: [user system] + ManifestSource string `json:"manifest_source,omitempty"` } // Validate validates this manifest @@ -36,6 +40,10 @@ func (m *Manifest) Validate(formats strfmt.Registry) error { res = append(res, err) } + if err := m.validateManifestSource(formats); err != nil { + res = append(res, err) + } + if len(res) > 0 { return errors.CompositeValidationError(res...) } @@ -84,6 +92,48 @@ func (m *Manifest) validateFolder(formats strfmt.Registry) error { return nil } +var manifestTypeManifestSourcePropEnum []interface{} + +func init() { + var res []string + if err := json.Unmarshal([]byte(`["user","system"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + manifestTypeManifestSourcePropEnum = append(manifestTypeManifestSourcePropEnum, v) + } +} + +const ( + + // ManifestManifestSourceUser captures enum value "user" + ManifestManifestSourceUser string = "user" + + // ManifestManifestSourceSystem captures enum value "system" + ManifestManifestSourceSystem string = "system" +) + +// prop value enum +func (m *Manifest) validateManifestSourceEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, manifestTypeManifestSourcePropEnum, true); err != nil { + return err + } + return nil +} + +func (m *Manifest) validateManifestSource(formats strfmt.Registry) error { + if swag.IsZero(m.ManifestSource) { // not required + return nil + } + + // value enum + if err := m.validateManifestSourceEnum("manifest_source", "body", m.ManifestSource); err != nil { + return err + } + + return nil +} + // ContextValidate validates this manifest based on context it is used func (m *Manifest) ContextValidate(ctx context.Context, formats strfmt.Registry) error { return nil diff --git a/vendor/github.com/openshift/assisted-service/models/monitored_operator.go b/vendor/github.com/openshift/assisted-service/models/monitored_operator.go index 75a127c92..8a91ba54d 100644 --- a/vendor/github.com/openshift/assisted-service/models/monitored_operator.go +++ b/vendor/github.com/openshift/assisted-service/models/monitored_operator.go @@ -12,6 +12,7 @@ import ( "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" "github.com/go-openapi/validate" + "github.com/lib/pq" ) // MonitoredOperator monitored operator @@ -19,10 +20,16 @@ import ( // swagger:model monitored-operator type MonitoredOperator struct { + // List of identifier of the bundles associated with the operator. Can be empty. + Bundles pq.StringArray `json:"bundles" gorm:"type:text[]"` + // The cluster that this operator is associated with. // Format: uuid ClusterID strfmt.UUID `json:"cluster_id,omitempty" gorm:"primaryKey"` + // Whether the operator can't be installed without being required by another operator. + DependencyOnly bool `json:"dependency_only,omitempty"` + // Unique name of the operator. Name string `json:"name,omitempty" gorm:"primaryKey"` diff --git a/vendor/github.com/openshift/assisted-service/models/mtu_report.go b/vendor/github.com/openshift/assisted-service/models/mtu_report.go new file mode 100644 index 000000000..9a5245cc3 --- /dev/null +++ b/vendor/github.com/openshift/assisted-service/models/mtu_report.go @@ -0,0 +1,56 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// MtuReport mtu report +// +// swagger:model mtu-report +type MtuReport struct { + + // mtu successful + MtuSuccessful bool `json:"mtu_successful,omitempty"` + + // outgoing nic + OutgoingNic string `json:"outgoing_nic,omitempty"` + + // remote ip address + RemoteIPAddress string `json:"remote_ip_address,omitempty"` +} + +// Validate validates this mtu report +func (m *MtuReport) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this mtu report based on context it is used +func (m *MtuReport) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *MtuReport) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *MtuReport) UnmarshalBinary(b []byte) error { + var res MtuReport + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/vendor/github.com/openshift/assisted-service/models/operator.go b/vendor/github.com/openshift/assisted-service/models/operator.go new file mode 100644 index 000000000..f7ec02949 --- /dev/null +++ b/vendor/github.com/openshift/assisted-service/models/operator.go @@ -0,0 +1,311 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// Operator operator +// +// swagger:model operator +type Operator struct { + + // dependencies + // Required: true + Dependencies []FeatureSupportLevelID `json:"dependencies"` + + // feature support level id + // Required: true + FeatureSupportLevelID FeatureSupportLevelID `json:"feature-support-level-id"` + + // incompatibilities + // Required: true + Incompatibilities []FeatureSupportLevelID `json:"incompatibilities"` + + // Name of the operator + // Required: true + Name *string `json:"name"` + + // reason + Reason IncompatibilityReason `json:"reason,omitempty"` + + // support level + // Required: true + SupportLevel SupportLevel `json:"support_level"` +} + +// Validate validates this operator +func (m *Operator) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateDependencies(formats); err != nil { + res = append(res, err) + } + + if err := m.validateFeatureSupportLevelID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateIncompatibilities(formats); err != nil { + res = append(res, err) + } + + if err := m.validateName(formats); err != nil { + res = append(res, err) + } + + if err := m.validateReason(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSupportLevel(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *Operator) validateDependencies(formats strfmt.Registry) error { + + if err := validate.Required("dependencies", "body", m.Dependencies); err != nil { + return err + } + + for i := 0; i < len(m.Dependencies); i++ { + + if err := m.Dependencies[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("dependencies" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("dependencies" + "." + strconv.Itoa(i)) + } + return err + } + + } + + return nil +} + +func (m *Operator) validateFeatureSupportLevelID(formats strfmt.Registry) error { + + if err := validate.Required("feature-support-level-id", "body", FeatureSupportLevelID(m.FeatureSupportLevelID)); err != nil { + return err + } + + if err := m.FeatureSupportLevelID.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("feature-support-level-id") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("feature-support-level-id") + } + return err + } + + return nil +} + +func (m *Operator) validateIncompatibilities(formats strfmt.Registry) error { + + if err := validate.Required("incompatibilities", "body", m.Incompatibilities); err != nil { + return err + } + + for i := 0; i < len(m.Incompatibilities); i++ { + + if err := m.Incompatibilities[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("incompatibilities" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("incompatibilities" + "." + strconv.Itoa(i)) + } + return err + } + + } + + return nil +} + +func (m *Operator) validateName(formats strfmt.Registry) error { + + if err := validate.Required("name", "body", m.Name); err != nil { + return err + } + + return nil +} + +func (m *Operator) validateReason(formats strfmt.Registry) error { + if swag.IsZero(m.Reason) { // not required + return nil + } + + if err := m.Reason.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("reason") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("reason") + } + return err + } + + return nil +} + +func (m *Operator) validateSupportLevel(formats strfmt.Registry) error { + + if err := validate.Required("support_level", "body", SupportLevel(m.SupportLevel)); err != nil { + return err + } + + if err := m.SupportLevel.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("support_level") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("support_level") + } + return err + } + + return nil +} + +// ContextValidate validate this operator based on the context it is used +func (m *Operator) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateDependencies(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateFeatureSupportLevelID(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateIncompatibilities(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateReason(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateSupportLevel(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *Operator) contextValidateDependencies(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Dependencies); i++ { + + if err := m.Dependencies[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("dependencies" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("dependencies" + "." + strconv.Itoa(i)) + } + return err + } + + } + + return nil +} + +func (m *Operator) contextValidateFeatureSupportLevelID(ctx context.Context, formats strfmt.Registry) error { + + if err := m.FeatureSupportLevelID.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("feature-support-level-id") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("feature-support-level-id") + } + return err + } + + return nil +} + +func (m *Operator) contextValidateIncompatibilities(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Incompatibilities); i++ { + + if err := m.Incompatibilities[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("incompatibilities" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("incompatibilities" + "." + strconv.Itoa(i)) + } + return err + } + + } + + return nil +} + +func (m *Operator) contextValidateReason(ctx context.Context, formats strfmt.Registry) error { + + if err := m.Reason.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("reason") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("reason") + } + return err + } + + return nil +} + +func (m *Operator) contextValidateSupportLevel(ctx context.Context, formats strfmt.Registry) error { + + if err := m.SupportLevel.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("support_level") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("support_level") + } + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *Operator) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *Operator) UnmarshalBinary(b []byte) error { + var res Operator + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/vendor/github.com/openshift/assisted-service/models/secure_boot_state.go b/vendor/github.com/openshift/assisted-service/models/secure_boot_state.go new file mode 100644 index 000000000..934cfd675 --- /dev/null +++ b/vendor/github.com/openshift/assisted-service/models/secure_boot_state.go @@ -0,0 +1,84 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "encoding/json" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" +) + +// SecureBootState secure boot state +// +// swagger:model secure-boot-state +type SecureBootState string + +func NewSecureBootState(value SecureBootState) *SecureBootState { + return &value +} + +// Pointer returns a pointer to a freshly-allocated SecureBootState. +func (m SecureBootState) Pointer() *SecureBootState { + return &m +} + +const ( + + // SecureBootStateUnknown captures enum value "Unknown" + SecureBootStateUnknown SecureBootState = "Unknown" + + // SecureBootStateNotSupported captures enum value "NotSupported" + SecureBootStateNotSupported SecureBootState = "NotSupported" + + // SecureBootStateEnabled captures enum value "Enabled" + SecureBootStateEnabled SecureBootState = "Enabled" + + // SecureBootStateDisabled captures enum value "Disabled" + SecureBootStateDisabled SecureBootState = "Disabled" +) + +// for schema +var secureBootStateEnum []interface{} + +func init() { + var res []SecureBootState + if err := json.Unmarshal([]byte(`["Unknown","NotSupported","Enabled","Disabled"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + secureBootStateEnum = append(secureBootStateEnum, v) + } +} + +func (m SecureBootState) validateSecureBootStateEnum(path, location string, value SecureBootState) error { + if err := validate.EnumCase(path, location, value, secureBootStateEnum, true); err != nil { + return err + } + return nil +} + +// Validate validates this secure boot state +func (m SecureBootState) Validate(formats strfmt.Registry) error { + var res []error + + // value enum + if err := m.validateSecureBootStateEnum("", "body", m); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// ContextValidate validates this secure boot state based on context it is used +func (m SecureBootState) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} diff --git a/vendor/github.com/openshift/assisted-service/models/update_manifest_params.go b/vendor/github.com/openshift/assisted-service/models/update_manifest_params.go index 662d9a5ae..9606db2aa 100644 --- a/vendor/github.com/openshift/assisted-service/models/update_manifest_params.go +++ b/vendor/github.com/openshift/assisted-service/models/update_manifest_params.go @@ -22,7 +22,7 @@ type UpdateManifestParams struct { // The file name for the manifest to modify. // Required: true - // Pattern: ^[^/]*\.(yaml|yml|json|yaml.patch.*|yml.patch.*)$ + // Pattern: ^[^\/]*\.(json|ya?ml(\.patch_?[a-zA-Z0-9_]*)?)$ FileName string `json:"file_name"` // The folder for the manifest to modify. @@ -34,7 +34,7 @@ type UpdateManifestParams struct { UpdatedContent *string `json:"updated_content,omitempty"` // The new file name for the manifest. - // Pattern: ^[^/]*\.(yaml|yml|json|yaml.patch.*|yml.patch.*)$ + // Pattern: ^[^\/]*\.(json|ya?ml(\.patch_?[a-zA-Z0-9_]*)?)$ UpdatedFileName *string `json:"updated_file_name,omitempty"` // The new folder for the manifest. Manifests can be placed in 'manifests' or 'openshift' directories. @@ -74,7 +74,7 @@ func (m *UpdateManifestParams) validateFileName(formats strfmt.Registry) error { return err } - if err := validate.Pattern("file_name", "body", m.FileName, `^[^/]*\.(yaml|yml|json|yaml.patch.*|yml.patch.*)$`); err != nil { + if err := validate.Pattern("file_name", "body", m.FileName, `^[^\/]*\.(json|ya?ml(\.patch_?[a-zA-Z0-9_]*)?)$`); err != nil { return err } @@ -129,7 +129,7 @@ func (m *UpdateManifestParams) validateUpdatedFileName(formats strfmt.Registry) return nil } - if err := validate.Pattern("updated_file_name", "body", *m.UpdatedFileName, `^[^/]*\.(yaml|yml|json|yaml.patch.*|yml.patch.*)$`); err != nil { + if err := validate.Pattern("updated_file_name", "body", *m.UpdatedFileName, `^[^\/]*\.(json|ya?ml(\.patch_?[a-zA-Z0-9_]*)?)$`); err != nil { return err } diff --git a/vendor/github.com/openshift/assisted-service/models/v2_cluster_update_params.go b/vendor/github.com/openshift/assisted-service/models/v2_cluster_update_params.go index cf3edc1ef..9ebef86d0 100644 --- a/vendor/github.com/openshift/assisted-service/models/v2_cluster_update_params.go +++ b/vendor/github.com/openshift/assisted-service/models/v2_cluster_update_params.go @@ -45,6 +45,9 @@ type V2ClusterUpdateParams struct { // Cluster networks that are associated with this cluster. ClusterNetworks []*ClusterNetwork `json:"cluster_networks"` + // Specifies the required number of control plane nodes that should be part of the cluster. + ControlPlaneCount *int64 `json:"control_plane_count,omitempty"` + // Installation disks encryption mode and host roles to be applied. DiskEncryption *DiskEncryption `json:"disk_encryption,omitempty" gorm:"embedded;embeddedPrefix:disk_encryption_"` @@ -58,8 +61,8 @@ type V2ClusterUpdateParams struct { // HTTPSProxy *string `json:"https_proxy,omitempty"` - // Enable/disable hyperthreading on master nodes, worker nodes, or all nodes. - // Enum: [masters workers all none] + // Enable/disable hyperthreading on master nodes, arbiter nodes, worker nodes, or a combination of them. + // Enum: [none masters arbiters workers masters,arbiters masters,workers arbiters,workers masters,arbiters,workers all] Hyperthreading *string `json:"hyperthreading,omitempty"` // Explicit ignition endpoint overrides the default ignition endpoint. @@ -68,6 +71,9 @@ type V2ClusterUpdateParams struct { // The virtual IPs used for cluster ingress traffic. Enter one IP address for single-stack clusters, or up to two for dual-stack clusters (at most one IP address per IP stack used). The order of stacks should be the same as order of subnets in Cluster Networks, Service Networks, and Machine Networks. IngressVips []*IngressVip `json:"ingress_vips"` + // load balancer + LoadBalancer *LoadBalancer `json:"load_balancer,omitempty" gorm:"embedded;embeddedPrefix:load_balancer_"` + // A CIDR that all hosts belonging to the cluster should have an interfaces with IP address that belongs to this CIDR. The api_vip belongs to this CIDR. // Pattern: ^(?:(?:(?:[0-9]{1,3}\.){3}[0-9]{1,3}\/(?:(?:[0-9])|(?:[1-2][0-9])|(?:3[0-2])))|(?:(?:[0-9a-fA-F]*:[0-9a-fA-F]*){2,})/(?:(?:[0-9])|(?:[1-9][0-9])|(?:1[0-1][0-9])|(?:12[0-8])))$ MachineNetworkCidr *string `json:"machine_network_cidr,omitempty"` @@ -88,6 +94,8 @@ type V2ClusterUpdateParams struct { NoProxy *string `json:"no_proxy,omitempty"` // List of OLM operators to be installed. + // For the full list of supported operators, check the endpoint `/v2/supported-operators`: + // OlmOperators []*OperatorCreateParams `json:"olm_operators"` // platform @@ -155,6 +163,10 @@ func (m *V2ClusterUpdateParams) Validate(formats strfmt.Registry) error { res = append(res, err) } + if err := m.validateLoadBalancer(formats); err != nil { + res = append(res, err) + } + if err := m.validateMachineNetworkCidr(formats); err != nil { res = append(res, err) } @@ -296,7 +308,7 @@ var v2ClusterUpdateParamsTypeHyperthreadingPropEnum []interface{} func init() { var res []string - if err := json.Unmarshal([]byte(`["masters","workers","all","none"]`), &res); err != nil { + if err := json.Unmarshal([]byte(`["none","masters","arbiters","workers","masters,arbiters","masters,workers","arbiters,workers","masters,arbiters,workers","all"]`), &res); err != nil { panic(err) } for _, v := range res { @@ -306,17 +318,32 @@ func init() { const ( + // V2ClusterUpdateParamsHyperthreadingNone captures enum value "none" + V2ClusterUpdateParamsHyperthreadingNone string = "none" + // V2ClusterUpdateParamsHyperthreadingMasters captures enum value "masters" V2ClusterUpdateParamsHyperthreadingMasters string = "masters" + // V2ClusterUpdateParamsHyperthreadingArbiters captures enum value "arbiters" + V2ClusterUpdateParamsHyperthreadingArbiters string = "arbiters" + // V2ClusterUpdateParamsHyperthreadingWorkers captures enum value "workers" V2ClusterUpdateParamsHyperthreadingWorkers string = "workers" + // V2ClusterUpdateParamsHyperthreadingMastersArbiters captures enum value "masters,arbiters" + V2ClusterUpdateParamsHyperthreadingMastersArbiters string = "masters,arbiters" + + // V2ClusterUpdateParamsHyperthreadingMastersWorkers captures enum value "masters,workers" + V2ClusterUpdateParamsHyperthreadingMastersWorkers string = "masters,workers" + + // V2ClusterUpdateParamsHyperthreadingArbitersWorkers captures enum value "arbiters,workers" + V2ClusterUpdateParamsHyperthreadingArbitersWorkers string = "arbiters,workers" + + // V2ClusterUpdateParamsHyperthreadingMastersArbitersWorkers captures enum value "masters,arbiters,workers" + V2ClusterUpdateParamsHyperthreadingMastersArbitersWorkers string = "masters,arbiters,workers" + // V2ClusterUpdateParamsHyperthreadingAll captures enum value "all" V2ClusterUpdateParamsHyperthreadingAll string = "all" - - // V2ClusterUpdateParamsHyperthreadingNone captures enum value "none" - V2ClusterUpdateParamsHyperthreadingNone string = "none" ) // prop value enum @@ -385,6 +412,25 @@ func (m *V2ClusterUpdateParams) validateIngressVips(formats strfmt.Registry) err return nil } +func (m *V2ClusterUpdateParams) validateLoadBalancer(formats strfmt.Registry) error { + if swag.IsZero(m.LoadBalancer) { // not required + return nil + } + + if m.LoadBalancer != nil { + if err := m.LoadBalancer.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("load_balancer") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("load_balancer") + } + return err + } + } + + return nil +} + func (m *V2ClusterUpdateParams) validateMachineNetworkCidr(formats strfmt.Registry) error { if swag.IsZero(m.MachineNetworkCidr) { // not required return nil @@ -588,6 +634,10 @@ func (m *V2ClusterUpdateParams) ContextValidate(ctx context.Context, formats str res = append(res, err) } + if err := m.contextValidateLoadBalancer(ctx, formats); err != nil { + res = append(res, err) + } + if err := m.contextValidateMachineNetworks(ctx, formats); err != nil { res = append(res, err) } @@ -702,6 +752,22 @@ func (m *V2ClusterUpdateParams) contextValidateIngressVips(ctx context.Context, return nil } +func (m *V2ClusterUpdateParams) contextValidateLoadBalancer(ctx context.Context, formats strfmt.Registry) error { + + if m.LoadBalancer != nil { + if err := m.LoadBalancer.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("load_balancer") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("load_balancer") + } + return err + } + } + + return nil +} + func (m *V2ClusterUpdateParams) contextValidateMachineNetworks(ctx context.Context, formats strfmt.Registry) error { for i := 0; i < len(m.MachineNetworks); i++ { diff --git a/vendor/github.com/openshift/assisted-service/models/validations/dns_validation.go b/vendor/github.com/openshift/assisted-service/models/validations/dns_validation.go new file mode 100644 index 000000000..ededf646c --- /dev/null +++ b/vendor/github.com/openshift/assisted-service/models/validations/dns_validation.go @@ -0,0 +1,50 @@ +package validations + +import ( + "fmt" + "net/http" + "regexp" + "strings" +) + +const ( + baseDomainRegex = `^[a-z\d]([\-]*[a-z\d]+)+$` + dnsNameRegex = `^([a-z\d]([\-]*[a-z\d]+)*\.)+[a-z\d]+([\-]*[a-z\d]+)+$` + wildCardDomainRegex = `^(validateNoWildcardDNS\.).+\.?$` +) + +// ValidateDomainNameFormat validates that the provided domain or FQDN conforms to DNS naming rules. +// Returns 0 and nil on success, or an HTTP status code and error on failure. +func ValidateDomainNameFormat(dnsDomainName string) (int32, error) { + domainName := dnsDomainName + wildCardMatched, wildCardMatchErr := regexp.MatchString(wildCardDomainRegex, dnsDomainName) + if wildCardMatchErr == nil && wildCardMatched { + trimmedDomain := strings.TrimPrefix(dnsDomainName, "validateNoWildcardDNS.") + domainName = strings.TrimSuffix(trimmedDomain, ".") + } + + matched, err := regexp.MatchString(baseDomainRegex, domainName) + if err != nil { + return http.StatusInternalServerError, fmt.Errorf("Single DNS base domain validation for %s: %w", dnsDomainName, err) + } + if matched && len(domainName) > 1 && len(domainName) < 63 { + return 0, nil + } + + matched, err = regexp.MatchString(dnsNameRegex, domainName) + if err != nil { + return http.StatusInternalServerError, fmt.Errorf("DNS name validation for %s: %w", dnsDomainName, err) + } + + if !matched || isDottedDecimalDomain(domainName) || len(domainName) > 255 { + return http.StatusBadRequest, fmt.Errorf("DNS format mismatch: %s domain name is not valid. Must match regex [%s], be no more than 255 characters, and not be in dotted decimal format (##.##.##.##)", dnsDomainName, dnsNameRegex) + } + return 0, nil +} + +// RFC 1123 (https://datatracker.ietf.org/doc/html/rfc1123#page-13) +// states that domains cannot resemble the format ##.##.##.## +func isDottedDecimalDomain(domain string) bool { + regex := `([\d]+\.){3}[\d]+` + return regexp.MustCompile(regex).MatchString(domain) +} diff --git a/vendor/github.com/openshift/assisted-service/models/versioned_host_requirements.go b/vendor/github.com/openshift/assisted-service/models/versioned_host_requirements.go index 6fba4d2fc..ce5e814eb 100644 --- a/vendor/github.com/openshift/assisted-service/models/versioned_host_requirements.go +++ b/vendor/github.com/openshift/assisted-service/models/versioned_host_requirements.go @@ -18,6 +18,9 @@ import ( // swagger:model versioned-host-requirements type VersionedHostRequirements struct { + // Arbiter node requirements + ArbiterRequirements *ClusterHostRequirementsDetails `json:"arbiter,omitempty"` + // Edge Worker OpenShift node requirements EdgeWorkerRequirements *ClusterHostRequirementsDetails `json:"edge-worker,omitempty"` @@ -38,6 +41,10 @@ type VersionedHostRequirements struct { func (m *VersionedHostRequirements) Validate(formats strfmt.Registry) error { var res []error + if err := m.validateArbiterRequirements(formats); err != nil { + res = append(res, err) + } + if err := m.validateEdgeWorkerRequirements(formats); err != nil { res = append(res, err) } @@ -60,6 +67,25 @@ func (m *VersionedHostRequirements) Validate(formats strfmt.Registry) error { return nil } +func (m *VersionedHostRequirements) validateArbiterRequirements(formats strfmt.Registry) error { + if swag.IsZero(m.ArbiterRequirements) { // not required + return nil + } + + if m.ArbiterRequirements != nil { + if err := m.ArbiterRequirements.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("arbiter") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("arbiter") + } + return err + } + } + + return nil +} + func (m *VersionedHostRequirements) validateEdgeWorkerRequirements(formats strfmt.Registry) error { if swag.IsZero(m.EdgeWorkerRequirements) { // not required return nil @@ -140,6 +166,10 @@ func (m *VersionedHostRequirements) validateWorkerRequirements(formats strfmt.Re func (m *VersionedHostRequirements) ContextValidate(ctx context.Context, formats strfmt.Registry) error { var res []error + if err := m.contextValidateArbiterRequirements(ctx, formats); err != nil { + res = append(res, err) + } + if err := m.contextValidateEdgeWorkerRequirements(ctx, formats); err != nil { res = append(res, err) } @@ -162,6 +192,22 @@ func (m *VersionedHostRequirements) ContextValidate(ctx context.Context, formats return nil } +func (m *VersionedHostRequirements) contextValidateArbiterRequirements(ctx context.Context, formats strfmt.Registry) error { + + if m.ArbiterRequirements != nil { + if err := m.ArbiterRequirements.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("arbiter") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("arbiter") + } + return err + } + } + + return nil +} + func (m *VersionedHostRequirements) contextValidateEdgeWorkerRequirements(ctx context.Context, formats strfmt.Registry) error { if m.EdgeWorkerRequirements != nil { diff --git a/vendor/github.com/openshift/assisted-service/pkg/validations/validations.go b/vendor/github.com/openshift/assisted-service/pkg/validations/validations.go deleted file mode 100644 index 20b5811a2..000000000 --- a/vendor/github.com/openshift/assisted-service/pkg/validations/validations.go +++ /dev/null @@ -1,209 +0,0 @@ -package validations - -import ( - "crypto/x509" - "encoding/base64" - "fmt" - "net" - "net/http" - "net/url" - "regexp" - "strings" - - "github.com/asaskevich/govalidator" - "github.com/pkg/errors" - "github.com/thoas/go-funk" -) - -const ( - baseDomainRegex = `^[a-z\d]([\-]*[a-z\d]+)+$` - dnsNameRegex = `^([a-z\d]([\-]*[a-z\d]+)*\.)+[a-z\d]+([\-]*[a-z\d]+)+$` - wildCardDomainRegex = `^(validateNoWildcardDNS\.).+\.?$` - hostnameRegex = `^[a-z0-9][a-z0-9\-\.]{0,61}[a-z0-9]$` - installerArgsValuesRegex = `^[A-Za-z0-9@!#$%*()_+-=//.,";':{}\[\]]+$` -) - -var allowedFlags = []string{"--append-karg", "--delete-karg", "-n", "--copy-network", "--network-dir", "--save-partlabel", "--save-partindex", "--image-url", "--image-file"} - -func ValidateInstallerArgs(args []string) error { - argsRe := regexp.MustCompile("^-+.*") - valuesRe := regexp.MustCompile(installerArgsValuesRegex) - - for _, arg := range args { - if argsRe.MatchString(arg) { - if !funk.ContainsString(allowedFlags, arg) { - return fmt.Errorf("found unexpected flag %s for installer - allowed flags are %v", arg, allowedFlags) - } - continue - } - - if !valuesRe.MatchString(arg) { - return fmt.Errorf("found unexpected chars in value %s for installer", arg) - } - } - - return nil -} - -func ValidateDomainNameFormat(dnsDomainName string) (int32, error) { - domainName := dnsDomainName - wildCardMatched, wildCardMatchErr := regexp.MatchString(wildCardDomainRegex, dnsDomainName) - if wildCardMatchErr == nil && wildCardMatched { - trimmedDomain := strings.TrimPrefix(dnsDomainName, "validateNoWildcardDNS.") - domainName = strings.TrimSuffix(trimmedDomain, ".") - } - matched, err := regexp.MatchString(baseDomainRegex, domainName) - if err != nil { - return http.StatusInternalServerError, errors.Wrapf(err, "Single DNS base domain validation for %s", dnsDomainName) - } - if matched && len(domainName) > 1 && len(domainName) < 63 { - return 0, nil - } - matched, err = regexp.MatchString(dnsNameRegex, domainName) - if err != nil { - return http.StatusInternalServerError, errors.Wrapf(err, "DNS name validation for %s", dnsDomainName) - } - - if !matched || isDottedDecimalDomain(domainName) || len(domainName) > 255 { - return http.StatusBadRequest, errors.Errorf( - "DNS format mismatch: %s domain name is not valid. Must match regex [%s], be no more than 255 characters, and not be in dotted decimal format (##.##.##.##)", - dnsDomainName, dnsNameRegex) - } - return 0, nil -} - -func ValidateHostname(name string) error { - matched, err := regexp.MatchString(hostnameRegex, name) - if err != nil { - return errors.Wrapf(err, "Hostname validation for %s", name) - } - if !matched { - return errors.Errorf(`Hostname format mismatch: %s name is not valid. - Hostname must have a maximum length of 64 characters, - start and end with a lowercase alphanumerical character, - and can only contain lowercase alphanumerical characters, dashes, and periods.`, name) - } - return nil -} - -func AllStrings(vs []string, f func(string) bool) bool { - for _, v := range vs { - if !f(v) { - return false - } - } - return true -} - -func ValidateAdditionalNTPSource(commaSeparatedNTPSources string) bool { - return AllStrings(strings.Split(commaSeparatedNTPSources, ","), ValidateNTPSource) -} - -func ValidateNTPSource(ntpSource string) bool { - if addr := net.ParseIP(ntpSource); addr != nil { - return true - } - - if err := ValidateHostname(ntpSource); err == nil { - return true - } - - return false -} - -// ValidateHTTPFormat validates the HTTP and HTTPS format -func ValidateHTTPFormat(theurl string) error { - u, err := url.Parse(theurl) - if err != nil { - return fmt.Errorf("URL '%s' format is not valid: %w", theurl, err) - } - if !(u.Scheme == "http" || u.Scheme == "https") { - return errors.Errorf("The URL scheme must be http(s) and specified in the URL: '%s'", theurl) - } - return nil -} - -// ValidateHTTPProxyFormat validates the HTTP Proxy and HTTPS Proxy format -func ValidateHTTPProxyFormat(proxyURL string) error { - if !govalidator.IsURL(proxyURL) { - return errors.Errorf("Proxy URL format is not valid: '%s'", proxyURL) - } - u, err := url.Parse(proxyURL) - if err != nil { - return errors.Errorf("Proxy URL format is not valid: '%s'", proxyURL) - } - if u.Scheme == "https" { - return errors.Errorf("The URL scheme must be http; https is currently not supported: '%s'", proxyURL) - } - if u.Scheme != "http" { - return errors.Errorf("The URL scheme must be http and specified in the URL: '%s'", proxyURL) - } - return nil -} - -// ValidateNoProxyFormat validates the no-proxy format which should be a comma-separated list -// of destination domain names, domains, IP addresses or other network CIDRs. A domain can be -// prefaced with '.' to include all subdomains of that domain. -func ValidateNoProxyFormat(noProxy string) error { - if noProxy == "*" { - return nil - } - domains := strings.Split(noProxy, ",") - for _, s := range domains { - s = strings.TrimPrefix(s, ".") - if govalidator.IsIP(s) { - continue - } - - if govalidator.IsCIDR(s) { - continue - } - - if govalidator.IsDNSName(s) { - continue - } - return errors.Errorf("NO Proxy format is not valid: '%s'. "+ - "NO Proxy is a comma-separated list of destination domain names, domains, IP addresses or other network CIDRs. "+ - "A domain can be prefaced with '.' to include all subdomains of that domain. Use '*' to bypass proxy for all destinations with OpenShift 4.8 or later.", noProxy) - } - return nil -} - -func ValidateTags(tags string) error { - if tags == "" { - return nil - } - if !AllStrings(strings.Split(tags, ","), IsValidTag) { - errMsg := "Invalid format for Tags: %s. Tags should be a comma-separated list (e.g. tag1,tag2,tag3). " + - "Each tag can consist of the following characters: Alphanumeric (aA-zZ, 0-9), underscore (_) and white-spaces." - return errors.Errorf(errMsg, tags) - } - return nil -} - -func IsValidTag(tag string) bool { - tagRegex := `^\w+( \w+)*$` // word characters and whitespace - return regexp.MustCompile(tagRegex).MatchString(tag) -} - -// ValidateCaCertificate ensures the specified base64 CA certificate -// is valid by trying to decode and parse it. -func ValidateCaCertificate(certificate string) error { - decodedCaCert, err := base64.StdEncoding.DecodeString(certificate) - if err != nil { - return errors.Wrap(err, "failed to decode certificate") - } - caCertPool := x509.NewCertPool() - if ok := caCertPool.AppendCertsFromPEM(decodedCaCert); !ok { - return errors.Errorf("unable to parse certificate") - } - - return nil -} - -// RFC 1123 (https://datatracker.ietf.org/doc/html/rfc1123#page-13) -// states that domains cannot resemble the format ##.##.##.## -func isDottedDecimalDomain(domain string) bool { - regex := `([\d]+\.){3}[\d]+` - return regexp.MustCompile(regex).MatchString(domain) -} diff --git a/vendor/modules.txt b/vendor/modules.txt index 918e4529c..d8f7a052e 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -214,17 +214,15 @@ github.com/onsi/gomega/types # github.com/openshift/api v0.0.0-20231031181504-3be12e93388f ## explicit; go 1.20 github.com/openshift/api/config/v1 -# github.com/openshift/assisted-service v1.0.10-0.20240506174859-4577ef6f4cf1 -## explicit; go 1.20 -github.com/openshift/assisted-service/pkg/validations # github.com/openshift/assisted-service/api v0.0.0 => github.com/openshift/assisted-service/api v0.0.0-20240506174859-4577ef6f4cf1 ## explicit; go 1.20 github.com/openshift/assisted-service/api/common github.com/openshift/assisted-service/api/hiveextension/v1beta1 github.com/openshift/assisted-service/api/v1beta1 -# github.com/openshift/assisted-service/models v0.0.0 => github.com/openshift/assisted-service/models v0.0.0-20240506174859-4577ef6f4cf1 -## explicit; go 1.20 +# github.com/openshift/assisted-service/models v0.0.0 => github.com/openshift/assisted-service/models v0.0.0-20251008122257-ed1e53465867 +## explicit; go 1.21 github.com/openshift/assisted-service/models +github.com/openshift/assisted-service/models/validations # github.com/openshift/cluster-api-provider-agent/api v0.0.0-20230918065757-81658c4ddf2f => ./api ## explicit; go 1.21 github.com/openshift/cluster-api-provider-agent/api/v1alpha1 @@ -273,6 +271,8 @@ github.com/sirupsen/logrus # github.com/spf13/pflag v1.0.6-0.20210604193023-d5e0c0615ace ## explicit; go 1.12 github.com/spf13/pflag +# github.com/stretchr/testify v1.9.0 +## explicit; go 1.17 # github.com/thoas/go-funk v0.9.3 ## explicit; go 1.13 github.com/thoas/go-funk @@ -353,6 +353,10 @@ golang.org/x/time/rate # gomodules.xyz/jsonpatch/v2 v2.4.0 ## explicit; go 1.20 gomodules.xyz/jsonpatch/v2 +# google.golang.org/genproto/googleapis/api v0.0.0-20230711160842-782d3b101e98 +## explicit; go 1.19 +# google.golang.org/genproto/googleapis/rpc v0.0.0-20230711160842-782d3b101e98 +## explicit; go 1.19 # google.golang.org/protobuf v1.31.0 ## explicit; go 1.11 google.golang.org/protobuf/encoding/prototext @@ -524,6 +528,8 @@ k8s.io/apimachinery/pkg/version k8s.io/apimachinery/pkg/watch k8s.io/apimachinery/third_party/forked/golang/json k8s.io/apimachinery/third_party/forked/golang/reflect +# k8s.io/apiserver v0.28.4 +## explicit; go 1.20 # k8s.io/client-go v0.28.4 ## explicit; go 1.20 k8s.io/client-go/applyconfigurations/admissionregistration/v1 @@ -792,6 +798,6 @@ sigs.k8s.io/structured-merge-diff/v4/value sigs.k8s.io/yaml sigs.k8s.io/yaml/goyaml.v2 # github.com/openshift/assisted-service/api => github.com/openshift/assisted-service/api v0.0.0-20240506174859-4577ef6f4cf1 -# github.com/openshift/assisted-service/models => github.com/openshift/assisted-service/models v0.0.0-20240506174859-4577ef6f4cf1 +# github.com/openshift/assisted-service/models => github.com/openshift/assisted-service/models v0.0.0-20251008122257-ed1e53465867 # github.com/openshift/cluster-api-provider-agent/api => ./api # golang.org/x/oauth2 => github.com/openshift/golang-oauth2 v0.26.1-0.20250310184649-06a918c6239d