From 271f7a5180c32e79fd31c538d7e67ad41886e9c7 Mon Sep 17 00:00:00 2001 From: Brandon Palm Date: Thu, 23 Jul 2026 11:45:33 -0500 Subject: [PATCH 1/4] OCPBUGS-85579: Move Console resources from bundle to runtime with CRD discovery Move Console resource creation (ConsoleYAMLSample, ConsoleQuickStart) from the OLM bundle to operator runtime, fixing installs on consoleless clusters where OLM fails with "GroupVersionKind console.openshift.io/v1 not found". At startup, the operator uses ResourceDiscoverer to check if Console CRDs exist. If present, the console resources controller is created and applies resources using the typed console clientset. If absent (MicroShift, consoleless RAN/SNO), the controller is never started. Day-2 console enablement is picked up on operator restart. Key changes: - Use typed consoleclient.Interface instead of dynamic.Interface - CRD existence discovery at startup via utils.NewResourceDiscoverer - Console controller conditionally created in CertManagerControllerSet - Remove ClusterVersion capability polling (no more per-sync API calls) - Remove clusterversions RBAC (no longer needed) - Console assets loaded via generic loadAssets[T] with sigs.k8s.io/yaml --- .../cert-manager-acme-issuer-sample.yaml | 2 - .../cert-manager-certificate-sample.yaml | 2 - .../cert-manager-example-quickstart.yaml | 5 - .../console/cert-manager-issuer-sample.yaml | 2 - ...ole.openshift.io_v1_consoleyamlsample.yaml | 28 - ...ole.openshift.io_v1_consoleyamlsample.yaml | 26 - ...ole.openshift.io_v1_consolequickstart.yaml | 203 ---- ...ole.openshift.io_v1_consoleyamlsample.yaml | 20 - ...anager-operator.clusterserviceversion.yaml | 9 + config/console/kustomization.yaml | 6 - config/manifests/kustomization.yaml | 1 - config/rbac/role.yaml | 9 + .../cert_manager_controller_set.go | 15 +- .../cert_manager_controller_set_test.go | 55 ++ .../certmanager/console_resources.go | 158 ++++ .../certmanager/console_resources_test.go | 464 +++++++++ pkg/operator/assets/bindata.go | 346 +++++++ pkg/operator/starter.go | 16 + pkg/operator/utils/apidiscovery_test.go | 64 ++ test/e2e/console_resources_test.go | 126 +++ test/go.mod | 5 + test/go.sum | 12 + .../console/v1/applicationmenuspec.go | 32 + .../console/v1/clidownloadlink.go | 32 + .../console/v1/consoleclidownload.go | 254 +++++ .../console/v1/consoleclidownloadspec.go | 46 + .../console/v1/consoleexternalloglink.go | 254 +++++ .../console/v1/consoleexternalloglinkspec.go | 41 + .../console/v1/consolelink.go | 254 +++++ .../console/v1/consolelinkspec.go | 62 ++ .../console/v1/consolenotification.go | 254 +++++ .../console/v1/consolenotificationspec.go | 63 ++ .../console/v1/consoleplugin.go | 254 +++++ .../console/v1/consolepluginbackend.go | 36 + .../console/v1/consoleplugincsp.go | 38 + .../console/v1/consoleplugini18n.go | 27 + .../console/v1/consolepluginproxy.go | 54 ++ .../console/v1/consolepluginproxyendpoint.go | 36 + .../v1/consolepluginproxyserviceconfig.go | 41 + .../console/v1/consolepluginservice.go | 50 + .../console/v1/consolepluginspec.go | 69 ++ .../console/v1/consolequickstart.go | 254 +++++ .../console/v1/consolequickstartspec.go | 130 +++ .../console/v1/consolequickstarttask.go | 50 + .../console/v1/consolequickstarttaskreview.go | 32 + .../v1/consolequickstarttasksummary.go | 32 + .../console/v1/consolesample.go | 254 +++++ .../v1/consolesamplecontainerimportsource.go | 32 + ...nsolesamplecontainerimportsourceservice.go | 23 + .../v1/consolesamplegitimportsource.go | 32 + .../consolesamplegitimportsourcerepository.go | 41 + .../v1/consolesamplegitimportsourceservice.go | 23 + .../console/v1/consolesamplesource.go | 45 + .../console/v1/consolesamplespec.go | 88 ++ .../console/v1/consoleyamlsample.go | 254 +++++ .../console/v1/consoleyamlsamplespec.go | 64 ++ .../applyconfigurations/console/v1/link.go | 32 + .../console/v1/namespacedashboardspec.go | 38 + .../applyconfigurations/internal/internal.go | 888 ++++++++++++++++++ .../console/applyconfigurations/utils.go | 98 ++ .../console/clientset/versioned/clientset.go | 104 ++ .../versioned/fake/clientset_generated.go | 115 +++ .../console/clientset/versioned/fake/doc.go | 4 + .../clientset/versioned/fake/register.go | 40 + .../console/clientset/versioned/scheme/doc.go | 4 + .../clientset/versioned/scheme/register.go | 40 + .../typed/console/v1/console_client.go | 120 +++ .../typed/console/v1/consoleclidownload.go | 54 ++ .../console/v1/consoleexternalloglink.go | 54 ++ .../versioned/typed/console/v1/consolelink.go | 54 ++ .../typed/console/v1/consolenotification.go | 54 ++ .../typed/console/v1/consoleplugin.go | 54 ++ .../typed/console/v1/consolequickstart.go | 54 ++ .../typed/console/v1/consolesample.go | 54 ++ .../typed/console/v1/consoleyamlsample.go | 54 ++ .../versioned/typed/console/v1/doc.go | 4 + .../versioned/typed/console/v1/fake/doc.go | 4 + .../console/v1/fake/fake_console_client.go | 52 + .../v1/fake/fake_consoleclidownload.go | 37 + .../v1/fake/fake_consoleexternalloglink.go | 37 + .../typed/console/v1/fake/fake_consolelink.go | 33 + .../v1/fake/fake_consolenotification.go | 37 + .../console/v1/fake/fake_consoleplugin.go | 35 + .../console/v1/fake/fake_consolequickstart.go | 37 + .../console/v1/fake/fake_consolesample.go | 35 + .../console/v1/fake/fake_consoleyamlsample.go | 37 + .../typed/console/v1/generated_expansion.go | 19 + vendor/modules.txt | 8 + 88 files changed, 6818 insertions(+), 297 deletions(-) rename {config => bindata}/console/cert-manager-acme-issuer-sample.yaml (92%) rename {config => bindata}/console/cert-manager-certificate-sample.yaml (90%) rename {config => bindata}/console/cert-manager-example-quickstart.yaml (97%) rename {config => bindata}/console/cert-manager-issuer-sample.yaml (88%) delete mode 100644 bundle/manifests/cert-manager-acme-issuer-sample_console.openshift.io_v1_consoleyamlsample.yaml delete mode 100644 bundle/manifests/cert-manager-certificate-sample_console.openshift.io_v1_consoleyamlsample.yaml delete mode 100644 bundle/manifests/cert-manager-example_console.openshift.io_v1_consolequickstart.yaml delete mode 100644 bundle/manifests/cert-manager-issuer-sample_console.openshift.io_v1_consoleyamlsample.yaml delete mode 100644 config/console/kustomization.yaml create mode 100644 pkg/controller/certmanager/cert_manager_controller_set_test.go create mode 100644 pkg/controller/certmanager/console_resources.go create mode 100644 pkg/controller/certmanager/console_resources_test.go create mode 100644 test/e2e/console_resources_test.go create mode 100644 vendor/github.com/openshift/client-go/console/applyconfigurations/console/v1/applicationmenuspec.go create mode 100644 vendor/github.com/openshift/client-go/console/applyconfigurations/console/v1/clidownloadlink.go create mode 100644 vendor/github.com/openshift/client-go/console/applyconfigurations/console/v1/consoleclidownload.go create mode 100644 vendor/github.com/openshift/client-go/console/applyconfigurations/console/v1/consoleclidownloadspec.go create mode 100644 vendor/github.com/openshift/client-go/console/applyconfigurations/console/v1/consoleexternalloglink.go create mode 100644 vendor/github.com/openshift/client-go/console/applyconfigurations/console/v1/consoleexternalloglinkspec.go create mode 100644 vendor/github.com/openshift/client-go/console/applyconfigurations/console/v1/consolelink.go create mode 100644 vendor/github.com/openshift/client-go/console/applyconfigurations/console/v1/consolelinkspec.go create mode 100644 vendor/github.com/openshift/client-go/console/applyconfigurations/console/v1/consolenotification.go create mode 100644 vendor/github.com/openshift/client-go/console/applyconfigurations/console/v1/consolenotificationspec.go create mode 100644 vendor/github.com/openshift/client-go/console/applyconfigurations/console/v1/consoleplugin.go create mode 100644 vendor/github.com/openshift/client-go/console/applyconfigurations/console/v1/consolepluginbackend.go create mode 100644 vendor/github.com/openshift/client-go/console/applyconfigurations/console/v1/consoleplugincsp.go create mode 100644 vendor/github.com/openshift/client-go/console/applyconfigurations/console/v1/consoleplugini18n.go create mode 100644 vendor/github.com/openshift/client-go/console/applyconfigurations/console/v1/consolepluginproxy.go create mode 100644 vendor/github.com/openshift/client-go/console/applyconfigurations/console/v1/consolepluginproxyendpoint.go create mode 100644 vendor/github.com/openshift/client-go/console/applyconfigurations/console/v1/consolepluginproxyserviceconfig.go create mode 100644 vendor/github.com/openshift/client-go/console/applyconfigurations/console/v1/consolepluginservice.go create mode 100644 vendor/github.com/openshift/client-go/console/applyconfigurations/console/v1/consolepluginspec.go create mode 100644 vendor/github.com/openshift/client-go/console/applyconfigurations/console/v1/consolequickstart.go create mode 100644 vendor/github.com/openshift/client-go/console/applyconfigurations/console/v1/consolequickstartspec.go create mode 100644 vendor/github.com/openshift/client-go/console/applyconfigurations/console/v1/consolequickstarttask.go create mode 100644 vendor/github.com/openshift/client-go/console/applyconfigurations/console/v1/consolequickstarttaskreview.go create mode 100644 vendor/github.com/openshift/client-go/console/applyconfigurations/console/v1/consolequickstarttasksummary.go create mode 100644 vendor/github.com/openshift/client-go/console/applyconfigurations/console/v1/consolesample.go create mode 100644 vendor/github.com/openshift/client-go/console/applyconfigurations/console/v1/consolesamplecontainerimportsource.go create mode 100644 vendor/github.com/openshift/client-go/console/applyconfigurations/console/v1/consolesamplecontainerimportsourceservice.go create mode 100644 vendor/github.com/openshift/client-go/console/applyconfigurations/console/v1/consolesamplegitimportsource.go create mode 100644 vendor/github.com/openshift/client-go/console/applyconfigurations/console/v1/consolesamplegitimportsourcerepository.go create mode 100644 vendor/github.com/openshift/client-go/console/applyconfigurations/console/v1/consolesamplegitimportsourceservice.go create mode 100644 vendor/github.com/openshift/client-go/console/applyconfigurations/console/v1/consolesamplesource.go create mode 100644 vendor/github.com/openshift/client-go/console/applyconfigurations/console/v1/consolesamplespec.go create mode 100644 vendor/github.com/openshift/client-go/console/applyconfigurations/console/v1/consoleyamlsample.go create mode 100644 vendor/github.com/openshift/client-go/console/applyconfigurations/console/v1/consoleyamlsamplespec.go create mode 100644 vendor/github.com/openshift/client-go/console/applyconfigurations/console/v1/link.go create mode 100644 vendor/github.com/openshift/client-go/console/applyconfigurations/console/v1/namespacedashboardspec.go create mode 100644 vendor/github.com/openshift/client-go/console/applyconfigurations/internal/internal.go create mode 100644 vendor/github.com/openshift/client-go/console/applyconfigurations/utils.go create mode 100644 vendor/github.com/openshift/client-go/console/clientset/versioned/clientset.go create mode 100644 vendor/github.com/openshift/client-go/console/clientset/versioned/fake/clientset_generated.go create mode 100644 vendor/github.com/openshift/client-go/console/clientset/versioned/fake/doc.go create mode 100644 vendor/github.com/openshift/client-go/console/clientset/versioned/fake/register.go create mode 100644 vendor/github.com/openshift/client-go/console/clientset/versioned/scheme/doc.go create mode 100644 vendor/github.com/openshift/client-go/console/clientset/versioned/scheme/register.go create mode 100644 vendor/github.com/openshift/client-go/console/clientset/versioned/typed/console/v1/console_client.go create mode 100644 vendor/github.com/openshift/client-go/console/clientset/versioned/typed/console/v1/consoleclidownload.go create mode 100644 vendor/github.com/openshift/client-go/console/clientset/versioned/typed/console/v1/consoleexternalloglink.go create mode 100644 vendor/github.com/openshift/client-go/console/clientset/versioned/typed/console/v1/consolelink.go create mode 100644 vendor/github.com/openshift/client-go/console/clientset/versioned/typed/console/v1/consolenotification.go create mode 100644 vendor/github.com/openshift/client-go/console/clientset/versioned/typed/console/v1/consoleplugin.go create mode 100644 vendor/github.com/openshift/client-go/console/clientset/versioned/typed/console/v1/consolequickstart.go create mode 100644 vendor/github.com/openshift/client-go/console/clientset/versioned/typed/console/v1/consolesample.go create mode 100644 vendor/github.com/openshift/client-go/console/clientset/versioned/typed/console/v1/consoleyamlsample.go create mode 100644 vendor/github.com/openshift/client-go/console/clientset/versioned/typed/console/v1/doc.go create mode 100644 vendor/github.com/openshift/client-go/console/clientset/versioned/typed/console/v1/fake/doc.go create mode 100644 vendor/github.com/openshift/client-go/console/clientset/versioned/typed/console/v1/fake/fake_console_client.go create mode 100644 vendor/github.com/openshift/client-go/console/clientset/versioned/typed/console/v1/fake/fake_consoleclidownload.go create mode 100644 vendor/github.com/openshift/client-go/console/clientset/versioned/typed/console/v1/fake/fake_consoleexternalloglink.go create mode 100644 vendor/github.com/openshift/client-go/console/clientset/versioned/typed/console/v1/fake/fake_consolelink.go create mode 100644 vendor/github.com/openshift/client-go/console/clientset/versioned/typed/console/v1/fake/fake_consolenotification.go create mode 100644 vendor/github.com/openshift/client-go/console/clientset/versioned/typed/console/v1/fake/fake_consoleplugin.go create mode 100644 vendor/github.com/openshift/client-go/console/clientset/versioned/typed/console/v1/fake/fake_consolequickstart.go create mode 100644 vendor/github.com/openshift/client-go/console/clientset/versioned/typed/console/v1/fake/fake_consolesample.go create mode 100644 vendor/github.com/openshift/client-go/console/clientset/versioned/typed/console/v1/fake/fake_consoleyamlsample.go create mode 100644 vendor/github.com/openshift/client-go/console/clientset/versioned/typed/console/v1/generated_expansion.go diff --git a/config/console/cert-manager-acme-issuer-sample.yaml b/bindata/console/cert-manager-acme-issuer-sample.yaml similarity index 92% rename from config/console/cert-manager-acme-issuer-sample.yaml rename to bindata/console/cert-manager-acme-issuer-sample.yaml index ae04d2fab..40e3d7e4a 100644 --- a/config/console/cert-manager-acme-issuer-sample.yaml +++ b/bindata/console/cert-manager-acme-issuer-sample.yaml @@ -2,8 +2,6 @@ apiVersion: console.openshift.io/v1 kind: ConsoleYAMLSample metadata: name: cert-manager-acme-issuer-sample - annotations: - capability.openshift.io/name: Console spec: targetResource: apiVersion: cert-manager.io/v1 diff --git a/config/console/cert-manager-certificate-sample.yaml b/bindata/console/cert-manager-certificate-sample.yaml similarity index 90% rename from config/console/cert-manager-certificate-sample.yaml rename to bindata/console/cert-manager-certificate-sample.yaml index 23b565989..b83b514ac 100644 --- a/config/console/cert-manager-certificate-sample.yaml +++ b/bindata/console/cert-manager-certificate-sample.yaml @@ -2,8 +2,6 @@ apiVersion: console.openshift.io/v1 kind: ConsoleYAMLSample metadata: name: cert-manager-certificate-sample - annotations: - capability.openshift.io/name: Console spec: targetResource: apiVersion: cert-manager.io/v1 diff --git a/config/console/cert-manager-example-quickstart.yaml b/bindata/console/cert-manager-example-quickstart.yaml similarity index 97% rename from config/console/cert-manager-example-quickstart.yaml rename to bindata/console/cert-manager-example-quickstart.yaml index f1f192aa3..127c2b206 100644 --- a/config/console/cert-manager-example-quickstart.yaml +++ b/bindata/console/cert-manager-example-quickstart.yaml @@ -2,11 +2,6 @@ apiVersion: console.openshift.io/v1 kind: ConsoleQuickStart metadata: name: cert-manager-example - annotations: - capability.openshift.io/name: Console - include.release.openshift.io/ibm-cloud-managed: "true" - include.release.openshift.io/self-managed-high-availability: "true" - include.release.openshift.io/single-node-developer: "true" spec: displayName: cert-manager Operator for Red Hat OpenShift Example tags: diff --git a/config/console/cert-manager-issuer-sample.yaml b/bindata/console/cert-manager-issuer-sample.yaml similarity index 88% rename from config/console/cert-manager-issuer-sample.yaml rename to bindata/console/cert-manager-issuer-sample.yaml index 3100ed5b7..3bc9ebd71 100644 --- a/config/console/cert-manager-issuer-sample.yaml +++ b/bindata/console/cert-manager-issuer-sample.yaml @@ -2,8 +2,6 @@ apiVersion: console.openshift.io/v1 kind: ConsoleYAMLSample metadata: name: cert-manager-issuer-sample - annotations: - capability.openshift.io/name: Console spec: targetResource: apiVersion: cert-manager.io/v1 diff --git a/bundle/manifests/cert-manager-acme-issuer-sample_console.openshift.io_v1_consoleyamlsample.yaml b/bundle/manifests/cert-manager-acme-issuer-sample_console.openshift.io_v1_consoleyamlsample.yaml deleted file mode 100644 index 31f27a2e0..000000000 --- a/bundle/manifests/cert-manager-acme-issuer-sample_console.openshift.io_v1_consoleyamlsample.yaml +++ /dev/null @@ -1,28 +0,0 @@ -apiVersion: console.openshift.io/v1 -kind: ConsoleYAMLSample -metadata: - annotations: - capability.openshift.io/name: Console - name: cert-manager-acme-issuer-sample -spec: - description: An example ACME Issuer for Let's Encrypt production certificates with - HTTP-01 challenge - targetResource: - apiVersion: cert-manager.io/v1 - kind: Issuer - title: Example ACME Issuer (Let's Encrypt) - yaml: |- - apiVersion: cert-manager.io/v1 - kind: Issuer - metadata: - name: letsencrypt-prod - namespace: default - spec: - acme: - server: https://acme-v02.api.letsencrypt.org/directory - privateKeySecretRef: - name: letsencrypt-prod-account-key - solvers: - - http01: - ingress: - ingressClassName: openshift-default diff --git a/bundle/manifests/cert-manager-certificate-sample_console.openshift.io_v1_consoleyamlsample.yaml b/bundle/manifests/cert-manager-certificate-sample_console.openshift.io_v1_consoleyamlsample.yaml deleted file mode 100644 index 64b78b490..000000000 --- a/bundle/manifests/cert-manager-certificate-sample_console.openshift.io_v1_consoleyamlsample.yaml +++ /dev/null @@ -1,26 +0,0 @@ -apiVersion: console.openshift.io/v1 -kind: ConsoleYAMLSample -metadata: - annotations: - capability.openshift.io/name: Console - name: cert-manager-certificate-sample -spec: - description: A simple Certificate example - targetResource: - apiVersion: cert-manager.io/v1 - kind: Certificate - title: Example Certificate - yaml: |- - apiVersion: cert-manager.io/v1 - kind: Certificate - metadata: - name: example-cert - namespace: default - spec: - secretName: example-tls - commonName: example.com - dnsNames: - - example.com - issuerRef: - name: selfsigned-issuer - kind: Issuer diff --git a/bundle/manifests/cert-manager-example_console.openshift.io_v1_consolequickstart.yaml b/bundle/manifests/cert-manager-example_console.openshift.io_v1_consolequickstart.yaml deleted file mode 100644 index 37847c281..000000000 --- a/bundle/manifests/cert-manager-example_console.openshift.io_v1_consolequickstart.yaml +++ /dev/null @@ -1,203 +0,0 @@ -apiVersion: console.openshift.io/v1 -kind: ConsoleQuickStart -metadata: - annotations: - capability.openshift.io/name: Console - include.release.openshift.io/ibm-cloud-managed: "true" - include.release.openshift.io/self-managed-high-availability: "true" - include.release.openshift.io/single-node-developer: "true" - name: cert-manager-example -spec: - conclusion: |- - Great job! You've successfully created your first Issuer and Certificate. - - ### Next Steps: - - - For production, use Let's Encrypt (ACME Issuer) instead of self-signed certificates - - Explore ClusterIssuer for cluster-wide certificate management - - Check out the [cert-manager documentation](https://docs.redhat.com/en/documentation/openshift_container_platform/latest/html/security_and_compliance/cert-manager-operator-for-red-hat-openshift) to learn more - description: Create and issue TLS certificates using the cert-manager Operator for - Red Hat OpenShift - displayName: cert-manager Operator for Red Hat OpenShift Example - durationMinutes: 10 - introduction: |- - # cert-manager Operator for Red Hat OpenShift - - The cert-manager Operator for Red Hat OpenShift enables you to create and sign TLS certificates from an external PKI for your workloads - running on an OpenShift cluster. - - ### Expected Learning - - With this Quick Start, you will learn about the following CRDs provided by the cert-manager operator: - 1. **Issuer** - defines a certificate authority that can sign certificates - 2. **Certificate** - defines the desired certificate and its properties - - This Quick Start will walk you through creating your first certificate: - - Create a self-signed Issuer (for testing) - - Create a Certificate signed by that Issuer - - View the generated certificate in a Kubernetes Secret - - Learn how to use it in your applications - - **Note**: For production, you would use Let's Encrypt (ACME), HashiCorp Vault, or your organization's CA instead of self-signed certificates. - prerequisites: - - You completed the "Install the cert-manager Operator for Red Hat OpenShift" quick - start. - - You have a namespace in which to deploy the example CRs. - tags: - - example - - operator - - certificates - tasks: - - description: |- - ### To navigate to the installed operator: - 1. Go to the **Installed Operators** from the [Ecosystem]{{highlight qs-nav-ecosystem}} section of the navigation. - 2. In the **Search by name** field, type `cert-manager`. - 3. Look for **cert-manager Operator for Red Hat OpenShift**. If you had completed the prerequisite Quick Start, the tile should appear. - 4. Click on the installed operator - - You will be brought to the **Operator Details** page and be presented with **Provided APIs** - review: - failedTaskHelp: This task isn't verified yet. Try the task again. - instructions: |- - #### Verify you see a list of **Provided APIs**: - The list should include `Issuer`, `ClusterIssuer`, and `Certificate` - summary: - failed: Try the steps again. - success: You are in the right place, and ready to start the rest of the Quick - Start - title: Navigate to installed cert-manager operator - - description: |- - ### Create or select a project to work in - 1. Find the **Project** dropdown menu at the top of the screen. - 2. Select or create the project in which you want to work in. - - **Note**: For this example, we'll create an `Issuer` which is namespace-scoped. If you want to issue certificates - across multiple namespaces, you can create a `ClusterIssuer` instead. - review: - failedTaskHelp: Try the task again. - instructions: '#### Verify the name in the **Project** dropdown menu is the - expected project' - summary: - failed: Try the steps again. - success: You are in the right place. - title: Select a project - - description: |- - ### To create a self-signed Issuer - - An Issuer represents a certificate authority that can sign certificates. We'll create a self-signed Issuer - for this example. This is useful for testing and development. - - 1. Find the `Issuer` Custom Resource in the list of **Provided APIs** or in the top side-scrolling menu bar. - - From the list of **Provided APIs**, click the **Create instance** link. - - From the **top side-scrolling menu bar**, click **Issuer** and then click **Create Issuer**. - - 2. Switch to **YAML view** in the editor. - - 3. On the right sidebar, look for the **Samples** section and select **"Example Self-Signed Issuer"**. - - 4. Click **Try it** to populate the editor with the sample YAML. - - 5. Click the **Create** button to create the Issuer. - review: - failedTaskHelp: This task isn't verified yet. Try the task again. - instructions: |- - #### Verify the Issuer was successfully created: - 1. You should see the Issuer listed with the name `selfsigned-issuer` - 2. Check that the **Ready** condition shows **True** in the Conditions section - summary: - failed: Try the steps again. - success: You just created a self-signed Issuer! Now we can create certificates. - title: Create a self-signed Issuer - - description: |- - ### To create a Certificate - - Now we'll create a certificate that will be signed by our Issuer. - - 1. Find the `Certificate` Custom Resource in the list of **Provided APIs** or in the top side-scrolling menu bar. - - From the list of **Provided APIs**, click the **Create instance** link. - - From the **top side-scrolling menu bar**, click **Certificate** and then click **Create Certificate**. - - 2. Switch to **YAML view** in the editor. - - 3. On the right sidebar, look for the **Samples** section and select **"Example Certificate"**. - - 4. Click **Try it** to populate the editor with the sample YAML. - - 5. Click the **Create** button to create the Certificate. - review: - failedTaskHelp: This task isn't verified yet. Try the task again. - instructions: |- - #### Verify the Certificate was successfully created: - 1. You should see the Certificate listed with the name `example-cert`. - 2. Check that the **Ready** condition shows **True**. - 3. Navigate to the [Workloads]{{highlight qs-nav-workloads}} section and click **Secrets** - 4. You should see a new Secret named `example-tls`. - summary: - failed: Try the steps again. - success: You just created your first certificate! cert-manager has issued it - and stored it in a Secret. - title: Create a Certificate - - description: |- - ### To inspect the certificate - - Let's look at the Secret that contains the certificate. - - 1. Make sure you're in the [Workloads]{{highlight qs-nav-workloads}} section, click **Secrets**. - 2. Click on the **example-tls** Secret. - 3. You should see the certificate data with keys: - - `tls.crt` - The certificate. - - `tls.key` - The private key. - - `ca.crt` - The CA certificate. - review: - failedTaskHelp: This task isn't verified yet. Try the task again. - instructions: |- - #### Verify you can see the certificate data: - Is the Secret `example-tls` present with `tls.crt` and `tls.key`? - summary: - failed: Try the steps again. - success: Great! Your certificate is ready to use. - title: View the certificate - - description: |- - ### How to use certificates - - Now you can use this certificate in your applications. Here's a simple example for an OpenShift Route: - - ```yaml - apiVersion: route.openshift.io/v1 - kind: Route - metadata: - name: my-app - spec: - to: - kind: Service - name: my-service - tls: - termination: edge - externalCertificate: - name: example-tls - ``` - - Or in an Ingress: - - ```yaml - apiVersion: networking.k8s.io/v1 - kind: Ingress - metadata: - name: my-app - spec: - tls: - - secretName: example-tls - rules: - - host: example.com - ``` - - **Note**: cert-manager will automatically renew certificates before they expire! - review: - failedTaskHelp: Review the examples above. - instructions: |- - #### Do you understand how to use certificates? - Certificates can be referenced in Routes and Ingress resources. - summary: - failed: Review the examples again. - success: You now know how to create and use certificates! - title: Use the certificate diff --git a/bundle/manifests/cert-manager-issuer-sample_console.openshift.io_v1_consoleyamlsample.yaml b/bundle/manifests/cert-manager-issuer-sample_console.openshift.io_v1_consoleyamlsample.yaml deleted file mode 100644 index 3e8fffad4..000000000 --- a/bundle/manifests/cert-manager-issuer-sample_console.openshift.io_v1_consoleyamlsample.yaml +++ /dev/null @@ -1,20 +0,0 @@ -apiVersion: console.openshift.io/v1 -kind: ConsoleYAMLSample -metadata: - annotations: - capability.openshift.io/name: Console - name: cert-manager-issuer-sample -spec: - description: A simple self-signed Issuer for development and testing - targetResource: - apiVersion: cert-manager.io/v1 - kind: Issuer - title: Example Self-Signed Issuer - yaml: |- - apiVersion: cert-manager.io/v1 - kind: Issuer - metadata: - name: selfsigned-issuer - namespace: default - spec: - selfSigned: {} diff --git a/bundle/manifests/cert-manager-operator.clusterserviceversion.yaml b/bundle/manifests/cert-manager-operator.clusterserviceversion.yaml index d938526b1..b44a8e6ec 100644 --- a/bundle/manifests/cert-manager-operator.clusterserviceversion.yaml +++ b/bundle/manifests/cert-manager-operator.clusterserviceversion.yaml @@ -577,6 +577,15 @@ spec: - patch - update - watch + - apiGroups: + - console.openshift.io + resources: + - consolequickstarts + - consoleyamlsamples + verbs: + - create + - get + - update - apiGroups: - coordination.k8s.io resources: diff --git a/config/console/kustomization.yaml b/config/console/kustomization.yaml deleted file mode 100644 index 599549b5a..000000000 --- a/config/console/kustomization.yaml +++ /dev/null @@ -1,6 +0,0 @@ -resources: -- cert-manager-example-quickstart.yaml -- cert-manager-issuer-sample.yaml -- cert-manager-certificate-sample.yaml -- cert-manager-acme-issuer-sample.yaml - diff --git a/config/manifests/kustomization.yaml b/config/manifests/kustomization.yaml index 0a4b22e0f..1bbf49121 100644 --- a/config/manifests/kustomization.yaml +++ b/config/manifests/kustomization.yaml @@ -5,7 +5,6 @@ resources: - ../default - ../samples - ../scorecard -- ../console # [WEBHOOK] To enable webhooks, uncomment all the sections with [WEBHOOK] prefix. # Do NOT uncomment sections with prefix [CERTMANAGER], as OLM does not support cert-manager. diff --git a/config/rbac/role.yaml b/config/rbac/role.yaml index ed4472e77..302a8dd11 100644 --- a/config/rbac/role.yaml +++ b/config/rbac/role.yaml @@ -168,6 +168,15 @@ rules: - patch - update - watch +- apiGroups: + - console.openshift.io + resources: + - consolequickstarts + - consoleyamlsamples + verbs: + - create + - get + - update - apiGroups: - coordination.k8s.io resources: diff --git a/pkg/controller/certmanager/cert_manager_controller_set.go b/pkg/controller/certmanager/cert_manager_controller_set.go index 08981cb33..91f8b48a7 100644 --- a/pkg/controller/certmanager/cert_manager_controller_set.go +++ b/pkg/controller/certmanager/cert_manager_controller_set.go @@ -5,6 +5,7 @@ import ( "k8s.io/client-go/kubernetes" configinformers "github.com/openshift/client-go/config/informers/externalversions" + consoleclient "github.com/openshift/client-go/console/clientset/versioned" "github.com/openshift/library-go/pkg/controller/factory" "github.com/openshift/library-go/pkg/operator/events" "github.com/openshift/library-go/pkg/operator/resource/resourceapply" @@ -24,6 +25,7 @@ type CertManagerControllerSet struct { certManagerCAInjectorDeploymentController factory.Controller certManagerNetworkPolicyStaticResourcesController factory.Controller certManagerNetworkPolicyUserDefinedController factory.Controller + consoleResourcesController factory.Controller } func NewCertManagerControllerSet( @@ -34,13 +36,14 @@ func NewCertManagerControllerSet( operatorClient v1helpers.OperatorClientWithFinalizers, certManagerOperatorInformers certmanoperatorinformers.SharedInformerFactory, kubeClientContainer *resourceapply.ClientHolder, + consoleClient consoleclient.Interface, eventRecorder events.Recorder, targetVersion string, versionRecorder status.VersionGetter, trustedCAConfigmapName, cloudCredentialsSecretName string, ) *CertManagerControllerSet { - return &CertManagerControllerSet{ + set := &CertManagerControllerSet{ certManagerControllerStaticResourcesController: NewCertManagerControllerStaticResourcesController(operatorClient, kubeClientContainer, kubeInformersForNamespaces, eventRecorder), certManagerControllerDeploymentController: NewCertManagerControllerDeploymentController(operatorClient, certManagerOperatorInformers, infraInformers, kubeClient, kubeInformersForTargetNamespace, eventRecorder, targetVersion, versionRecorder, trustedCAConfigmapName, cloudCredentialsSecretName), certManagerWebhookStaticResourcesController: NewCertManagerWebhookStaticResourcesController(operatorClient, kubeClientContainer, kubeInformersForNamespaces, eventRecorder), @@ -50,10 +53,14 @@ func NewCertManagerControllerSet( certManagerNetworkPolicyStaticResourcesController: NewCertManagerNetworkPolicyStaticResourcesController(operatorClient, kubeClientContainer, kubeInformersForNamespaces, certManagerOperatorInformers, eventRecorder), certManagerNetworkPolicyUserDefinedController: NewCertManagerNetworkPolicyUserDefinedController(operatorClient, certManagerOperatorInformers, kubeClient, kubeInformersForNamespaces, eventRecorder), } + if consoleClient != nil { + set.consoleResourcesController = NewConsoleResourcesController(operatorClient, consoleClient, eventRecorder) + } + return set } func (c *CertManagerControllerSet) ToArray() []factory.Controller { - return []factory.Controller{ + controllers := []factory.Controller{ c.certManagerControllerStaticResourcesController, c.certManagerControllerDeploymentController, c.certManagerWebhookStaticResourcesController, @@ -63,4 +70,8 @@ func (c *CertManagerControllerSet) ToArray() []factory.Controller { c.certManagerNetworkPolicyStaticResourcesController, c.certManagerNetworkPolicyUserDefinedController, } + if c.consoleResourcesController != nil { + controllers = append(controllers, c.consoleResourcesController) + } + return controllers } diff --git a/pkg/controller/certmanager/cert_manager_controller_set_test.go b/pkg/controller/certmanager/cert_manager_controller_set_test.go new file mode 100644 index 000000000..87a68b42a --- /dev/null +++ b/pkg/controller/certmanager/cert_manager_controller_set_test.go @@ -0,0 +1,55 @@ +package certmanager + +import ( + "context" + "testing" + + "github.com/openshift/library-go/pkg/controller/factory" +) + +type stubController struct{} + +func (s *stubController) Run(ctx context.Context, workers int) {} +func (s *stubController) Sync(ctx context.Context, syncContext factory.SyncContext) error { return nil } +func (s *stubController) Name() string { return "stub" } + +func TestToArrayConsoleControllerInclusion(t *testing.T) { + stub := &stubController{} + + tests := []struct { + name string + includeConsole bool + wantCount int + }{ + {name: "with console controller", includeConsole: true, wantCount: 9}, + {name: "without console controller", includeConsole: false, wantCount: 8}, + } + + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + set := &CertManagerControllerSet{ + certManagerControllerStaticResourcesController: stub, + certManagerControllerDeploymentController: stub, + certManagerWebhookStaticResourcesController: stub, + certManagerWebhookDeploymentController: stub, + certManagerCAInjectorStaticResourcesController: stub, + certManagerCAInjectorDeploymentController: stub, + certManagerNetworkPolicyStaticResourcesController: stub, + certManagerNetworkPolicyUserDefinedController: stub, + } + if tt.includeConsole { + set.consoleResourcesController = stub + } + + controllers := set.ToArray() + if len(controllers) != tt.wantCount { + t.Errorf("ToArray() returned %d controllers, want %d", len(controllers), tt.wantCount) + } + for i, c := range controllers { + if c == nil { + t.Errorf("ToArray()[%d] is nil", i) + } + } + }) + } +} diff --git a/pkg/controller/certmanager/console_resources.go b/pkg/controller/certmanager/console_resources.go new file mode 100644 index 000000000..a1bbf7331 --- /dev/null +++ b/pkg/controller/certmanager/console_resources.go @@ -0,0 +1,158 @@ +package certmanager + +import ( + "context" + "errors" + "fmt" + "time" + + "k8s.io/apimachinery/pkg/api/equality" + apierrors "k8s.io/apimachinery/pkg/api/errors" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/runtime/schema" + sigyaml "sigs.k8s.io/yaml" + + consolev1 "github.com/openshift/api/console/v1" + consoleclient "github.com/openshift/client-go/console/clientset/versioned" + "github.com/openshift/library-go/pkg/controller/factory" + "github.com/openshift/library-go/pkg/operator/events" + "github.com/openshift/library-go/pkg/operator/v1helpers" + + "github.com/openshift/cert-manager-operator/pkg/operator/assets" +) + +const ( + consoleResourcesControllerName = operatorName + "-console-resources" +) + +var ( + ConsoleYAMLSampleGVR = schema.GroupVersionResource{ + Group: "console.openshift.io", + Version: "v1", + Resource: "consoleyamlsamples", + } + + ConsoleQuickStartGVR = schema.GroupVersionResource{ + Group: "console.openshift.io", + Version: "v1", + Resource: "consolequickstarts", + } + + yamlSampleAssetFiles = []string{ + "console/cert-manager-acme-issuer-sample.yaml", + "console/cert-manager-certificate-sample.yaml", + "console/cert-manager-issuer-sample.yaml", + } + + quickStartAssetFiles = []string{ + "console/cert-manager-example-quickstart.yaml", + } +) + +// +kubebuilder:rbac:groups=console.openshift.io,resources=consoleyamlsamples;consolequickstarts,verbs=get;create;update + +type consoleResourcesController struct { + consoleClient consoleclient.Interface + eventRecorder events.Recorder + yamlSamples []*consolev1.ConsoleYAMLSample + quickStarts []*consolev1.ConsoleQuickStart +} + +func loadAssets[T any](files []string) []*T { + result := make([]*T, 0, len(files)) + for _, file := range files { + data, err := assets.Asset(file) + if err != nil { + panic(fmt.Sprintf("failed to read console asset %s: %v", file, err)) + } + var obj T + if err := sigyaml.UnmarshalStrict(data, &obj); err != nil { + panic(fmt.Sprintf("failed to decode console asset %s: %v", file, err)) + } + result = append(result, &obj) + } + return result +} + +func NewConsoleResourcesController( + operatorClient v1helpers.OperatorClient, + consoleClient consoleclient.Interface, + eventRecorder events.Recorder, +) factory.Controller { + c := &consoleResourcesController{ + consoleClient: consoleClient, + eventRecorder: eventRecorder.WithComponentSuffix("console-resources"), + yamlSamples: loadAssets[consolev1.ConsoleYAMLSample](yamlSampleAssetFiles), + quickStarts: loadAssets[consolev1.ConsoleQuickStart](quickStartAssetFiles), + } + + return factory.New(). + WithInformers(operatorClient.Informer()). + ResyncEvery(10*time.Minute). + WithSync(c.sync). + ToController(consoleResourcesControllerName, c.eventRecorder) +} + +func (c *consoleResourcesController) sync(ctx context.Context, _ factory.SyncContext) error { + var errs []error + + yamlClient := c.consoleClient.ConsoleV1().ConsoleYAMLSamples() + for _, desired := range c.yamlSamples { + if err := applyConsoleResource(ctx, c.eventRecorder, "ConsoleYAMLSample", desired.Name, desired, + yamlClient.Get, yamlClient.Create, yamlClient.Update, + func(a, b *consolev1.ConsoleYAMLSample) bool { return equality.Semantic.DeepEqual(a.Spec, b.Spec) }, + func(existing, desired *consolev1.ConsoleYAMLSample) *consolev1.ConsoleYAMLSample { + u := existing.DeepCopy(); u.Spec = desired.Spec; return u + }, + ); err != nil { + errs = append(errs, fmt.Errorf("failed to apply ConsoleYAMLSample/%s: %w", desired.Name, err)) + } + } + + qsClient := c.consoleClient.ConsoleV1().ConsoleQuickStarts() + for _, desired := range c.quickStarts { + if err := applyConsoleResource(ctx, c.eventRecorder, "ConsoleQuickStart", desired.Name, desired, + qsClient.Get, qsClient.Create, qsClient.Update, + func(a, b *consolev1.ConsoleQuickStart) bool { return equality.Semantic.DeepEqual(a.Spec, b.Spec) }, + func(existing, desired *consolev1.ConsoleQuickStart) *consolev1.ConsoleQuickStart { + u := existing.DeepCopy(); u.Spec = desired.Spec; return u + }, + ); err != nil { + errs = append(errs, fmt.Errorf("failed to apply ConsoleQuickStart/%s: %w", desired.Name, err)) + } + } + + return errors.Join(errs...) +} + +func applyConsoleResource[T any]( + ctx context.Context, + recorder events.Recorder, + kind, name string, + desired *T, + get func(context.Context, string, metav1.GetOptions) (*T, error), + create func(context.Context, *T, metav1.CreateOptions) (*T, error), + update func(context.Context, *T, metav1.UpdateOptions) (*T, error), + specsEqual func(existing, desired *T) bool, + withDesiredSpec func(existing, desired *T) *T, +) error { + existing, err := get(ctx, name, metav1.GetOptions{}) + if apierrors.IsNotFound(err) { + if _, err = create(ctx, desired, metav1.CreateOptions{}); err != nil { + return err + } + recorder.Eventf(kind+"Created", "Created %s %q", kind, name) + return nil + } + if err != nil { + return err + } + if specsEqual(existing, desired) { + return nil + } + if _, err = update(ctx, withDesiredSpec(existing, desired), metav1.UpdateOptions{}); err != nil { + return err + } + recorder.Eventf(kind+"Updated", "Updated %s %q", kind, name) + return nil +} diff --git a/pkg/controller/certmanager/console_resources_test.go b/pkg/controller/certmanager/console_resources_test.go new file mode 100644 index 000000000..e3763acd6 --- /dev/null +++ b/pkg/controller/certmanager/console_resources_test.go @@ -0,0 +1,464 @@ +package certmanager + +import ( + "context" + "fmt" + "strings" + "testing" + + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/runtime" + clienttesting "k8s.io/client-go/testing" + "k8s.io/utils/clock" + + consolev1 "github.com/openshift/api/console/v1" + consolefake "github.com/openshift/client-go/console/clientset/versioned/fake" + "github.com/openshift/library-go/pkg/operator/events" +) + +func newTestController(t *testing.T, consoleClient *consolefake.Clientset) *consoleResourcesController { + t.Helper() + return &consoleResourcesController{ + consoleClient: consoleClient, + eventRecorder: events.NewInMemoryRecorder("test", clock.RealClock{}), + yamlSamples: loadAssets[consolev1.ConsoleYAMLSample](yamlSampleAssetFiles), + quickStarts: loadAssets[consolev1.ConsoleQuickStart](quickStartAssetFiles), + } +} + +func TestSyncCreatesResources(t *testing.T) { + consoleClient := consolefake.NewClientset() + + c := newTestController(t, consoleClient) + + err := c.sync(context.Background(), nil) + if err != nil { + t.Fatalf("sync() returned error: %v", err) + } + + samples, err := consoleClient.ConsoleV1().ConsoleYAMLSamples().List(context.Background(), metav1.ListOptions{}) + if err != nil { + t.Fatalf("failed to list ConsoleYAMLSamples: %v", err) + } + if len(samples.Items) != len(yamlSampleAssetFiles) { + t.Errorf("expected %d ConsoleYAMLSamples, got %d", len(yamlSampleAssetFiles), len(samples.Items)) + } + + quickStarts, err := consoleClient.ConsoleV1().ConsoleQuickStarts().List(context.Background(), metav1.ListOptions{}) + if err != nil { + t.Fatalf("failed to list ConsoleQuickStarts: %v", err) + } + if len(quickStarts.Items) != len(quickStartAssetFiles) { + t.Errorf("expected %d ConsoleQuickStarts, got %d", len(quickStartAssetFiles), len(quickStarts.Items)) + } +} + +func TestSyncAttemptsAllAssetsOnError(t *testing.T) { + consoleClient := consolefake.NewClientset() + + consoleClient.PrependReactor("get", "*", func(action clienttesting.Action) (bool, runtime.Object, error) { + return true, nil, fmt.Errorf("simulated error") + }) + + c := newTestController(t, consoleClient) + totalAssets := len(c.yamlSamples) + len(c.quickStarts) + + err := c.sync(context.Background(), nil) + if err == nil { + t.Fatal("sync() should return error when all assets fail") + } + + getActions := 0 + for _, action := range consoleClient.Actions() { + if action.GetVerb() == "get" { + getActions++ + } + } + + if getActions < totalAssets { + t.Errorf("expected at least %d get actions (one per asset), got %d; sync may be aborting early", + totalAssets, getActions) + } +} + +func TestSyncNoAssetsNoError(t *testing.T) { + consoleClient := consolefake.NewClientset() + + c := &consoleResourcesController{ + consoleClient: consoleClient, + eventRecorder: events.NewInMemoryRecorder("test", clock.RealClock{}), + } + + if err := c.sync(context.Background(), nil); err != nil { + t.Fatalf("sync() with no assets should succeed, got: %v", err) + } + + if len(consoleClient.Actions()) != 0 { + t.Errorf("expected no console client actions with empty assets, got %d", len(consoleClient.Actions())) + } +} + +func TestSyncIdempotent(t *testing.T) { + consoleClient := consolefake.NewClientset() + + c := newTestController(t, consoleClient) + + if err := c.sync(context.Background(), nil); err != nil { + t.Fatalf("first sync() failed: %v", err) + } + + if err := c.sync(context.Background(), nil); err != nil { + t.Fatalf("second sync() failed: %v", err) + } + + samples, _ := consoleClient.ConsoleV1().ConsoleYAMLSamples().List(context.Background(), metav1.ListOptions{}) + if len(samples.Items) != len(yamlSampleAssetFiles) { + t.Errorf("expected %d ConsoleYAMLSamples after second sync, got %d", len(yamlSampleAssetFiles), len(samples.Items)) + } +} + +func TestSyncReturnsAggregatedErrors(t *testing.T) { + consoleClient := consolefake.NewClientset() + + consoleClient.PrependReactor("get", "*", func(action clienttesting.Action) (bool, runtime.Object, error) { + return true, nil, fmt.Errorf("simulated error for %s", action.GetResource().Resource) + }) + + c := newTestController(t, consoleClient) + + err := c.sync(context.Background(), nil) + if err == nil { + t.Fatal("sync() should return error when all assets fail") + } + + errStr := err.Error() + if !strings.Contains(errStr, "ConsoleYAMLSample") { + t.Errorf("aggregated error should mention ConsoleYAMLSample, got: %v", err) + } + if !strings.Contains(errStr, "ConsoleQuickStart") { + t.Errorf("aggregated error should mention ConsoleQuickStart, got: %v", err) + } +} + +func TestSyncUpdatesChangedSpec(t *testing.T) { + consoleClient := consolefake.NewClientset() + c := newTestController(t, consoleClient) + + if err := c.sync(context.Background(), nil); err != nil { + t.Fatalf("initial sync() failed: %v", err) + } + + sample, err := consoleClient.ConsoleV1().ConsoleYAMLSamples().Get(context.Background(), "cert-manager-acme-issuer-sample", metav1.GetOptions{}) + if err != nil { + t.Fatalf("failed to get ConsoleYAMLSample: %v", err) + } + sample.Spec.Description = "modified" + if _, err := consoleClient.ConsoleV1().ConsoleYAMLSamples().Update(context.Background(), sample, metav1.UpdateOptions{}); err != nil { + t.Fatalf("failed to mutate ConsoleYAMLSample: %v", err) + } + + qs, err := consoleClient.ConsoleV1().ConsoleQuickStarts().Get(context.Background(), "cert-manager-example", metav1.GetOptions{}) + if err != nil { + t.Fatalf("failed to get ConsoleQuickStart: %v", err) + } + qs.Spec.DisplayName = "modified" + if _, err := consoleClient.ConsoleV1().ConsoleQuickStarts().Update(context.Background(), qs, metav1.UpdateOptions{}); err != nil { + t.Fatalf("failed to mutate ConsoleQuickStart: %v", err) + } + + if err := c.sync(context.Background(), nil); err != nil { + t.Fatalf("re-sync after mutation failed: %v", err) + } + + updated, _ := consoleClient.ConsoleV1().ConsoleYAMLSamples().Get(context.Background(), "cert-manager-acme-issuer-sample", metav1.GetOptions{}) + if updated.Spec.Description == "modified" { + t.Error("ConsoleYAMLSample spec should have been reverted by sync, but mutation persisted") + } + + updatedQS, _ := consoleClient.ConsoleV1().ConsoleQuickStarts().Get(context.Background(), "cert-manager-example", metav1.GetOptions{}) + if updatedQS.Spec.DisplayName == "modified" { + t.Error("ConsoleQuickStart spec should have been reverted by sync, but mutation persisted") + } +} + +func TestSyncPartialFailure(t *testing.T) { + consoleClient := consolefake.NewClientset() + c := newTestController(t, consoleClient) + + consoleClient.PrependReactor("get", "consolequickstarts", func(action clienttesting.Action) (bool, runtime.Object, error) { + return true, nil, fmt.Errorf("simulated quickstart error") + }) + + err := c.sync(context.Background(), nil) + if err == nil { + t.Fatal("sync() should return error when quickstarts fail") + } + if !strings.Contains(err.Error(), "ConsoleQuickStart") { + t.Errorf("error should mention ConsoleQuickStart, got: %v", err) + } + + samples, listErr := consoleClient.ConsoleV1().ConsoleYAMLSamples().List(context.Background(), metav1.ListOptions{}) + if listErr != nil { + t.Fatalf("failed to list ConsoleYAMLSamples: %v", listErr) + } + if len(samples.Items) != len(yamlSampleAssetFiles) { + t.Errorf("expected %d ConsoleYAMLSamples to be created despite quickstart failure, got %d", len(yamlSampleAssetFiles), len(samples.Items)) + } +} + +func TestSyncCreateError(t *testing.T) { + consoleClient := consolefake.NewClientset() + + consoleClient.PrependReactor("create", "consoleyamlsamples", func(action clienttesting.Action) (bool, runtime.Object, error) { + return true, nil, fmt.Errorf("simulated create error") + }) + + c := newTestController(t, consoleClient) + + err := c.sync(context.Background(), nil) + if err == nil { + t.Fatal("sync() should return error when create fails") + } + if !strings.Contains(err.Error(), "ConsoleYAMLSample") { + t.Errorf("error should mention ConsoleYAMLSample, got: %v", err) + } +} + +func TestSyncUpdateError(t *testing.T) { + consoleClient := consolefake.NewClientset() + c := newTestController(t, consoleClient) + + if err := c.sync(context.Background(), nil); err != nil { + t.Fatalf("initial sync() failed: %v", err) + } + + sample, _ := consoleClient.ConsoleV1().ConsoleYAMLSamples().Get(context.Background(), "cert-manager-acme-issuer-sample", metav1.GetOptions{}) + sample.Spec.Description = "modified" + consoleClient.ConsoleV1().ConsoleYAMLSamples().Update(context.Background(), sample, metav1.UpdateOptions{}) + + consoleClient.PrependReactor("update", "consoleyamlsamples", func(action clienttesting.Action) (bool, runtime.Object, error) { + return true, nil, fmt.Errorf("simulated update error") + }) + + err := c.sync(context.Background(), nil) + if err == nil { + t.Fatal("sync() should return error when update fails") + } + if !strings.Contains(err.Error(), "ConsoleYAMLSample") { + t.Errorf("error should mention ConsoleYAMLSample, got: %v", err) + } +} + +func TestApplyConsoleResourceCreatesWhenNotFound(t *testing.T) { + consoleClient := consolefake.NewClientset() + recorder := events.NewInMemoryRecorder("test", clock.RealClock{}) + + desired := &consolev1.ConsoleYAMLSample{ + ObjectMeta: metav1.ObjectMeta{Name: "test-sample"}, + Spec: consolev1.ConsoleYAMLSampleSpec{Title: "Test"}, + } + + client := consoleClient.ConsoleV1().ConsoleYAMLSamples() + err := applyConsoleResource(context.Background(), recorder, "ConsoleYAMLSample", desired.Name, desired, + client.Get, client.Create, client.Update, + func(a, b *consolev1.ConsoleYAMLSample) bool { return a.Spec == b.Spec }, + func(existing, desired *consolev1.ConsoleYAMLSample) *consolev1.ConsoleYAMLSample { + u := existing.DeepCopy(); u.Spec = desired.Spec; return u + }, + ) + if err != nil { + t.Fatalf("applyConsoleResource() returned error: %v", err) + } + + got, err := client.Get(context.Background(), "test-sample", metav1.GetOptions{}) + if err != nil { + t.Fatalf("resource was not created: %v", err) + } + if got.Spec.Title != "Test" { + t.Errorf("spec.title = %q, want %q", got.Spec.Title, "Test") + } + + evts := recorder.Events() + if len(evts) != 1 { + t.Fatalf("expected 1 event, got %d", len(evts)) + } + if evts[0].Reason != "ConsoleYAMLSampleCreated" { + t.Errorf("event reason = %q, want %q", evts[0].Reason, "ConsoleYAMLSampleCreated") + } +} + +func TestApplyConsoleResourceUpdatesWhenSpecDiffers(t *testing.T) { + consoleClient := consolefake.NewClientset() + recorder := events.NewInMemoryRecorder("test", clock.RealClock{}) + + existing := &consolev1.ConsoleQuickStart{ + ObjectMeta: metav1.ObjectMeta{Name: "test-qs"}, + Spec: consolev1.ConsoleQuickStartSpec{DisplayName: "Old", DurationMinutes: 1, Description: "d", Introduction: "i", Tasks: []consolev1.ConsoleQuickStartTask{{Title: "t", Description: "d"}}}, + } + client := consoleClient.ConsoleV1().ConsoleQuickStarts() + if _, err := client.Create(context.Background(), existing, metav1.CreateOptions{}); err != nil { + t.Fatalf("setup create failed: %v", err) + } + + desired := existing.DeepCopy() + desired.Spec.DisplayName = "New" + + err := applyConsoleResource(context.Background(), recorder, "ConsoleQuickStart", desired.Name, desired, + client.Get, client.Create, client.Update, + func(a, b *consolev1.ConsoleQuickStart) bool { return a.Spec.DisplayName == b.Spec.DisplayName }, + func(existing, desired *consolev1.ConsoleQuickStart) *consolev1.ConsoleQuickStart { + u := existing.DeepCopy(); u.Spec = desired.Spec; return u + }, + ) + if err != nil { + t.Fatalf("applyConsoleResource() returned error: %v", err) + } + + got, _ := client.Get(context.Background(), "test-qs", metav1.GetOptions{}) + if got.Spec.DisplayName != "New" { + t.Errorf("spec was not updated: displayName = %q, want %q", got.Spec.DisplayName, "New") + } + + evts := recorder.Events() + if len(evts) != 1 { + t.Fatalf("expected 1 event, got %d", len(evts)) + } + if evts[0].Reason != "ConsoleQuickStartUpdated" { + t.Errorf("event reason = %q, want %q", evts[0].Reason, "ConsoleQuickStartUpdated") + } +} + +func TestApplyConsoleResourceNoOpWhenSpecsEqual(t *testing.T) { + consoleClient := consolefake.NewClientset() + recorder := events.NewInMemoryRecorder("test", clock.RealClock{}) + + existing := &consolev1.ConsoleYAMLSample{ + ObjectMeta: metav1.ObjectMeta{Name: "test-sample"}, + Spec: consolev1.ConsoleYAMLSampleSpec{Title: "Same"}, + } + client := consoleClient.ConsoleV1().ConsoleYAMLSamples() + if _, err := client.Create(context.Background(), existing, metav1.CreateOptions{}); err != nil { + t.Fatalf("setup create failed: %v", err) + } + + desired := existing.DeepCopy() + + err := applyConsoleResource(context.Background(), recorder, "ConsoleYAMLSample", desired.Name, desired, + client.Get, client.Create, client.Update, + func(a, b *consolev1.ConsoleYAMLSample) bool { return a.Spec.Title == b.Spec.Title }, + func(existing, desired *consolev1.ConsoleYAMLSample) *consolev1.ConsoleYAMLSample { + u := existing.DeepCopy(); u.Spec = desired.Spec; return u + }, + ) + if err != nil { + t.Fatalf("applyConsoleResource() returned error: %v", err) + } + + if len(recorder.Events()) != 0 { + t.Errorf("expected 0 events for no-op, got %d", len(recorder.Events())) + } +} + +func TestApplyConsoleResourceGetError(t *testing.T) { + consoleClient := consolefake.NewClientset() + recorder := events.NewInMemoryRecorder("test", clock.RealClock{}) + + consoleClient.PrependReactor("get", "consoleyamlsamples", func(action clienttesting.Action) (bool, runtime.Object, error) { + return true, nil, fmt.Errorf("simulated get error") + }) + + desired := &consolev1.ConsoleYAMLSample{ + ObjectMeta: metav1.ObjectMeta{Name: "test-sample"}, + } + client := consoleClient.ConsoleV1().ConsoleYAMLSamples() + + err := applyConsoleResource(context.Background(), recorder, "ConsoleYAMLSample", desired.Name, desired, + client.Get, client.Create, client.Update, + func(a, b *consolev1.ConsoleYAMLSample) bool { return true }, + func(existing, desired *consolev1.ConsoleYAMLSample) *consolev1.ConsoleYAMLSample { + return existing.DeepCopy() + }, + ) + if err == nil { + t.Fatal("expected error from get failure") + } + if !strings.Contains(err.Error(), "simulated get error") { + t.Errorf("unexpected error: %v", err) + } +} + +func TestApplyConsoleResourceCreateError(t *testing.T) { + consoleClient := consolefake.NewClientset() + recorder := events.NewInMemoryRecorder("test", clock.RealClock{}) + + consoleClient.PrependReactor("create", "consoleyamlsamples", func(action clienttesting.Action) (bool, runtime.Object, error) { + return true, nil, fmt.Errorf("simulated create error") + }) + + desired := &consolev1.ConsoleYAMLSample{ + ObjectMeta: metav1.ObjectMeta{Name: "test-sample"}, + } + client := consoleClient.ConsoleV1().ConsoleYAMLSamples() + + err := applyConsoleResource(context.Background(), recorder, "ConsoleYAMLSample", desired.Name, desired, + client.Get, client.Create, client.Update, + func(a, b *consolev1.ConsoleYAMLSample) bool { return true }, + func(existing, desired *consolev1.ConsoleYAMLSample) *consolev1.ConsoleYAMLSample { + return existing.DeepCopy() + }, + ) + if err == nil { + t.Fatal("expected error from create failure") + } +} + +func TestApplyConsoleResourceUpdateError(t *testing.T) { + consoleClient := consolefake.NewClientset() + recorder := events.NewInMemoryRecorder("test", clock.RealClock{}) + + existing := &consolev1.ConsoleYAMLSample{ + ObjectMeta: metav1.ObjectMeta{Name: "test-sample"}, + Spec: consolev1.ConsoleYAMLSampleSpec{Title: "Old"}, + } + client := consoleClient.ConsoleV1().ConsoleYAMLSamples() + if _, err := client.Create(context.Background(), existing, metav1.CreateOptions{}); err != nil { + t.Fatalf("setup create failed: %v", err) + } + + consoleClient.PrependReactor("update", "consoleyamlsamples", func(action clienttesting.Action) (bool, runtime.Object, error) { + return true, nil, fmt.Errorf("simulated update error") + }) + + desired := existing.DeepCopy() + desired.Spec.Title = "New" + + err := applyConsoleResource(context.Background(), recorder, "ConsoleYAMLSample", desired.Name, desired, + client.Get, client.Create, client.Update, + func(a, b *consolev1.ConsoleYAMLSample) bool { return a.Spec.Title == b.Spec.Title }, + func(existing, desired *consolev1.ConsoleYAMLSample) *consolev1.ConsoleYAMLSample { + u := existing.DeepCopy(); u.Spec = desired.Spec; return u + }, + ) + if err == nil { + t.Fatal("expected error from update failure") + } +} + +func TestConsoleAssetContent(t *testing.T) { + yamlSamples := loadAssets[consolev1.ConsoleYAMLSample](yamlSampleAssetFiles) + expectedNames := []string{ + "cert-manager-acme-issuer-sample", + "cert-manager-certificate-sample", + "cert-manager-issuer-sample", + } + for i, sample := range yamlSamples { + if sample.Name != expectedNames[i] { + t.Errorf("yamlSample[%d] name = %q, want %q", i, sample.Name, expectedNames[i]) + } + } + + quickStarts := loadAssets[consolev1.ConsoleQuickStart](quickStartAssetFiles) + if len(quickStarts) != 1 || quickStarts[0].Name != "cert-manager-example" { + t.Errorf("quickStart name = %q, want %q", quickStarts[0].Name, "cert-manager-example") + } +} diff --git a/pkg/operator/assets/bindata.go b/pkg/operator/assets/bindata.go index 0561d0a7e..7a742df52 100644 --- a/pkg/operator/assets/bindata.go +++ b/pkg/operator/assets/bindata.go @@ -43,6 +43,10 @@ // bindata/cert-manager-deployment/webhook/cert-manager-webhook-subjectaccessreviews-crb.yaml // bindata/cert-manager-deployment/webhook/cert-manager-webhook-svc.yaml // bindata/cert-manager-deployment/webhook/cert-manager-webhook-validatingwebhookconfiguration.yaml +// bindata/console/cert-manager-acme-issuer-sample.yaml +// bindata/console/cert-manager-certificate-sample.yaml +// bindata/console/cert-manager-example-quickstart.yaml +// bindata/console/cert-manager-issuer-sample.yaml // bindata/istio-csr/cert-manager-istio-csr-clusterrole.yaml // bindata/istio-csr/cert-manager-istio-csr-clusterrolebinding.yaml // bindata/istio-csr/cert-manager-istio-csr-deployment.yaml @@ -2286,6 +2290,338 @@ func certManagerDeploymentWebhookCertManagerWebhookValidatingwebhookconfiguratio return a, nil } +var _consoleCertManagerAcmeIssuerSampleYaml = []byte(`apiVersion: console.openshift.io/v1 +kind: ConsoleYAMLSample +metadata: + name: cert-manager-acme-issuer-sample +spec: + targetResource: + apiVersion: cert-manager.io/v1 + kind: Issuer + title: Example ACME Issuer (Let's Encrypt) + description: An example ACME Issuer for Let's Encrypt production certificates with HTTP-01 challenge + yaml: |- + apiVersion: cert-manager.io/v1 + kind: Issuer + metadata: + name: letsencrypt-prod + namespace: default + spec: + acme: + server: https://acme-v02.api.letsencrypt.org/directory + privateKeySecretRef: + name: letsencrypt-prod-account-key + solvers: + - http01: + ingress: + ingressClassName: openshift-default +`) + +func consoleCertManagerAcmeIssuerSampleYamlBytes() ([]byte, error) { + return _consoleCertManagerAcmeIssuerSampleYaml, nil +} + +func consoleCertManagerAcmeIssuerSampleYaml() (*asset, error) { + bytes, err := consoleCertManagerAcmeIssuerSampleYamlBytes() + if err != nil { + return nil, err + } + + info := bindataFileInfo{name: "console/cert-manager-acme-issuer-sample.yaml", size: 0, mode: os.FileMode(0), modTime: time.Unix(0, 0)} + a := &asset{bytes: bytes, info: info} + return a, nil +} + +var _consoleCertManagerCertificateSampleYaml = []byte(`apiVersion: console.openshift.io/v1 +kind: ConsoleYAMLSample +metadata: + name: cert-manager-certificate-sample +spec: + targetResource: + apiVersion: cert-manager.io/v1 + kind: Certificate + title: Example Certificate + description: A simple Certificate example + yaml: |- + apiVersion: cert-manager.io/v1 + kind: Certificate + metadata: + name: example-cert + namespace: default + spec: + secretName: example-tls + commonName: example.com + dnsNames: + - example.com + issuerRef: + name: selfsigned-issuer + kind: Issuer + +`) + +func consoleCertManagerCertificateSampleYamlBytes() ([]byte, error) { + return _consoleCertManagerCertificateSampleYaml, nil +} + +func consoleCertManagerCertificateSampleYaml() (*asset, error) { + bytes, err := consoleCertManagerCertificateSampleYamlBytes() + if err != nil { + return nil, err + } + + info := bindataFileInfo{name: "console/cert-manager-certificate-sample.yaml", size: 0, mode: os.FileMode(0), modTime: time.Unix(0, 0)} + a := &asset{bytes: bytes, info: info} + return a, nil +} + +var _consoleCertManagerExampleQuickstartYaml = []byte(`apiVersion: console.openshift.io/v1 +kind: ConsoleQuickStart +metadata: + name: cert-manager-example +spec: + displayName: cert-manager Operator for Red Hat OpenShift Example + tags: + - example + - operator + - certificates + durationMinutes: 10 + prerequisites: + - You completed the "Install the cert-manager Operator for Red Hat OpenShift" quick start. + - You have a namespace in which to deploy the example CRs. + description: |- + Create and issue TLS certificates using the cert-manager Operator for Red Hat OpenShift + introduction: |- + # cert-manager Operator for Red Hat OpenShift + + The cert-manager Operator for Red Hat OpenShift enables you to create and sign TLS certificates from an external PKI for your workloads + running on an OpenShift cluster. + + ### Expected Learning + + With this Quick Start, you will learn about the following CRDs provided by the cert-manager operator: + 1. **Issuer** - defines a certificate authority that can sign certificates + 2. **Certificate** - defines the desired certificate and its properties + + This Quick Start will walk you through creating your first certificate: + - Create a self-signed Issuer (for testing) + - Create a Certificate signed by that Issuer + - View the generated certificate in a Kubernetes Secret + - Learn how to use it in your applications + + **Note**: For production, you would use Let's Encrypt (ACME), HashiCorp Vault, or your organization's CA instead of self-signed certificates. + tasks: + - title: Navigate to installed cert-manager operator + description: |- + ### To navigate to the installed operator: + 1. Go to the **Installed Operators** from the [Ecosystem]{{highlight qs-nav-ecosystem}} section of the navigation. + 2. In the **Search by name** field, type ` + "`" + `cert-manager` + "`" + `. + 3. Look for **cert-manager Operator for Red Hat OpenShift**. If you had completed the prerequisite Quick Start, the tile should appear. + 4. Click on the installed operator + + You will be brought to the **Operator Details** page and be presented with **Provided APIs** + review: + instructions: |- + #### Verify you see a list of **Provided APIs**: + The list should include ` + "`" + `Issuer` + "`" + `, ` + "`" + `ClusterIssuer` + "`" + `, and ` + "`" + `Certificate` + "`" + ` + failedTaskHelp: This task isn't verified yet. Try the task again. + summary: + success: You are in the right place, and ready to start the rest of the Quick Start + failed: Try the steps again. + - title: Select a project + description: |- + ### Create or select a project to work in + 1. Find the **Project** dropdown menu at the top of the screen. + 2. Select or create the project in which you want to work in. + + **Note**: For this example, we'll create an ` + "`" + `Issuer` + "`" + ` which is namespace-scoped. If you want to issue certificates + across multiple namespaces, you can create a ` + "`" + `ClusterIssuer` + "`" + ` instead. + review: + instructions: |- + #### Verify the name in the **Project** dropdown menu is the expected project + failedTaskHelp: Try the task again. + summary: + success: You are in the right place. + failed: Try the steps again. + - title: Create a self-signed Issuer + description: |- + ### To create a self-signed Issuer + + An Issuer represents a certificate authority that can sign certificates. We'll create a self-signed Issuer + for this example. This is useful for testing and development. + + 1. Find the ` + "`" + `Issuer` + "`" + ` Custom Resource in the list of **Provided APIs** or in the top side-scrolling menu bar. + - From the list of **Provided APIs**, click the **Create instance** link. + - From the **top side-scrolling menu bar**, click **Issuer** and then click **Create Issuer**. + + 2. Switch to **YAML view** in the editor. + + 3. On the right sidebar, look for the **Samples** section and select **"Example Self-Signed Issuer"**. + + 4. Click **Try it** to populate the editor with the sample YAML. + + 5. Click the **Create** button to create the Issuer. + review: + instructions: |- + #### Verify the Issuer was successfully created: + 1. You should see the Issuer listed with the name ` + "`" + `selfsigned-issuer` + "`" + ` + 2. Check that the **Ready** condition shows **True** in the Conditions section + failedTaskHelp: This task isn't verified yet. Try the task again. + summary: + success: You just created a self-signed Issuer! Now we can create certificates. + failed: Try the steps again. + - title: Create a Certificate + description: |- + ### To create a Certificate + + Now we'll create a certificate that will be signed by our Issuer. + + 1. Find the ` + "`" + `Certificate` + "`" + ` Custom Resource in the list of **Provided APIs** or in the top side-scrolling menu bar. + - From the list of **Provided APIs**, click the **Create instance** link. + - From the **top side-scrolling menu bar**, click **Certificate** and then click **Create Certificate**. + + 2. Switch to **YAML view** in the editor. + + 3. On the right sidebar, look for the **Samples** section and select **"Example Certificate"**. + + 4. Click **Try it** to populate the editor with the sample YAML. + + 5. Click the **Create** button to create the Certificate. + review: + instructions: |- + #### Verify the Certificate was successfully created: + 1. You should see the Certificate listed with the name ` + "`" + `example-cert` + "`" + `. + 2. Check that the **Ready** condition shows **True**. + 3. Navigate to the [Workloads]{{highlight qs-nav-workloads}} section and click **Secrets** + 4. You should see a new Secret named ` + "`" + `example-tls` + "`" + `. + failedTaskHelp: This task isn't verified yet. Try the task again. + summary: + success: You just created your first certificate! cert-manager has issued it and stored it in a Secret. + failed: Try the steps again. + - title: View the certificate + description: |- + ### To inspect the certificate + + Let's look at the Secret that contains the certificate. + + 1. Make sure you're in the [Workloads]{{highlight qs-nav-workloads}} section, click **Secrets**. + 2. Click on the **example-tls** Secret. + 3. You should see the certificate data with keys: + - ` + "`" + `tls.crt` + "`" + ` - The certificate. + - ` + "`" + `tls.key` + "`" + ` - The private key. + - ` + "`" + `ca.crt` + "`" + ` - The CA certificate. + review: + instructions: |- + #### Verify you can see the certificate data: + Is the Secret ` + "`" + `example-tls` + "`" + ` present with ` + "`" + `tls.crt` + "`" + ` and ` + "`" + `tls.key` + "`" + `? + failedTaskHelp: This task isn't verified yet. Try the task again. + summary: + success: Great! Your certificate is ready to use. + failed: Try the steps again. + - title: Use the certificate + description: |- + ### How to use certificates + + Now you can use this certificate in your applications. Here's a simple example for an OpenShift Route: + + ` + "`" + `` + "`" + `` + "`" + `yaml + apiVersion: route.openshift.io/v1 + kind: Route + metadata: + name: my-app + spec: + to: + kind: Service + name: my-service + tls: + termination: edge + externalCertificate: + name: example-tls + ` + "`" + `` + "`" + `` + "`" + ` + + Or in an Ingress: + + ` + "`" + `` + "`" + `` + "`" + `yaml + apiVersion: networking.k8s.io/v1 + kind: Ingress + metadata: + name: my-app + spec: + tls: + - secretName: example-tls + rules: + - host: example.com + ` + "`" + `` + "`" + `` + "`" + ` + + **Note**: cert-manager will automatically renew certificates before they expire! + review: + instructions: |- + #### Do you understand how to use certificates? + Certificates can be referenced in Routes and Ingress resources. + failedTaskHelp: Review the examples above. + summary: + success: You now know how to create and use certificates! + failed: Review the examples again. + conclusion: |- + Great job! You've successfully created your first Issuer and Certificate. + + ### Next Steps: + + - For production, use Let's Encrypt (ACME Issuer) instead of self-signed certificates + - Explore ClusterIssuer for cluster-wide certificate management + - Check out the [cert-manager documentation](https://docs.redhat.com/en/documentation/openshift_container_platform/latest/html/security_and_compliance/cert-manager-operator-for-red-hat-openshift) to learn more +`) + +func consoleCertManagerExampleQuickstartYamlBytes() ([]byte, error) { + return _consoleCertManagerExampleQuickstartYaml, nil +} + +func consoleCertManagerExampleQuickstartYaml() (*asset, error) { + bytes, err := consoleCertManagerExampleQuickstartYamlBytes() + if err != nil { + return nil, err + } + + info := bindataFileInfo{name: "console/cert-manager-example-quickstart.yaml", size: 0, mode: os.FileMode(0), modTime: time.Unix(0, 0)} + a := &asset{bytes: bytes, info: info} + return a, nil +} + +var _consoleCertManagerIssuerSampleYaml = []byte(`apiVersion: console.openshift.io/v1 +kind: ConsoleYAMLSample +metadata: + name: cert-manager-issuer-sample +spec: + targetResource: + apiVersion: cert-manager.io/v1 + kind: Issuer + title: Example Self-Signed Issuer + description: A simple self-signed Issuer for development and testing + yaml: |- + apiVersion: cert-manager.io/v1 + kind: Issuer + metadata: + name: selfsigned-issuer + namespace: default + spec: + selfSigned: {} + +`) + +func consoleCertManagerIssuerSampleYamlBytes() ([]byte, error) { + return _consoleCertManagerIssuerSampleYaml, nil +} + +func consoleCertManagerIssuerSampleYaml() (*asset, error) { + bytes, err := consoleCertManagerIssuerSampleYamlBytes() + if err != nil { + return nil, err + } + + info := bindataFileInfo{name: "console/cert-manager-issuer-sample.yaml", size: 0, mode: os.FileMode(0), modTime: time.Unix(0, 0)} + a := &asset{bytes: bytes, info: info} + return a, nil +} + var _istioCsrCertManagerIstioCsrClusterroleYaml = []byte(`kind: ClusterRole apiVersion: rbac.authorization.k8s.io/v1 metadata: @@ -3763,6 +4099,10 @@ var _bindata = map[string]func() (*asset, error){ "cert-manager-deployment/webhook/cert-manager-webhook-subjectaccessreviews-crb.yaml": certManagerDeploymentWebhookCertManagerWebhookSubjectaccessreviewsCrbYaml, "cert-manager-deployment/webhook/cert-manager-webhook-svc.yaml": certManagerDeploymentWebhookCertManagerWebhookSvcYaml, "cert-manager-deployment/webhook/cert-manager-webhook-validatingwebhookconfiguration.yaml": certManagerDeploymentWebhookCertManagerWebhookValidatingwebhookconfigurationYaml, + "console/cert-manager-acme-issuer-sample.yaml": consoleCertManagerAcmeIssuerSampleYaml, + "console/cert-manager-certificate-sample.yaml": consoleCertManagerCertificateSampleYaml, + "console/cert-manager-example-quickstart.yaml": consoleCertManagerExampleQuickstartYaml, + "console/cert-manager-issuer-sample.yaml": consoleCertManagerIssuerSampleYaml, "istio-csr/cert-manager-istio-csr-clusterrole.yaml": istioCsrCertManagerIstioCsrClusterroleYaml, "istio-csr/cert-manager-istio-csr-clusterrolebinding.yaml": istioCsrCertManagerIstioCsrClusterrolebindingYaml, "istio-csr/cert-manager-istio-csr-deployment.yaml": istioCsrCertManagerIstioCsrDeploymentYaml, @@ -3894,6 +4234,12 @@ var _bintree = &bintree{nil, map[string]*bintree{ "cert-manager-webhook-validatingwebhookconfiguration.yaml": {certManagerDeploymentWebhookCertManagerWebhookValidatingwebhookconfigurationYaml, map[string]*bintree{}}, }}, }}, + "console": {nil, map[string]*bintree{ + "cert-manager-acme-issuer-sample.yaml": {consoleCertManagerAcmeIssuerSampleYaml, map[string]*bintree{}}, + "cert-manager-certificate-sample.yaml": {consoleCertManagerCertificateSampleYaml, map[string]*bintree{}}, + "cert-manager-example-quickstart.yaml": {consoleCertManagerExampleQuickstartYaml, map[string]*bintree{}}, + "cert-manager-issuer-sample.yaml": {consoleCertManagerIssuerSampleYaml, map[string]*bintree{}}, + }}, "istio-csr": {nil, map[string]*bintree{ "cert-manager-istio-csr-clusterrole.yaml": {istioCsrCertManagerIstioCsrClusterroleYaml, map[string]*bintree{}}, "cert-manager-istio-csr-clusterrolebinding.yaml": {istioCsrCertManagerIstioCsrClusterrolebindingYaml, map[string]*bintree{}}, diff --git a/pkg/operator/starter.go b/pkg/operator/starter.go index dc1541c9d..e3eb462a2 100644 --- a/pkg/operator/starter.go +++ b/pkg/operator/starter.go @@ -13,6 +13,7 @@ import ( configv1 "github.com/openshift/api/config/v1" configv1client "github.com/openshift/client-go/config/clientset/versioned" configinformers "github.com/openshift/client-go/config/informers/externalversions" + consoleclient "github.com/openshift/client-go/console/clientset/versioned" "github.com/openshift/library-go/pkg/controller/controllercmd" "github.com/openshift/library-go/pkg/operator/resource/resourceapply" "github.com/openshift/library-go/pkg/operator/status" @@ -98,6 +99,20 @@ func RunOperator(ctx context.Context, cc *controllercmd.ControllerContext) error return fmt.Errorf("failed to discover Infrastructure presence: %w", err) } + consoleDiscoverer := utils.NewResourceDiscoverer(certmanager.ConsoleYAMLSampleGVR, configClient.Discovery()) + consoleAvailable, err := consoleDiscoverer.Discover() + if err != nil { + return fmt.Errorf("failed to discover Console CRD presence: %w", err) + } + + var consoleClient consoleclient.Interface + if consoleAvailable { + consoleClient, err = consoleclient.NewForConfig(cc.KubeConfig) + if err != nil { + return err + } + } + certManagerControllerSet := certmanager.NewCertManagerControllerSet( kubeClient, kubeInformersForNamespaces, @@ -106,6 +121,7 @@ func RunOperator(ctx context.Context, cc *controllercmd.ControllerContext) error operatorClient, certManagerInformers, resourceapply.NewKubeClientHolder(kubeClient).WithAPIExtensionsClient(apiExtensionsClient), + consoleClient, cc.EventRecorder, status.VersionForOperandFromEnv(), versionRecorder, diff --git a/pkg/operator/utils/apidiscovery_test.go b/pkg/operator/utils/apidiscovery_test.go index 6f3fcf5c4..eecb6f3ba 100644 --- a/pkg/operator/utils/apidiscovery_test.go +++ b/pkg/operator/utils/apidiscovery_test.go @@ -8,6 +8,7 @@ import ( "github.com/stretchr/testify/require" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/runtime/schema" "k8s.io/client-go/discovery" fakediscovery "k8s.io/client-go/discovery/fake" @@ -62,6 +63,69 @@ func createErroneousFakeDiscoveryClient() discovery.DiscoveryInterface { return &alwaysErrorFakeDiscovery{} } +func TestDiscoverConsoleCapability(t *testing.T) { + gvr := schema.GroupVersionResource{ + Group: "console.openshift.io", + Version: "v1", + Resource: "consoleyamlsamples", + } + + tests := []struct { + name string + resources []*metav1.APIResourceList + want bool + }{ + { + name: "console resources present", + resources: []*metav1.APIResourceList{ + { + GroupVersion: "console.openshift.io/v1", + APIResources: []metav1.APIResource{ + {Name: "consoleyamlsamples"}, + {Name: "consolequickstarts"}, + }, + }, + }, + want: true, + }, + { + name: "console resources absent", + resources: nil, + want: false, + }, + { + name: "different group present but not console", + resources: []*metav1.APIResourceList{ + { + GroupVersion: operatorv1alpha1.SchemeGroupVersion.String(), + APIResources: []metav1.APIResource{ + {Name: "certmanagers"}, + }, + }, + }, + want: false, + }, + } + + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + fakeClient := fake.NewClientset() + fakeClient.Resources = tt.resources + + discoverer := NewResourceDiscoverer(gvr, fakeClient.Discovery()) + got, err := discoverer.Discover() + require.NoError(t, err) + assert.Equal(t, tt.want, got) + }) + } + + t.Run("discovery error propagates", func(t *testing.T) { + discoverer := NewResourceDiscoverer(gvr, createErroneousFakeDiscoveryClient()) + _, err := discoverer.Discover() + require.Error(t, err) + }) +} + // TestOptionalInformer covers NewResourceDiscoverer, Discover, and // InitInformerIfAvailable end-to-end. func TestOptionalInformer(t *testing.T) { diff --git a/test/e2e/console_resources_test.go b/test/e2e/console_resources_test.go new file mode 100644 index 000000000..c14c55ee5 --- /dev/null +++ b/test/e2e/console_resources_test.go @@ -0,0 +1,126 @@ +//go:build e2e +// +build e2e + +package e2e + +import ( + "context" + "fmt" + + . "github.com/onsi/ginkgo/v2" + . "github.com/onsi/gomega" + + "github.com/openshift/library-go/pkg/operator/resource/resourceread" + + apierrors "k8s.io/apimachinery/pkg/api/errors" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" + "k8s.io/apimachinery/pkg/runtime/schema" + "k8s.io/apimachinery/pkg/util/wait" + + "github.com/openshift/cert-manager-operator/pkg/controller/certmanager" + "github.com/openshift/cert-manager-operator/pkg/operator/assets" + "github.com/openshift/cert-manager-operator/pkg/operator/utils" +) + +var consoleExpectedAssets = []struct { + file string + name string + gvr schema.GroupVersionResource +}{ + {file: "console/cert-manager-acme-issuer-sample.yaml", name: "cert-manager-acme-issuer-sample", gvr: certmanager.ConsoleYAMLSampleGVR}, + {file: "console/cert-manager-certificate-sample.yaml", name: "cert-manager-certificate-sample", gvr: certmanager.ConsoleYAMLSampleGVR}, + {file: "console/cert-manager-issuer-sample.yaml", name: "cert-manager-issuer-sample", gvr: certmanager.ConsoleYAMLSampleGVR}, + {file: "console/cert-manager-example-quickstart.yaml", name: "cert-manager-example", gvr: certmanager.ConsoleQuickStartGVR}, +} + +func hasConsoleCapability() (bool, error) { + return utils.NewResourceDiscoverer( + certmanager.ConsoleYAMLSampleGVR, + k8sClientSet.Discovery(), + ).Discover() +} + +var _ = Describe("Console Resources", Label("Platform:Generic"), Ordered, func() { + var ( + ctx context.Context + consoleEnabled bool + ) + + BeforeAll(func() { + ctx = context.Background() + + By("detecting Console capability on the cluster") + enabled, err := hasConsoleCapability() + Expect(err).NotTo(HaveOccurred(), "failed to check Console capability") + consoleEnabled = enabled + + if consoleEnabled { + fmt.Fprintf(GinkgoWriter, "Console capability is ENABLED on this cluster\n") + } else { + fmt.Fprintf(GinkgoWriter, "Console capability is DISABLED on this cluster\n") + } + }) + + BeforeEach(func() { + By("waiting for operator status to become available") + err := VerifyHealthyOperatorConditions(certmanageroperatorclient.OperatorV1alpha1()) + Expect(err).NotTo(HaveOccurred(), "operator is expected to be available") + }) + + Context("when Console capability is enabled", func() { + It("should create all console resources with correct content", func() { + if !consoleEnabled { + Skip("Console capability is not enabled on this cluster") + } + + for _, asset := range consoleExpectedAssets { + By(fmt.Sprintf("verifying %s exists", asset.name)) + + var live *unstructured.Unstructured + err := wait.PollUntilContextTimeout(ctx, fastPollInterval, lowTimeout, true, func(ctx context.Context) (bool, error) { + obj, getErr := loader.DynamicClient.Resource(asset.gvr).Get(ctx, asset.name, metav1.GetOptions{}) + if getErr != nil { + if apierrors.IsNotFound(getErr) { + return false, nil + } + return false, getErr + } + live = obj + return true, nil + }) + Expect(err).NotTo(HaveOccurred(), "timed out waiting for %s to be created", asset.name) + + By(fmt.Sprintf("validating content of %s", asset.name)) + data, err := assets.Asset(asset.file) + Expect(err).NotTo(HaveOccurred(), "failed to load bindata asset %s", asset.file) + expected := resourceread.ReadUnstructuredOrDie(data) + + liveSpec, ok := live.Object["spec"].(map[string]interface{}) + Expect(ok).To(BeTrue(), "live spec should be a map for %s", asset.name) + expectedSpec, ok := expected.Object["spec"].(map[string]interface{}) + Expect(ok).To(BeTrue(), "expected spec should be a map for %s", asset.name) + + for key, expectedVal := range expectedSpec { + Expect(liveSpec).To(HaveKeyWithValue(key, expectedVal), + "spec.%s mismatch for %s", key, asset.name) + } + } + }) + }) + + Context("when Console capability is disabled", func() { + It("should not create any console resources", func() { + if consoleEnabled { + Skip("Console capability is enabled on this cluster") + } + + for _, asset := range consoleExpectedAssets { + By(fmt.Sprintf("verifying %s does not exist", asset.name)) + _, err := loader.DynamicClient.Resource(asset.gvr).Get(ctx, asset.name, metav1.GetOptions{}) + Expect(apierrors.IsNotFound(err)).To(BeTrue(), + "expected %s to not exist on consoleless cluster, but got: %v", asset.name, err) + } + }) + }) +}) diff --git a/test/go.mod b/test/go.mod index cdc895e20..82cad3292 100644 --- a/test/go.mod +++ b/test/go.mod @@ -22,6 +22,7 @@ require ( github.com/openshift/api v0.0.0-20260105191300-d1c4dc4fd37b github.com/openshift/cert-manager-operator v0.0.0-00010101000000-000000000000 github.com/openshift/client-go v0.0.0-20251205093018-96a6cbc1420c + github.com/openshift/library-go v0.0.0-20251205073205-ab8d51820e0b github.com/stretchr/testify v1.11.1 github.com/tidwall/gjson v1.18.0 github.com/vmware-archive/yaml-patch v0.0.11 @@ -102,12 +103,14 @@ require ( github.com/nxadm/tail v1.4.11 // indirect github.com/onsi/ginkgo v1.16.5 // indirect github.com/opencontainers/go-digest v1.0.0 // indirect + github.com/operator-framework/operator-lib v0.19.0 // indirect github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c // indirect github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect github.com/prometheus/client_golang v1.23.2 // indirect github.com/prometheus/client_model v0.6.2 // indirect github.com/prometheus/common v0.66.1 // indirect github.com/prometheus/procfs v0.17.0 // indirect + github.com/robfig/cron v1.2.0 // indirect github.com/spf13/pflag v1.0.10 // indirect github.com/tidwall/match v1.1.1 // indirect github.com/tidwall/pretty v1.2.1 // indirect @@ -145,11 +148,13 @@ require ( k8s.io/component-helpers v0.34.4 // indirect k8s.io/controller-manager v0.34.4 // indirect k8s.io/klog/v2 v2.130.1 // indirect + k8s.io/kube-aggregator v0.34.4 // indirect k8s.io/kube-openapi v0.0.0-20250910181357-589584f1c912 // indirect k8s.io/kubelet v0.34.4 // indirect k8s.io/kubernetes v1.34.4 // indirect sigs.k8s.io/gateway-api v1.4.0 // indirect sigs.k8s.io/json v0.0.0-20250730193827-2d320260d730 // indirect + sigs.k8s.io/kube-storage-version-migrator v0.0.6-0.20230721195810-5c8923c5ff96 // indirect sigs.k8s.io/randfill v1.0.0 // indirect sigs.k8s.io/structured-merge-diff/v6 v6.3.1 // indirect ) diff --git a/test/go.sum b/test/go.sum index 9304bbbf6..31c7f3538 100644 --- a/test/go.sum +++ b/test/go.sum @@ -235,6 +235,10 @@ github.com/openshift/client-go v0.0.0-20251205093018-96a6cbc1420c h1:TBE0Gl+oCo/ github.com/openshift/client-go v0.0.0-20251205093018-96a6cbc1420c/go.mod h1:IsynOWZAfdH+BgWimcFQRtI41Id9sgdhsCEjIk8ACLw= github.com/openshift/jetstack-cert-manager v1.19.7-0.20260722075217-d2224398552d h1:HIx+fx8rc6eRUHxeUMIUYbD2O8KZGnm/Y8UjVW8L7Fw= github.com/openshift/jetstack-cert-manager v1.19.7-0.20260722075217-d2224398552d/go.mod h1:uC9pPoxhw/+Jcv3eWBhYpN7jbqNlYwSZn7ioROZSPM4= +github.com/openshift/library-go v0.0.0-20251205073205-ab8d51820e0b h1:Fh2PJw4DP4zylB7oOu2T1C5rxhI0G36aj1D71vwS5S4= +github.com/openshift/library-go v0.0.0-20251205073205-ab8d51820e0b/go.mod h1:ErDfiIrPHH+menTP/B4LKd0nxFDdvCbTamAc6SWMIh8= +github.com/operator-framework/operator-lib v0.19.0 h1:az6ogYj21rtU0SF9uYctRLyKp2dtlqTsmpfehFy6Ce8= +github.com/operator-framework/operator-lib v0.19.0/go.mod h1:KxycAjFnHt0DBtHmH3Jm7yHcY5sdrshPKTqM/HKAQ08= github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c h1:+mdjkGKdHQG3305AYmdv1U2eRNDiU2ErMBj1gwrq8eQ= github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c/go.mod h1:7rwL4CYBLnjLxUqIJNnCWiEdr3bn6IUYi15bNlnbCCU= github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= @@ -242,6 +246,8 @@ github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINE github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRIccs7FGNTlIRMkT8wgtp5eCXdBlqhYGL6U= github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring v0.74.0 h1:AHzMWDxNiAVscJL6+4wkvFRTpMnJqiaZFEKA/osaBXE= +github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring v0.74.0/go.mod h1:wAR5JopumPtAZnu0Cjv2PSqV4p4QB09LMhc6fZZTXuA= github.com/prometheus/client_golang v1.23.2 h1:Je96obch5RDVy3FDMndoUsjAhG5Edi49h0RJWRi/o0o= github.com/prometheus/client_golang v1.23.2/go.mod h1:Tb1a6LWHB3/SPIzCoaDXI4I8UHKeFTEQ1YCr+0Gyqmg= github.com/prometheus/client_model v0.6.2 h1:oBsgwpGs7iVziMvrGhE53c/GrLUsZdHnqNwqPLxwZyk= @@ -250,6 +256,8 @@ github.com/prometheus/common v0.66.1 h1:h5E0h5/Y8niHc5DlaLlWLArTQI7tMrsfQjHV+d9Z github.com/prometheus/common v0.66.1/go.mod h1:gcaUsgf3KfRSwHY4dIMXLPV0K/Wg1oZ8+SbZk/HH/dA= github.com/prometheus/procfs v0.17.0 h1:FuLQ+05u4ZI+SS/w9+BWEM2TXiHKsUQ9TADiRH7DuK0= github.com/prometheus/procfs v0.17.0/go.mod h1:oPQLaDAMRbA+u8H5Pbfq+dl3VDAvHxMUOVhe0wYB2zw= +github.com/robfig/cron v1.2.0 h1:ZjScXvvxeQ63Dbyxy76Fj3AT3Ut0aKsyd2/tl3DTMuQ= +github.com/robfig/cron v1.2.0/go.mod h1:JGuDeoQd7Z6yL4zQhZ3OPEVHB7fL6Ka6skscFHfmt2k= github.com/rogpeppe/go-internal v1.14.1 h1:UQB4HGPB6osV0SQTLymcB4TgvyWu6ZyliaW0tI/otEQ= github.com/rogpeppe/go-internal v1.14.1/go.mod h1:MaRKkUm5W0goXpeCfT7UZI6fk/L7L7so1lCWt35ZSgc= github.com/spf13/pflag v1.0.10 h1:4EBh2KAYBwaONj6b2Ye1GiHfwjqyROoF4RwYO+vPwFk= @@ -414,6 +422,8 @@ k8s.io/controller-manager v0.34.4 h1:eBj1Obdj29dS6rtk69jzdnTtu5L7RYwzU6QSiQ2bH4Y k8s.io/controller-manager v0.34.4/go.mod h1:j1a3/NhjnAIcY8i5mHppvc1v5ZBJ86c/WadjveCLA68= k8s.io/klog/v2 v2.130.1 h1:n9Xl7H1Xvksem4KFG4PYbdQCQxqc/tTUyrgXaOhHSzk= k8s.io/klog/v2 v2.130.1/go.mod h1:3Jpz1GvMt720eyJH1ckRHK1EDfpxISzJ7I9OYgaDtPE= +k8s.io/kube-aggregator v0.34.4 h1:b2Y07+HfImko/ru5BSMsWOSndGJ7+gc5AyZe/rgc+wI= +k8s.io/kube-aggregator v0.34.4/go.mod h1:L2u+9yLYVB5v9+np9EInd63aq5uwN+pnHrlVNaEi8Jc= k8s.io/kube-openapi v0.0.0-20250910181357-589584f1c912 h1:Y3gxNAuB0OBLImH611+UDZcmKS3g6CthxToOb37KgwE= k8s.io/kube-openapi v0.0.0-20250910181357-589584f1c912/go.mod h1:kdmbQkyfwUagLfXIad1y2TdrjPFWp2Q89B3qkRwf/pQ= k8s.io/kubelet v0.34.4 h1:+8aLwtoZSUnE7HLxjrAYNtlJFzlwxQ4UBleyaW4JzA8= @@ -428,6 +438,8 @@ sigs.k8s.io/gateway-api v1.4.0 h1:ZwlNM6zOHq0h3WUX2gfByPs2yAEsy/EenYJB78jpQfQ= sigs.k8s.io/gateway-api v1.4.0/go.mod h1:AR5RSqciWP98OPckEjOjh2XJhAe2Na4LHyXD2FUY7Qk= sigs.k8s.io/json v0.0.0-20250730193827-2d320260d730 h1:IpInykpT6ceI+QxKBbEflcR5EXP7sU1kvOlxwZh5txg= sigs.k8s.io/json v0.0.0-20250730193827-2d320260d730/go.mod h1:mdzfpAEoE6DHQEN0uh9ZbOCuHbLK5wOm7dK4ctXE9Tg= +sigs.k8s.io/kube-storage-version-migrator v0.0.6-0.20230721195810-5c8923c5ff96 h1:PFWFSkpArPNJxFX4ZKWAk9NSeRoZaXschn+ULa4xVek= +sigs.k8s.io/kube-storage-version-migrator v0.0.6-0.20230721195810-5c8923c5ff96/go.mod h1:EOBQyBowOUsd7U4CJnMHNE0ri+zCXyouGdLwC/jZU+I= sigs.k8s.io/randfill v1.0.0 h1:JfjMILfT8A6RbawdsK2JXGBR5AQVfd+9TbzrlneTyrU= sigs.k8s.io/randfill v1.0.0/go.mod h1:XeLlZ/jmk4i1HRopwe7/aU3H5n1zNUcX6TM94b3QxOY= sigs.k8s.io/structured-merge-diff/v6 v6.3.1 h1:JrhdFMqOd/+3ByqlP2I45kTOZmTRLBUm5pvRjeheg7E= diff --git a/vendor/github.com/openshift/client-go/console/applyconfigurations/console/v1/applicationmenuspec.go b/vendor/github.com/openshift/client-go/console/applyconfigurations/console/v1/applicationmenuspec.go new file mode 100644 index 000000000..8f54af3d5 --- /dev/null +++ b/vendor/github.com/openshift/client-go/console/applyconfigurations/console/v1/applicationmenuspec.go @@ -0,0 +1,32 @@ +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +// ApplicationMenuSpecApplyConfiguration represents a declarative configuration of the ApplicationMenuSpec type for use +// with apply. +type ApplicationMenuSpecApplyConfiguration struct { + Section *string `json:"section,omitempty"` + ImageURL *string `json:"imageURL,omitempty"` +} + +// ApplicationMenuSpecApplyConfiguration constructs a declarative configuration of the ApplicationMenuSpec type for use with +// apply. +func ApplicationMenuSpec() *ApplicationMenuSpecApplyConfiguration { + return &ApplicationMenuSpecApplyConfiguration{} +} + +// WithSection sets the Section field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Section field is set to the value of the last call. +func (b *ApplicationMenuSpecApplyConfiguration) WithSection(value string) *ApplicationMenuSpecApplyConfiguration { + b.Section = &value + return b +} + +// WithImageURL sets the ImageURL field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ImageURL field is set to the value of the last call. +func (b *ApplicationMenuSpecApplyConfiguration) WithImageURL(value string) *ApplicationMenuSpecApplyConfiguration { + b.ImageURL = &value + return b +} diff --git a/vendor/github.com/openshift/client-go/console/applyconfigurations/console/v1/clidownloadlink.go b/vendor/github.com/openshift/client-go/console/applyconfigurations/console/v1/clidownloadlink.go new file mode 100644 index 000000000..efddfece3 --- /dev/null +++ b/vendor/github.com/openshift/client-go/console/applyconfigurations/console/v1/clidownloadlink.go @@ -0,0 +1,32 @@ +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +// CLIDownloadLinkApplyConfiguration represents a declarative configuration of the CLIDownloadLink type for use +// with apply. +type CLIDownloadLinkApplyConfiguration struct { + Text *string `json:"text,omitempty"` + Href *string `json:"href,omitempty"` +} + +// CLIDownloadLinkApplyConfiguration constructs a declarative configuration of the CLIDownloadLink type for use with +// apply. +func CLIDownloadLink() *CLIDownloadLinkApplyConfiguration { + return &CLIDownloadLinkApplyConfiguration{} +} + +// WithText sets the Text field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Text field is set to the value of the last call. +func (b *CLIDownloadLinkApplyConfiguration) WithText(value string) *CLIDownloadLinkApplyConfiguration { + b.Text = &value + return b +} + +// WithHref sets the Href field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Href field is set to the value of the last call. +func (b *CLIDownloadLinkApplyConfiguration) WithHref(value string) *CLIDownloadLinkApplyConfiguration { + b.Href = &value + return b +} diff --git a/vendor/github.com/openshift/client-go/console/applyconfigurations/console/v1/consoleclidownload.go b/vendor/github.com/openshift/client-go/console/applyconfigurations/console/v1/consoleclidownload.go new file mode 100644 index 000000000..eac679b0f --- /dev/null +++ b/vendor/github.com/openshift/client-go/console/applyconfigurations/console/v1/consoleclidownload.go @@ -0,0 +1,254 @@ +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +import ( + consolev1 "github.com/openshift/api/console/v1" + internal "github.com/openshift/client-go/console/applyconfigurations/internal" + apismetav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + managedfields "k8s.io/apimachinery/pkg/util/managedfields" + metav1 "k8s.io/client-go/applyconfigurations/meta/v1" +) + +// ConsoleCLIDownloadApplyConfiguration represents a declarative configuration of the ConsoleCLIDownload type for use +// with apply. +type ConsoleCLIDownloadApplyConfiguration struct { + metav1.TypeMetaApplyConfiguration `json:",inline"` + *metav1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` + Spec *ConsoleCLIDownloadSpecApplyConfiguration `json:"spec,omitempty"` +} + +// ConsoleCLIDownload constructs a declarative configuration of the ConsoleCLIDownload type for use with +// apply. +func ConsoleCLIDownload(name string) *ConsoleCLIDownloadApplyConfiguration { + b := &ConsoleCLIDownloadApplyConfiguration{} + b.WithName(name) + b.WithKind("ConsoleCLIDownload") + b.WithAPIVersion("console.openshift.io/v1") + return b +} + +// ExtractConsoleCLIDownload extracts the applied configuration owned by fieldManager from +// consoleCLIDownload. If no managedFields are found in consoleCLIDownload for fieldManager, a +// ConsoleCLIDownloadApplyConfiguration is returned with only the Name, Namespace (if applicable), +// APIVersion and Kind populated. It is possible that no managed fields were found for because other +// field managers have taken ownership of all the fields previously owned by fieldManager, or because +// the fieldManager never owned fields any fields. +// consoleCLIDownload must be a unmodified ConsoleCLIDownload API object that was retrieved from the Kubernetes API. +// ExtractConsoleCLIDownload provides a way to perform a extract/modify-in-place/apply workflow. +// Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously +// applied if another fieldManager has updated or force applied any of the previously applied fields. +// Experimental! +func ExtractConsoleCLIDownload(consoleCLIDownload *consolev1.ConsoleCLIDownload, fieldManager string) (*ConsoleCLIDownloadApplyConfiguration, error) { + return extractConsoleCLIDownload(consoleCLIDownload, fieldManager, "") +} + +// ExtractConsoleCLIDownloadStatus is the same as ExtractConsoleCLIDownload except +// that it extracts the status subresource applied configuration. +// Experimental! +func ExtractConsoleCLIDownloadStatus(consoleCLIDownload *consolev1.ConsoleCLIDownload, fieldManager string) (*ConsoleCLIDownloadApplyConfiguration, error) { + return extractConsoleCLIDownload(consoleCLIDownload, fieldManager, "status") +} + +func extractConsoleCLIDownload(consoleCLIDownload *consolev1.ConsoleCLIDownload, fieldManager string, subresource string) (*ConsoleCLIDownloadApplyConfiguration, error) { + b := &ConsoleCLIDownloadApplyConfiguration{} + err := managedfields.ExtractInto(consoleCLIDownload, internal.Parser().Type("com.github.openshift.api.console.v1.ConsoleCLIDownload"), fieldManager, b, subresource) + if err != nil { + return nil, err + } + b.WithName(consoleCLIDownload.Name) + + b.WithKind("ConsoleCLIDownload") + b.WithAPIVersion("console.openshift.io/v1") + return b, nil +} +func (b ConsoleCLIDownloadApplyConfiguration) IsApplyConfiguration() {} + +// WithKind sets the Kind field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Kind field is set to the value of the last call. +func (b *ConsoleCLIDownloadApplyConfiguration) WithKind(value string) *ConsoleCLIDownloadApplyConfiguration { + b.TypeMetaApplyConfiguration.Kind = &value + return b +} + +// WithAPIVersion sets the APIVersion field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the APIVersion field is set to the value of the last call. +func (b *ConsoleCLIDownloadApplyConfiguration) WithAPIVersion(value string) *ConsoleCLIDownloadApplyConfiguration { + b.TypeMetaApplyConfiguration.APIVersion = &value + return b +} + +// WithName sets the Name field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Name field is set to the value of the last call. +func (b *ConsoleCLIDownloadApplyConfiguration) WithName(value string) *ConsoleCLIDownloadApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.Name = &value + return b +} + +// WithGenerateName sets the GenerateName field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the GenerateName field is set to the value of the last call. +func (b *ConsoleCLIDownloadApplyConfiguration) WithGenerateName(value string) *ConsoleCLIDownloadApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.GenerateName = &value + return b +} + +// WithNamespace sets the Namespace field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Namespace field is set to the value of the last call. +func (b *ConsoleCLIDownloadApplyConfiguration) WithNamespace(value string) *ConsoleCLIDownloadApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.Namespace = &value + return b +} + +// WithUID sets the UID field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the UID field is set to the value of the last call. +func (b *ConsoleCLIDownloadApplyConfiguration) WithUID(value types.UID) *ConsoleCLIDownloadApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.UID = &value + return b +} + +// WithResourceVersion sets the ResourceVersion field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ResourceVersion field is set to the value of the last call. +func (b *ConsoleCLIDownloadApplyConfiguration) WithResourceVersion(value string) *ConsoleCLIDownloadApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.ResourceVersion = &value + return b +} + +// WithGeneration sets the Generation field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Generation field is set to the value of the last call. +func (b *ConsoleCLIDownloadApplyConfiguration) WithGeneration(value int64) *ConsoleCLIDownloadApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.Generation = &value + return b +} + +// WithCreationTimestamp sets the CreationTimestamp field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the CreationTimestamp field is set to the value of the last call. +func (b *ConsoleCLIDownloadApplyConfiguration) WithCreationTimestamp(value apismetav1.Time) *ConsoleCLIDownloadApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.CreationTimestamp = &value + return b +} + +// WithDeletionTimestamp sets the DeletionTimestamp field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the DeletionTimestamp field is set to the value of the last call. +func (b *ConsoleCLIDownloadApplyConfiguration) WithDeletionTimestamp(value apismetav1.Time) *ConsoleCLIDownloadApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.DeletionTimestamp = &value + return b +} + +// WithDeletionGracePeriodSeconds sets the DeletionGracePeriodSeconds field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the DeletionGracePeriodSeconds field is set to the value of the last call. +func (b *ConsoleCLIDownloadApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *ConsoleCLIDownloadApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.DeletionGracePeriodSeconds = &value + return b +} + +// WithLabels puts the entries into the Labels field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, the entries provided by each call will be put on the Labels field, +// overwriting an existing map entries in Labels field with the same key. +func (b *ConsoleCLIDownloadApplyConfiguration) WithLabels(entries map[string]string) *ConsoleCLIDownloadApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + if b.ObjectMetaApplyConfiguration.Labels == nil && len(entries) > 0 { + b.ObjectMetaApplyConfiguration.Labels = make(map[string]string, len(entries)) + } + for k, v := range entries { + b.ObjectMetaApplyConfiguration.Labels[k] = v + } + return b +} + +// WithAnnotations puts the entries into the Annotations field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, the entries provided by each call will be put on the Annotations field, +// overwriting an existing map entries in Annotations field with the same key. +func (b *ConsoleCLIDownloadApplyConfiguration) WithAnnotations(entries map[string]string) *ConsoleCLIDownloadApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + if b.ObjectMetaApplyConfiguration.Annotations == nil && len(entries) > 0 { + b.ObjectMetaApplyConfiguration.Annotations = make(map[string]string, len(entries)) + } + for k, v := range entries { + b.ObjectMetaApplyConfiguration.Annotations[k] = v + } + return b +} + +// WithOwnerReferences adds the given value to the OwnerReferences field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the OwnerReferences field. +func (b *ConsoleCLIDownloadApplyConfiguration) WithOwnerReferences(values ...*metav1.OwnerReferenceApplyConfiguration) *ConsoleCLIDownloadApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + for i := range values { + if values[i] == nil { + panic("nil value passed to WithOwnerReferences") + } + b.ObjectMetaApplyConfiguration.OwnerReferences = append(b.ObjectMetaApplyConfiguration.OwnerReferences, *values[i]) + } + return b +} + +// WithFinalizers adds the given value to the Finalizers field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Finalizers field. +func (b *ConsoleCLIDownloadApplyConfiguration) WithFinalizers(values ...string) *ConsoleCLIDownloadApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + for i := range values { + b.ObjectMetaApplyConfiguration.Finalizers = append(b.ObjectMetaApplyConfiguration.Finalizers, values[i]) + } + return b +} + +func (b *ConsoleCLIDownloadApplyConfiguration) ensureObjectMetaApplyConfigurationExists() { + if b.ObjectMetaApplyConfiguration == nil { + b.ObjectMetaApplyConfiguration = &metav1.ObjectMetaApplyConfiguration{} + } +} + +// WithSpec sets the Spec field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Spec field is set to the value of the last call. +func (b *ConsoleCLIDownloadApplyConfiguration) WithSpec(value *ConsoleCLIDownloadSpecApplyConfiguration) *ConsoleCLIDownloadApplyConfiguration { + b.Spec = value + return b +} + +// GetKind retrieves the value of the Kind field in the declarative configuration. +func (b *ConsoleCLIDownloadApplyConfiguration) GetKind() *string { + return b.TypeMetaApplyConfiguration.Kind +} + +// GetAPIVersion retrieves the value of the APIVersion field in the declarative configuration. +func (b *ConsoleCLIDownloadApplyConfiguration) GetAPIVersion() *string { + return b.TypeMetaApplyConfiguration.APIVersion +} + +// GetName retrieves the value of the Name field in the declarative configuration. +func (b *ConsoleCLIDownloadApplyConfiguration) GetName() *string { + b.ensureObjectMetaApplyConfigurationExists() + return b.ObjectMetaApplyConfiguration.Name +} + +// GetNamespace retrieves the value of the Namespace field in the declarative configuration. +func (b *ConsoleCLIDownloadApplyConfiguration) GetNamespace() *string { + b.ensureObjectMetaApplyConfigurationExists() + return b.ObjectMetaApplyConfiguration.Namespace +} diff --git a/vendor/github.com/openshift/client-go/console/applyconfigurations/console/v1/consoleclidownloadspec.go b/vendor/github.com/openshift/client-go/console/applyconfigurations/console/v1/consoleclidownloadspec.go new file mode 100644 index 000000000..9e61ef267 --- /dev/null +++ b/vendor/github.com/openshift/client-go/console/applyconfigurations/console/v1/consoleclidownloadspec.go @@ -0,0 +1,46 @@ +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +// ConsoleCLIDownloadSpecApplyConfiguration represents a declarative configuration of the ConsoleCLIDownloadSpec type for use +// with apply. +type ConsoleCLIDownloadSpecApplyConfiguration struct { + DisplayName *string `json:"displayName,omitempty"` + Description *string `json:"description,omitempty"` + Links []CLIDownloadLinkApplyConfiguration `json:"links,omitempty"` +} + +// ConsoleCLIDownloadSpecApplyConfiguration constructs a declarative configuration of the ConsoleCLIDownloadSpec type for use with +// apply. +func ConsoleCLIDownloadSpec() *ConsoleCLIDownloadSpecApplyConfiguration { + return &ConsoleCLIDownloadSpecApplyConfiguration{} +} + +// WithDisplayName sets the DisplayName field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the DisplayName field is set to the value of the last call. +func (b *ConsoleCLIDownloadSpecApplyConfiguration) WithDisplayName(value string) *ConsoleCLIDownloadSpecApplyConfiguration { + b.DisplayName = &value + return b +} + +// WithDescription sets the Description field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Description field is set to the value of the last call. +func (b *ConsoleCLIDownloadSpecApplyConfiguration) WithDescription(value string) *ConsoleCLIDownloadSpecApplyConfiguration { + b.Description = &value + return b +} + +// WithLinks adds the given value to the Links field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Links field. +func (b *ConsoleCLIDownloadSpecApplyConfiguration) WithLinks(values ...*CLIDownloadLinkApplyConfiguration) *ConsoleCLIDownloadSpecApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithLinks") + } + b.Links = append(b.Links, *values[i]) + } + return b +} diff --git a/vendor/github.com/openshift/client-go/console/applyconfigurations/console/v1/consoleexternalloglink.go b/vendor/github.com/openshift/client-go/console/applyconfigurations/console/v1/consoleexternalloglink.go new file mode 100644 index 000000000..932d10ef4 --- /dev/null +++ b/vendor/github.com/openshift/client-go/console/applyconfigurations/console/v1/consoleexternalloglink.go @@ -0,0 +1,254 @@ +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +import ( + consolev1 "github.com/openshift/api/console/v1" + internal "github.com/openshift/client-go/console/applyconfigurations/internal" + apismetav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + managedfields "k8s.io/apimachinery/pkg/util/managedfields" + metav1 "k8s.io/client-go/applyconfigurations/meta/v1" +) + +// ConsoleExternalLogLinkApplyConfiguration represents a declarative configuration of the ConsoleExternalLogLink type for use +// with apply. +type ConsoleExternalLogLinkApplyConfiguration struct { + metav1.TypeMetaApplyConfiguration `json:",inline"` + *metav1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` + Spec *ConsoleExternalLogLinkSpecApplyConfiguration `json:"spec,omitempty"` +} + +// ConsoleExternalLogLink constructs a declarative configuration of the ConsoleExternalLogLink type for use with +// apply. +func ConsoleExternalLogLink(name string) *ConsoleExternalLogLinkApplyConfiguration { + b := &ConsoleExternalLogLinkApplyConfiguration{} + b.WithName(name) + b.WithKind("ConsoleExternalLogLink") + b.WithAPIVersion("console.openshift.io/v1") + return b +} + +// ExtractConsoleExternalLogLink extracts the applied configuration owned by fieldManager from +// consoleExternalLogLink. If no managedFields are found in consoleExternalLogLink for fieldManager, a +// ConsoleExternalLogLinkApplyConfiguration is returned with only the Name, Namespace (if applicable), +// APIVersion and Kind populated. It is possible that no managed fields were found for because other +// field managers have taken ownership of all the fields previously owned by fieldManager, or because +// the fieldManager never owned fields any fields. +// consoleExternalLogLink must be a unmodified ConsoleExternalLogLink API object that was retrieved from the Kubernetes API. +// ExtractConsoleExternalLogLink provides a way to perform a extract/modify-in-place/apply workflow. +// Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously +// applied if another fieldManager has updated or force applied any of the previously applied fields. +// Experimental! +func ExtractConsoleExternalLogLink(consoleExternalLogLink *consolev1.ConsoleExternalLogLink, fieldManager string) (*ConsoleExternalLogLinkApplyConfiguration, error) { + return extractConsoleExternalLogLink(consoleExternalLogLink, fieldManager, "") +} + +// ExtractConsoleExternalLogLinkStatus is the same as ExtractConsoleExternalLogLink except +// that it extracts the status subresource applied configuration. +// Experimental! +func ExtractConsoleExternalLogLinkStatus(consoleExternalLogLink *consolev1.ConsoleExternalLogLink, fieldManager string) (*ConsoleExternalLogLinkApplyConfiguration, error) { + return extractConsoleExternalLogLink(consoleExternalLogLink, fieldManager, "status") +} + +func extractConsoleExternalLogLink(consoleExternalLogLink *consolev1.ConsoleExternalLogLink, fieldManager string, subresource string) (*ConsoleExternalLogLinkApplyConfiguration, error) { + b := &ConsoleExternalLogLinkApplyConfiguration{} + err := managedfields.ExtractInto(consoleExternalLogLink, internal.Parser().Type("com.github.openshift.api.console.v1.ConsoleExternalLogLink"), fieldManager, b, subresource) + if err != nil { + return nil, err + } + b.WithName(consoleExternalLogLink.Name) + + b.WithKind("ConsoleExternalLogLink") + b.WithAPIVersion("console.openshift.io/v1") + return b, nil +} +func (b ConsoleExternalLogLinkApplyConfiguration) IsApplyConfiguration() {} + +// WithKind sets the Kind field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Kind field is set to the value of the last call. +func (b *ConsoleExternalLogLinkApplyConfiguration) WithKind(value string) *ConsoleExternalLogLinkApplyConfiguration { + b.TypeMetaApplyConfiguration.Kind = &value + return b +} + +// WithAPIVersion sets the APIVersion field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the APIVersion field is set to the value of the last call. +func (b *ConsoleExternalLogLinkApplyConfiguration) WithAPIVersion(value string) *ConsoleExternalLogLinkApplyConfiguration { + b.TypeMetaApplyConfiguration.APIVersion = &value + return b +} + +// WithName sets the Name field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Name field is set to the value of the last call. +func (b *ConsoleExternalLogLinkApplyConfiguration) WithName(value string) *ConsoleExternalLogLinkApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.Name = &value + return b +} + +// WithGenerateName sets the GenerateName field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the GenerateName field is set to the value of the last call. +func (b *ConsoleExternalLogLinkApplyConfiguration) WithGenerateName(value string) *ConsoleExternalLogLinkApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.GenerateName = &value + return b +} + +// WithNamespace sets the Namespace field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Namespace field is set to the value of the last call. +func (b *ConsoleExternalLogLinkApplyConfiguration) WithNamespace(value string) *ConsoleExternalLogLinkApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.Namespace = &value + return b +} + +// WithUID sets the UID field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the UID field is set to the value of the last call. +func (b *ConsoleExternalLogLinkApplyConfiguration) WithUID(value types.UID) *ConsoleExternalLogLinkApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.UID = &value + return b +} + +// WithResourceVersion sets the ResourceVersion field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ResourceVersion field is set to the value of the last call. +func (b *ConsoleExternalLogLinkApplyConfiguration) WithResourceVersion(value string) *ConsoleExternalLogLinkApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.ResourceVersion = &value + return b +} + +// WithGeneration sets the Generation field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Generation field is set to the value of the last call. +func (b *ConsoleExternalLogLinkApplyConfiguration) WithGeneration(value int64) *ConsoleExternalLogLinkApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.Generation = &value + return b +} + +// WithCreationTimestamp sets the CreationTimestamp field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the CreationTimestamp field is set to the value of the last call. +func (b *ConsoleExternalLogLinkApplyConfiguration) WithCreationTimestamp(value apismetav1.Time) *ConsoleExternalLogLinkApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.CreationTimestamp = &value + return b +} + +// WithDeletionTimestamp sets the DeletionTimestamp field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the DeletionTimestamp field is set to the value of the last call. +func (b *ConsoleExternalLogLinkApplyConfiguration) WithDeletionTimestamp(value apismetav1.Time) *ConsoleExternalLogLinkApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.DeletionTimestamp = &value + return b +} + +// WithDeletionGracePeriodSeconds sets the DeletionGracePeriodSeconds field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the DeletionGracePeriodSeconds field is set to the value of the last call. +func (b *ConsoleExternalLogLinkApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *ConsoleExternalLogLinkApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.DeletionGracePeriodSeconds = &value + return b +} + +// WithLabels puts the entries into the Labels field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, the entries provided by each call will be put on the Labels field, +// overwriting an existing map entries in Labels field with the same key. +func (b *ConsoleExternalLogLinkApplyConfiguration) WithLabels(entries map[string]string) *ConsoleExternalLogLinkApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + if b.ObjectMetaApplyConfiguration.Labels == nil && len(entries) > 0 { + b.ObjectMetaApplyConfiguration.Labels = make(map[string]string, len(entries)) + } + for k, v := range entries { + b.ObjectMetaApplyConfiguration.Labels[k] = v + } + return b +} + +// WithAnnotations puts the entries into the Annotations field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, the entries provided by each call will be put on the Annotations field, +// overwriting an existing map entries in Annotations field with the same key. +func (b *ConsoleExternalLogLinkApplyConfiguration) WithAnnotations(entries map[string]string) *ConsoleExternalLogLinkApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + if b.ObjectMetaApplyConfiguration.Annotations == nil && len(entries) > 0 { + b.ObjectMetaApplyConfiguration.Annotations = make(map[string]string, len(entries)) + } + for k, v := range entries { + b.ObjectMetaApplyConfiguration.Annotations[k] = v + } + return b +} + +// WithOwnerReferences adds the given value to the OwnerReferences field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the OwnerReferences field. +func (b *ConsoleExternalLogLinkApplyConfiguration) WithOwnerReferences(values ...*metav1.OwnerReferenceApplyConfiguration) *ConsoleExternalLogLinkApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + for i := range values { + if values[i] == nil { + panic("nil value passed to WithOwnerReferences") + } + b.ObjectMetaApplyConfiguration.OwnerReferences = append(b.ObjectMetaApplyConfiguration.OwnerReferences, *values[i]) + } + return b +} + +// WithFinalizers adds the given value to the Finalizers field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Finalizers field. +func (b *ConsoleExternalLogLinkApplyConfiguration) WithFinalizers(values ...string) *ConsoleExternalLogLinkApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + for i := range values { + b.ObjectMetaApplyConfiguration.Finalizers = append(b.ObjectMetaApplyConfiguration.Finalizers, values[i]) + } + return b +} + +func (b *ConsoleExternalLogLinkApplyConfiguration) ensureObjectMetaApplyConfigurationExists() { + if b.ObjectMetaApplyConfiguration == nil { + b.ObjectMetaApplyConfiguration = &metav1.ObjectMetaApplyConfiguration{} + } +} + +// WithSpec sets the Spec field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Spec field is set to the value of the last call. +func (b *ConsoleExternalLogLinkApplyConfiguration) WithSpec(value *ConsoleExternalLogLinkSpecApplyConfiguration) *ConsoleExternalLogLinkApplyConfiguration { + b.Spec = value + return b +} + +// GetKind retrieves the value of the Kind field in the declarative configuration. +func (b *ConsoleExternalLogLinkApplyConfiguration) GetKind() *string { + return b.TypeMetaApplyConfiguration.Kind +} + +// GetAPIVersion retrieves the value of the APIVersion field in the declarative configuration. +func (b *ConsoleExternalLogLinkApplyConfiguration) GetAPIVersion() *string { + return b.TypeMetaApplyConfiguration.APIVersion +} + +// GetName retrieves the value of the Name field in the declarative configuration. +func (b *ConsoleExternalLogLinkApplyConfiguration) GetName() *string { + b.ensureObjectMetaApplyConfigurationExists() + return b.ObjectMetaApplyConfiguration.Name +} + +// GetNamespace retrieves the value of the Namespace field in the declarative configuration. +func (b *ConsoleExternalLogLinkApplyConfiguration) GetNamespace() *string { + b.ensureObjectMetaApplyConfigurationExists() + return b.ObjectMetaApplyConfiguration.Namespace +} diff --git a/vendor/github.com/openshift/client-go/console/applyconfigurations/console/v1/consoleexternalloglinkspec.go b/vendor/github.com/openshift/client-go/console/applyconfigurations/console/v1/consoleexternalloglinkspec.go new file mode 100644 index 000000000..0f63111e4 --- /dev/null +++ b/vendor/github.com/openshift/client-go/console/applyconfigurations/console/v1/consoleexternalloglinkspec.go @@ -0,0 +1,41 @@ +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +// ConsoleExternalLogLinkSpecApplyConfiguration represents a declarative configuration of the ConsoleExternalLogLinkSpec type for use +// with apply. +type ConsoleExternalLogLinkSpecApplyConfiguration struct { + Text *string `json:"text,omitempty"` + HrefTemplate *string `json:"hrefTemplate,omitempty"` + NamespaceFilter *string `json:"namespaceFilter,omitempty"` +} + +// ConsoleExternalLogLinkSpecApplyConfiguration constructs a declarative configuration of the ConsoleExternalLogLinkSpec type for use with +// apply. +func ConsoleExternalLogLinkSpec() *ConsoleExternalLogLinkSpecApplyConfiguration { + return &ConsoleExternalLogLinkSpecApplyConfiguration{} +} + +// WithText sets the Text field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Text field is set to the value of the last call. +func (b *ConsoleExternalLogLinkSpecApplyConfiguration) WithText(value string) *ConsoleExternalLogLinkSpecApplyConfiguration { + b.Text = &value + return b +} + +// WithHrefTemplate sets the HrefTemplate field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the HrefTemplate field is set to the value of the last call. +func (b *ConsoleExternalLogLinkSpecApplyConfiguration) WithHrefTemplate(value string) *ConsoleExternalLogLinkSpecApplyConfiguration { + b.HrefTemplate = &value + return b +} + +// WithNamespaceFilter sets the NamespaceFilter field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the NamespaceFilter field is set to the value of the last call. +func (b *ConsoleExternalLogLinkSpecApplyConfiguration) WithNamespaceFilter(value string) *ConsoleExternalLogLinkSpecApplyConfiguration { + b.NamespaceFilter = &value + return b +} diff --git a/vendor/github.com/openshift/client-go/console/applyconfigurations/console/v1/consolelink.go b/vendor/github.com/openshift/client-go/console/applyconfigurations/console/v1/consolelink.go new file mode 100644 index 000000000..5168442f5 --- /dev/null +++ b/vendor/github.com/openshift/client-go/console/applyconfigurations/console/v1/consolelink.go @@ -0,0 +1,254 @@ +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +import ( + consolev1 "github.com/openshift/api/console/v1" + internal "github.com/openshift/client-go/console/applyconfigurations/internal" + apismetav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + managedfields "k8s.io/apimachinery/pkg/util/managedfields" + metav1 "k8s.io/client-go/applyconfigurations/meta/v1" +) + +// ConsoleLinkApplyConfiguration represents a declarative configuration of the ConsoleLink type for use +// with apply. +type ConsoleLinkApplyConfiguration struct { + metav1.TypeMetaApplyConfiguration `json:",inline"` + *metav1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` + Spec *ConsoleLinkSpecApplyConfiguration `json:"spec,omitempty"` +} + +// ConsoleLink constructs a declarative configuration of the ConsoleLink type for use with +// apply. +func ConsoleLink(name string) *ConsoleLinkApplyConfiguration { + b := &ConsoleLinkApplyConfiguration{} + b.WithName(name) + b.WithKind("ConsoleLink") + b.WithAPIVersion("console.openshift.io/v1") + return b +} + +// ExtractConsoleLink extracts the applied configuration owned by fieldManager from +// consoleLink. If no managedFields are found in consoleLink for fieldManager, a +// ConsoleLinkApplyConfiguration is returned with only the Name, Namespace (if applicable), +// APIVersion and Kind populated. It is possible that no managed fields were found for because other +// field managers have taken ownership of all the fields previously owned by fieldManager, or because +// the fieldManager never owned fields any fields. +// consoleLink must be a unmodified ConsoleLink API object that was retrieved from the Kubernetes API. +// ExtractConsoleLink provides a way to perform a extract/modify-in-place/apply workflow. +// Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously +// applied if another fieldManager has updated or force applied any of the previously applied fields. +// Experimental! +func ExtractConsoleLink(consoleLink *consolev1.ConsoleLink, fieldManager string) (*ConsoleLinkApplyConfiguration, error) { + return extractConsoleLink(consoleLink, fieldManager, "") +} + +// ExtractConsoleLinkStatus is the same as ExtractConsoleLink except +// that it extracts the status subresource applied configuration. +// Experimental! +func ExtractConsoleLinkStatus(consoleLink *consolev1.ConsoleLink, fieldManager string) (*ConsoleLinkApplyConfiguration, error) { + return extractConsoleLink(consoleLink, fieldManager, "status") +} + +func extractConsoleLink(consoleLink *consolev1.ConsoleLink, fieldManager string, subresource string) (*ConsoleLinkApplyConfiguration, error) { + b := &ConsoleLinkApplyConfiguration{} + err := managedfields.ExtractInto(consoleLink, internal.Parser().Type("com.github.openshift.api.console.v1.ConsoleLink"), fieldManager, b, subresource) + if err != nil { + return nil, err + } + b.WithName(consoleLink.Name) + + b.WithKind("ConsoleLink") + b.WithAPIVersion("console.openshift.io/v1") + return b, nil +} +func (b ConsoleLinkApplyConfiguration) IsApplyConfiguration() {} + +// WithKind sets the Kind field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Kind field is set to the value of the last call. +func (b *ConsoleLinkApplyConfiguration) WithKind(value string) *ConsoleLinkApplyConfiguration { + b.TypeMetaApplyConfiguration.Kind = &value + return b +} + +// WithAPIVersion sets the APIVersion field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the APIVersion field is set to the value of the last call. +func (b *ConsoleLinkApplyConfiguration) WithAPIVersion(value string) *ConsoleLinkApplyConfiguration { + b.TypeMetaApplyConfiguration.APIVersion = &value + return b +} + +// WithName sets the Name field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Name field is set to the value of the last call. +func (b *ConsoleLinkApplyConfiguration) WithName(value string) *ConsoleLinkApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.Name = &value + return b +} + +// WithGenerateName sets the GenerateName field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the GenerateName field is set to the value of the last call. +func (b *ConsoleLinkApplyConfiguration) WithGenerateName(value string) *ConsoleLinkApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.GenerateName = &value + return b +} + +// WithNamespace sets the Namespace field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Namespace field is set to the value of the last call. +func (b *ConsoleLinkApplyConfiguration) WithNamespace(value string) *ConsoleLinkApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.Namespace = &value + return b +} + +// WithUID sets the UID field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the UID field is set to the value of the last call. +func (b *ConsoleLinkApplyConfiguration) WithUID(value types.UID) *ConsoleLinkApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.UID = &value + return b +} + +// WithResourceVersion sets the ResourceVersion field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ResourceVersion field is set to the value of the last call. +func (b *ConsoleLinkApplyConfiguration) WithResourceVersion(value string) *ConsoleLinkApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.ResourceVersion = &value + return b +} + +// WithGeneration sets the Generation field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Generation field is set to the value of the last call. +func (b *ConsoleLinkApplyConfiguration) WithGeneration(value int64) *ConsoleLinkApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.Generation = &value + return b +} + +// WithCreationTimestamp sets the CreationTimestamp field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the CreationTimestamp field is set to the value of the last call. +func (b *ConsoleLinkApplyConfiguration) WithCreationTimestamp(value apismetav1.Time) *ConsoleLinkApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.CreationTimestamp = &value + return b +} + +// WithDeletionTimestamp sets the DeletionTimestamp field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the DeletionTimestamp field is set to the value of the last call. +func (b *ConsoleLinkApplyConfiguration) WithDeletionTimestamp(value apismetav1.Time) *ConsoleLinkApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.DeletionTimestamp = &value + return b +} + +// WithDeletionGracePeriodSeconds sets the DeletionGracePeriodSeconds field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the DeletionGracePeriodSeconds field is set to the value of the last call. +func (b *ConsoleLinkApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *ConsoleLinkApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.DeletionGracePeriodSeconds = &value + return b +} + +// WithLabels puts the entries into the Labels field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, the entries provided by each call will be put on the Labels field, +// overwriting an existing map entries in Labels field with the same key. +func (b *ConsoleLinkApplyConfiguration) WithLabels(entries map[string]string) *ConsoleLinkApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + if b.ObjectMetaApplyConfiguration.Labels == nil && len(entries) > 0 { + b.ObjectMetaApplyConfiguration.Labels = make(map[string]string, len(entries)) + } + for k, v := range entries { + b.ObjectMetaApplyConfiguration.Labels[k] = v + } + return b +} + +// WithAnnotations puts the entries into the Annotations field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, the entries provided by each call will be put on the Annotations field, +// overwriting an existing map entries in Annotations field with the same key. +func (b *ConsoleLinkApplyConfiguration) WithAnnotations(entries map[string]string) *ConsoleLinkApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + if b.ObjectMetaApplyConfiguration.Annotations == nil && len(entries) > 0 { + b.ObjectMetaApplyConfiguration.Annotations = make(map[string]string, len(entries)) + } + for k, v := range entries { + b.ObjectMetaApplyConfiguration.Annotations[k] = v + } + return b +} + +// WithOwnerReferences adds the given value to the OwnerReferences field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the OwnerReferences field. +func (b *ConsoleLinkApplyConfiguration) WithOwnerReferences(values ...*metav1.OwnerReferenceApplyConfiguration) *ConsoleLinkApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + for i := range values { + if values[i] == nil { + panic("nil value passed to WithOwnerReferences") + } + b.ObjectMetaApplyConfiguration.OwnerReferences = append(b.ObjectMetaApplyConfiguration.OwnerReferences, *values[i]) + } + return b +} + +// WithFinalizers adds the given value to the Finalizers field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Finalizers field. +func (b *ConsoleLinkApplyConfiguration) WithFinalizers(values ...string) *ConsoleLinkApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + for i := range values { + b.ObjectMetaApplyConfiguration.Finalizers = append(b.ObjectMetaApplyConfiguration.Finalizers, values[i]) + } + return b +} + +func (b *ConsoleLinkApplyConfiguration) ensureObjectMetaApplyConfigurationExists() { + if b.ObjectMetaApplyConfiguration == nil { + b.ObjectMetaApplyConfiguration = &metav1.ObjectMetaApplyConfiguration{} + } +} + +// WithSpec sets the Spec field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Spec field is set to the value of the last call. +func (b *ConsoleLinkApplyConfiguration) WithSpec(value *ConsoleLinkSpecApplyConfiguration) *ConsoleLinkApplyConfiguration { + b.Spec = value + return b +} + +// GetKind retrieves the value of the Kind field in the declarative configuration. +func (b *ConsoleLinkApplyConfiguration) GetKind() *string { + return b.TypeMetaApplyConfiguration.Kind +} + +// GetAPIVersion retrieves the value of the APIVersion field in the declarative configuration. +func (b *ConsoleLinkApplyConfiguration) GetAPIVersion() *string { + return b.TypeMetaApplyConfiguration.APIVersion +} + +// GetName retrieves the value of the Name field in the declarative configuration. +func (b *ConsoleLinkApplyConfiguration) GetName() *string { + b.ensureObjectMetaApplyConfigurationExists() + return b.ObjectMetaApplyConfiguration.Name +} + +// GetNamespace retrieves the value of the Namespace field in the declarative configuration. +func (b *ConsoleLinkApplyConfiguration) GetNamespace() *string { + b.ensureObjectMetaApplyConfigurationExists() + return b.ObjectMetaApplyConfiguration.Namespace +} diff --git a/vendor/github.com/openshift/client-go/console/applyconfigurations/console/v1/consolelinkspec.go b/vendor/github.com/openshift/client-go/console/applyconfigurations/console/v1/consolelinkspec.go new file mode 100644 index 000000000..151aaacfc --- /dev/null +++ b/vendor/github.com/openshift/client-go/console/applyconfigurations/console/v1/consolelinkspec.go @@ -0,0 +1,62 @@ +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +import ( + consolev1 "github.com/openshift/api/console/v1" +) + +// ConsoleLinkSpecApplyConfiguration represents a declarative configuration of the ConsoleLinkSpec type for use +// with apply. +type ConsoleLinkSpecApplyConfiguration struct { + LinkApplyConfiguration `json:",inline"` + Location *consolev1.ConsoleLinkLocation `json:"location,omitempty"` + ApplicationMenu *ApplicationMenuSpecApplyConfiguration `json:"applicationMenu,omitempty"` + NamespaceDashboard *NamespaceDashboardSpecApplyConfiguration `json:"namespaceDashboard,omitempty"` +} + +// ConsoleLinkSpecApplyConfiguration constructs a declarative configuration of the ConsoleLinkSpec type for use with +// apply. +func ConsoleLinkSpec() *ConsoleLinkSpecApplyConfiguration { + return &ConsoleLinkSpecApplyConfiguration{} +} + +// WithText sets the Text field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Text field is set to the value of the last call. +func (b *ConsoleLinkSpecApplyConfiguration) WithText(value string) *ConsoleLinkSpecApplyConfiguration { + b.LinkApplyConfiguration.Text = &value + return b +} + +// WithHref sets the Href field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Href field is set to the value of the last call. +func (b *ConsoleLinkSpecApplyConfiguration) WithHref(value string) *ConsoleLinkSpecApplyConfiguration { + b.LinkApplyConfiguration.Href = &value + return b +} + +// WithLocation sets the Location field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Location field is set to the value of the last call. +func (b *ConsoleLinkSpecApplyConfiguration) WithLocation(value consolev1.ConsoleLinkLocation) *ConsoleLinkSpecApplyConfiguration { + b.Location = &value + return b +} + +// WithApplicationMenu sets the ApplicationMenu field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ApplicationMenu field is set to the value of the last call. +func (b *ConsoleLinkSpecApplyConfiguration) WithApplicationMenu(value *ApplicationMenuSpecApplyConfiguration) *ConsoleLinkSpecApplyConfiguration { + b.ApplicationMenu = value + return b +} + +// WithNamespaceDashboard sets the NamespaceDashboard field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the NamespaceDashboard field is set to the value of the last call. +func (b *ConsoleLinkSpecApplyConfiguration) WithNamespaceDashboard(value *NamespaceDashboardSpecApplyConfiguration) *ConsoleLinkSpecApplyConfiguration { + b.NamespaceDashboard = value + return b +} diff --git a/vendor/github.com/openshift/client-go/console/applyconfigurations/console/v1/consolenotification.go b/vendor/github.com/openshift/client-go/console/applyconfigurations/console/v1/consolenotification.go new file mode 100644 index 000000000..7ed7838c0 --- /dev/null +++ b/vendor/github.com/openshift/client-go/console/applyconfigurations/console/v1/consolenotification.go @@ -0,0 +1,254 @@ +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +import ( + consolev1 "github.com/openshift/api/console/v1" + internal "github.com/openshift/client-go/console/applyconfigurations/internal" + apismetav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + managedfields "k8s.io/apimachinery/pkg/util/managedfields" + metav1 "k8s.io/client-go/applyconfigurations/meta/v1" +) + +// ConsoleNotificationApplyConfiguration represents a declarative configuration of the ConsoleNotification type for use +// with apply. +type ConsoleNotificationApplyConfiguration struct { + metav1.TypeMetaApplyConfiguration `json:",inline"` + *metav1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` + Spec *ConsoleNotificationSpecApplyConfiguration `json:"spec,omitempty"` +} + +// ConsoleNotification constructs a declarative configuration of the ConsoleNotification type for use with +// apply. +func ConsoleNotification(name string) *ConsoleNotificationApplyConfiguration { + b := &ConsoleNotificationApplyConfiguration{} + b.WithName(name) + b.WithKind("ConsoleNotification") + b.WithAPIVersion("console.openshift.io/v1") + return b +} + +// ExtractConsoleNotification extracts the applied configuration owned by fieldManager from +// consoleNotification. If no managedFields are found in consoleNotification for fieldManager, a +// ConsoleNotificationApplyConfiguration is returned with only the Name, Namespace (if applicable), +// APIVersion and Kind populated. It is possible that no managed fields were found for because other +// field managers have taken ownership of all the fields previously owned by fieldManager, or because +// the fieldManager never owned fields any fields. +// consoleNotification must be a unmodified ConsoleNotification API object that was retrieved from the Kubernetes API. +// ExtractConsoleNotification provides a way to perform a extract/modify-in-place/apply workflow. +// Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously +// applied if another fieldManager has updated or force applied any of the previously applied fields. +// Experimental! +func ExtractConsoleNotification(consoleNotification *consolev1.ConsoleNotification, fieldManager string) (*ConsoleNotificationApplyConfiguration, error) { + return extractConsoleNotification(consoleNotification, fieldManager, "") +} + +// ExtractConsoleNotificationStatus is the same as ExtractConsoleNotification except +// that it extracts the status subresource applied configuration. +// Experimental! +func ExtractConsoleNotificationStatus(consoleNotification *consolev1.ConsoleNotification, fieldManager string) (*ConsoleNotificationApplyConfiguration, error) { + return extractConsoleNotification(consoleNotification, fieldManager, "status") +} + +func extractConsoleNotification(consoleNotification *consolev1.ConsoleNotification, fieldManager string, subresource string) (*ConsoleNotificationApplyConfiguration, error) { + b := &ConsoleNotificationApplyConfiguration{} + err := managedfields.ExtractInto(consoleNotification, internal.Parser().Type("com.github.openshift.api.console.v1.ConsoleNotification"), fieldManager, b, subresource) + if err != nil { + return nil, err + } + b.WithName(consoleNotification.Name) + + b.WithKind("ConsoleNotification") + b.WithAPIVersion("console.openshift.io/v1") + return b, nil +} +func (b ConsoleNotificationApplyConfiguration) IsApplyConfiguration() {} + +// WithKind sets the Kind field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Kind field is set to the value of the last call. +func (b *ConsoleNotificationApplyConfiguration) WithKind(value string) *ConsoleNotificationApplyConfiguration { + b.TypeMetaApplyConfiguration.Kind = &value + return b +} + +// WithAPIVersion sets the APIVersion field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the APIVersion field is set to the value of the last call. +func (b *ConsoleNotificationApplyConfiguration) WithAPIVersion(value string) *ConsoleNotificationApplyConfiguration { + b.TypeMetaApplyConfiguration.APIVersion = &value + return b +} + +// WithName sets the Name field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Name field is set to the value of the last call. +func (b *ConsoleNotificationApplyConfiguration) WithName(value string) *ConsoleNotificationApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.Name = &value + return b +} + +// WithGenerateName sets the GenerateName field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the GenerateName field is set to the value of the last call. +func (b *ConsoleNotificationApplyConfiguration) WithGenerateName(value string) *ConsoleNotificationApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.GenerateName = &value + return b +} + +// WithNamespace sets the Namespace field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Namespace field is set to the value of the last call. +func (b *ConsoleNotificationApplyConfiguration) WithNamespace(value string) *ConsoleNotificationApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.Namespace = &value + return b +} + +// WithUID sets the UID field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the UID field is set to the value of the last call. +func (b *ConsoleNotificationApplyConfiguration) WithUID(value types.UID) *ConsoleNotificationApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.UID = &value + return b +} + +// WithResourceVersion sets the ResourceVersion field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ResourceVersion field is set to the value of the last call. +func (b *ConsoleNotificationApplyConfiguration) WithResourceVersion(value string) *ConsoleNotificationApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.ResourceVersion = &value + return b +} + +// WithGeneration sets the Generation field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Generation field is set to the value of the last call. +func (b *ConsoleNotificationApplyConfiguration) WithGeneration(value int64) *ConsoleNotificationApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.Generation = &value + return b +} + +// WithCreationTimestamp sets the CreationTimestamp field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the CreationTimestamp field is set to the value of the last call. +func (b *ConsoleNotificationApplyConfiguration) WithCreationTimestamp(value apismetav1.Time) *ConsoleNotificationApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.CreationTimestamp = &value + return b +} + +// WithDeletionTimestamp sets the DeletionTimestamp field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the DeletionTimestamp field is set to the value of the last call. +func (b *ConsoleNotificationApplyConfiguration) WithDeletionTimestamp(value apismetav1.Time) *ConsoleNotificationApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.DeletionTimestamp = &value + return b +} + +// WithDeletionGracePeriodSeconds sets the DeletionGracePeriodSeconds field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the DeletionGracePeriodSeconds field is set to the value of the last call. +func (b *ConsoleNotificationApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *ConsoleNotificationApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.DeletionGracePeriodSeconds = &value + return b +} + +// WithLabels puts the entries into the Labels field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, the entries provided by each call will be put on the Labels field, +// overwriting an existing map entries in Labels field with the same key. +func (b *ConsoleNotificationApplyConfiguration) WithLabels(entries map[string]string) *ConsoleNotificationApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + if b.ObjectMetaApplyConfiguration.Labels == nil && len(entries) > 0 { + b.ObjectMetaApplyConfiguration.Labels = make(map[string]string, len(entries)) + } + for k, v := range entries { + b.ObjectMetaApplyConfiguration.Labels[k] = v + } + return b +} + +// WithAnnotations puts the entries into the Annotations field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, the entries provided by each call will be put on the Annotations field, +// overwriting an existing map entries in Annotations field with the same key. +func (b *ConsoleNotificationApplyConfiguration) WithAnnotations(entries map[string]string) *ConsoleNotificationApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + if b.ObjectMetaApplyConfiguration.Annotations == nil && len(entries) > 0 { + b.ObjectMetaApplyConfiguration.Annotations = make(map[string]string, len(entries)) + } + for k, v := range entries { + b.ObjectMetaApplyConfiguration.Annotations[k] = v + } + return b +} + +// WithOwnerReferences adds the given value to the OwnerReferences field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the OwnerReferences field. +func (b *ConsoleNotificationApplyConfiguration) WithOwnerReferences(values ...*metav1.OwnerReferenceApplyConfiguration) *ConsoleNotificationApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + for i := range values { + if values[i] == nil { + panic("nil value passed to WithOwnerReferences") + } + b.ObjectMetaApplyConfiguration.OwnerReferences = append(b.ObjectMetaApplyConfiguration.OwnerReferences, *values[i]) + } + return b +} + +// WithFinalizers adds the given value to the Finalizers field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Finalizers field. +func (b *ConsoleNotificationApplyConfiguration) WithFinalizers(values ...string) *ConsoleNotificationApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + for i := range values { + b.ObjectMetaApplyConfiguration.Finalizers = append(b.ObjectMetaApplyConfiguration.Finalizers, values[i]) + } + return b +} + +func (b *ConsoleNotificationApplyConfiguration) ensureObjectMetaApplyConfigurationExists() { + if b.ObjectMetaApplyConfiguration == nil { + b.ObjectMetaApplyConfiguration = &metav1.ObjectMetaApplyConfiguration{} + } +} + +// WithSpec sets the Spec field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Spec field is set to the value of the last call. +func (b *ConsoleNotificationApplyConfiguration) WithSpec(value *ConsoleNotificationSpecApplyConfiguration) *ConsoleNotificationApplyConfiguration { + b.Spec = value + return b +} + +// GetKind retrieves the value of the Kind field in the declarative configuration. +func (b *ConsoleNotificationApplyConfiguration) GetKind() *string { + return b.TypeMetaApplyConfiguration.Kind +} + +// GetAPIVersion retrieves the value of the APIVersion field in the declarative configuration. +func (b *ConsoleNotificationApplyConfiguration) GetAPIVersion() *string { + return b.TypeMetaApplyConfiguration.APIVersion +} + +// GetName retrieves the value of the Name field in the declarative configuration. +func (b *ConsoleNotificationApplyConfiguration) GetName() *string { + b.ensureObjectMetaApplyConfigurationExists() + return b.ObjectMetaApplyConfiguration.Name +} + +// GetNamespace retrieves the value of the Namespace field in the declarative configuration. +func (b *ConsoleNotificationApplyConfiguration) GetNamespace() *string { + b.ensureObjectMetaApplyConfigurationExists() + return b.ObjectMetaApplyConfiguration.Namespace +} diff --git a/vendor/github.com/openshift/client-go/console/applyconfigurations/console/v1/consolenotificationspec.go b/vendor/github.com/openshift/client-go/console/applyconfigurations/console/v1/consolenotificationspec.go new file mode 100644 index 000000000..1f06e50ac --- /dev/null +++ b/vendor/github.com/openshift/client-go/console/applyconfigurations/console/v1/consolenotificationspec.go @@ -0,0 +1,63 @@ +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +import ( + consolev1 "github.com/openshift/api/console/v1" +) + +// ConsoleNotificationSpecApplyConfiguration represents a declarative configuration of the ConsoleNotificationSpec type for use +// with apply. +type ConsoleNotificationSpecApplyConfiguration struct { + Text *string `json:"text,omitempty"` + Location *consolev1.ConsoleNotificationLocation `json:"location,omitempty"` + Link *LinkApplyConfiguration `json:"link,omitempty"` + Color *string `json:"color,omitempty"` + BackgroundColor *string `json:"backgroundColor,omitempty"` +} + +// ConsoleNotificationSpecApplyConfiguration constructs a declarative configuration of the ConsoleNotificationSpec type for use with +// apply. +func ConsoleNotificationSpec() *ConsoleNotificationSpecApplyConfiguration { + return &ConsoleNotificationSpecApplyConfiguration{} +} + +// WithText sets the Text field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Text field is set to the value of the last call. +func (b *ConsoleNotificationSpecApplyConfiguration) WithText(value string) *ConsoleNotificationSpecApplyConfiguration { + b.Text = &value + return b +} + +// WithLocation sets the Location field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Location field is set to the value of the last call. +func (b *ConsoleNotificationSpecApplyConfiguration) WithLocation(value consolev1.ConsoleNotificationLocation) *ConsoleNotificationSpecApplyConfiguration { + b.Location = &value + return b +} + +// WithLink sets the Link field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Link field is set to the value of the last call. +func (b *ConsoleNotificationSpecApplyConfiguration) WithLink(value *LinkApplyConfiguration) *ConsoleNotificationSpecApplyConfiguration { + b.Link = value + return b +} + +// WithColor sets the Color field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Color field is set to the value of the last call. +func (b *ConsoleNotificationSpecApplyConfiguration) WithColor(value string) *ConsoleNotificationSpecApplyConfiguration { + b.Color = &value + return b +} + +// WithBackgroundColor sets the BackgroundColor field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the BackgroundColor field is set to the value of the last call. +func (b *ConsoleNotificationSpecApplyConfiguration) WithBackgroundColor(value string) *ConsoleNotificationSpecApplyConfiguration { + b.BackgroundColor = &value + return b +} diff --git a/vendor/github.com/openshift/client-go/console/applyconfigurations/console/v1/consoleplugin.go b/vendor/github.com/openshift/client-go/console/applyconfigurations/console/v1/consoleplugin.go new file mode 100644 index 000000000..1e2f48e94 --- /dev/null +++ b/vendor/github.com/openshift/client-go/console/applyconfigurations/console/v1/consoleplugin.go @@ -0,0 +1,254 @@ +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +import ( + consolev1 "github.com/openshift/api/console/v1" + internal "github.com/openshift/client-go/console/applyconfigurations/internal" + apismetav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + managedfields "k8s.io/apimachinery/pkg/util/managedfields" + metav1 "k8s.io/client-go/applyconfigurations/meta/v1" +) + +// ConsolePluginApplyConfiguration represents a declarative configuration of the ConsolePlugin type for use +// with apply. +type ConsolePluginApplyConfiguration struct { + metav1.TypeMetaApplyConfiguration `json:",inline"` + *metav1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` + Spec *ConsolePluginSpecApplyConfiguration `json:"spec,omitempty"` +} + +// ConsolePlugin constructs a declarative configuration of the ConsolePlugin type for use with +// apply. +func ConsolePlugin(name string) *ConsolePluginApplyConfiguration { + b := &ConsolePluginApplyConfiguration{} + b.WithName(name) + b.WithKind("ConsolePlugin") + b.WithAPIVersion("console.openshift.io/v1") + return b +} + +// ExtractConsolePlugin extracts the applied configuration owned by fieldManager from +// consolePlugin. If no managedFields are found in consolePlugin for fieldManager, a +// ConsolePluginApplyConfiguration is returned with only the Name, Namespace (if applicable), +// APIVersion and Kind populated. It is possible that no managed fields were found for because other +// field managers have taken ownership of all the fields previously owned by fieldManager, or because +// the fieldManager never owned fields any fields. +// consolePlugin must be a unmodified ConsolePlugin API object that was retrieved from the Kubernetes API. +// ExtractConsolePlugin provides a way to perform a extract/modify-in-place/apply workflow. +// Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously +// applied if another fieldManager has updated or force applied any of the previously applied fields. +// Experimental! +func ExtractConsolePlugin(consolePlugin *consolev1.ConsolePlugin, fieldManager string) (*ConsolePluginApplyConfiguration, error) { + return extractConsolePlugin(consolePlugin, fieldManager, "") +} + +// ExtractConsolePluginStatus is the same as ExtractConsolePlugin except +// that it extracts the status subresource applied configuration. +// Experimental! +func ExtractConsolePluginStatus(consolePlugin *consolev1.ConsolePlugin, fieldManager string) (*ConsolePluginApplyConfiguration, error) { + return extractConsolePlugin(consolePlugin, fieldManager, "status") +} + +func extractConsolePlugin(consolePlugin *consolev1.ConsolePlugin, fieldManager string, subresource string) (*ConsolePluginApplyConfiguration, error) { + b := &ConsolePluginApplyConfiguration{} + err := managedfields.ExtractInto(consolePlugin, internal.Parser().Type("com.github.openshift.api.console.v1.ConsolePlugin"), fieldManager, b, subresource) + if err != nil { + return nil, err + } + b.WithName(consolePlugin.Name) + + b.WithKind("ConsolePlugin") + b.WithAPIVersion("console.openshift.io/v1") + return b, nil +} +func (b ConsolePluginApplyConfiguration) IsApplyConfiguration() {} + +// WithKind sets the Kind field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Kind field is set to the value of the last call. +func (b *ConsolePluginApplyConfiguration) WithKind(value string) *ConsolePluginApplyConfiguration { + b.TypeMetaApplyConfiguration.Kind = &value + return b +} + +// WithAPIVersion sets the APIVersion field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the APIVersion field is set to the value of the last call. +func (b *ConsolePluginApplyConfiguration) WithAPIVersion(value string) *ConsolePluginApplyConfiguration { + b.TypeMetaApplyConfiguration.APIVersion = &value + return b +} + +// WithName sets the Name field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Name field is set to the value of the last call. +func (b *ConsolePluginApplyConfiguration) WithName(value string) *ConsolePluginApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.Name = &value + return b +} + +// WithGenerateName sets the GenerateName field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the GenerateName field is set to the value of the last call. +func (b *ConsolePluginApplyConfiguration) WithGenerateName(value string) *ConsolePluginApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.GenerateName = &value + return b +} + +// WithNamespace sets the Namespace field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Namespace field is set to the value of the last call. +func (b *ConsolePluginApplyConfiguration) WithNamespace(value string) *ConsolePluginApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.Namespace = &value + return b +} + +// WithUID sets the UID field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the UID field is set to the value of the last call. +func (b *ConsolePluginApplyConfiguration) WithUID(value types.UID) *ConsolePluginApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.UID = &value + return b +} + +// WithResourceVersion sets the ResourceVersion field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ResourceVersion field is set to the value of the last call. +func (b *ConsolePluginApplyConfiguration) WithResourceVersion(value string) *ConsolePluginApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.ResourceVersion = &value + return b +} + +// WithGeneration sets the Generation field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Generation field is set to the value of the last call. +func (b *ConsolePluginApplyConfiguration) WithGeneration(value int64) *ConsolePluginApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.Generation = &value + return b +} + +// WithCreationTimestamp sets the CreationTimestamp field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the CreationTimestamp field is set to the value of the last call. +func (b *ConsolePluginApplyConfiguration) WithCreationTimestamp(value apismetav1.Time) *ConsolePluginApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.CreationTimestamp = &value + return b +} + +// WithDeletionTimestamp sets the DeletionTimestamp field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the DeletionTimestamp field is set to the value of the last call. +func (b *ConsolePluginApplyConfiguration) WithDeletionTimestamp(value apismetav1.Time) *ConsolePluginApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.DeletionTimestamp = &value + return b +} + +// WithDeletionGracePeriodSeconds sets the DeletionGracePeriodSeconds field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the DeletionGracePeriodSeconds field is set to the value of the last call. +func (b *ConsolePluginApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *ConsolePluginApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.DeletionGracePeriodSeconds = &value + return b +} + +// WithLabels puts the entries into the Labels field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, the entries provided by each call will be put on the Labels field, +// overwriting an existing map entries in Labels field with the same key. +func (b *ConsolePluginApplyConfiguration) WithLabels(entries map[string]string) *ConsolePluginApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + if b.ObjectMetaApplyConfiguration.Labels == nil && len(entries) > 0 { + b.ObjectMetaApplyConfiguration.Labels = make(map[string]string, len(entries)) + } + for k, v := range entries { + b.ObjectMetaApplyConfiguration.Labels[k] = v + } + return b +} + +// WithAnnotations puts the entries into the Annotations field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, the entries provided by each call will be put on the Annotations field, +// overwriting an existing map entries in Annotations field with the same key. +func (b *ConsolePluginApplyConfiguration) WithAnnotations(entries map[string]string) *ConsolePluginApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + if b.ObjectMetaApplyConfiguration.Annotations == nil && len(entries) > 0 { + b.ObjectMetaApplyConfiguration.Annotations = make(map[string]string, len(entries)) + } + for k, v := range entries { + b.ObjectMetaApplyConfiguration.Annotations[k] = v + } + return b +} + +// WithOwnerReferences adds the given value to the OwnerReferences field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the OwnerReferences field. +func (b *ConsolePluginApplyConfiguration) WithOwnerReferences(values ...*metav1.OwnerReferenceApplyConfiguration) *ConsolePluginApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + for i := range values { + if values[i] == nil { + panic("nil value passed to WithOwnerReferences") + } + b.ObjectMetaApplyConfiguration.OwnerReferences = append(b.ObjectMetaApplyConfiguration.OwnerReferences, *values[i]) + } + return b +} + +// WithFinalizers adds the given value to the Finalizers field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Finalizers field. +func (b *ConsolePluginApplyConfiguration) WithFinalizers(values ...string) *ConsolePluginApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + for i := range values { + b.ObjectMetaApplyConfiguration.Finalizers = append(b.ObjectMetaApplyConfiguration.Finalizers, values[i]) + } + return b +} + +func (b *ConsolePluginApplyConfiguration) ensureObjectMetaApplyConfigurationExists() { + if b.ObjectMetaApplyConfiguration == nil { + b.ObjectMetaApplyConfiguration = &metav1.ObjectMetaApplyConfiguration{} + } +} + +// WithSpec sets the Spec field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Spec field is set to the value of the last call. +func (b *ConsolePluginApplyConfiguration) WithSpec(value *ConsolePluginSpecApplyConfiguration) *ConsolePluginApplyConfiguration { + b.Spec = value + return b +} + +// GetKind retrieves the value of the Kind field in the declarative configuration. +func (b *ConsolePluginApplyConfiguration) GetKind() *string { + return b.TypeMetaApplyConfiguration.Kind +} + +// GetAPIVersion retrieves the value of the APIVersion field in the declarative configuration. +func (b *ConsolePluginApplyConfiguration) GetAPIVersion() *string { + return b.TypeMetaApplyConfiguration.APIVersion +} + +// GetName retrieves the value of the Name field in the declarative configuration. +func (b *ConsolePluginApplyConfiguration) GetName() *string { + b.ensureObjectMetaApplyConfigurationExists() + return b.ObjectMetaApplyConfiguration.Name +} + +// GetNamespace retrieves the value of the Namespace field in the declarative configuration. +func (b *ConsolePluginApplyConfiguration) GetNamespace() *string { + b.ensureObjectMetaApplyConfigurationExists() + return b.ObjectMetaApplyConfiguration.Namespace +} diff --git a/vendor/github.com/openshift/client-go/console/applyconfigurations/console/v1/consolepluginbackend.go b/vendor/github.com/openshift/client-go/console/applyconfigurations/console/v1/consolepluginbackend.go new file mode 100644 index 000000000..03fe8ac93 --- /dev/null +++ b/vendor/github.com/openshift/client-go/console/applyconfigurations/console/v1/consolepluginbackend.go @@ -0,0 +1,36 @@ +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +import ( + consolev1 "github.com/openshift/api/console/v1" +) + +// ConsolePluginBackendApplyConfiguration represents a declarative configuration of the ConsolePluginBackend type for use +// with apply. +type ConsolePluginBackendApplyConfiguration struct { + Type *consolev1.ConsolePluginBackendType `json:"type,omitempty"` + Service *ConsolePluginServiceApplyConfiguration `json:"service,omitempty"` +} + +// ConsolePluginBackendApplyConfiguration constructs a declarative configuration of the ConsolePluginBackend type for use with +// apply. +func ConsolePluginBackend() *ConsolePluginBackendApplyConfiguration { + return &ConsolePluginBackendApplyConfiguration{} +} + +// WithType sets the Type field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Type field is set to the value of the last call. +func (b *ConsolePluginBackendApplyConfiguration) WithType(value consolev1.ConsolePluginBackendType) *ConsolePluginBackendApplyConfiguration { + b.Type = &value + return b +} + +// WithService sets the Service field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Service field is set to the value of the last call. +func (b *ConsolePluginBackendApplyConfiguration) WithService(value *ConsolePluginServiceApplyConfiguration) *ConsolePluginBackendApplyConfiguration { + b.Service = value + return b +} diff --git a/vendor/github.com/openshift/client-go/console/applyconfigurations/console/v1/consoleplugincsp.go b/vendor/github.com/openshift/client-go/console/applyconfigurations/console/v1/consoleplugincsp.go new file mode 100644 index 000000000..a837b06b7 --- /dev/null +++ b/vendor/github.com/openshift/client-go/console/applyconfigurations/console/v1/consoleplugincsp.go @@ -0,0 +1,38 @@ +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +import ( + consolev1 "github.com/openshift/api/console/v1" +) + +// ConsolePluginCSPApplyConfiguration represents a declarative configuration of the ConsolePluginCSP type for use +// with apply. +type ConsolePluginCSPApplyConfiguration struct { + Directive *consolev1.DirectiveType `json:"directive,omitempty"` + Values []consolev1.CSPDirectiveValue `json:"values,omitempty"` +} + +// ConsolePluginCSPApplyConfiguration constructs a declarative configuration of the ConsolePluginCSP type for use with +// apply. +func ConsolePluginCSP() *ConsolePluginCSPApplyConfiguration { + return &ConsolePluginCSPApplyConfiguration{} +} + +// WithDirective sets the Directive field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Directive field is set to the value of the last call. +func (b *ConsolePluginCSPApplyConfiguration) WithDirective(value consolev1.DirectiveType) *ConsolePluginCSPApplyConfiguration { + b.Directive = &value + return b +} + +// WithValues adds the given value to the Values field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Values field. +func (b *ConsolePluginCSPApplyConfiguration) WithValues(values ...consolev1.CSPDirectiveValue) *ConsolePluginCSPApplyConfiguration { + for i := range values { + b.Values = append(b.Values, values[i]) + } + return b +} diff --git a/vendor/github.com/openshift/client-go/console/applyconfigurations/console/v1/consoleplugini18n.go b/vendor/github.com/openshift/client-go/console/applyconfigurations/console/v1/consoleplugini18n.go new file mode 100644 index 000000000..050b3bbd7 --- /dev/null +++ b/vendor/github.com/openshift/client-go/console/applyconfigurations/console/v1/consoleplugini18n.go @@ -0,0 +1,27 @@ +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +import ( + consolev1 "github.com/openshift/api/console/v1" +) + +// ConsolePluginI18nApplyConfiguration represents a declarative configuration of the ConsolePluginI18n type for use +// with apply. +type ConsolePluginI18nApplyConfiguration struct { + LoadType *consolev1.LoadType `json:"loadType,omitempty"` +} + +// ConsolePluginI18nApplyConfiguration constructs a declarative configuration of the ConsolePluginI18n type for use with +// apply. +func ConsolePluginI18n() *ConsolePluginI18nApplyConfiguration { + return &ConsolePluginI18nApplyConfiguration{} +} + +// WithLoadType sets the LoadType field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the LoadType field is set to the value of the last call. +func (b *ConsolePluginI18nApplyConfiguration) WithLoadType(value consolev1.LoadType) *ConsolePluginI18nApplyConfiguration { + b.LoadType = &value + return b +} diff --git a/vendor/github.com/openshift/client-go/console/applyconfigurations/console/v1/consolepluginproxy.go b/vendor/github.com/openshift/client-go/console/applyconfigurations/console/v1/consolepluginproxy.go new file mode 100644 index 000000000..bb52626fe --- /dev/null +++ b/vendor/github.com/openshift/client-go/console/applyconfigurations/console/v1/consolepluginproxy.go @@ -0,0 +1,54 @@ +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +import ( + consolev1 "github.com/openshift/api/console/v1" +) + +// ConsolePluginProxyApplyConfiguration represents a declarative configuration of the ConsolePluginProxy type for use +// with apply. +type ConsolePluginProxyApplyConfiguration struct { + Endpoint *ConsolePluginProxyEndpointApplyConfiguration `json:"endpoint,omitempty"` + Alias *string `json:"alias,omitempty"` + CACertificate *string `json:"caCertificate,omitempty"` + Authorization *consolev1.AuthorizationType `json:"authorization,omitempty"` +} + +// ConsolePluginProxyApplyConfiguration constructs a declarative configuration of the ConsolePluginProxy type for use with +// apply. +func ConsolePluginProxy() *ConsolePluginProxyApplyConfiguration { + return &ConsolePluginProxyApplyConfiguration{} +} + +// WithEndpoint sets the Endpoint field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Endpoint field is set to the value of the last call. +func (b *ConsolePluginProxyApplyConfiguration) WithEndpoint(value *ConsolePluginProxyEndpointApplyConfiguration) *ConsolePluginProxyApplyConfiguration { + b.Endpoint = value + return b +} + +// WithAlias sets the Alias field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Alias field is set to the value of the last call. +func (b *ConsolePluginProxyApplyConfiguration) WithAlias(value string) *ConsolePluginProxyApplyConfiguration { + b.Alias = &value + return b +} + +// WithCACertificate sets the CACertificate field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the CACertificate field is set to the value of the last call. +func (b *ConsolePluginProxyApplyConfiguration) WithCACertificate(value string) *ConsolePluginProxyApplyConfiguration { + b.CACertificate = &value + return b +} + +// WithAuthorization sets the Authorization field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Authorization field is set to the value of the last call. +func (b *ConsolePluginProxyApplyConfiguration) WithAuthorization(value consolev1.AuthorizationType) *ConsolePluginProxyApplyConfiguration { + b.Authorization = &value + return b +} diff --git a/vendor/github.com/openshift/client-go/console/applyconfigurations/console/v1/consolepluginproxyendpoint.go b/vendor/github.com/openshift/client-go/console/applyconfigurations/console/v1/consolepluginproxyendpoint.go new file mode 100644 index 000000000..2a6b8bad5 --- /dev/null +++ b/vendor/github.com/openshift/client-go/console/applyconfigurations/console/v1/consolepluginproxyendpoint.go @@ -0,0 +1,36 @@ +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +import ( + consolev1 "github.com/openshift/api/console/v1" +) + +// ConsolePluginProxyEndpointApplyConfiguration represents a declarative configuration of the ConsolePluginProxyEndpoint type for use +// with apply. +type ConsolePluginProxyEndpointApplyConfiguration struct { + Type *consolev1.ConsolePluginProxyType `json:"type,omitempty"` + Service *ConsolePluginProxyServiceConfigApplyConfiguration `json:"service,omitempty"` +} + +// ConsolePluginProxyEndpointApplyConfiguration constructs a declarative configuration of the ConsolePluginProxyEndpoint type for use with +// apply. +func ConsolePluginProxyEndpoint() *ConsolePluginProxyEndpointApplyConfiguration { + return &ConsolePluginProxyEndpointApplyConfiguration{} +} + +// WithType sets the Type field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Type field is set to the value of the last call. +func (b *ConsolePluginProxyEndpointApplyConfiguration) WithType(value consolev1.ConsolePluginProxyType) *ConsolePluginProxyEndpointApplyConfiguration { + b.Type = &value + return b +} + +// WithService sets the Service field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Service field is set to the value of the last call. +func (b *ConsolePluginProxyEndpointApplyConfiguration) WithService(value *ConsolePluginProxyServiceConfigApplyConfiguration) *ConsolePluginProxyEndpointApplyConfiguration { + b.Service = value + return b +} diff --git a/vendor/github.com/openshift/client-go/console/applyconfigurations/console/v1/consolepluginproxyserviceconfig.go b/vendor/github.com/openshift/client-go/console/applyconfigurations/console/v1/consolepluginproxyserviceconfig.go new file mode 100644 index 000000000..6c186e815 --- /dev/null +++ b/vendor/github.com/openshift/client-go/console/applyconfigurations/console/v1/consolepluginproxyserviceconfig.go @@ -0,0 +1,41 @@ +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +// ConsolePluginProxyServiceConfigApplyConfiguration represents a declarative configuration of the ConsolePluginProxyServiceConfig type for use +// with apply. +type ConsolePluginProxyServiceConfigApplyConfiguration struct { + Name *string `json:"name,omitempty"` + Namespace *string `json:"namespace,omitempty"` + Port *int32 `json:"port,omitempty"` +} + +// ConsolePluginProxyServiceConfigApplyConfiguration constructs a declarative configuration of the ConsolePluginProxyServiceConfig type for use with +// apply. +func ConsolePluginProxyServiceConfig() *ConsolePluginProxyServiceConfigApplyConfiguration { + return &ConsolePluginProxyServiceConfigApplyConfiguration{} +} + +// WithName sets the Name field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Name field is set to the value of the last call. +func (b *ConsolePluginProxyServiceConfigApplyConfiguration) WithName(value string) *ConsolePluginProxyServiceConfigApplyConfiguration { + b.Name = &value + return b +} + +// WithNamespace sets the Namespace field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Namespace field is set to the value of the last call. +func (b *ConsolePluginProxyServiceConfigApplyConfiguration) WithNamespace(value string) *ConsolePluginProxyServiceConfigApplyConfiguration { + b.Namespace = &value + return b +} + +// WithPort sets the Port field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Port field is set to the value of the last call. +func (b *ConsolePluginProxyServiceConfigApplyConfiguration) WithPort(value int32) *ConsolePluginProxyServiceConfigApplyConfiguration { + b.Port = &value + return b +} diff --git a/vendor/github.com/openshift/client-go/console/applyconfigurations/console/v1/consolepluginservice.go b/vendor/github.com/openshift/client-go/console/applyconfigurations/console/v1/consolepluginservice.go new file mode 100644 index 000000000..badfcd9e0 --- /dev/null +++ b/vendor/github.com/openshift/client-go/console/applyconfigurations/console/v1/consolepluginservice.go @@ -0,0 +1,50 @@ +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +// ConsolePluginServiceApplyConfiguration represents a declarative configuration of the ConsolePluginService type for use +// with apply. +type ConsolePluginServiceApplyConfiguration struct { + Name *string `json:"name,omitempty"` + Namespace *string `json:"namespace,omitempty"` + Port *int32 `json:"port,omitempty"` + BasePath *string `json:"basePath,omitempty"` +} + +// ConsolePluginServiceApplyConfiguration constructs a declarative configuration of the ConsolePluginService type for use with +// apply. +func ConsolePluginService() *ConsolePluginServiceApplyConfiguration { + return &ConsolePluginServiceApplyConfiguration{} +} + +// WithName sets the Name field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Name field is set to the value of the last call. +func (b *ConsolePluginServiceApplyConfiguration) WithName(value string) *ConsolePluginServiceApplyConfiguration { + b.Name = &value + return b +} + +// WithNamespace sets the Namespace field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Namespace field is set to the value of the last call. +func (b *ConsolePluginServiceApplyConfiguration) WithNamespace(value string) *ConsolePluginServiceApplyConfiguration { + b.Namespace = &value + return b +} + +// WithPort sets the Port field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Port field is set to the value of the last call. +func (b *ConsolePluginServiceApplyConfiguration) WithPort(value int32) *ConsolePluginServiceApplyConfiguration { + b.Port = &value + return b +} + +// WithBasePath sets the BasePath field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the BasePath field is set to the value of the last call. +func (b *ConsolePluginServiceApplyConfiguration) WithBasePath(value string) *ConsolePluginServiceApplyConfiguration { + b.BasePath = &value + return b +} diff --git a/vendor/github.com/openshift/client-go/console/applyconfigurations/console/v1/consolepluginspec.go b/vendor/github.com/openshift/client-go/console/applyconfigurations/console/v1/consolepluginspec.go new file mode 100644 index 000000000..c4674c6aa --- /dev/null +++ b/vendor/github.com/openshift/client-go/console/applyconfigurations/console/v1/consolepluginspec.go @@ -0,0 +1,69 @@ +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +// ConsolePluginSpecApplyConfiguration represents a declarative configuration of the ConsolePluginSpec type for use +// with apply. +type ConsolePluginSpecApplyConfiguration struct { + DisplayName *string `json:"displayName,omitempty"` + Backend *ConsolePluginBackendApplyConfiguration `json:"backend,omitempty"` + Proxy []ConsolePluginProxyApplyConfiguration `json:"proxy,omitempty"` + I18n *ConsolePluginI18nApplyConfiguration `json:"i18n,omitempty"` + ContentSecurityPolicy []ConsolePluginCSPApplyConfiguration `json:"contentSecurityPolicy,omitempty"` +} + +// ConsolePluginSpecApplyConfiguration constructs a declarative configuration of the ConsolePluginSpec type for use with +// apply. +func ConsolePluginSpec() *ConsolePluginSpecApplyConfiguration { + return &ConsolePluginSpecApplyConfiguration{} +} + +// WithDisplayName sets the DisplayName field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the DisplayName field is set to the value of the last call. +func (b *ConsolePluginSpecApplyConfiguration) WithDisplayName(value string) *ConsolePluginSpecApplyConfiguration { + b.DisplayName = &value + return b +} + +// WithBackend sets the Backend field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Backend field is set to the value of the last call. +func (b *ConsolePluginSpecApplyConfiguration) WithBackend(value *ConsolePluginBackendApplyConfiguration) *ConsolePluginSpecApplyConfiguration { + b.Backend = value + return b +} + +// WithProxy adds the given value to the Proxy field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Proxy field. +func (b *ConsolePluginSpecApplyConfiguration) WithProxy(values ...*ConsolePluginProxyApplyConfiguration) *ConsolePluginSpecApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithProxy") + } + b.Proxy = append(b.Proxy, *values[i]) + } + return b +} + +// WithI18n sets the I18n field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the I18n field is set to the value of the last call. +func (b *ConsolePluginSpecApplyConfiguration) WithI18n(value *ConsolePluginI18nApplyConfiguration) *ConsolePluginSpecApplyConfiguration { + b.I18n = value + return b +} + +// WithContentSecurityPolicy adds the given value to the ContentSecurityPolicy field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the ContentSecurityPolicy field. +func (b *ConsolePluginSpecApplyConfiguration) WithContentSecurityPolicy(values ...*ConsolePluginCSPApplyConfiguration) *ConsolePluginSpecApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithContentSecurityPolicy") + } + b.ContentSecurityPolicy = append(b.ContentSecurityPolicy, *values[i]) + } + return b +} diff --git a/vendor/github.com/openshift/client-go/console/applyconfigurations/console/v1/consolequickstart.go b/vendor/github.com/openshift/client-go/console/applyconfigurations/console/v1/consolequickstart.go new file mode 100644 index 000000000..b32138ebd --- /dev/null +++ b/vendor/github.com/openshift/client-go/console/applyconfigurations/console/v1/consolequickstart.go @@ -0,0 +1,254 @@ +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +import ( + consolev1 "github.com/openshift/api/console/v1" + internal "github.com/openshift/client-go/console/applyconfigurations/internal" + apismetav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + managedfields "k8s.io/apimachinery/pkg/util/managedfields" + metav1 "k8s.io/client-go/applyconfigurations/meta/v1" +) + +// ConsoleQuickStartApplyConfiguration represents a declarative configuration of the ConsoleQuickStart type for use +// with apply. +type ConsoleQuickStartApplyConfiguration struct { + metav1.TypeMetaApplyConfiguration `json:",inline"` + *metav1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` + Spec *ConsoleQuickStartSpecApplyConfiguration `json:"spec,omitempty"` +} + +// ConsoleQuickStart constructs a declarative configuration of the ConsoleQuickStart type for use with +// apply. +func ConsoleQuickStart(name string) *ConsoleQuickStartApplyConfiguration { + b := &ConsoleQuickStartApplyConfiguration{} + b.WithName(name) + b.WithKind("ConsoleQuickStart") + b.WithAPIVersion("console.openshift.io/v1") + return b +} + +// ExtractConsoleQuickStart extracts the applied configuration owned by fieldManager from +// consoleQuickStart. If no managedFields are found in consoleQuickStart for fieldManager, a +// ConsoleQuickStartApplyConfiguration is returned with only the Name, Namespace (if applicable), +// APIVersion and Kind populated. It is possible that no managed fields were found for because other +// field managers have taken ownership of all the fields previously owned by fieldManager, or because +// the fieldManager never owned fields any fields. +// consoleQuickStart must be a unmodified ConsoleQuickStart API object that was retrieved from the Kubernetes API. +// ExtractConsoleQuickStart provides a way to perform a extract/modify-in-place/apply workflow. +// Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously +// applied if another fieldManager has updated or force applied any of the previously applied fields. +// Experimental! +func ExtractConsoleQuickStart(consoleQuickStart *consolev1.ConsoleQuickStart, fieldManager string) (*ConsoleQuickStartApplyConfiguration, error) { + return extractConsoleQuickStart(consoleQuickStart, fieldManager, "") +} + +// ExtractConsoleQuickStartStatus is the same as ExtractConsoleQuickStart except +// that it extracts the status subresource applied configuration. +// Experimental! +func ExtractConsoleQuickStartStatus(consoleQuickStart *consolev1.ConsoleQuickStart, fieldManager string) (*ConsoleQuickStartApplyConfiguration, error) { + return extractConsoleQuickStart(consoleQuickStart, fieldManager, "status") +} + +func extractConsoleQuickStart(consoleQuickStart *consolev1.ConsoleQuickStart, fieldManager string, subresource string) (*ConsoleQuickStartApplyConfiguration, error) { + b := &ConsoleQuickStartApplyConfiguration{} + err := managedfields.ExtractInto(consoleQuickStart, internal.Parser().Type("com.github.openshift.api.console.v1.ConsoleQuickStart"), fieldManager, b, subresource) + if err != nil { + return nil, err + } + b.WithName(consoleQuickStart.Name) + + b.WithKind("ConsoleQuickStart") + b.WithAPIVersion("console.openshift.io/v1") + return b, nil +} +func (b ConsoleQuickStartApplyConfiguration) IsApplyConfiguration() {} + +// WithKind sets the Kind field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Kind field is set to the value of the last call. +func (b *ConsoleQuickStartApplyConfiguration) WithKind(value string) *ConsoleQuickStartApplyConfiguration { + b.TypeMetaApplyConfiguration.Kind = &value + return b +} + +// WithAPIVersion sets the APIVersion field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the APIVersion field is set to the value of the last call. +func (b *ConsoleQuickStartApplyConfiguration) WithAPIVersion(value string) *ConsoleQuickStartApplyConfiguration { + b.TypeMetaApplyConfiguration.APIVersion = &value + return b +} + +// WithName sets the Name field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Name field is set to the value of the last call. +func (b *ConsoleQuickStartApplyConfiguration) WithName(value string) *ConsoleQuickStartApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.Name = &value + return b +} + +// WithGenerateName sets the GenerateName field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the GenerateName field is set to the value of the last call. +func (b *ConsoleQuickStartApplyConfiguration) WithGenerateName(value string) *ConsoleQuickStartApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.GenerateName = &value + return b +} + +// WithNamespace sets the Namespace field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Namespace field is set to the value of the last call. +func (b *ConsoleQuickStartApplyConfiguration) WithNamespace(value string) *ConsoleQuickStartApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.Namespace = &value + return b +} + +// WithUID sets the UID field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the UID field is set to the value of the last call. +func (b *ConsoleQuickStartApplyConfiguration) WithUID(value types.UID) *ConsoleQuickStartApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.UID = &value + return b +} + +// WithResourceVersion sets the ResourceVersion field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ResourceVersion field is set to the value of the last call. +func (b *ConsoleQuickStartApplyConfiguration) WithResourceVersion(value string) *ConsoleQuickStartApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.ResourceVersion = &value + return b +} + +// WithGeneration sets the Generation field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Generation field is set to the value of the last call. +func (b *ConsoleQuickStartApplyConfiguration) WithGeneration(value int64) *ConsoleQuickStartApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.Generation = &value + return b +} + +// WithCreationTimestamp sets the CreationTimestamp field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the CreationTimestamp field is set to the value of the last call. +func (b *ConsoleQuickStartApplyConfiguration) WithCreationTimestamp(value apismetav1.Time) *ConsoleQuickStartApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.CreationTimestamp = &value + return b +} + +// WithDeletionTimestamp sets the DeletionTimestamp field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the DeletionTimestamp field is set to the value of the last call. +func (b *ConsoleQuickStartApplyConfiguration) WithDeletionTimestamp(value apismetav1.Time) *ConsoleQuickStartApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.DeletionTimestamp = &value + return b +} + +// WithDeletionGracePeriodSeconds sets the DeletionGracePeriodSeconds field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the DeletionGracePeriodSeconds field is set to the value of the last call. +func (b *ConsoleQuickStartApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *ConsoleQuickStartApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.DeletionGracePeriodSeconds = &value + return b +} + +// WithLabels puts the entries into the Labels field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, the entries provided by each call will be put on the Labels field, +// overwriting an existing map entries in Labels field with the same key. +func (b *ConsoleQuickStartApplyConfiguration) WithLabels(entries map[string]string) *ConsoleQuickStartApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + if b.ObjectMetaApplyConfiguration.Labels == nil && len(entries) > 0 { + b.ObjectMetaApplyConfiguration.Labels = make(map[string]string, len(entries)) + } + for k, v := range entries { + b.ObjectMetaApplyConfiguration.Labels[k] = v + } + return b +} + +// WithAnnotations puts the entries into the Annotations field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, the entries provided by each call will be put on the Annotations field, +// overwriting an existing map entries in Annotations field with the same key. +func (b *ConsoleQuickStartApplyConfiguration) WithAnnotations(entries map[string]string) *ConsoleQuickStartApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + if b.ObjectMetaApplyConfiguration.Annotations == nil && len(entries) > 0 { + b.ObjectMetaApplyConfiguration.Annotations = make(map[string]string, len(entries)) + } + for k, v := range entries { + b.ObjectMetaApplyConfiguration.Annotations[k] = v + } + return b +} + +// WithOwnerReferences adds the given value to the OwnerReferences field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the OwnerReferences field. +func (b *ConsoleQuickStartApplyConfiguration) WithOwnerReferences(values ...*metav1.OwnerReferenceApplyConfiguration) *ConsoleQuickStartApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + for i := range values { + if values[i] == nil { + panic("nil value passed to WithOwnerReferences") + } + b.ObjectMetaApplyConfiguration.OwnerReferences = append(b.ObjectMetaApplyConfiguration.OwnerReferences, *values[i]) + } + return b +} + +// WithFinalizers adds the given value to the Finalizers field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Finalizers field. +func (b *ConsoleQuickStartApplyConfiguration) WithFinalizers(values ...string) *ConsoleQuickStartApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + for i := range values { + b.ObjectMetaApplyConfiguration.Finalizers = append(b.ObjectMetaApplyConfiguration.Finalizers, values[i]) + } + return b +} + +func (b *ConsoleQuickStartApplyConfiguration) ensureObjectMetaApplyConfigurationExists() { + if b.ObjectMetaApplyConfiguration == nil { + b.ObjectMetaApplyConfiguration = &metav1.ObjectMetaApplyConfiguration{} + } +} + +// WithSpec sets the Spec field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Spec field is set to the value of the last call. +func (b *ConsoleQuickStartApplyConfiguration) WithSpec(value *ConsoleQuickStartSpecApplyConfiguration) *ConsoleQuickStartApplyConfiguration { + b.Spec = value + return b +} + +// GetKind retrieves the value of the Kind field in the declarative configuration. +func (b *ConsoleQuickStartApplyConfiguration) GetKind() *string { + return b.TypeMetaApplyConfiguration.Kind +} + +// GetAPIVersion retrieves the value of the APIVersion field in the declarative configuration. +func (b *ConsoleQuickStartApplyConfiguration) GetAPIVersion() *string { + return b.TypeMetaApplyConfiguration.APIVersion +} + +// GetName retrieves the value of the Name field in the declarative configuration. +func (b *ConsoleQuickStartApplyConfiguration) GetName() *string { + b.ensureObjectMetaApplyConfigurationExists() + return b.ObjectMetaApplyConfiguration.Name +} + +// GetNamespace retrieves the value of the Namespace field in the declarative configuration. +func (b *ConsoleQuickStartApplyConfiguration) GetNamespace() *string { + b.ensureObjectMetaApplyConfigurationExists() + return b.ObjectMetaApplyConfiguration.Namespace +} diff --git a/vendor/github.com/openshift/client-go/console/applyconfigurations/console/v1/consolequickstartspec.go b/vendor/github.com/openshift/client-go/console/applyconfigurations/console/v1/consolequickstartspec.go new file mode 100644 index 000000000..8ad6564b9 --- /dev/null +++ b/vendor/github.com/openshift/client-go/console/applyconfigurations/console/v1/consolequickstartspec.go @@ -0,0 +1,130 @@ +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +import ( + authorizationv1 "k8s.io/api/authorization/v1" +) + +// ConsoleQuickStartSpecApplyConfiguration represents a declarative configuration of the ConsoleQuickStartSpec type for use +// with apply. +type ConsoleQuickStartSpecApplyConfiguration struct { + DisplayName *string `json:"displayName,omitempty"` + Icon *string `json:"icon,omitempty"` + Tags []string `json:"tags,omitempty"` + DurationMinutes *int `json:"durationMinutes,omitempty"` + Description *string `json:"description,omitempty"` + Prerequisites []string `json:"prerequisites,omitempty"` + Introduction *string `json:"introduction,omitempty"` + Tasks []ConsoleQuickStartTaskApplyConfiguration `json:"tasks,omitempty"` + Conclusion *string `json:"conclusion,omitempty"` + NextQuickStart []string `json:"nextQuickStart,omitempty"` + AccessReviewResources []authorizationv1.ResourceAttributes `json:"accessReviewResources,omitempty"` +} + +// ConsoleQuickStartSpecApplyConfiguration constructs a declarative configuration of the ConsoleQuickStartSpec type for use with +// apply. +func ConsoleQuickStartSpec() *ConsoleQuickStartSpecApplyConfiguration { + return &ConsoleQuickStartSpecApplyConfiguration{} +} + +// WithDisplayName sets the DisplayName field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the DisplayName field is set to the value of the last call. +func (b *ConsoleQuickStartSpecApplyConfiguration) WithDisplayName(value string) *ConsoleQuickStartSpecApplyConfiguration { + b.DisplayName = &value + return b +} + +// WithIcon sets the Icon field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Icon field is set to the value of the last call. +func (b *ConsoleQuickStartSpecApplyConfiguration) WithIcon(value string) *ConsoleQuickStartSpecApplyConfiguration { + b.Icon = &value + return b +} + +// WithTags adds the given value to the Tags field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Tags field. +func (b *ConsoleQuickStartSpecApplyConfiguration) WithTags(values ...string) *ConsoleQuickStartSpecApplyConfiguration { + for i := range values { + b.Tags = append(b.Tags, values[i]) + } + return b +} + +// WithDurationMinutes sets the DurationMinutes field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the DurationMinutes field is set to the value of the last call. +func (b *ConsoleQuickStartSpecApplyConfiguration) WithDurationMinutes(value int) *ConsoleQuickStartSpecApplyConfiguration { + b.DurationMinutes = &value + return b +} + +// WithDescription sets the Description field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Description field is set to the value of the last call. +func (b *ConsoleQuickStartSpecApplyConfiguration) WithDescription(value string) *ConsoleQuickStartSpecApplyConfiguration { + b.Description = &value + return b +} + +// WithPrerequisites adds the given value to the Prerequisites field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Prerequisites field. +func (b *ConsoleQuickStartSpecApplyConfiguration) WithPrerequisites(values ...string) *ConsoleQuickStartSpecApplyConfiguration { + for i := range values { + b.Prerequisites = append(b.Prerequisites, values[i]) + } + return b +} + +// WithIntroduction sets the Introduction field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Introduction field is set to the value of the last call. +func (b *ConsoleQuickStartSpecApplyConfiguration) WithIntroduction(value string) *ConsoleQuickStartSpecApplyConfiguration { + b.Introduction = &value + return b +} + +// WithTasks adds the given value to the Tasks field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Tasks field. +func (b *ConsoleQuickStartSpecApplyConfiguration) WithTasks(values ...*ConsoleQuickStartTaskApplyConfiguration) *ConsoleQuickStartSpecApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithTasks") + } + b.Tasks = append(b.Tasks, *values[i]) + } + return b +} + +// WithConclusion sets the Conclusion field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Conclusion field is set to the value of the last call. +func (b *ConsoleQuickStartSpecApplyConfiguration) WithConclusion(value string) *ConsoleQuickStartSpecApplyConfiguration { + b.Conclusion = &value + return b +} + +// WithNextQuickStart adds the given value to the NextQuickStart field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the NextQuickStart field. +func (b *ConsoleQuickStartSpecApplyConfiguration) WithNextQuickStart(values ...string) *ConsoleQuickStartSpecApplyConfiguration { + for i := range values { + b.NextQuickStart = append(b.NextQuickStart, values[i]) + } + return b +} + +// WithAccessReviewResources adds the given value to the AccessReviewResources field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the AccessReviewResources field. +func (b *ConsoleQuickStartSpecApplyConfiguration) WithAccessReviewResources(values ...authorizationv1.ResourceAttributes) *ConsoleQuickStartSpecApplyConfiguration { + for i := range values { + b.AccessReviewResources = append(b.AccessReviewResources, values[i]) + } + return b +} diff --git a/vendor/github.com/openshift/client-go/console/applyconfigurations/console/v1/consolequickstarttask.go b/vendor/github.com/openshift/client-go/console/applyconfigurations/console/v1/consolequickstarttask.go new file mode 100644 index 000000000..a6e498cdd --- /dev/null +++ b/vendor/github.com/openshift/client-go/console/applyconfigurations/console/v1/consolequickstarttask.go @@ -0,0 +1,50 @@ +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +// ConsoleQuickStartTaskApplyConfiguration represents a declarative configuration of the ConsoleQuickStartTask type for use +// with apply. +type ConsoleQuickStartTaskApplyConfiguration struct { + Title *string `json:"title,omitempty"` + Description *string `json:"description,omitempty"` + Review *ConsoleQuickStartTaskReviewApplyConfiguration `json:"review,omitempty"` + Summary *ConsoleQuickStartTaskSummaryApplyConfiguration `json:"summary,omitempty"` +} + +// ConsoleQuickStartTaskApplyConfiguration constructs a declarative configuration of the ConsoleQuickStartTask type for use with +// apply. +func ConsoleQuickStartTask() *ConsoleQuickStartTaskApplyConfiguration { + return &ConsoleQuickStartTaskApplyConfiguration{} +} + +// WithTitle sets the Title field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Title field is set to the value of the last call. +func (b *ConsoleQuickStartTaskApplyConfiguration) WithTitle(value string) *ConsoleQuickStartTaskApplyConfiguration { + b.Title = &value + return b +} + +// WithDescription sets the Description field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Description field is set to the value of the last call. +func (b *ConsoleQuickStartTaskApplyConfiguration) WithDescription(value string) *ConsoleQuickStartTaskApplyConfiguration { + b.Description = &value + return b +} + +// WithReview sets the Review field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Review field is set to the value of the last call. +func (b *ConsoleQuickStartTaskApplyConfiguration) WithReview(value *ConsoleQuickStartTaskReviewApplyConfiguration) *ConsoleQuickStartTaskApplyConfiguration { + b.Review = value + return b +} + +// WithSummary sets the Summary field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Summary field is set to the value of the last call. +func (b *ConsoleQuickStartTaskApplyConfiguration) WithSummary(value *ConsoleQuickStartTaskSummaryApplyConfiguration) *ConsoleQuickStartTaskApplyConfiguration { + b.Summary = value + return b +} diff --git a/vendor/github.com/openshift/client-go/console/applyconfigurations/console/v1/consolequickstarttaskreview.go b/vendor/github.com/openshift/client-go/console/applyconfigurations/console/v1/consolequickstarttaskreview.go new file mode 100644 index 000000000..01dd43bdb --- /dev/null +++ b/vendor/github.com/openshift/client-go/console/applyconfigurations/console/v1/consolequickstarttaskreview.go @@ -0,0 +1,32 @@ +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +// ConsoleQuickStartTaskReviewApplyConfiguration represents a declarative configuration of the ConsoleQuickStartTaskReview type for use +// with apply. +type ConsoleQuickStartTaskReviewApplyConfiguration struct { + Instructions *string `json:"instructions,omitempty"` + FailedTaskHelp *string `json:"failedTaskHelp,omitempty"` +} + +// ConsoleQuickStartTaskReviewApplyConfiguration constructs a declarative configuration of the ConsoleQuickStartTaskReview type for use with +// apply. +func ConsoleQuickStartTaskReview() *ConsoleQuickStartTaskReviewApplyConfiguration { + return &ConsoleQuickStartTaskReviewApplyConfiguration{} +} + +// WithInstructions sets the Instructions field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Instructions field is set to the value of the last call. +func (b *ConsoleQuickStartTaskReviewApplyConfiguration) WithInstructions(value string) *ConsoleQuickStartTaskReviewApplyConfiguration { + b.Instructions = &value + return b +} + +// WithFailedTaskHelp sets the FailedTaskHelp field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the FailedTaskHelp field is set to the value of the last call. +func (b *ConsoleQuickStartTaskReviewApplyConfiguration) WithFailedTaskHelp(value string) *ConsoleQuickStartTaskReviewApplyConfiguration { + b.FailedTaskHelp = &value + return b +} diff --git a/vendor/github.com/openshift/client-go/console/applyconfigurations/console/v1/consolequickstarttasksummary.go b/vendor/github.com/openshift/client-go/console/applyconfigurations/console/v1/consolequickstarttasksummary.go new file mode 100644 index 000000000..d19e8a5d5 --- /dev/null +++ b/vendor/github.com/openshift/client-go/console/applyconfigurations/console/v1/consolequickstarttasksummary.go @@ -0,0 +1,32 @@ +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +// ConsoleQuickStartTaskSummaryApplyConfiguration represents a declarative configuration of the ConsoleQuickStartTaskSummary type for use +// with apply. +type ConsoleQuickStartTaskSummaryApplyConfiguration struct { + Success *string `json:"success,omitempty"` + Failed *string `json:"failed,omitempty"` +} + +// ConsoleQuickStartTaskSummaryApplyConfiguration constructs a declarative configuration of the ConsoleQuickStartTaskSummary type for use with +// apply. +func ConsoleQuickStartTaskSummary() *ConsoleQuickStartTaskSummaryApplyConfiguration { + return &ConsoleQuickStartTaskSummaryApplyConfiguration{} +} + +// WithSuccess sets the Success field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Success field is set to the value of the last call. +func (b *ConsoleQuickStartTaskSummaryApplyConfiguration) WithSuccess(value string) *ConsoleQuickStartTaskSummaryApplyConfiguration { + b.Success = &value + return b +} + +// WithFailed sets the Failed field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Failed field is set to the value of the last call. +func (b *ConsoleQuickStartTaskSummaryApplyConfiguration) WithFailed(value string) *ConsoleQuickStartTaskSummaryApplyConfiguration { + b.Failed = &value + return b +} diff --git a/vendor/github.com/openshift/client-go/console/applyconfigurations/console/v1/consolesample.go b/vendor/github.com/openshift/client-go/console/applyconfigurations/console/v1/consolesample.go new file mode 100644 index 000000000..07bbe2872 --- /dev/null +++ b/vendor/github.com/openshift/client-go/console/applyconfigurations/console/v1/consolesample.go @@ -0,0 +1,254 @@ +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +import ( + consolev1 "github.com/openshift/api/console/v1" + internal "github.com/openshift/client-go/console/applyconfigurations/internal" + apismetav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + managedfields "k8s.io/apimachinery/pkg/util/managedfields" + metav1 "k8s.io/client-go/applyconfigurations/meta/v1" +) + +// ConsoleSampleApplyConfiguration represents a declarative configuration of the ConsoleSample type for use +// with apply. +type ConsoleSampleApplyConfiguration struct { + metav1.TypeMetaApplyConfiguration `json:",inline"` + *metav1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` + Spec *ConsoleSampleSpecApplyConfiguration `json:"spec,omitempty"` +} + +// ConsoleSample constructs a declarative configuration of the ConsoleSample type for use with +// apply. +func ConsoleSample(name string) *ConsoleSampleApplyConfiguration { + b := &ConsoleSampleApplyConfiguration{} + b.WithName(name) + b.WithKind("ConsoleSample") + b.WithAPIVersion("console.openshift.io/v1") + return b +} + +// ExtractConsoleSample extracts the applied configuration owned by fieldManager from +// consoleSample. If no managedFields are found in consoleSample for fieldManager, a +// ConsoleSampleApplyConfiguration is returned with only the Name, Namespace (if applicable), +// APIVersion and Kind populated. It is possible that no managed fields were found for because other +// field managers have taken ownership of all the fields previously owned by fieldManager, or because +// the fieldManager never owned fields any fields. +// consoleSample must be a unmodified ConsoleSample API object that was retrieved from the Kubernetes API. +// ExtractConsoleSample provides a way to perform a extract/modify-in-place/apply workflow. +// Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously +// applied if another fieldManager has updated or force applied any of the previously applied fields. +// Experimental! +func ExtractConsoleSample(consoleSample *consolev1.ConsoleSample, fieldManager string) (*ConsoleSampleApplyConfiguration, error) { + return extractConsoleSample(consoleSample, fieldManager, "") +} + +// ExtractConsoleSampleStatus is the same as ExtractConsoleSample except +// that it extracts the status subresource applied configuration. +// Experimental! +func ExtractConsoleSampleStatus(consoleSample *consolev1.ConsoleSample, fieldManager string) (*ConsoleSampleApplyConfiguration, error) { + return extractConsoleSample(consoleSample, fieldManager, "status") +} + +func extractConsoleSample(consoleSample *consolev1.ConsoleSample, fieldManager string, subresource string) (*ConsoleSampleApplyConfiguration, error) { + b := &ConsoleSampleApplyConfiguration{} + err := managedfields.ExtractInto(consoleSample, internal.Parser().Type("com.github.openshift.api.console.v1.ConsoleSample"), fieldManager, b, subresource) + if err != nil { + return nil, err + } + b.WithName(consoleSample.Name) + + b.WithKind("ConsoleSample") + b.WithAPIVersion("console.openshift.io/v1") + return b, nil +} +func (b ConsoleSampleApplyConfiguration) IsApplyConfiguration() {} + +// WithKind sets the Kind field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Kind field is set to the value of the last call. +func (b *ConsoleSampleApplyConfiguration) WithKind(value string) *ConsoleSampleApplyConfiguration { + b.TypeMetaApplyConfiguration.Kind = &value + return b +} + +// WithAPIVersion sets the APIVersion field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the APIVersion field is set to the value of the last call. +func (b *ConsoleSampleApplyConfiguration) WithAPIVersion(value string) *ConsoleSampleApplyConfiguration { + b.TypeMetaApplyConfiguration.APIVersion = &value + return b +} + +// WithName sets the Name field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Name field is set to the value of the last call. +func (b *ConsoleSampleApplyConfiguration) WithName(value string) *ConsoleSampleApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.Name = &value + return b +} + +// WithGenerateName sets the GenerateName field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the GenerateName field is set to the value of the last call. +func (b *ConsoleSampleApplyConfiguration) WithGenerateName(value string) *ConsoleSampleApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.GenerateName = &value + return b +} + +// WithNamespace sets the Namespace field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Namespace field is set to the value of the last call. +func (b *ConsoleSampleApplyConfiguration) WithNamespace(value string) *ConsoleSampleApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.Namespace = &value + return b +} + +// WithUID sets the UID field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the UID field is set to the value of the last call. +func (b *ConsoleSampleApplyConfiguration) WithUID(value types.UID) *ConsoleSampleApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.UID = &value + return b +} + +// WithResourceVersion sets the ResourceVersion field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ResourceVersion field is set to the value of the last call. +func (b *ConsoleSampleApplyConfiguration) WithResourceVersion(value string) *ConsoleSampleApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.ResourceVersion = &value + return b +} + +// WithGeneration sets the Generation field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Generation field is set to the value of the last call. +func (b *ConsoleSampleApplyConfiguration) WithGeneration(value int64) *ConsoleSampleApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.Generation = &value + return b +} + +// WithCreationTimestamp sets the CreationTimestamp field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the CreationTimestamp field is set to the value of the last call. +func (b *ConsoleSampleApplyConfiguration) WithCreationTimestamp(value apismetav1.Time) *ConsoleSampleApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.CreationTimestamp = &value + return b +} + +// WithDeletionTimestamp sets the DeletionTimestamp field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the DeletionTimestamp field is set to the value of the last call. +func (b *ConsoleSampleApplyConfiguration) WithDeletionTimestamp(value apismetav1.Time) *ConsoleSampleApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.DeletionTimestamp = &value + return b +} + +// WithDeletionGracePeriodSeconds sets the DeletionGracePeriodSeconds field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the DeletionGracePeriodSeconds field is set to the value of the last call. +func (b *ConsoleSampleApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *ConsoleSampleApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.DeletionGracePeriodSeconds = &value + return b +} + +// WithLabels puts the entries into the Labels field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, the entries provided by each call will be put on the Labels field, +// overwriting an existing map entries in Labels field with the same key. +func (b *ConsoleSampleApplyConfiguration) WithLabels(entries map[string]string) *ConsoleSampleApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + if b.ObjectMetaApplyConfiguration.Labels == nil && len(entries) > 0 { + b.ObjectMetaApplyConfiguration.Labels = make(map[string]string, len(entries)) + } + for k, v := range entries { + b.ObjectMetaApplyConfiguration.Labels[k] = v + } + return b +} + +// WithAnnotations puts the entries into the Annotations field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, the entries provided by each call will be put on the Annotations field, +// overwriting an existing map entries in Annotations field with the same key. +func (b *ConsoleSampleApplyConfiguration) WithAnnotations(entries map[string]string) *ConsoleSampleApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + if b.ObjectMetaApplyConfiguration.Annotations == nil && len(entries) > 0 { + b.ObjectMetaApplyConfiguration.Annotations = make(map[string]string, len(entries)) + } + for k, v := range entries { + b.ObjectMetaApplyConfiguration.Annotations[k] = v + } + return b +} + +// WithOwnerReferences adds the given value to the OwnerReferences field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the OwnerReferences field. +func (b *ConsoleSampleApplyConfiguration) WithOwnerReferences(values ...*metav1.OwnerReferenceApplyConfiguration) *ConsoleSampleApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + for i := range values { + if values[i] == nil { + panic("nil value passed to WithOwnerReferences") + } + b.ObjectMetaApplyConfiguration.OwnerReferences = append(b.ObjectMetaApplyConfiguration.OwnerReferences, *values[i]) + } + return b +} + +// WithFinalizers adds the given value to the Finalizers field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Finalizers field. +func (b *ConsoleSampleApplyConfiguration) WithFinalizers(values ...string) *ConsoleSampleApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + for i := range values { + b.ObjectMetaApplyConfiguration.Finalizers = append(b.ObjectMetaApplyConfiguration.Finalizers, values[i]) + } + return b +} + +func (b *ConsoleSampleApplyConfiguration) ensureObjectMetaApplyConfigurationExists() { + if b.ObjectMetaApplyConfiguration == nil { + b.ObjectMetaApplyConfiguration = &metav1.ObjectMetaApplyConfiguration{} + } +} + +// WithSpec sets the Spec field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Spec field is set to the value of the last call. +func (b *ConsoleSampleApplyConfiguration) WithSpec(value *ConsoleSampleSpecApplyConfiguration) *ConsoleSampleApplyConfiguration { + b.Spec = value + return b +} + +// GetKind retrieves the value of the Kind field in the declarative configuration. +func (b *ConsoleSampleApplyConfiguration) GetKind() *string { + return b.TypeMetaApplyConfiguration.Kind +} + +// GetAPIVersion retrieves the value of the APIVersion field in the declarative configuration. +func (b *ConsoleSampleApplyConfiguration) GetAPIVersion() *string { + return b.TypeMetaApplyConfiguration.APIVersion +} + +// GetName retrieves the value of the Name field in the declarative configuration. +func (b *ConsoleSampleApplyConfiguration) GetName() *string { + b.ensureObjectMetaApplyConfigurationExists() + return b.ObjectMetaApplyConfiguration.Name +} + +// GetNamespace retrieves the value of the Namespace field in the declarative configuration. +func (b *ConsoleSampleApplyConfiguration) GetNamespace() *string { + b.ensureObjectMetaApplyConfigurationExists() + return b.ObjectMetaApplyConfiguration.Namespace +} diff --git a/vendor/github.com/openshift/client-go/console/applyconfigurations/console/v1/consolesamplecontainerimportsource.go b/vendor/github.com/openshift/client-go/console/applyconfigurations/console/v1/consolesamplecontainerimportsource.go new file mode 100644 index 000000000..0c81ee453 --- /dev/null +++ b/vendor/github.com/openshift/client-go/console/applyconfigurations/console/v1/consolesamplecontainerimportsource.go @@ -0,0 +1,32 @@ +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +// ConsoleSampleContainerImportSourceApplyConfiguration represents a declarative configuration of the ConsoleSampleContainerImportSource type for use +// with apply. +type ConsoleSampleContainerImportSourceApplyConfiguration struct { + Image *string `json:"image,omitempty"` + Service *ConsoleSampleContainerImportSourceServiceApplyConfiguration `json:"service,omitempty"` +} + +// ConsoleSampleContainerImportSourceApplyConfiguration constructs a declarative configuration of the ConsoleSampleContainerImportSource type for use with +// apply. +func ConsoleSampleContainerImportSource() *ConsoleSampleContainerImportSourceApplyConfiguration { + return &ConsoleSampleContainerImportSourceApplyConfiguration{} +} + +// WithImage sets the Image field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Image field is set to the value of the last call. +func (b *ConsoleSampleContainerImportSourceApplyConfiguration) WithImage(value string) *ConsoleSampleContainerImportSourceApplyConfiguration { + b.Image = &value + return b +} + +// WithService sets the Service field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Service field is set to the value of the last call. +func (b *ConsoleSampleContainerImportSourceApplyConfiguration) WithService(value *ConsoleSampleContainerImportSourceServiceApplyConfiguration) *ConsoleSampleContainerImportSourceApplyConfiguration { + b.Service = value + return b +} diff --git a/vendor/github.com/openshift/client-go/console/applyconfigurations/console/v1/consolesamplecontainerimportsourceservice.go b/vendor/github.com/openshift/client-go/console/applyconfigurations/console/v1/consolesamplecontainerimportsourceservice.go new file mode 100644 index 000000000..a594317f1 --- /dev/null +++ b/vendor/github.com/openshift/client-go/console/applyconfigurations/console/v1/consolesamplecontainerimportsourceservice.go @@ -0,0 +1,23 @@ +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +// ConsoleSampleContainerImportSourceServiceApplyConfiguration represents a declarative configuration of the ConsoleSampleContainerImportSourceService type for use +// with apply. +type ConsoleSampleContainerImportSourceServiceApplyConfiguration struct { + TargetPort *int32 `json:"targetPort,omitempty"` +} + +// ConsoleSampleContainerImportSourceServiceApplyConfiguration constructs a declarative configuration of the ConsoleSampleContainerImportSourceService type for use with +// apply. +func ConsoleSampleContainerImportSourceService() *ConsoleSampleContainerImportSourceServiceApplyConfiguration { + return &ConsoleSampleContainerImportSourceServiceApplyConfiguration{} +} + +// WithTargetPort sets the TargetPort field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the TargetPort field is set to the value of the last call. +func (b *ConsoleSampleContainerImportSourceServiceApplyConfiguration) WithTargetPort(value int32) *ConsoleSampleContainerImportSourceServiceApplyConfiguration { + b.TargetPort = &value + return b +} diff --git a/vendor/github.com/openshift/client-go/console/applyconfigurations/console/v1/consolesamplegitimportsource.go b/vendor/github.com/openshift/client-go/console/applyconfigurations/console/v1/consolesamplegitimportsource.go new file mode 100644 index 000000000..2e6260a92 --- /dev/null +++ b/vendor/github.com/openshift/client-go/console/applyconfigurations/console/v1/consolesamplegitimportsource.go @@ -0,0 +1,32 @@ +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +// ConsoleSampleGitImportSourceApplyConfiguration represents a declarative configuration of the ConsoleSampleGitImportSource type for use +// with apply. +type ConsoleSampleGitImportSourceApplyConfiguration struct { + Repository *ConsoleSampleGitImportSourceRepositoryApplyConfiguration `json:"repository,omitempty"` + Service *ConsoleSampleGitImportSourceServiceApplyConfiguration `json:"service,omitempty"` +} + +// ConsoleSampleGitImportSourceApplyConfiguration constructs a declarative configuration of the ConsoleSampleGitImportSource type for use with +// apply. +func ConsoleSampleGitImportSource() *ConsoleSampleGitImportSourceApplyConfiguration { + return &ConsoleSampleGitImportSourceApplyConfiguration{} +} + +// WithRepository sets the Repository field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Repository field is set to the value of the last call. +func (b *ConsoleSampleGitImportSourceApplyConfiguration) WithRepository(value *ConsoleSampleGitImportSourceRepositoryApplyConfiguration) *ConsoleSampleGitImportSourceApplyConfiguration { + b.Repository = value + return b +} + +// WithService sets the Service field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Service field is set to the value of the last call. +func (b *ConsoleSampleGitImportSourceApplyConfiguration) WithService(value *ConsoleSampleGitImportSourceServiceApplyConfiguration) *ConsoleSampleGitImportSourceApplyConfiguration { + b.Service = value + return b +} diff --git a/vendor/github.com/openshift/client-go/console/applyconfigurations/console/v1/consolesamplegitimportsourcerepository.go b/vendor/github.com/openshift/client-go/console/applyconfigurations/console/v1/consolesamplegitimportsourcerepository.go new file mode 100644 index 000000000..84d19162b --- /dev/null +++ b/vendor/github.com/openshift/client-go/console/applyconfigurations/console/v1/consolesamplegitimportsourcerepository.go @@ -0,0 +1,41 @@ +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +// ConsoleSampleGitImportSourceRepositoryApplyConfiguration represents a declarative configuration of the ConsoleSampleGitImportSourceRepository type for use +// with apply. +type ConsoleSampleGitImportSourceRepositoryApplyConfiguration struct { + URL *string `json:"url,omitempty"` + Revision *string `json:"revision,omitempty"` + ContextDir *string `json:"contextDir,omitempty"` +} + +// ConsoleSampleGitImportSourceRepositoryApplyConfiguration constructs a declarative configuration of the ConsoleSampleGitImportSourceRepository type for use with +// apply. +func ConsoleSampleGitImportSourceRepository() *ConsoleSampleGitImportSourceRepositoryApplyConfiguration { + return &ConsoleSampleGitImportSourceRepositoryApplyConfiguration{} +} + +// WithURL sets the URL field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the URL field is set to the value of the last call. +func (b *ConsoleSampleGitImportSourceRepositoryApplyConfiguration) WithURL(value string) *ConsoleSampleGitImportSourceRepositoryApplyConfiguration { + b.URL = &value + return b +} + +// WithRevision sets the Revision field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Revision field is set to the value of the last call. +func (b *ConsoleSampleGitImportSourceRepositoryApplyConfiguration) WithRevision(value string) *ConsoleSampleGitImportSourceRepositoryApplyConfiguration { + b.Revision = &value + return b +} + +// WithContextDir sets the ContextDir field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ContextDir field is set to the value of the last call. +func (b *ConsoleSampleGitImportSourceRepositoryApplyConfiguration) WithContextDir(value string) *ConsoleSampleGitImportSourceRepositoryApplyConfiguration { + b.ContextDir = &value + return b +} diff --git a/vendor/github.com/openshift/client-go/console/applyconfigurations/console/v1/consolesamplegitimportsourceservice.go b/vendor/github.com/openshift/client-go/console/applyconfigurations/console/v1/consolesamplegitimportsourceservice.go new file mode 100644 index 000000000..0dd55a7b7 --- /dev/null +++ b/vendor/github.com/openshift/client-go/console/applyconfigurations/console/v1/consolesamplegitimportsourceservice.go @@ -0,0 +1,23 @@ +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +// ConsoleSampleGitImportSourceServiceApplyConfiguration represents a declarative configuration of the ConsoleSampleGitImportSourceService type for use +// with apply. +type ConsoleSampleGitImportSourceServiceApplyConfiguration struct { + TargetPort *int32 `json:"targetPort,omitempty"` +} + +// ConsoleSampleGitImportSourceServiceApplyConfiguration constructs a declarative configuration of the ConsoleSampleGitImportSourceService type for use with +// apply. +func ConsoleSampleGitImportSourceService() *ConsoleSampleGitImportSourceServiceApplyConfiguration { + return &ConsoleSampleGitImportSourceServiceApplyConfiguration{} +} + +// WithTargetPort sets the TargetPort field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the TargetPort field is set to the value of the last call. +func (b *ConsoleSampleGitImportSourceServiceApplyConfiguration) WithTargetPort(value int32) *ConsoleSampleGitImportSourceServiceApplyConfiguration { + b.TargetPort = &value + return b +} diff --git a/vendor/github.com/openshift/client-go/console/applyconfigurations/console/v1/consolesamplesource.go b/vendor/github.com/openshift/client-go/console/applyconfigurations/console/v1/consolesamplesource.go new file mode 100644 index 000000000..372a6c7d7 --- /dev/null +++ b/vendor/github.com/openshift/client-go/console/applyconfigurations/console/v1/consolesamplesource.go @@ -0,0 +1,45 @@ +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +import ( + consolev1 "github.com/openshift/api/console/v1" +) + +// ConsoleSampleSourceApplyConfiguration represents a declarative configuration of the ConsoleSampleSource type for use +// with apply. +type ConsoleSampleSourceApplyConfiguration struct { + Type *consolev1.ConsoleSampleSourceType `json:"type,omitempty"` + GitImport *ConsoleSampleGitImportSourceApplyConfiguration `json:"gitImport,omitempty"` + ContainerImport *ConsoleSampleContainerImportSourceApplyConfiguration `json:"containerImport,omitempty"` +} + +// ConsoleSampleSourceApplyConfiguration constructs a declarative configuration of the ConsoleSampleSource type for use with +// apply. +func ConsoleSampleSource() *ConsoleSampleSourceApplyConfiguration { + return &ConsoleSampleSourceApplyConfiguration{} +} + +// WithType sets the Type field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Type field is set to the value of the last call. +func (b *ConsoleSampleSourceApplyConfiguration) WithType(value consolev1.ConsoleSampleSourceType) *ConsoleSampleSourceApplyConfiguration { + b.Type = &value + return b +} + +// WithGitImport sets the GitImport field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the GitImport field is set to the value of the last call. +func (b *ConsoleSampleSourceApplyConfiguration) WithGitImport(value *ConsoleSampleGitImportSourceApplyConfiguration) *ConsoleSampleSourceApplyConfiguration { + b.GitImport = value + return b +} + +// WithContainerImport sets the ContainerImport field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ContainerImport field is set to the value of the last call. +func (b *ConsoleSampleSourceApplyConfiguration) WithContainerImport(value *ConsoleSampleContainerImportSourceApplyConfiguration) *ConsoleSampleSourceApplyConfiguration { + b.ContainerImport = value + return b +} diff --git a/vendor/github.com/openshift/client-go/console/applyconfigurations/console/v1/consolesamplespec.go b/vendor/github.com/openshift/client-go/console/applyconfigurations/console/v1/consolesamplespec.go new file mode 100644 index 000000000..87c14c35f --- /dev/null +++ b/vendor/github.com/openshift/client-go/console/applyconfigurations/console/v1/consolesamplespec.go @@ -0,0 +1,88 @@ +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +// ConsoleSampleSpecApplyConfiguration represents a declarative configuration of the ConsoleSampleSpec type for use +// with apply. +type ConsoleSampleSpecApplyConfiguration struct { + Title *string `json:"title,omitempty"` + Abstract *string `json:"abstract,omitempty"` + Description *string `json:"description,omitempty"` + Icon *string `json:"icon,omitempty"` + Type *string `json:"type,omitempty"` + Provider *string `json:"provider,omitempty"` + Tags []string `json:"tags,omitempty"` + Source *ConsoleSampleSourceApplyConfiguration `json:"source,omitempty"` +} + +// ConsoleSampleSpecApplyConfiguration constructs a declarative configuration of the ConsoleSampleSpec type for use with +// apply. +func ConsoleSampleSpec() *ConsoleSampleSpecApplyConfiguration { + return &ConsoleSampleSpecApplyConfiguration{} +} + +// WithTitle sets the Title field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Title field is set to the value of the last call. +func (b *ConsoleSampleSpecApplyConfiguration) WithTitle(value string) *ConsoleSampleSpecApplyConfiguration { + b.Title = &value + return b +} + +// WithAbstract sets the Abstract field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Abstract field is set to the value of the last call. +func (b *ConsoleSampleSpecApplyConfiguration) WithAbstract(value string) *ConsoleSampleSpecApplyConfiguration { + b.Abstract = &value + return b +} + +// WithDescription sets the Description field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Description field is set to the value of the last call. +func (b *ConsoleSampleSpecApplyConfiguration) WithDescription(value string) *ConsoleSampleSpecApplyConfiguration { + b.Description = &value + return b +} + +// WithIcon sets the Icon field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Icon field is set to the value of the last call. +func (b *ConsoleSampleSpecApplyConfiguration) WithIcon(value string) *ConsoleSampleSpecApplyConfiguration { + b.Icon = &value + return b +} + +// WithType sets the Type field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Type field is set to the value of the last call. +func (b *ConsoleSampleSpecApplyConfiguration) WithType(value string) *ConsoleSampleSpecApplyConfiguration { + b.Type = &value + return b +} + +// WithProvider sets the Provider field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Provider field is set to the value of the last call. +func (b *ConsoleSampleSpecApplyConfiguration) WithProvider(value string) *ConsoleSampleSpecApplyConfiguration { + b.Provider = &value + return b +} + +// WithTags adds the given value to the Tags field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Tags field. +func (b *ConsoleSampleSpecApplyConfiguration) WithTags(values ...string) *ConsoleSampleSpecApplyConfiguration { + for i := range values { + b.Tags = append(b.Tags, values[i]) + } + return b +} + +// WithSource sets the Source field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Source field is set to the value of the last call. +func (b *ConsoleSampleSpecApplyConfiguration) WithSource(value *ConsoleSampleSourceApplyConfiguration) *ConsoleSampleSpecApplyConfiguration { + b.Source = value + return b +} diff --git a/vendor/github.com/openshift/client-go/console/applyconfigurations/console/v1/consoleyamlsample.go b/vendor/github.com/openshift/client-go/console/applyconfigurations/console/v1/consoleyamlsample.go new file mode 100644 index 000000000..f554b2c8e --- /dev/null +++ b/vendor/github.com/openshift/client-go/console/applyconfigurations/console/v1/consoleyamlsample.go @@ -0,0 +1,254 @@ +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +import ( + consolev1 "github.com/openshift/api/console/v1" + internal "github.com/openshift/client-go/console/applyconfigurations/internal" + apismetav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + managedfields "k8s.io/apimachinery/pkg/util/managedfields" + metav1 "k8s.io/client-go/applyconfigurations/meta/v1" +) + +// ConsoleYAMLSampleApplyConfiguration represents a declarative configuration of the ConsoleYAMLSample type for use +// with apply. +type ConsoleYAMLSampleApplyConfiguration struct { + metav1.TypeMetaApplyConfiguration `json:",inline"` + *metav1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` + Spec *ConsoleYAMLSampleSpecApplyConfiguration `json:"spec,omitempty"` +} + +// ConsoleYAMLSample constructs a declarative configuration of the ConsoleYAMLSample type for use with +// apply. +func ConsoleYAMLSample(name string) *ConsoleYAMLSampleApplyConfiguration { + b := &ConsoleYAMLSampleApplyConfiguration{} + b.WithName(name) + b.WithKind("ConsoleYAMLSample") + b.WithAPIVersion("console.openshift.io/v1") + return b +} + +// ExtractConsoleYAMLSample extracts the applied configuration owned by fieldManager from +// consoleYAMLSample. If no managedFields are found in consoleYAMLSample for fieldManager, a +// ConsoleYAMLSampleApplyConfiguration is returned with only the Name, Namespace (if applicable), +// APIVersion and Kind populated. It is possible that no managed fields were found for because other +// field managers have taken ownership of all the fields previously owned by fieldManager, or because +// the fieldManager never owned fields any fields. +// consoleYAMLSample must be a unmodified ConsoleYAMLSample API object that was retrieved from the Kubernetes API. +// ExtractConsoleYAMLSample provides a way to perform a extract/modify-in-place/apply workflow. +// Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously +// applied if another fieldManager has updated or force applied any of the previously applied fields. +// Experimental! +func ExtractConsoleYAMLSample(consoleYAMLSample *consolev1.ConsoleYAMLSample, fieldManager string) (*ConsoleYAMLSampleApplyConfiguration, error) { + return extractConsoleYAMLSample(consoleYAMLSample, fieldManager, "") +} + +// ExtractConsoleYAMLSampleStatus is the same as ExtractConsoleYAMLSample except +// that it extracts the status subresource applied configuration. +// Experimental! +func ExtractConsoleYAMLSampleStatus(consoleYAMLSample *consolev1.ConsoleYAMLSample, fieldManager string) (*ConsoleYAMLSampleApplyConfiguration, error) { + return extractConsoleYAMLSample(consoleYAMLSample, fieldManager, "status") +} + +func extractConsoleYAMLSample(consoleYAMLSample *consolev1.ConsoleYAMLSample, fieldManager string, subresource string) (*ConsoleYAMLSampleApplyConfiguration, error) { + b := &ConsoleYAMLSampleApplyConfiguration{} + err := managedfields.ExtractInto(consoleYAMLSample, internal.Parser().Type("com.github.openshift.api.console.v1.ConsoleYAMLSample"), fieldManager, b, subresource) + if err != nil { + return nil, err + } + b.WithName(consoleYAMLSample.Name) + + b.WithKind("ConsoleYAMLSample") + b.WithAPIVersion("console.openshift.io/v1") + return b, nil +} +func (b ConsoleYAMLSampleApplyConfiguration) IsApplyConfiguration() {} + +// WithKind sets the Kind field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Kind field is set to the value of the last call. +func (b *ConsoleYAMLSampleApplyConfiguration) WithKind(value string) *ConsoleYAMLSampleApplyConfiguration { + b.TypeMetaApplyConfiguration.Kind = &value + return b +} + +// WithAPIVersion sets the APIVersion field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the APIVersion field is set to the value of the last call. +func (b *ConsoleYAMLSampleApplyConfiguration) WithAPIVersion(value string) *ConsoleYAMLSampleApplyConfiguration { + b.TypeMetaApplyConfiguration.APIVersion = &value + return b +} + +// WithName sets the Name field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Name field is set to the value of the last call. +func (b *ConsoleYAMLSampleApplyConfiguration) WithName(value string) *ConsoleYAMLSampleApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.Name = &value + return b +} + +// WithGenerateName sets the GenerateName field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the GenerateName field is set to the value of the last call. +func (b *ConsoleYAMLSampleApplyConfiguration) WithGenerateName(value string) *ConsoleYAMLSampleApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.GenerateName = &value + return b +} + +// WithNamespace sets the Namespace field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Namespace field is set to the value of the last call. +func (b *ConsoleYAMLSampleApplyConfiguration) WithNamespace(value string) *ConsoleYAMLSampleApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.Namespace = &value + return b +} + +// WithUID sets the UID field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the UID field is set to the value of the last call. +func (b *ConsoleYAMLSampleApplyConfiguration) WithUID(value types.UID) *ConsoleYAMLSampleApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.UID = &value + return b +} + +// WithResourceVersion sets the ResourceVersion field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ResourceVersion field is set to the value of the last call. +func (b *ConsoleYAMLSampleApplyConfiguration) WithResourceVersion(value string) *ConsoleYAMLSampleApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.ResourceVersion = &value + return b +} + +// WithGeneration sets the Generation field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Generation field is set to the value of the last call. +func (b *ConsoleYAMLSampleApplyConfiguration) WithGeneration(value int64) *ConsoleYAMLSampleApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.Generation = &value + return b +} + +// WithCreationTimestamp sets the CreationTimestamp field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the CreationTimestamp field is set to the value of the last call. +func (b *ConsoleYAMLSampleApplyConfiguration) WithCreationTimestamp(value apismetav1.Time) *ConsoleYAMLSampleApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.CreationTimestamp = &value + return b +} + +// WithDeletionTimestamp sets the DeletionTimestamp field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the DeletionTimestamp field is set to the value of the last call. +func (b *ConsoleYAMLSampleApplyConfiguration) WithDeletionTimestamp(value apismetav1.Time) *ConsoleYAMLSampleApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.DeletionTimestamp = &value + return b +} + +// WithDeletionGracePeriodSeconds sets the DeletionGracePeriodSeconds field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the DeletionGracePeriodSeconds field is set to the value of the last call. +func (b *ConsoleYAMLSampleApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *ConsoleYAMLSampleApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.DeletionGracePeriodSeconds = &value + return b +} + +// WithLabels puts the entries into the Labels field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, the entries provided by each call will be put on the Labels field, +// overwriting an existing map entries in Labels field with the same key. +func (b *ConsoleYAMLSampleApplyConfiguration) WithLabels(entries map[string]string) *ConsoleYAMLSampleApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + if b.ObjectMetaApplyConfiguration.Labels == nil && len(entries) > 0 { + b.ObjectMetaApplyConfiguration.Labels = make(map[string]string, len(entries)) + } + for k, v := range entries { + b.ObjectMetaApplyConfiguration.Labels[k] = v + } + return b +} + +// WithAnnotations puts the entries into the Annotations field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, the entries provided by each call will be put on the Annotations field, +// overwriting an existing map entries in Annotations field with the same key. +func (b *ConsoleYAMLSampleApplyConfiguration) WithAnnotations(entries map[string]string) *ConsoleYAMLSampleApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + if b.ObjectMetaApplyConfiguration.Annotations == nil && len(entries) > 0 { + b.ObjectMetaApplyConfiguration.Annotations = make(map[string]string, len(entries)) + } + for k, v := range entries { + b.ObjectMetaApplyConfiguration.Annotations[k] = v + } + return b +} + +// WithOwnerReferences adds the given value to the OwnerReferences field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the OwnerReferences field. +func (b *ConsoleYAMLSampleApplyConfiguration) WithOwnerReferences(values ...*metav1.OwnerReferenceApplyConfiguration) *ConsoleYAMLSampleApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + for i := range values { + if values[i] == nil { + panic("nil value passed to WithOwnerReferences") + } + b.ObjectMetaApplyConfiguration.OwnerReferences = append(b.ObjectMetaApplyConfiguration.OwnerReferences, *values[i]) + } + return b +} + +// WithFinalizers adds the given value to the Finalizers field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Finalizers field. +func (b *ConsoleYAMLSampleApplyConfiguration) WithFinalizers(values ...string) *ConsoleYAMLSampleApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + for i := range values { + b.ObjectMetaApplyConfiguration.Finalizers = append(b.ObjectMetaApplyConfiguration.Finalizers, values[i]) + } + return b +} + +func (b *ConsoleYAMLSampleApplyConfiguration) ensureObjectMetaApplyConfigurationExists() { + if b.ObjectMetaApplyConfiguration == nil { + b.ObjectMetaApplyConfiguration = &metav1.ObjectMetaApplyConfiguration{} + } +} + +// WithSpec sets the Spec field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Spec field is set to the value of the last call. +func (b *ConsoleYAMLSampleApplyConfiguration) WithSpec(value *ConsoleYAMLSampleSpecApplyConfiguration) *ConsoleYAMLSampleApplyConfiguration { + b.Spec = value + return b +} + +// GetKind retrieves the value of the Kind field in the declarative configuration. +func (b *ConsoleYAMLSampleApplyConfiguration) GetKind() *string { + return b.TypeMetaApplyConfiguration.Kind +} + +// GetAPIVersion retrieves the value of the APIVersion field in the declarative configuration. +func (b *ConsoleYAMLSampleApplyConfiguration) GetAPIVersion() *string { + return b.TypeMetaApplyConfiguration.APIVersion +} + +// GetName retrieves the value of the Name field in the declarative configuration. +func (b *ConsoleYAMLSampleApplyConfiguration) GetName() *string { + b.ensureObjectMetaApplyConfigurationExists() + return b.ObjectMetaApplyConfiguration.Name +} + +// GetNamespace retrieves the value of the Namespace field in the declarative configuration. +func (b *ConsoleYAMLSampleApplyConfiguration) GetNamespace() *string { + b.ensureObjectMetaApplyConfigurationExists() + return b.ObjectMetaApplyConfiguration.Namespace +} diff --git a/vendor/github.com/openshift/client-go/console/applyconfigurations/console/v1/consoleyamlsamplespec.go b/vendor/github.com/openshift/client-go/console/applyconfigurations/console/v1/consoleyamlsamplespec.go new file mode 100644 index 000000000..d5fee7bc1 --- /dev/null +++ b/vendor/github.com/openshift/client-go/console/applyconfigurations/console/v1/consoleyamlsamplespec.go @@ -0,0 +1,64 @@ +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +import ( + consolev1 "github.com/openshift/api/console/v1" + metav1 "k8s.io/client-go/applyconfigurations/meta/v1" +) + +// ConsoleYAMLSampleSpecApplyConfiguration represents a declarative configuration of the ConsoleYAMLSampleSpec type for use +// with apply. +type ConsoleYAMLSampleSpecApplyConfiguration struct { + TargetResource *metav1.TypeMetaApplyConfiguration `json:"targetResource,omitempty"` + Title *consolev1.ConsoleYAMLSampleTitle `json:"title,omitempty"` + Description *consolev1.ConsoleYAMLSampleDescription `json:"description,omitempty"` + YAML *consolev1.ConsoleYAMLSampleYAML `json:"yaml,omitempty"` + Snippet *bool `json:"snippet,omitempty"` +} + +// ConsoleYAMLSampleSpecApplyConfiguration constructs a declarative configuration of the ConsoleYAMLSampleSpec type for use with +// apply. +func ConsoleYAMLSampleSpec() *ConsoleYAMLSampleSpecApplyConfiguration { + return &ConsoleYAMLSampleSpecApplyConfiguration{} +} + +// WithTargetResource sets the TargetResource field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the TargetResource field is set to the value of the last call. +func (b *ConsoleYAMLSampleSpecApplyConfiguration) WithTargetResource(value *metav1.TypeMetaApplyConfiguration) *ConsoleYAMLSampleSpecApplyConfiguration { + b.TargetResource = value + return b +} + +// WithTitle sets the Title field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Title field is set to the value of the last call. +func (b *ConsoleYAMLSampleSpecApplyConfiguration) WithTitle(value consolev1.ConsoleYAMLSampleTitle) *ConsoleYAMLSampleSpecApplyConfiguration { + b.Title = &value + return b +} + +// WithDescription sets the Description field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Description field is set to the value of the last call. +func (b *ConsoleYAMLSampleSpecApplyConfiguration) WithDescription(value consolev1.ConsoleYAMLSampleDescription) *ConsoleYAMLSampleSpecApplyConfiguration { + b.Description = &value + return b +} + +// WithYAML sets the YAML field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the YAML field is set to the value of the last call. +func (b *ConsoleYAMLSampleSpecApplyConfiguration) WithYAML(value consolev1.ConsoleYAMLSampleYAML) *ConsoleYAMLSampleSpecApplyConfiguration { + b.YAML = &value + return b +} + +// WithSnippet sets the Snippet field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Snippet field is set to the value of the last call. +func (b *ConsoleYAMLSampleSpecApplyConfiguration) WithSnippet(value bool) *ConsoleYAMLSampleSpecApplyConfiguration { + b.Snippet = &value + return b +} diff --git a/vendor/github.com/openshift/client-go/console/applyconfigurations/console/v1/link.go b/vendor/github.com/openshift/client-go/console/applyconfigurations/console/v1/link.go new file mode 100644 index 000000000..cc82a7444 --- /dev/null +++ b/vendor/github.com/openshift/client-go/console/applyconfigurations/console/v1/link.go @@ -0,0 +1,32 @@ +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +// LinkApplyConfiguration represents a declarative configuration of the Link type for use +// with apply. +type LinkApplyConfiguration struct { + Text *string `json:"text,omitempty"` + Href *string `json:"href,omitempty"` +} + +// LinkApplyConfiguration constructs a declarative configuration of the Link type for use with +// apply. +func Link() *LinkApplyConfiguration { + return &LinkApplyConfiguration{} +} + +// WithText sets the Text field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Text field is set to the value of the last call. +func (b *LinkApplyConfiguration) WithText(value string) *LinkApplyConfiguration { + b.Text = &value + return b +} + +// WithHref sets the Href field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Href field is set to the value of the last call. +func (b *LinkApplyConfiguration) WithHref(value string) *LinkApplyConfiguration { + b.Href = &value + return b +} diff --git a/vendor/github.com/openshift/client-go/console/applyconfigurations/console/v1/namespacedashboardspec.go b/vendor/github.com/openshift/client-go/console/applyconfigurations/console/v1/namespacedashboardspec.go new file mode 100644 index 000000000..6731ab5a2 --- /dev/null +++ b/vendor/github.com/openshift/client-go/console/applyconfigurations/console/v1/namespacedashboardspec.go @@ -0,0 +1,38 @@ +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +import ( + metav1 "k8s.io/client-go/applyconfigurations/meta/v1" +) + +// NamespaceDashboardSpecApplyConfiguration represents a declarative configuration of the NamespaceDashboardSpec type for use +// with apply. +type NamespaceDashboardSpecApplyConfiguration struct { + Namespaces []string `json:"namespaces,omitempty"` + NamespaceSelector *metav1.LabelSelectorApplyConfiguration `json:"namespaceSelector,omitempty"` +} + +// NamespaceDashboardSpecApplyConfiguration constructs a declarative configuration of the NamespaceDashboardSpec type for use with +// apply. +func NamespaceDashboardSpec() *NamespaceDashboardSpecApplyConfiguration { + return &NamespaceDashboardSpecApplyConfiguration{} +} + +// WithNamespaces adds the given value to the Namespaces field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Namespaces field. +func (b *NamespaceDashboardSpecApplyConfiguration) WithNamespaces(values ...string) *NamespaceDashboardSpecApplyConfiguration { + for i := range values { + b.Namespaces = append(b.Namespaces, values[i]) + } + return b +} + +// WithNamespaceSelector sets the NamespaceSelector field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the NamespaceSelector field is set to the value of the last call. +func (b *NamespaceDashboardSpecApplyConfiguration) WithNamespaceSelector(value *metav1.LabelSelectorApplyConfiguration) *NamespaceDashboardSpecApplyConfiguration { + b.NamespaceSelector = value + return b +} diff --git a/vendor/github.com/openshift/client-go/console/applyconfigurations/internal/internal.go b/vendor/github.com/openshift/client-go/console/applyconfigurations/internal/internal.go new file mode 100644 index 000000000..31d49abbf --- /dev/null +++ b/vendor/github.com/openshift/client-go/console/applyconfigurations/internal/internal.go @@ -0,0 +1,888 @@ +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package internal + +import ( + fmt "fmt" + sync "sync" + + typed "sigs.k8s.io/structured-merge-diff/v6/typed" +) + +func Parser() *typed.Parser { + parserOnce.Do(func() { + var err error + parser, err = typed.NewParser(schemaYAML) + if err != nil { + panic(fmt.Sprintf("Failed to parse schema: %v", err)) + } + }) + return parser +} + +var parserOnce sync.Once +var parser *typed.Parser +var schemaYAML = typed.YAMLObject(`types: +- name: com.github.openshift.api.console.v1.ApplicationMenuSpec + map: + fields: + - name: imageURL + type: + scalar: string + - name: section + type: + scalar: string + default: "" +- name: com.github.openshift.api.console.v1.CLIDownloadLink + map: + fields: + - name: href + type: + scalar: string + default: "" + - name: text + type: + scalar: string + default: "" +- name: com.github.openshift.api.console.v1.ConsoleCLIDownload + map: + fields: + - name: apiVersion + type: + scalar: string + - name: kind + type: + scalar: string + - name: metadata + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta + default: {} + - name: spec + type: + namedType: com.github.openshift.api.console.v1.ConsoleCLIDownloadSpec + default: {} +- name: com.github.openshift.api.console.v1.ConsoleCLIDownloadSpec + map: + fields: + - name: description + type: + scalar: string + default: "" + - name: displayName + type: + scalar: string + default: "" + - name: links + type: + list: + elementType: + namedType: com.github.openshift.api.console.v1.CLIDownloadLink + elementRelationship: atomic +- name: com.github.openshift.api.console.v1.ConsoleExternalLogLink + map: + fields: + - name: apiVersion + type: + scalar: string + - name: kind + type: + scalar: string + - name: metadata + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta + default: {} + - name: spec + type: + namedType: com.github.openshift.api.console.v1.ConsoleExternalLogLinkSpec + default: {} +- name: com.github.openshift.api.console.v1.ConsoleExternalLogLinkSpec + map: + fields: + - name: hrefTemplate + type: + scalar: string + default: "" + - name: namespaceFilter + type: + scalar: string + - name: text + type: + scalar: string + default: "" +- name: com.github.openshift.api.console.v1.ConsoleLink + map: + fields: + - name: apiVersion + type: + scalar: string + - name: kind + type: + scalar: string + - name: metadata + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta + default: {} + - name: spec + type: + namedType: com.github.openshift.api.console.v1.ConsoleLinkSpec + default: {} +- name: com.github.openshift.api.console.v1.ConsoleLinkSpec + map: + fields: + - name: applicationMenu + type: + namedType: com.github.openshift.api.console.v1.ApplicationMenuSpec + - name: href + type: + scalar: string + default: "" + - name: location + type: + scalar: string + default: "" + - name: namespaceDashboard + type: + namedType: com.github.openshift.api.console.v1.NamespaceDashboardSpec + - name: text + type: + scalar: string + default: "" +- name: com.github.openshift.api.console.v1.ConsoleNotification + map: + fields: + - name: apiVersion + type: + scalar: string + - name: kind + type: + scalar: string + - name: metadata + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta + default: {} + - name: spec + type: + namedType: com.github.openshift.api.console.v1.ConsoleNotificationSpec + default: {} +- name: com.github.openshift.api.console.v1.ConsoleNotificationSpec + map: + fields: + - name: backgroundColor + type: + scalar: string + - name: color + type: + scalar: string + - name: link + type: + namedType: com.github.openshift.api.console.v1.Link + - name: location + type: + scalar: string + - name: text + type: + scalar: string + default: "" +- name: com.github.openshift.api.console.v1.ConsolePlugin + map: + fields: + - name: apiVersion + type: + scalar: string + - name: kind + type: + scalar: string + - name: metadata + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta + default: {} + - name: spec + type: + namedType: com.github.openshift.api.console.v1.ConsolePluginSpec + default: {} +- name: com.github.openshift.api.console.v1.ConsolePluginBackend + map: + fields: + - name: service + type: + namedType: com.github.openshift.api.console.v1.ConsolePluginService + - name: type + type: + scalar: string + default: "" + unions: + - discriminator: type + fields: + - fieldName: service + discriminatorValue: Service +- name: com.github.openshift.api.console.v1.ConsolePluginCSP + map: + fields: + - name: directive + type: + scalar: string + default: "" + - name: values + type: + list: + elementType: + scalar: string + elementRelationship: atomic +- name: com.github.openshift.api.console.v1.ConsolePluginI18n + map: + fields: + - name: loadType + type: + scalar: string + default: "" +- name: com.github.openshift.api.console.v1.ConsolePluginProxy + map: + fields: + - name: alias + type: + scalar: string + default: "" + - name: authorization + type: + scalar: string + - name: caCertificate + type: + scalar: string + - name: endpoint + type: + namedType: com.github.openshift.api.console.v1.ConsolePluginProxyEndpoint + default: {} +- name: com.github.openshift.api.console.v1.ConsolePluginProxyEndpoint + map: + fields: + - name: service + type: + namedType: com.github.openshift.api.console.v1.ConsolePluginProxyServiceConfig + - name: type + type: + scalar: string + default: "" + unions: + - discriminator: type + fields: + - fieldName: service + discriminatorValue: Service +- name: com.github.openshift.api.console.v1.ConsolePluginProxyServiceConfig + map: + fields: + - name: name + type: + scalar: string + default: "" + - name: namespace + type: + scalar: string + default: "" + - name: port + type: + scalar: numeric + default: 0 +- name: com.github.openshift.api.console.v1.ConsolePluginService + map: + fields: + - name: basePath + type: + scalar: string + - name: name + type: + scalar: string + default: "" + - name: namespace + type: + scalar: string + default: "" + - name: port + type: + scalar: numeric + default: 0 +- name: com.github.openshift.api.console.v1.ConsolePluginSpec + map: + fields: + - name: backend + type: + namedType: com.github.openshift.api.console.v1.ConsolePluginBackend + default: {} + - name: contentSecurityPolicy + type: + list: + elementType: + namedType: com.github.openshift.api.console.v1.ConsolePluginCSP + elementRelationship: associative + keys: + - directive + - name: displayName + type: + scalar: string + default: "" + - name: i18n + type: + namedType: com.github.openshift.api.console.v1.ConsolePluginI18n + default: {} + - name: proxy + type: + list: + elementType: + namedType: com.github.openshift.api.console.v1.ConsolePluginProxy + elementRelationship: atomic +- name: com.github.openshift.api.console.v1.ConsoleQuickStart + map: + fields: + - name: apiVersion + type: + scalar: string + - name: kind + type: + scalar: string + - name: metadata + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta + default: {} + - name: spec + type: + namedType: com.github.openshift.api.console.v1.ConsoleQuickStartSpec + default: {} +- name: com.github.openshift.api.console.v1.ConsoleQuickStartSpec + map: + fields: + - name: accessReviewResources + type: + list: + elementType: + namedType: io.k8s.api.authorization.v1.ResourceAttributes + elementRelationship: atomic + - name: conclusion + type: + scalar: string + - name: description + type: + scalar: string + default: "" + - name: displayName + type: + scalar: string + default: "" + - name: durationMinutes + type: + scalar: numeric + default: 0 + - name: icon + type: + scalar: string + - name: introduction + type: + scalar: string + default: "" + - name: nextQuickStart + type: + list: + elementType: + scalar: string + elementRelationship: atomic + - name: prerequisites + type: + list: + elementType: + scalar: string + elementRelationship: atomic + - name: tags + type: + list: + elementType: + scalar: string + elementRelationship: atomic + - name: tasks + type: + list: + elementType: + namedType: com.github.openshift.api.console.v1.ConsoleQuickStartTask + elementRelationship: atomic +- name: com.github.openshift.api.console.v1.ConsoleQuickStartTask + map: + fields: + - name: description + type: + scalar: string + default: "" + - name: review + type: + namedType: com.github.openshift.api.console.v1.ConsoleQuickStartTaskReview + - name: summary + type: + namedType: com.github.openshift.api.console.v1.ConsoleQuickStartTaskSummary + - name: title + type: + scalar: string + default: "" +- name: com.github.openshift.api.console.v1.ConsoleQuickStartTaskReview + map: + fields: + - name: failedTaskHelp + type: + scalar: string + default: "" + - name: instructions + type: + scalar: string + default: "" +- name: com.github.openshift.api.console.v1.ConsoleQuickStartTaskSummary + map: + fields: + - name: failed + type: + scalar: string + default: "" + - name: success + type: + scalar: string + default: "" +- name: com.github.openshift.api.console.v1.ConsoleSample + map: + fields: + - name: apiVersion + type: + scalar: string + - name: kind + type: + scalar: string + - name: metadata + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta + default: {} + - name: spec + type: + namedType: com.github.openshift.api.console.v1.ConsoleSampleSpec + default: {} +- name: com.github.openshift.api.console.v1.ConsoleSampleContainerImportSource + map: + fields: + - name: image + type: + scalar: string + default: "" + - name: service + type: + namedType: com.github.openshift.api.console.v1.ConsoleSampleContainerImportSourceService + default: {} +- name: com.github.openshift.api.console.v1.ConsoleSampleContainerImportSourceService + map: + fields: + - name: targetPort + type: + scalar: numeric +- name: com.github.openshift.api.console.v1.ConsoleSampleGitImportSource + map: + fields: + - name: repository + type: + namedType: com.github.openshift.api.console.v1.ConsoleSampleGitImportSourceRepository + default: {} + - name: service + type: + namedType: com.github.openshift.api.console.v1.ConsoleSampleGitImportSourceService + default: {} +- name: com.github.openshift.api.console.v1.ConsoleSampleGitImportSourceRepository + map: + fields: + - name: contextDir + type: + scalar: string + default: "" + - name: revision + type: + scalar: string + default: "" + - name: url + type: + scalar: string + default: "" +- name: com.github.openshift.api.console.v1.ConsoleSampleGitImportSourceService + map: + fields: + - name: targetPort + type: + scalar: numeric +- name: com.github.openshift.api.console.v1.ConsoleSampleSource + map: + fields: + - name: containerImport + type: + namedType: com.github.openshift.api.console.v1.ConsoleSampleContainerImportSource + - name: gitImport + type: + namedType: com.github.openshift.api.console.v1.ConsoleSampleGitImportSource + - name: type + type: + scalar: string + default: "" + unions: + - discriminator: type + fields: + - fieldName: containerImport + discriminatorValue: ContainerImport + - fieldName: gitImport + discriminatorValue: GitImport +- name: com.github.openshift.api.console.v1.ConsoleSampleSpec + map: + fields: + - name: abstract + type: + scalar: string + default: "" + - name: description + type: + scalar: string + default: "" + - name: icon + type: + scalar: string + default: "" + - name: provider + type: + scalar: string + default: "" + - name: source + type: + namedType: com.github.openshift.api.console.v1.ConsoleSampleSource + default: {} + - name: tags + type: + list: + elementType: + scalar: string + elementRelationship: associative + - name: title + type: + scalar: string + default: "" + - name: type + type: + scalar: string + default: "" +- name: com.github.openshift.api.console.v1.ConsoleYAMLSample + map: + fields: + - name: apiVersion + type: + scalar: string + - name: kind + type: + scalar: string + - name: metadata + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta + default: {} + - name: spec + type: + namedType: com.github.openshift.api.console.v1.ConsoleYAMLSampleSpec + default: {} +- name: com.github.openshift.api.console.v1.ConsoleYAMLSampleSpec + map: + fields: + - name: description + type: + scalar: string + default: "" + - name: snippet + type: + scalar: boolean + default: false + - name: targetResource + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.TypeMeta + default: {} + - name: title + type: + scalar: string + default: "" + - name: yaml + type: + scalar: string + default: "" +- name: com.github.openshift.api.console.v1.Link + map: + fields: + - name: href + type: + scalar: string + default: "" + - name: text + type: + scalar: string + default: "" +- name: com.github.openshift.api.console.v1.NamespaceDashboardSpec + map: + fields: + - name: namespaceSelector + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.LabelSelector + - name: namespaces + type: + list: + elementType: + scalar: string + elementRelationship: atomic +- name: io.k8s.api.authorization.v1.FieldSelectorAttributes + map: + fields: + - name: rawSelector + type: + scalar: string + - name: requirements + type: + list: + elementType: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.FieldSelectorRequirement + elementRelationship: atomic +- name: io.k8s.api.authorization.v1.LabelSelectorAttributes + map: + fields: + - name: rawSelector + type: + scalar: string + - name: requirements + type: + list: + elementType: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.LabelSelectorRequirement + elementRelationship: atomic +- name: io.k8s.api.authorization.v1.ResourceAttributes + map: + fields: + - name: fieldSelector + type: + namedType: io.k8s.api.authorization.v1.FieldSelectorAttributes + - name: group + type: + scalar: string + - name: labelSelector + type: + namedType: io.k8s.api.authorization.v1.LabelSelectorAttributes + - name: name + type: + scalar: string + - name: namespace + type: + scalar: string + - name: resource + type: + scalar: string + - name: subresource + type: + scalar: string + - name: verb + type: + scalar: string + - name: version + type: + scalar: string +- name: io.k8s.apimachinery.pkg.apis.meta.v1.FieldSelectorRequirement + map: + fields: + - name: key + type: + scalar: string + default: "" + - name: operator + type: + scalar: string + default: "" + - name: values + type: + list: + elementType: + scalar: string + elementRelationship: atomic +- name: io.k8s.apimachinery.pkg.apis.meta.v1.FieldsV1 + map: + elementType: + scalar: untyped + list: + elementType: + namedType: __untyped_atomic_ + elementRelationship: atomic + map: + elementType: + namedType: __untyped_deduced_ + elementRelationship: separable +- name: io.k8s.apimachinery.pkg.apis.meta.v1.LabelSelector + map: + fields: + - name: matchExpressions + type: + list: + elementType: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.LabelSelectorRequirement + elementRelationship: atomic + - name: matchLabels + type: + map: + elementType: + scalar: string + elementRelationship: atomic +- name: io.k8s.apimachinery.pkg.apis.meta.v1.LabelSelectorRequirement + map: + fields: + - name: key + type: + scalar: string + default: "" + - name: operator + type: + scalar: string + default: "" + - name: values + type: + list: + elementType: + scalar: string + elementRelationship: atomic +- name: io.k8s.apimachinery.pkg.apis.meta.v1.ManagedFieldsEntry + map: + fields: + - name: apiVersion + type: + scalar: string + - name: fieldsType + type: + scalar: string + - name: fieldsV1 + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.FieldsV1 + - name: manager + type: + scalar: string + - name: operation + type: + scalar: string + - name: subresource + type: + scalar: string + - name: time + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.Time +- name: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta + map: + fields: + - name: annotations + type: + map: + elementType: + scalar: string + - name: creationTimestamp + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.Time + - name: deletionGracePeriodSeconds + type: + scalar: numeric + - name: deletionTimestamp + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.Time + - name: finalizers + type: + list: + elementType: + scalar: string + elementRelationship: associative + - name: generateName + type: + scalar: string + - name: generation + type: + scalar: numeric + - name: labels + type: + map: + elementType: + scalar: string + - name: managedFields + type: + list: + elementType: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ManagedFieldsEntry + elementRelationship: atomic + - name: name + type: + scalar: string + - name: namespace + type: + scalar: string + - name: ownerReferences + type: + list: + elementType: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.OwnerReference + elementRelationship: associative + keys: + - uid + - name: resourceVersion + type: + scalar: string + - name: selfLink + type: + scalar: string + - name: uid + type: + scalar: string +- name: io.k8s.apimachinery.pkg.apis.meta.v1.OwnerReference + map: + fields: + - name: apiVersion + type: + scalar: string + default: "" + - name: blockOwnerDeletion + type: + scalar: boolean + - name: controller + type: + scalar: boolean + - name: kind + type: + scalar: string + default: "" + - name: name + type: + scalar: string + default: "" + - name: uid + type: + scalar: string + default: "" + elementRelationship: atomic +- name: io.k8s.apimachinery.pkg.apis.meta.v1.Time + scalar: untyped +- name: io.k8s.apimachinery.pkg.apis.meta.v1.TypeMeta + map: + fields: + - name: apiVersion + type: + scalar: string + - name: kind + type: + scalar: string +- name: __untyped_atomic_ + scalar: untyped + list: + elementType: + namedType: __untyped_atomic_ + elementRelationship: atomic + map: + elementType: + namedType: __untyped_atomic_ + elementRelationship: atomic +- name: __untyped_deduced_ + scalar: untyped + list: + elementType: + namedType: __untyped_atomic_ + elementRelationship: atomic + map: + elementType: + namedType: __untyped_deduced_ + elementRelationship: separable +`) diff --git a/vendor/github.com/openshift/client-go/console/applyconfigurations/utils.go b/vendor/github.com/openshift/client-go/console/applyconfigurations/utils.go new file mode 100644 index 000000000..595a26048 --- /dev/null +++ b/vendor/github.com/openshift/client-go/console/applyconfigurations/utils.go @@ -0,0 +1,98 @@ +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package applyconfigurations + +import ( + v1 "github.com/openshift/api/console/v1" + consolev1 "github.com/openshift/client-go/console/applyconfigurations/console/v1" + internal "github.com/openshift/client-go/console/applyconfigurations/internal" + runtime "k8s.io/apimachinery/pkg/runtime" + schema "k8s.io/apimachinery/pkg/runtime/schema" + managedfields "k8s.io/apimachinery/pkg/util/managedfields" +) + +// ForKind returns an apply configuration type for the given GroupVersionKind, or nil if no +// apply configuration type exists for the given GroupVersionKind. +func ForKind(kind schema.GroupVersionKind) interface{} { + switch kind { + // Group=console.openshift.io, Version=v1 + case v1.SchemeGroupVersion.WithKind("ApplicationMenuSpec"): + return &consolev1.ApplicationMenuSpecApplyConfiguration{} + case v1.SchemeGroupVersion.WithKind("CLIDownloadLink"): + return &consolev1.CLIDownloadLinkApplyConfiguration{} + case v1.SchemeGroupVersion.WithKind("ConsoleCLIDownload"): + return &consolev1.ConsoleCLIDownloadApplyConfiguration{} + case v1.SchemeGroupVersion.WithKind("ConsoleCLIDownloadSpec"): + return &consolev1.ConsoleCLIDownloadSpecApplyConfiguration{} + case v1.SchemeGroupVersion.WithKind("ConsoleExternalLogLink"): + return &consolev1.ConsoleExternalLogLinkApplyConfiguration{} + case v1.SchemeGroupVersion.WithKind("ConsoleExternalLogLinkSpec"): + return &consolev1.ConsoleExternalLogLinkSpecApplyConfiguration{} + case v1.SchemeGroupVersion.WithKind("ConsoleLink"): + return &consolev1.ConsoleLinkApplyConfiguration{} + case v1.SchemeGroupVersion.WithKind("ConsoleLinkSpec"): + return &consolev1.ConsoleLinkSpecApplyConfiguration{} + case v1.SchemeGroupVersion.WithKind("ConsoleNotification"): + return &consolev1.ConsoleNotificationApplyConfiguration{} + case v1.SchemeGroupVersion.WithKind("ConsoleNotificationSpec"): + return &consolev1.ConsoleNotificationSpecApplyConfiguration{} + case v1.SchemeGroupVersion.WithKind("ConsolePlugin"): + return &consolev1.ConsolePluginApplyConfiguration{} + case v1.SchemeGroupVersion.WithKind("ConsolePluginBackend"): + return &consolev1.ConsolePluginBackendApplyConfiguration{} + case v1.SchemeGroupVersion.WithKind("ConsolePluginCSP"): + return &consolev1.ConsolePluginCSPApplyConfiguration{} + case v1.SchemeGroupVersion.WithKind("ConsolePluginI18n"): + return &consolev1.ConsolePluginI18nApplyConfiguration{} + case v1.SchemeGroupVersion.WithKind("ConsolePluginProxy"): + return &consolev1.ConsolePluginProxyApplyConfiguration{} + case v1.SchemeGroupVersion.WithKind("ConsolePluginProxyEndpoint"): + return &consolev1.ConsolePluginProxyEndpointApplyConfiguration{} + case v1.SchemeGroupVersion.WithKind("ConsolePluginProxyServiceConfig"): + return &consolev1.ConsolePluginProxyServiceConfigApplyConfiguration{} + case v1.SchemeGroupVersion.WithKind("ConsolePluginService"): + return &consolev1.ConsolePluginServiceApplyConfiguration{} + case v1.SchemeGroupVersion.WithKind("ConsolePluginSpec"): + return &consolev1.ConsolePluginSpecApplyConfiguration{} + case v1.SchemeGroupVersion.WithKind("ConsoleQuickStart"): + return &consolev1.ConsoleQuickStartApplyConfiguration{} + case v1.SchemeGroupVersion.WithKind("ConsoleQuickStartSpec"): + return &consolev1.ConsoleQuickStartSpecApplyConfiguration{} + case v1.SchemeGroupVersion.WithKind("ConsoleQuickStartTask"): + return &consolev1.ConsoleQuickStartTaskApplyConfiguration{} + case v1.SchemeGroupVersion.WithKind("ConsoleQuickStartTaskReview"): + return &consolev1.ConsoleQuickStartTaskReviewApplyConfiguration{} + case v1.SchemeGroupVersion.WithKind("ConsoleQuickStartTaskSummary"): + return &consolev1.ConsoleQuickStartTaskSummaryApplyConfiguration{} + case v1.SchemeGroupVersion.WithKind("ConsoleSample"): + return &consolev1.ConsoleSampleApplyConfiguration{} + case v1.SchemeGroupVersion.WithKind("ConsoleSampleContainerImportSource"): + return &consolev1.ConsoleSampleContainerImportSourceApplyConfiguration{} + case v1.SchemeGroupVersion.WithKind("ConsoleSampleContainerImportSourceService"): + return &consolev1.ConsoleSampleContainerImportSourceServiceApplyConfiguration{} + case v1.SchemeGroupVersion.WithKind("ConsoleSampleGitImportSource"): + return &consolev1.ConsoleSampleGitImportSourceApplyConfiguration{} + case v1.SchemeGroupVersion.WithKind("ConsoleSampleGitImportSourceRepository"): + return &consolev1.ConsoleSampleGitImportSourceRepositoryApplyConfiguration{} + case v1.SchemeGroupVersion.WithKind("ConsoleSampleGitImportSourceService"): + return &consolev1.ConsoleSampleGitImportSourceServiceApplyConfiguration{} + case v1.SchemeGroupVersion.WithKind("ConsoleSampleSource"): + return &consolev1.ConsoleSampleSourceApplyConfiguration{} + case v1.SchemeGroupVersion.WithKind("ConsoleSampleSpec"): + return &consolev1.ConsoleSampleSpecApplyConfiguration{} + case v1.SchemeGroupVersion.WithKind("ConsoleYAMLSample"): + return &consolev1.ConsoleYAMLSampleApplyConfiguration{} + case v1.SchemeGroupVersion.WithKind("ConsoleYAMLSampleSpec"): + return &consolev1.ConsoleYAMLSampleSpecApplyConfiguration{} + case v1.SchemeGroupVersion.WithKind("Link"): + return &consolev1.LinkApplyConfiguration{} + case v1.SchemeGroupVersion.WithKind("NamespaceDashboardSpec"): + return &consolev1.NamespaceDashboardSpecApplyConfiguration{} + + } + return nil +} + +func NewTypeConverter(scheme *runtime.Scheme) managedfields.TypeConverter { + return managedfields.NewSchemeTypeConverter(scheme, internal.Parser()) +} diff --git a/vendor/github.com/openshift/client-go/console/clientset/versioned/clientset.go b/vendor/github.com/openshift/client-go/console/clientset/versioned/clientset.go new file mode 100644 index 000000000..a03b79be0 --- /dev/null +++ b/vendor/github.com/openshift/client-go/console/clientset/versioned/clientset.go @@ -0,0 +1,104 @@ +// Code generated by client-gen. DO NOT EDIT. + +package versioned + +import ( + fmt "fmt" + http "net/http" + + consolev1 "github.com/openshift/client-go/console/clientset/versioned/typed/console/v1" + discovery "k8s.io/client-go/discovery" + rest "k8s.io/client-go/rest" + flowcontrol "k8s.io/client-go/util/flowcontrol" +) + +type Interface interface { + Discovery() discovery.DiscoveryInterface + ConsoleV1() consolev1.ConsoleV1Interface +} + +// Clientset contains the clients for groups. +type Clientset struct { + *discovery.DiscoveryClient + consoleV1 *consolev1.ConsoleV1Client +} + +// ConsoleV1 retrieves the ConsoleV1Client +func (c *Clientset) ConsoleV1() consolev1.ConsoleV1Interface { + return c.consoleV1 +} + +// Discovery retrieves the DiscoveryClient +func (c *Clientset) Discovery() discovery.DiscoveryInterface { + if c == nil { + return nil + } + return c.DiscoveryClient +} + +// NewForConfig creates a new Clientset for the given config. +// If config's RateLimiter is not set and QPS and Burst are acceptable, +// NewForConfig will generate a rate-limiter in configShallowCopy. +// NewForConfig is equivalent to NewForConfigAndClient(c, httpClient), +// where httpClient was generated with rest.HTTPClientFor(c). +func NewForConfig(c *rest.Config) (*Clientset, error) { + configShallowCopy := *c + + if configShallowCopy.UserAgent == "" { + configShallowCopy.UserAgent = rest.DefaultKubernetesUserAgent() + } + + // share the transport between all clients + httpClient, err := rest.HTTPClientFor(&configShallowCopy) + if err != nil { + return nil, err + } + + return NewForConfigAndClient(&configShallowCopy, httpClient) +} + +// NewForConfigAndClient creates a new Clientset for the given config and http client. +// Note the http client provided takes precedence over the configured transport values. +// If config's RateLimiter is not set and QPS and Burst are acceptable, +// NewForConfigAndClient will generate a rate-limiter in configShallowCopy. +func NewForConfigAndClient(c *rest.Config, httpClient *http.Client) (*Clientset, error) { + configShallowCopy := *c + if configShallowCopy.RateLimiter == nil && configShallowCopy.QPS > 0 { + if configShallowCopy.Burst <= 0 { + return nil, fmt.Errorf("burst is required to be greater than 0 when RateLimiter is not set and QPS is set to greater than 0") + } + configShallowCopy.RateLimiter = flowcontrol.NewTokenBucketRateLimiter(configShallowCopy.QPS, configShallowCopy.Burst) + } + + var cs Clientset + var err error + cs.consoleV1, err = consolev1.NewForConfigAndClient(&configShallowCopy, httpClient) + if err != nil { + return nil, err + } + + cs.DiscoveryClient, err = discovery.NewDiscoveryClientForConfigAndClient(&configShallowCopy, httpClient) + if err != nil { + return nil, err + } + return &cs, nil +} + +// NewForConfigOrDie creates a new Clientset for the given config and +// panics if there is an error in the config. +func NewForConfigOrDie(c *rest.Config) *Clientset { + cs, err := NewForConfig(c) + if err != nil { + panic(err) + } + return cs +} + +// New creates a new Clientset for the given RESTClient. +func New(c rest.Interface) *Clientset { + var cs Clientset + cs.consoleV1 = consolev1.New(c) + + cs.DiscoveryClient = discovery.NewDiscoveryClient(c) + return &cs +} diff --git a/vendor/github.com/openshift/client-go/console/clientset/versioned/fake/clientset_generated.go b/vendor/github.com/openshift/client-go/console/clientset/versioned/fake/clientset_generated.go new file mode 100644 index 000000000..3d358d699 --- /dev/null +++ b/vendor/github.com/openshift/client-go/console/clientset/versioned/fake/clientset_generated.go @@ -0,0 +1,115 @@ +// Code generated by client-gen. DO NOT EDIT. + +package fake + +import ( + applyconfigurations "github.com/openshift/client-go/console/applyconfigurations" + clientset "github.com/openshift/client-go/console/clientset/versioned" + consolev1 "github.com/openshift/client-go/console/clientset/versioned/typed/console/v1" + fakeconsolev1 "github.com/openshift/client-go/console/clientset/versioned/typed/console/v1/fake" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/runtime" + "k8s.io/apimachinery/pkg/watch" + "k8s.io/client-go/discovery" + fakediscovery "k8s.io/client-go/discovery/fake" + "k8s.io/client-go/testing" +) + +// NewSimpleClientset returns a clientset that will respond with the provided objects. +// It's backed by a very simple object tracker that processes creates, updates and deletions as-is, +// without applying any field management, validations and/or defaults. It shouldn't be considered a replacement +// for a real clientset and is mostly useful in simple unit tests. +// +// DEPRECATED: NewClientset replaces this with support for field management, which significantly improves +// server side apply testing. NewClientset is only available when apply configurations are generated (e.g. +// via --with-applyconfig). +func NewSimpleClientset(objects ...runtime.Object) *Clientset { + o := testing.NewObjectTracker(scheme, codecs.UniversalDecoder()) + for _, obj := range objects { + if err := o.Add(obj); err != nil { + panic(err) + } + } + + cs := &Clientset{tracker: o} + cs.discovery = &fakediscovery.FakeDiscovery{Fake: &cs.Fake} + cs.AddReactor("*", "*", testing.ObjectReaction(o)) + cs.AddWatchReactor("*", func(action testing.Action) (handled bool, ret watch.Interface, err error) { + var opts metav1.ListOptions + if watchActcion, ok := action.(testing.WatchActionImpl); ok { + opts = watchActcion.ListOptions + } + gvr := action.GetResource() + ns := action.GetNamespace() + watch, err := o.Watch(gvr, ns, opts) + if err != nil { + return false, nil, err + } + return true, watch, nil + }) + + return cs +} + +// Clientset implements clientset.Interface. Meant to be embedded into a +// struct to get a default implementation. This makes faking out just the method +// you want to test easier. +type Clientset struct { + testing.Fake + discovery *fakediscovery.FakeDiscovery + tracker testing.ObjectTracker +} + +func (c *Clientset) Discovery() discovery.DiscoveryInterface { + return c.discovery +} + +func (c *Clientset) Tracker() testing.ObjectTracker { + return c.tracker +} + +// NewClientset returns a clientset that will respond with the provided objects. +// It's backed by a very simple object tracker that processes creates, updates and deletions as-is, +// without applying any validations and/or defaults. It shouldn't be considered a replacement +// for a real clientset and is mostly useful in simple unit tests. +func NewClientset(objects ...runtime.Object) *Clientset { + o := testing.NewFieldManagedObjectTracker( + scheme, + codecs.UniversalDecoder(), + applyconfigurations.NewTypeConverter(scheme), + ) + for _, obj := range objects { + if err := o.Add(obj); err != nil { + panic(err) + } + } + + cs := &Clientset{tracker: o} + cs.discovery = &fakediscovery.FakeDiscovery{Fake: &cs.Fake} + cs.AddReactor("*", "*", testing.ObjectReaction(o)) + cs.AddWatchReactor("*", func(action testing.Action) (handled bool, ret watch.Interface, err error) { + var opts metav1.ListOptions + if watchAction, ok := action.(testing.WatchActionImpl); ok { + opts = watchAction.ListOptions + } + gvr := action.GetResource() + ns := action.GetNamespace() + watch, err := o.Watch(gvr, ns, opts) + if err != nil { + return false, nil, err + } + return true, watch, nil + }) + + return cs +} + +var ( + _ clientset.Interface = &Clientset{} + _ testing.FakeClient = &Clientset{} +) + +// ConsoleV1 retrieves the ConsoleV1Client +func (c *Clientset) ConsoleV1() consolev1.ConsoleV1Interface { + return &fakeconsolev1.FakeConsoleV1{Fake: &c.Fake} +} diff --git a/vendor/github.com/openshift/client-go/console/clientset/versioned/fake/doc.go b/vendor/github.com/openshift/client-go/console/clientset/versioned/fake/doc.go new file mode 100644 index 000000000..3630ed1cd --- /dev/null +++ b/vendor/github.com/openshift/client-go/console/clientset/versioned/fake/doc.go @@ -0,0 +1,4 @@ +// Code generated by client-gen. DO NOT EDIT. + +// This package has the automatically generated fake clientset. +package fake diff --git a/vendor/github.com/openshift/client-go/console/clientset/versioned/fake/register.go b/vendor/github.com/openshift/client-go/console/clientset/versioned/fake/register.go new file mode 100644 index 000000000..f9d5314b0 --- /dev/null +++ b/vendor/github.com/openshift/client-go/console/clientset/versioned/fake/register.go @@ -0,0 +1,40 @@ +// Code generated by client-gen. DO NOT EDIT. + +package fake + +import ( + consolev1 "github.com/openshift/api/console/v1" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + schema "k8s.io/apimachinery/pkg/runtime/schema" + serializer "k8s.io/apimachinery/pkg/runtime/serializer" + utilruntime "k8s.io/apimachinery/pkg/util/runtime" +) + +var scheme = runtime.NewScheme() +var codecs = serializer.NewCodecFactory(scheme) + +var localSchemeBuilder = runtime.SchemeBuilder{ + consolev1.AddToScheme, +} + +// AddToScheme adds all types of this clientset into the given scheme. This allows composition +// of clientsets, like in: +// +// import ( +// "k8s.io/client-go/kubernetes" +// clientsetscheme "k8s.io/client-go/kubernetes/scheme" +// aggregatorclientsetscheme "k8s.io/kube-aggregator/pkg/client/clientset_generated/clientset/scheme" +// ) +// +// kclientset, _ := kubernetes.NewForConfig(c) +// _ = aggregatorclientsetscheme.AddToScheme(clientsetscheme.Scheme) +// +// After this, RawExtensions in Kubernetes types will serialize kube-aggregator types +// correctly. +var AddToScheme = localSchemeBuilder.AddToScheme + +func init() { + v1.AddToGroupVersion(scheme, schema.GroupVersion{Version: "v1"}) + utilruntime.Must(AddToScheme(scheme)) +} diff --git a/vendor/github.com/openshift/client-go/console/clientset/versioned/scheme/doc.go b/vendor/github.com/openshift/client-go/console/clientset/versioned/scheme/doc.go new file mode 100644 index 000000000..14db57a58 --- /dev/null +++ b/vendor/github.com/openshift/client-go/console/clientset/versioned/scheme/doc.go @@ -0,0 +1,4 @@ +// Code generated by client-gen. DO NOT EDIT. + +// This package contains the scheme of the automatically generated clientset. +package scheme diff --git a/vendor/github.com/openshift/client-go/console/clientset/versioned/scheme/register.go b/vendor/github.com/openshift/client-go/console/clientset/versioned/scheme/register.go new file mode 100644 index 000000000..05b26832c --- /dev/null +++ b/vendor/github.com/openshift/client-go/console/clientset/versioned/scheme/register.go @@ -0,0 +1,40 @@ +// Code generated by client-gen. DO NOT EDIT. + +package scheme + +import ( + consolev1 "github.com/openshift/api/console/v1" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + schema "k8s.io/apimachinery/pkg/runtime/schema" + serializer "k8s.io/apimachinery/pkg/runtime/serializer" + utilruntime "k8s.io/apimachinery/pkg/util/runtime" +) + +var Scheme = runtime.NewScheme() +var Codecs = serializer.NewCodecFactory(Scheme) +var ParameterCodec = runtime.NewParameterCodec(Scheme) +var localSchemeBuilder = runtime.SchemeBuilder{ + consolev1.AddToScheme, +} + +// AddToScheme adds all types of this clientset into the given scheme. This allows composition +// of clientsets, like in: +// +// import ( +// "k8s.io/client-go/kubernetes" +// clientsetscheme "k8s.io/client-go/kubernetes/scheme" +// aggregatorclientsetscheme "k8s.io/kube-aggregator/pkg/client/clientset_generated/clientset/scheme" +// ) +// +// kclientset, _ := kubernetes.NewForConfig(c) +// _ = aggregatorclientsetscheme.AddToScheme(clientsetscheme.Scheme) +// +// After this, RawExtensions in Kubernetes types will serialize kube-aggregator types +// correctly. +var AddToScheme = localSchemeBuilder.AddToScheme + +func init() { + v1.AddToGroupVersion(Scheme, schema.GroupVersion{Version: "v1"}) + utilruntime.Must(AddToScheme(Scheme)) +} diff --git a/vendor/github.com/openshift/client-go/console/clientset/versioned/typed/console/v1/console_client.go b/vendor/github.com/openshift/client-go/console/clientset/versioned/typed/console/v1/console_client.go new file mode 100644 index 000000000..b54aa3924 --- /dev/null +++ b/vendor/github.com/openshift/client-go/console/clientset/versioned/typed/console/v1/console_client.go @@ -0,0 +1,120 @@ +// Code generated by client-gen. DO NOT EDIT. + +package v1 + +import ( + http "net/http" + + consolev1 "github.com/openshift/api/console/v1" + scheme "github.com/openshift/client-go/console/clientset/versioned/scheme" + rest "k8s.io/client-go/rest" +) + +type ConsoleV1Interface interface { + RESTClient() rest.Interface + ConsoleCLIDownloadsGetter + ConsoleExternalLogLinksGetter + ConsoleLinksGetter + ConsoleNotificationsGetter + ConsolePluginsGetter + ConsoleQuickStartsGetter + ConsoleSamplesGetter + ConsoleYAMLSamplesGetter +} + +// ConsoleV1Client is used to interact with features provided by the console.openshift.io group. +type ConsoleV1Client struct { + restClient rest.Interface +} + +func (c *ConsoleV1Client) ConsoleCLIDownloads() ConsoleCLIDownloadInterface { + return newConsoleCLIDownloads(c) +} + +func (c *ConsoleV1Client) ConsoleExternalLogLinks() ConsoleExternalLogLinkInterface { + return newConsoleExternalLogLinks(c) +} + +func (c *ConsoleV1Client) ConsoleLinks() ConsoleLinkInterface { + return newConsoleLinks(c) +} + +func (c *ConsoleV1Client) ConsoleNotifications() ConsoleNotificationInterface { + return newConsoleNotifications(c) +} + +func (c *ConsoleV1Client) ConsolePlugins() ConsolePluginInterface { + return newConsolePlugins(c) +} + +func (c *ConsoleV1Client) ConsoleQuickStarts() ConsoleQuickStartInterface { + return newConsoleQuickStarts(c) +} + +func (c *ConsoleV1Client) ConsoleSamples() ConsoleSampleInterface { + return newConsoleSamples(c) +} + +func (c *ConsoleV1Client) ConsoleYAMLSamples() ConsoleYAMLSampleInterface { + return newConsoleYAMLSamples(c) +} + +// NewForConfig creates a new ConsoleV1Client for the given config. +// NewForConfig is equivalent to NewForConfigAndClient(c, httpClient), +// where httpClient was generated with rest.HTTPClientFor(c). +func NewForConfig(c *rest.Config) (*ConsoleV1Client, error) { + config := *c + setConfigDefaults(&config) + httpClient, err := rest.HTTPClientFor(&config) + if err != nil { + return nil, err + } + return NewForConfigAndClient(&config, httpClient) +} + +// NewForConfigAndClient creates a new ConsoleV1Client for the given config and http client. +// Note the http client provided takes precedence over the configured transport values. +func NewForConfigAndClient(c *rest.Config, h *http.Client) (*ConsoleV1Client, error) { + config := *c + setConfigDefaults(&config) + client, err := rest.RESTClientForConfigAndClient(&config, h) + if err != nil { + return nil, err + } + return &ConsoleV1Client{client}, nil +} + +// NewForConfigOrDie creates a new ConsoleV1Client for the given config and +// panics if there is an error in the config. +func NewForConfigOrDie(c *rest.Config) *ConsoleV1Client { + client, err := NewForConfig(c) + if err != nil { + panic(err) + } + return client +} + +// New creates a new ConsoleV1Client for the given RESTClient. +func New(c rest.Interface) *ConsoleV1Client { + return &ConsoleV1Client{c} +} + +func setConfigDefaults(config *rest.Config) { + gv := consolev1.SchemeGroupVersion + config.GroupVersion = &gv + config.APIPath = "/apis" + config.NegotiatedSerializer = rest.CodecFactoryForGeneratedClient(scheme.Scheme, scheme.Codecs).WithoutConversion() + + if config.UserAgent == "" { + config.UserAgent = rest.DefaultKubernetesUserAgent() + } +} + +// RESTClient returns a RESTClient that is used to communicate +// with API server by this client implementation. +func (c *ConsoleV1Client) RESTClient() rest.Interface { + if c == nil { + return nil + } + return c.restClient +} diff --git a/vendor/github.com/openshift/client-go/console/clientset/versioned/typed/console/v1/consoleclidownload.go b/vendor/github.com/openshift/client-go/console/clientset/versioned/typed/console/v1/consoleclidownload.go new file mode 100644 index 000000000..0081fd62a --- /dev/null +++ b/vendor/github.com/openshift/client-go/console/clientset/versioned/typed/console/v1/consoleclidownload.go @@ -0,0 +1,54 @@ +// Code generated by client-gen. DO NOT EDIT. + +package v1 + +import ( + context "context" + + consolev1 "github.com/openshift/api/console/v1" + applyconfigurationsconsolev1 "github.com/openshift/client-go/console/applyconfigurations/console/v1" + scheme "github.com/openshift/client-go/console/clientset/versioned/scheme" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + gentype "k8s.io/client-go/gentype" +) + +// ConsoleCLIDownloadsGetter has a method to return a ConsoleCLIDownloadInterface. +// A group's client should implement this interface. +type ConsoleCLIDownloadsGetter interface { + ConsoleCLIDownloads() ConsoleCLIDownloadInterface +} + +// ConsoleCLIDownloadInterface has methods to work with ConsoleCLIDownload resources. +type ConsoleCLIDownloadInterface interface { + Create(ctx context.Context, consoleCLIDownload *consolev1.ConsoleCLIDownload, opts metav1.CreateOptions) (*consolev1.ConsoleCLIDownload, error) + Update(ctx context.Context, consoleCLIDownload *consolev1.ConsoleCLIDownload, opts metav1.UpdateOptions) (*consolev1.ConsoleCLIDownload, error) + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error + Get(ctx context.Context, name string, opts metav1.GetOptions) (*consolev1.ConsoleCLIDownload, error) + List(ctx context.Context, opts metav1.ListOptions) (*consolev1.ConsoleCLIDownloadList, error) + Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *consolev1.ConsoleCLIDownload, err error) + Apply(ctx context.Context, consoleCLIDownload *applyconfigurationsconsolev1.ConsoleCLIDownloadApplyConfiguration, opts metav1.ApplyOptions) (result *consolev1.ConsoleCLIDownload, err error) + ConsoleCLIDownloadExpansion +} + +// consoleCLIDownloads implements ConsoleCLIDownloadInterface +type consoleCLIDownloads struct { + *gentype.ClientWithListAndApply[*consolev1.ConsoleCLIDownload, *consolev1.ConsoleCLIDownloadList, *applyconfigurationsconsolev1.ConsoleCLIDownloadApplyConfiguration] +} + +// newConsoleCLIDownloads returns a ConsoleCLIDownloads +func newConsoleCLIDownloads(c *ConsoleV1Client) *consoleCLIDownloads { + return &consoleCLIDownloads{ + gentype.NewClientWithListAndApply[*consolev1.ConsoleCLIDownload, *consolev1.ConsoleCLIDownloadList, *applyconfigurationsconsolev1.ConsoleCLIDownloadApplyConfiguration]( + "consoleclidownloads", + c.RESTClient(), + scheme.ParameterCodec, + "", + func() *consolev1.ConsoleCLIDownload { return &consolev1.ConsoleCLIDownload{} }, + func() *consolev1.ConsoleCLIDownloadList { return &consolev1.ConsoleCLIDownloadList{} }, + ), + } +} diff --git a/vendor/github.com/openshift/client-go/console/clientset/versioned/typed/console/v1/consoleexternalloglink.go b/vendor/github.com/openshift/client-go/console/clientset/versioned/typed/console/v1/consoleexternalloglink.go new file mode 100644 index 000000000..08e467dd9 --- /dev/null +++ b/vendor/github.com/openshift/client-go/console/clientset/versioned/typed/console/v1/consoleexternalloglink.go @@ -0,0 +1,54 @@ +// Code generated by client-gen. DO NOT EDIT. + +package v1 + +import ( + context "context" + + consolev1 "github.com/openshift/api/console/v1" + applyconfigurationsconsolev1 "github.com/openshift/client-go/console/applyconfigurations/console/v1" + scheme "github.com/openshift/client-go/console/clientset/versioned/scheme" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + gentype "k8s.io/client-go/gentype" +) + +// ConsoleExternalLogLinksGetter has a method to return a ConsoleExternalLogLinkInterface. +// A group's client should implement this interface. +type ConsoleExternalLogLinksGetter interface { + ConsoleExternalLogLinks() ConsoleExternalLogLinkInterface +} + +// ConsoleExternalLogLinkInterface has methods to work with ConsoleExternalLogLink resources. +type ConsoleExternalLogLinkInterface interface { + Create(ctx context.Context, consoleExternalLogLink *consolev1.ConsoleExternalLogLink, opts metav1.CreateOptions) (*consolev1.ConsoleExternalLogLink, error) + Update(ctx context.Context, consoleExternalLogLink *consolev1.ConsoleExternalLogLink, opts metav1.UpdateOptions) (*consolev1.ConsoleExternalLogLink, error) + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error + Get(ctx context.Context, name string, opts metav1.GetOptions) (*consolev1.ConsoleExternalLogLink, error) + List(ctx context.Context, opts metav1.ListOptions) (*consolev1.ConsoleExternalLogLinkList, error) + Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *consolev1.ConsoleExternalLogLink, err error) + Apply(ctx context.Context, consoleExternalLogLink *applyconfigurationsconsolev1.ConsoleExternalLogLinkApplyConfiguration, opts metav1.ApplyOptions) (result *consolev1.ConsoleExternalLogLink, err error) + ConsoleExternalLogLinkExpansion +} + +// consoleExternalLogLinks implements ConsoleExternalLogLinkInterface +type consoleExternalLogLinks struct { + *gentype.ClientWithListAndApply[*consolev1.ConsoleExternalLogLink, *consolev1.ConsoleExternalLogLinkList, *applyconfigurationsconsolev1.ConsoleExternalLogLinkApplyConfiguration] +} + +// newConsoleExternalLogLinks returns a ConsoleExternalLogLinks +func newConsoleExternalLogLinks(c *ConsoleV1Client) *consoleExternalLogLinks { + return &consoleExternalLogLinks{ + gentype.NewClientWithListAndApply[*consolev1.ConsoleExternalLogLink, *consolev1.ConsoleExternalLogLinkList, *applyconfigurationsconsolev1.ConsoleExternalLogLinkApplyConfiguration]( + "consoleexternalloglinks", + c.RESTClient(), + scheme.ParameterCodec, + "", + func() *consolev1.ConsoleExternalLogLink { return &consolev1.ConsoleExternalLogLink{} }, + func() *consolev1.ConsoleExternalLogLinkList { return &consolev1.ConsoleExternalLogLinkList{} }, + ), + } +} diff --git a/vendor/github.com/openshift/client-go/console/clientset/versioned/typed/console/v1/consolelink.go b/vendor/github.com/openshift/client-go/console/clientset/versioned/typed/console/v1/consolelink.go new file mode 100644 index 000000000..6acc51995 --- /dev/null +++ b/vendor/github.com/openshift/client-go/console/clientset/versioned/typed/console/v1/consolelink.go @@ -0,0 +1,54 @@ +// Code generated by client-gen. DO NOT EDIT. + +package v1 + +import ( + context "context" + + consolev1 "github.com/openshift/api/console/v1" + applyconfigurationsconsolev1 "github.com/openshift/client-go/console/applyconfigurations/console/v1" + scheme "github.com/openshift/client-go/console/clientset/versioned/scheme" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + gentype "k8s.io/client-go/gentype" +) + +// ConsoleLinksGetter has a method to return a ConsoleLinkInterface. +// A group's client should implement this interface. +type ConsoleLinksGetter interface { + ConsoleLinks() ConsoleLinkInterface +} + +// ConsoleLinkInterface has methods to work with ConsoleLink resources. +type ConsoleLinkInterface interface { + Create(ctx context.Context, consoleLink *consolev1.ConsoleLink, opts metav1.CreateOptions) (*consolev1.ConsoleLink, error) + Update(ctx context.Context, consoleLink *consolev1.ConsoleLink, opts metav1.UpdateOptions) (*consolev1.ConsoleLink, error) + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error + Get(ctx context.Context, name string, opts metav1.GetOptions) (*consolev1.ConsoleLink, error) + List(ctx context.Context, opts metav1.ListOptions) (*consolev1.ConsoleLinkList, error) + Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *consolev1.ConsoleLink, err error) + Apply(ctx context.Context, consoleLink *applyconfigurationsconsolev1.ConsoleLinkApplyConfiguration, opts metav1.ApplyOptions) (result *consolev1.ConsoleLink, err error) + ConsoleLinkExpansion +} + +// consoleLinks implements ConsoleLinkInterface +type consoleLinks struct { + *gentype.ClientWithListAndApply[*consolev1.ConsoleLink, *consolev1.ConsoleLinkList, *applyconfigurationsconsolev1.ConsoleLinkApplyConfiguration] +} + +// newConsoleLinks returns a ConsoleLinks +func newConsoleLinks(c *ConsoleV1Client) *consoleLinks { + return &consoleLinks{ + gentype.NewClientWithListAndApply[*consolev1.ConsoleLink, *consolev1.ConsoleLinkList, *applyconfigurationsconsolev1.ConsoleLinkApplyConfiguration]( + "consolelinks", + c.RESTClient(), + scheme.ParameterCodec, + "", + func() *consolev1.ConsoleLink { return &consolev1.ConsoleLink{} }, + func() *consolev1.ConsoleLinkList { return &consolev1.ConsoleLinkList{} }, + ), + } +} diff --git a/vendor/github.com/openshift/client-go/console/clientset/versioned/typed/console/v1/consolenotification.go b/vendor/github.com/openshift/client-go/console/clientset/versioned/typed/console/v1/consolenotification.go new file mode 100644 index 000000000..bf46fa43d --- /dev/null +++ b/vendor/github.com/openshift/client-go/console/clientset/versioned/typed/console/v1/consolenotification.go @@ -0,0 +1,54 @@ +// Code generated by client-gen. DO NOT EDIT. + +package v1 + +import ( + context "context" + + consolev1 "github.com/openshift/api/console/v1" + applyconfigurationsconsolev1 "github.com/openshift/client-go/console/applyconfigurations/console/v1" + scheme "github.com/openshift/client-go/console/clientset/versioned/scheme" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + gentype "k8s.io/client-go/gentype" +) + +// ConsoleNotificationsGetter has a method to return a ConsoleNotificationInterface. +// A group's client should implement this interface. +type ConsoleNotificationsGetter interface { + ConsoleNotifications() ConsoleNotificationInterface +} + +// ConsoleNotificationInterface has methods to work with ConsoleNotification resources. +type ConsoleNotificationInterface interface { + Create(ctx context.Context, consoleNotification *consolev1.ConsoleNotification, opts metav1.CreateOptions) (*consolev1.ConsoleNotification, error) + Update(ctx context.Context, consoleNotification *consolev1.ConsoleNotification, opts metav1.UpdateOptions) (*consolev1.ConsoleNotification, error) + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error + Get(ctx context.Context, name string, opts metav1.GetOptions) (*consolev1.ConsoleNotification, error) + List(ctx context.Context, opts metav1.ListOptions) (*consolev1.ConsoleNotificationList, error) + Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *consolev1.ConsoleNotification, err error) + Apply(ctx context.Context, consoleNotification *applyconfigurationsconsolev1.ConsoleNotificationApplyConfiguration, opts metav1.ApplyOptions) (result *consolev1.ConsoleNotification, err error) + ConsoleNotificationExpansion +} + +// consoleNotifications implements ConsoleNotificationInterface +type consoleNotifications struct { + *gentype.ClientWithListAndApply[*consolev1.ConsoleNotification, *consolev1.ConsoleNotificationList, *applyconfigurationsconsolev1.ConsoleNotificationApplyConfiguration] +} + +// newConsoleNotifications returns a ConsoleNotifications +func newConsoleNotifications(c *ConsoleV1Client) *consoleNotifications { + return &consoleNotifications{ + gentype.NewClientWithListAndApply[*consolev1.ConsoleNotification, *consolev1.ConsoleNotificationList, *applyconfigurationsconsolev1.ConsoleNotificationApplyConfiguration]( + "consolenotifications", + c.RESTClient(), + scheme.ParameterCodec, + "", + func() *consolev1.ConsoleNotification { return &consolev1.ConsoleNotification{} }, + func() *consolev1.ConsoleNotificationList { return &consolev1.ConsoleNotificationList{} }, + ), + } +} diff --git a/vendor/github.com/openshift/client-go/console/clientset/versioned/typed/console/v1/consoleplugin.go b/vendor/github.com/openshift/client-go/console/clientset/versioned/typed/console/v1/consoleplugin.go new file mode 100644 index 000000000..d592717e9 --- /dev/null +++ b/vendor/github.com/openshift/client-go/console/clientset/versioned/typed/console/v1/consoleplugin.go @@ -0,0 +1,54 @@ +// Code generated by client-gen. DO NOT EDIT. + +package v1 + +import ( + context "context" + + consolev1 "github.com/openshift/api/console/v1" + applyconfigurationsconsolev1 "github.com/openshift/client-go/console/applyconfigurations/console/v1" + scheme "github.com/openshift/client-go/console/clientset/versioned/scheme" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + gentype "k8s.io/client-go/gentype" +) + +// ConsolePluginsGetter has a method to return a ConsolePluginInterface. +// A group's client should implement this interface. +type ConsolePluginsGetter interface { + ConsolePlugins() ConsolePluginInterface +} + +// ConsolePluginInterface has methods to work with ConsolePlugin resources. +type ConsolePluginInterface interface { + Create(ctx context.Context, consolePlugin *consolev1.ConsolePlugin, opts metav1.CreateOptions) (*consolev1.ConsolePlugin, error) + Update(ctx context.Context, consolePlugin *consolev1.ConsolePlugin, opts metav1.UpdateOptions) (*consolev1.ConsolePlugin, error) + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error + Get(ctx context.Context, name string, opts metav1.GetOptions) (*consolev1.ConsolePlugin, error) + List(ctx context.Context, opts metav1.ListOptions) (*consolev1.ConsolePluginList, error) + Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *consolev1.ConsolePlugin, err error) + Apply(ctx context.Context, consolePlugin *applyconfigurationsconsolev1.ConsolePluginApplyConfiguration, opts metav1.ApplyOptions) (result *consolev1.ConsolePlugin, err error) + ConsolePluginExpansion +} + +// consolePlugins implements ConsolePluginInterface +type consolePlugins struct { + *gentype.ClientWithListAndApply[*consolev1.ConsolePlugin, *consolev1.ConsolePluginList, *applyconfigurationsconsolev1.ConsolePluginApplyConfiguration] +} + +// newConsolePlugins returns a ConsolePlugins +func newConsolePlugins(c *ConsoleV1Client) *consolePlugins { + return &consolePlugins{ + gentype.NewClientWithListAndApply[*consolev1.ConsolePlugin, *consolev1.ConsolePluginList, *applyconfigurationsconsolev1.ConsolePluginApplyConfiguration]( + "consoleplugins", + c.RESTClient(), + scheme.ParameterCodec, + "", + func() *consolev1.ConsolePlugin { return &consolev1.ConsolePlugin{} }, + func() *consolev1.ConsolePluginList { return &consolev1.ConsolePluginList{} }, + ), + } +} diff --git a/vendor/github.com/openshift/client-go/console/clientset/versioned/typed/console/v1/consolequickstart.go b/vendor/github.com/openshift/client-go/console/clientset/versioned/typed/console/v1/consolequickstart.go new file mode 100644 index 000000000..7c69b11aa --- /dev/null +++ b/vendor/github.com/openshift/client-go/console/clientset/versioned/typed/console/v1/consolequickstart.go @@ -0,0 +1,54 @@ +// Code generated by client-gen. DO NOT EDIT. + +package v1 + +import ( + context "context" + + consolev1 "github.com/openshift/api/console/v1" + applyconfigurationsconsolev1 "github.com/openshift/client-go/console/applyconfigurations/console/v1" + scheme "github.com/openshift/client-go/console/clientset/versioned/scheme" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + gentype "k8s.io/client-go/gentype" +) + +// ConsoleQuickStartsGetter has a method to return a ConsoleQuickStartInterface. +// A group's client should implement this interface. +type ConsoleQuickStartsGetter interface { + ConsoleQuickStarts() ConsoleQuickStartInterface +} + +// ConsoleQuickStartInterface has methods to work with ConsoleQuickStart resources. +type ConsoleQuickStartInterface interface { + Create(ctx context.Context, consoleQuickStart *consolev1.ConsoleQuickStart, opts metav1.CreateOptions) (*consolev1.ConsoleQuickStart, error) + Update(ctx context.Context, consoleQuickStart *consolev1.ConsoleQuickStart, opts metav1.UpdateOptions) (*consolev1.ConsoleQuickStart, error) + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error + Get(ctx context.Context, name string, opts metav1.GetOptions) (*consolev1.ConsoleQuickStart, error) + List(ctx context.Context, opts metav1.ListOptions) (*consolev1.ConsoleQuickStartList, error) + Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *consolev1.ConsoleQuickStart, err error) + Apply(ctx context.Context, consoleQuickStart *applyconfigurationsconsolev1.ConsoleQuickStartApplyConfiguration, opts metav1.ApplyOptions) (result *consolev1.ConsoleQuickStart, err error) + ConsoleQuickStartExpansion +} + +// consoleQuickStarts implements ConsoleQuickStartInterface +type consoleQuickStarts struct { + *gentype.ClientWithListAndApply[*consolev1.ConsoleQuickStart, *consolev1.ConsoleQuickStartList, *applyconfigurationsconsolev1.ConsoleQuickStartApplyConfiguration] +} + +// newConsoleQuickStarts returns a ConsoleQuickStarts +func newConsoleQuickStarts(c *ConsoleV1Client) *consoleQuickStarts { + return &consoleQuickStarts{ + gentype.NewClientWithListAndApply[*consolev1.ConsoleQuickStart, *consolev1.ConsoleQuickStartList, *applyconfigurationsconsolev1.ConsoleQuickStartApplyConfiguration]( + "consolequickstarts", + c.RESTClient(), + scheme.ParameterCodec, + "", + func() *consolev1.ConsoleQuickStart { return &consolev1.ConsoleQuickStart{} }, + func() *consolev1.ConsoleQuickStartList { return &consolev1.ConsoleQuickStartList{} }, + ), + } +} diff --git a/vendor/github.com/openshift/client-go/console/clientset/versioned/typed/console/v1/consolesample.go b/vendor/github.com/openshift/client-go/console/clientset/versioned/typed/console/v1/consolesample.go new file mode 100644 index 000000000..629812954 --- /dev/null +++ b/vendor/github.com/openshift/client-go/console/clientset/versioned/typed/console/v1/consolesample.go @@ -0,0 +1,54 @@ +// Code generated by client-gen. DO NOT EDIT. + +package v1 + +import ( + context "context" + + consolev1 "github.com/openshift/api/console/v1" + applyconfigurationsconsolev1 "github.com/openshift/client-go/console/applyconfigurations/console/v1" + scheme "github.com/openshift/client-go/console/clientset/versioned/scheme" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + gentype "k8s.io/client-go/gentype" +) + +// ConsoleSamplesGetter has a method to return a ConsoleSampleInterface. +// A group's client should implement this interface. +type ConsoleSamplesGetter interface { + ConsoleSamples() ConsoleSampleInterface +} + +// ConsoleSampleInterface has methods to work with ConsoleSample resources. +type ConsoleSampleInterface interface { + Create(ctx context.Context, consoleSample *consolev1.ConsoleSample, opts metav1.CreateOptions) (*consolev1.ConsoleSample, error) + Update(ctx context.Context, consoleSample *consolev1.ConsoleSample, opts metav1.UpdateOptions) (*consolev1.ConsoleSample, error) + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error + Get(ctx context.Context, name string, opts metav1.GetOptions) (*consolev1.ConsoleSample, error) + List(ctx context.Context, opts metav1.ListOptions) (*consolev1.ConsoleSampleList, error) + Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *consolev1.ConsoleSample, err error) + Apply(ctx context.Context, consoleSample *applyconfigurationsconsolev1.ConsoleSampleApplyConfiguration, opts metav1.ApplyOptions) (result *consolev1.ConsoleSample, err error) + ConsoleSampleExpansion +} + +// consoleSamples implements ConsoleSampleInterface +type consoleSamples struct { + *gentype.ClientWithListAndApply[*consolev1.ConsoleSample, *consolev1.ConsoleSampleList, *applyconfigurationsconsolev1.ConsoleSampleApplyConfiguration] +} + +// newConsoleSamples returns a ConsoleSamples +func newConsoleSamples(c *ConsoleV1Client) *consoleSamples { + return &consoleSamples{ + gentype.NewClientWithListAndApply[*consolev1.ConsoleSample, *consolev1.ConsoleSampleList, *applyconfigurationsconsolev1.ConsoleSampleApplyConfiguration]( + "consolesamples", + c.RESTClient(), + scheme.ParameterCodec, + "", + func() *consolev1.ConsoleSample { return &consolev1.ConsoleSample{} }, + func() *consolev1.ConsoleSampleList { return &consolev1.ConsoleSampleList{} }, + ), + } +} diff --git a/vendor/github.com/openshift/client-go/console/clientset/versioned/typed/console/v1/consoleyamlsample.go b/vendor/github.com/openshift/client-go/console/clientset/versioned/typed/console/v1/consoleyamlsample.go new file mode 100644 index 000000000..32c07d856 --- /dev/null +++ b/vendor/github.com/openshift/client-go/console/clientset/versioned/typed/console/v1/consoleyamlsample.go @@ -0,0 +1,54 @@ +// Code generated by client-gen. DO NOT EDIT. + +package v1 + +import ( + context "context" + + consolev1 "github.com/openshift/api/console/v1" + applyconfigurationsconsolev1 "github.com/openshift/client-go/console/applyconfigurations/console/v1" + scheme "github.com/openshift/client-go/console/clientset/versioned/scheme" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + gentype "k8s.io/client-go/gentype" +) + +// ConsoleYAMLSamplesGetter has a method to return a ConsoleYAMLSampleInterface. +// A group's client should implement this interface. +type ConsoleYAMLSamplesGetter interface { + ConsoleYAMLSamples() ConsoleYAMLSampleInterface +} + +// ConsoleYAMLSampleInterface has methods to work with ConsoleYAMLSample resources. +type ConsoleYAMLSampleInterface interface { + Create(ctx context.Context, consoleYAMLSample *consolev1.ConsoleYAMLSample, opts metav1.CreateOptions) (*consolev1.ConsoleYAMLSample, error) + Update(ctx context.Context, consoleYAMLSample *consolev1.ConsoleYAMLSample, opts metav1.UpdateOptions) (*consolev1.ConsoleYAMLSample, error) + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error + Get(ctx context.Context, name string, opts metav1.GetOptions) (*consolev1.ConsoleYAMLSample, error) + List(ctx context.Context, opts metav1.ListOptions) (*consolev1.ConsoleYAMLSampleList, error) + Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *consolev1.ConsoleYAMLSample, err error) + Apply(ctx context.Context, consoleYAMLSample *applyconfigurationsconsolev1.ConsoleYAMLSampleApplyConfiguration, opts metav1.ApplyOptions) (result *consolev1.ConsoleYAMLSample, err error) + ConsoleYAMLSampleExpansion +} + +// consoleYAMLSamples implements ConsoleYAMLSampleInterface +type consoleYAMLSamples struct { + *gentype.ClientWithListAndApply[*consolev1.ConsoleYAMLSample, *consolev1.ConsoleYAMLSampleList, *applyconfigurationsconsolev1.ConsoleYAMLSampleApplyConfiguration] +} + +// newConsoleYAMLSamples returns a ConsoleYAMLSamples +func newConsoleYAMLSamples(c *ConsoleV1Client) *consoleYAMLSamples { + return &consoleYAMLSamples{ + gentype.NewClientWithListAndApply[*consolev1.ConsoleYAMLSample, *consolev1.ConsoleYAMLSampleList, *applyconfigurationsconsolev1.ConsoleYAMLSampleApplyConfiguration]( + "consoleyamlsamples", + c.RESTClient(), + scheme.ParameterCodec, + "", + func() *consolev1.ConsoleYAMLSample { return &consolev1.ConsoleYAMLSample{} }, + func() *consolev1.ConsoleYAMLSampleList { return &consolev1.ConsoleYAMLSampleList{} }, + ), + } +} diff --git a/vendor/github.com/openshift/client-go/console/clientset/versioned/typed/console/v1/doc.go b/vendor/github.com/openshift/client-go/console/clientset/versioned/typed/console/v1/doc.go new file mode 100644 index 000000000..225e6b2be --- /dev/null +++ b/vendor/github.com/openshift/client-go/console/clientset/versioned/typed/console/v1/doc.go @@ -0,0 +1,4 @@ +// Code generated by client-gen. DO NOT EDIT. + +// This package has the automatically generated typed clients. +package v1 diff --git a/vendor/github.com/openshift/client-go/console/clientset/versioned/typed/console/v1/fake/doc.go b/vendor/github.com/openshift/client-go/console/clientset/versioned/typed/console/v1/fake/doc.go new file mode 100644 index 000000000..2b5ba4c8e --- /dev/null +++ b/vendor/github.com/openshift/client-go/console/clientset/versioned/typed/console/v1/fake/doc.go @@ -0,0 +1,4 @@ +// Code generated by client-gen. DO NOT EDIT. + +// Package fake has the automatically generated clients. +package fake diff --git a/vendor/github.com/openshift/client-go/console/clientset/versioned/typed/console/v1/fake/fake_console_client.go b/vendor/github.com/openshift/client-go/console/clientset/versioned/typed/console/v1/fake/fake_console_client.go new file mode 100644 index 000000000..05fd1edeb --- /dev/null +++ b/vendor/github.com/openshift/client-go/console/clientset/versioned/typed/console/v1/fake/fake_console_client.go @@ -0,0 +1,52 @@ +// Code generated by client-gen. DO NOT EDIT. + +package fake + +import ( + v1 "github.com/openshift/client-go/console/clientset/versioned/typed/console/v1" + rest "k8s.io/client-go/rest" + testing "k8s.io/client-go/testing" +) + +type FakeConsoleV1 struct { + *testing.Fake +} + +func (c *FakeConsoleV1) ConsoleCLIDownloads() v1.ConsoleCLIDownloadInterface { + return newFakeConsoleCLIDownloads(c) +} + +func (c *FakeConsoleV1) ConsoleExternalLogLinks() v1.ConsoleExternalLogLinkInterface { + return newFakeConsoleExternalLogLinks(c) +} + +func (c *FakeConsoleV1) ConsoleLinks() v1.ConsoleLinkInterface { + return newFakeConsoleLinks(c) +} + +func (c *FakeConsoleV1) ConsoleNotifications() v1.ConsoleNotificationInterface { + return newFakeConsoleNotifications(c) +} + +func (c *FakeConsoleV1) ConsolePlugins() v1.ConsolePluginInterface { + return newFakeConsolePlugins(c) +} + +func (c *FakeConsoleV1) ConsoleQuickStarts() v1.ConsoleQuickStartInterface { + return newFakeConsoleQuickStarts(c) +} + +func (c *FakeConsoleV1) ConsoleSamples() v1.ConsoleSampleInterface { + return newFakeConsoleSamples(c) +} + +func (c *FakeConsoleV1) ConsoleYAMLSamples() v1.ConsoleYAMLSampleInterface { + return newFakeConsoleYAMLSamples(c) +} + +// RESTClient returns a RESTClient that is used to communicate +// with API server by this client implementation. +func (c *FakeConsoleV1) RESTClient() rest.Interface { + var ret *rest.RESTClient + return ret +} diff --git a/vendor/github.com/openshift/client-go/console/clientset/versioned/typed/console/v1/fake/fake_consoleclidownload.go b/vendor/github.com/openshift/client-go/console/clientset/versioned/typed/console/v1/fake/fake_consoleclidownload.go new file mode 100644 index 000000000..c4f35849d --- /dev/null +++ b/vendor/github.com/openshift/client-go/console/clientset/versioned/typed/console/v1/fake/fake_consoleclidownload.go @@ -0,0 +1,37 @@ +// Code generated by client-gen. DO NOT EDIT. + +package fake + +import ( + v1 "github.com/openshift/api/console/v1" + consolev1 "github.com/openshift/client-go/console/applyconfigurations/console/v1" + typedconsolev1 "github.com/openshift/client-go/console/clientset/versioned/typed/console/v1" + gentype "k8s.io/client-go/gentype" +) + +// fakeConsoleCLIDownloads implements ConsoleCLIDownloadInterface +type fakeConsoleCLIDownloads struct { + *gentype.FakeClientWithListAndApply[*v1.ConsoleCLIDownload, *v1.ConsoleCLIDownloadList, *consolev1.ConsoleCLIDownloadApplyConfiguration] + Fake *FakeConsoleV1 +} + +func newFakeConsoleCLIDownloads(fake *FakeConsoleV1) typedconsolev1.ConsoleCLIDownloadInterface { + return &fakeConsoleCLIDownloads{ + gentype.NewFakeClientWithListAndApply[*v1.ConsoleCLIDownload, *v1.ConsoleCLIDownloadList, *consolev1.ConsoleCLIDownloadApplyConfiguration]( + fake.Fake, + "", + v1.SchemeGroupVersion.WithResource("consoleclidownloads"), + v1.SchemeGroupVersion.WithKind("ConsoleCLIDownload"), + func() *v1.ConsoleCLIDownload { return &v1.ConsoleCLIDownload{} }, + func() *v1.ConsoleCLIDownloadList { return &v1.ConsoleCLIDownloadList{} }, + func(dst, src *v1.ConsoleCLIDownloadList) { dst.ListMeta = src.ListMeta }, + func(list *v1.ConsoleCLIDownloadList) []*v1.ConsoleCLIDownload { + return gentype.ToPointerSlice(list.Items) + }, + func(list *v1.ConsoleCLIDownloadList, items []*v1.ConsoleCLIDownload) { + list.Items = gentype.FromPointerSlice(items) + }, + ), + fake, + } +} diff --git a/vendor/github.com/openshift/client-go/console/clientset/versioned/typed/console/v1/fake/fake_consoleexternalloglink.go b/vendor/github.com/openshift/client-go/console/clientset/versioned/typed/console/v1/fake/fake_consoleexternalloglink.go new file mode 100644 index 000000000..c48acf872 --- /dev/null +++ b/vendor/github.com/openshift/client-go/console/clientset/versioned/typed/console/v1/fake/fake_consoleexternalloglink.go @@ -0,0 +1,37 @@ +// Code generated by client-gen. DO NOT EDIT. + +package fake + +import ( + v1 "github.com/openshift/api/console/v1" + consolev1 "github.com/openshift/client-go/console/applyconfigurations/console/v1" + typedconsolev1 "github.com/openshift/client-go/console/clientset/versioned/typed/console/v1" + gentype "k8s.io/client-go/gentype" +) + +// fakeConsoleExternalLogLinks implements ConsoleExternalLogLinkInterface +type fakeConsoleExternalLogLinks struct { + *gentype.FakeClientWithListAndApply[*v1.ConsoleExternalLogLink, *v1.ConsoleExternalLogLinkList, *consolev1.ConsoleExternalLogLinkApplyConfiguration] + Fake *FakeConsoleV1 +} + +func newFakeConsoleExternalLogLinks(fake *FakeConsoleV1) typedconsolev1.ConsoleExternalLogLinkInterface { + return &fakeConsoleExternalLogLinks{ + gentype.NewFakeClientWithListAndApply[*v1.ConsoleExternalLogLink, *v1.ConsoleExternalLogLinkList, *consolev1.ConsoleExternalLogLinkApplyConfiguration]( + fake.Fake, + "", + v1.SchemeGroupVersion.WithResource("consoleexternalloglinks"), + v1.SchemeGroupVersion.WithKind("ConsoleExternalLogLink"), + func() *v1.ConsoleExternalLogLink { return &v1.ConsoleExternalLogLink{} }, + func() *v1.ConsoleExternalLogLinkList { return &v1.ConsoleExternalLogLinkList{} }, + func(dst, src *v1.ConsoleExternalLogLinkList) { dst.ListMeta = src.ListMeta }, + func(list *v1.ConsoleExternalLogLinkList) []*v1.ConsoleExternalLogLink { + return gentype.ToPointerSlice(list.Items) + }, + func(list *v1.ConsoleExternalLogLinkList, items []*v1.ConsoleExternalLogLink) { + list.Items = gentype.FromPointerSlice(items) + }, + ), + fake, + } +} diff --git a/vendor/github.com/openshift/client-go/console/clientset/versioned/typed/console/v1/fake/fake_consolelink.go b/vendor/github.com/openshift/client-go/console/clientset/versioned/typed/console/v1/fake/fake_consolelink.go new file mode 100644 index 000000000..fdcc2c3d1 --- /dev/null +++ b/vendor/github.com/openshift/client-go/console/clientset/versioned/typed/console/v1/fake/fake_consolelink.go @@ -0,0 +1,33 @@ +// Code generated by client-gen. DO NOT EDIT. + +package fake + +import ( + v1 "github.com/openshift/api/console/v1" + consolev1 "github.com/openshift/client-go/console/applyconfigurations/console/v1" + typedconsolev1 "github.com/openshift/client-go/console/clientset/versioned/typed/console/v1" + gentype "k8s.io/client-go/gentype" +) + +// fakeConsoleLinks implements ConsoleLinkInterface +type fakeConsoleLinks struct { + *gentype.FakeClientWithListAndApply[*v1.ConsoleLink, *v1.ConsoleLinkList, *consolev1.ConsoleLinkApplyConfiguration] + Fake *FakeConsoleV1 +} + +func newFakeConsoleLinks(fake *FakeConsoleV1) typedconsolev1.ConsoleLinkInterface { + return &fakeConsoleLinks{ + gentype.NewFakeClientWithListAndApply[*v1.ConsoleLink, *v1.ConsoleLinkList, *consolev1.ConsoleLinkApplyConfiguration]( + fake.Fake, + "", + v1.SchemeGroupVersion.WithResource("consolelinks"), + v1.SchemeGroupVersion.WithKind("ConsoleLink"), + func() *v1.ConsoleLink { return &v1.ConsoleLink{} }, + func() *v1.ConsoleLinkList { return &v1.ConsoleLinkList{} }, + func(dst, src *v1.ConsoleLinkList) { dst.ListMeta = src.ListMeta }, + func(list *v1.ConsoleLinkList) []*v1.ConsoleLink { return gentype.ToPointerSlice(list.Items) }, + func(list *v1.ConsoleLinkList, items []*v1.ConsoleLink) { list.Items = gentype.FromPointerSlice(items) }, + ), + fake, + } +} diff --git a/vendor/github.com/openshift/client-go/console/clientset/versioned/typed/console/v1/fake/fake_consolenotification.go b/vendor/github.com/openshift/client-go/console/clientset/versioned/typed/console/v1/fake/fake_consolenotification.go new file mode 100644 index 000000000..09229375d --- /dev/null +++ b/vendor/github.com/openshift/client-go/console/clientset/versioned/typed/console/v1/fake/fake_consolenotification.go @@ -0,0 +1,37 @@ +// Code generated by client-gen. DO NOT EDIT. + +package fake + +import ( + v1 "github.com/openshift/api/console/v1" + consolev1 "github.com/openshift/client-go/console/applyconfigurations/console/v1" + typedconsolev1 "github.com/openshift/client-go/console/clientset/versioned/typed/console/v1" + gentype "k8s.io/client-go/gentype" +) + +// fakeConsoleNotifications implements ConsoleNotificationInterface +type fakeConsoleNotifications struct { + *gentype.FakeClientWithListAndApply[*v1.ConsoleNotification, *v1.ConsoleNotificationList, *consolev1.ConsoleNotificationApplyConfiguration] + Fake *FakeConsoleV1 +} + +func newFakeConsoleNotifications(fake *FakeConsoleV1) typedconsolev1.ConsoleNotificationInterface { + return &fakeConsoleNotifications{ + gentype.NewFakeClientWithListAndApply[*v1.ConsoleNotification, *v1.ConsoleNotificationList, *consolev1.ConsoleNotificationApplyConfiguration]( + fake.Fake, + "", + v1.SchemeGroupVersion.WithResource("consolenotifications"), + v1.SchemeGroupVersion.WithKind("ConsoleNotification"), + func() *v1.ConsoleNotification { return &v1.ConsoleNotification{} }, + func() *v1.ConsoleNotificationList { return &v1.ConsoleNotificationList{} }, + func(dst, src *v1.ConsoleNotificationList) { dst.ListMeta = src.ListMeta }, + func(list *v1.ConsoleNotificationList) []*v1.ConsoleNotification { + return gentype.ToPointerSlice(list.Items) + }, + func(list *v1.ConsoleNotificationList, items []*v1.ConsoleNotification) { + list.Items = gentype.FromPointerSlice(items) + }, + ), + fake, + } +} diff --git a/vendor/github.com/openshift/client-go/console/clientset/versioned/typed/console/v1/fake/fake_consoleplugin.go b/vendor/github.com/openshift/client-go/console/clientset/versioned/typed/console/v1/fake/fake_consoleplugin.go new file mode 100644 index 000000000..ae8618367 --- /dev/null +++ b/vendor/github.com/openshift/client-go/console/clientset/versioned/typed/console/v1/fake/fake_consoleplugin.go @@ -0,0 +1,35 @@ +// Code generated by client-gen. DO NOT EDIT. + +package fake + +import ( + v1 "github.com/openshift/api/console/v1" + consolev1 "github.com/openshift/client-go/console/applyconfigurations/console/v1" + typedconsolev1 "github.com/openshift/client-go/console/clientset/versioned/typed/console/v1" + gentype "k8s.io/client-go/gentype" +) + +// fakeConsolePlugins implements ConsolePluginInterface +type fakeConsolePlugins struct { + *gentype.FakeClientWithListAndApply[*v1.ConsolePlugin, *v1.ConsolePluginList, *consolev1.ConsolePluginApplyConfiguration] + Fake *FakeConsoleV1 +} + +func newFakeConsolePlugins(fake *FakeConsoleV1) typedconsolev1.ConsolePluginInterface { + return &fakeConsolePlugins{ + gentype.NewFakeClientWithListAndApply[*v1.ConsolePlugin, *v1.ConsolePluginList, *consolev1.ConsolePluginApplyConfiguration]( + fake.Fake, + "", + v1.SchemeGroupVersion.WithResource("consoleplugins"), + v1.SchemeGroupVersion.WithKind("ConsolePlugin"), + func() *v1.ConsolePlugin { return &v1.ConsolePlugin{} }, + func() *v1.ConsolePluginList { return &v1.ConsolePluginList{} }, + func(dst, src *v1.ConsolePluginList) { dst.ListMeta = src.ListMeta }, + func(list *v1.ConsolePluginList) []*v1.ConsolePlugin { return gentype.ToPointerSlice(list.Items) }, + func(list *v1.ConsolePluginList, items []*v1.ConsolePlugin) { + list.Items = gentype.FromPointerSlice(items) + }, + ), + fake, + } +} diff --git a/vendor/github.com/openshift/client-go/console/clientset/versioned/typed/console/v1/fake/fake_consolequickstart.go b/vendor/github.com/openshift/client-go/console/clientset/versioned/typed/console/v1/fake/fake_consolequickstart.go new file mode 100644 index 000000000..ea8afc470 --- /dev/null +++ b/vendor/github.com/openshift/client-go/console/clientset/versioned/typed/console/v1/fake/fake_consolequickstart.go @@ -0,0 +1,37 @@ +// Code generated by client-gen. DO NOT EDIT. + +package fake + +import ( + v1 "github.com/openshift/api/console/v1" + consolev1 "github.com/openshift/client-go/console/applyconfigurations/console/v1" + typedconsolev1 "github.com/openshift/client-go/console/clientset/versioned/typed/console/v1" + gentype "k8s.io/client-go/gentype" +) + +// fakeConsoleQuickStarts implements ConsoleQuickStartInterface +type fakeConsoleQuickStarts struct { + *gentype.FakeClientWithListAndApply[*v1.ConsoleQuickStart, *v1.ConsoleQuickStartList, *consolev1.ConsoleQuickStartApplyConfiguration] + Fake *FakeConsoleV1 +} + +func newFakeConsoleQuickStarts(fake *FakeConsoleV1) typedconsolev1.ConsoleQuickStartInterface { + return &fakeConsoleQuickStarts{ + gentype.NewFakeClientWithListAndApply[*v1.ConsoleQuickStart, *v1.ConsoleQuickStartList, *consolev1.ConsoleQuickStartApplyConfiguration]( + fake.Fake, + "", + v1.SchemeGroupVersion.WithResource("consolequickstarts"), + v1.SchemeGroupVersion.WithKind("ConsoleQuickStart"), + func() *v1.ConsoleQuickStart { return &v1.ConsoleQuickStart{} }, + func() *v1.ConsoleQuickStartList { return &v1.ConsoleQuickStartList{} }, + func(dst, src *v1.ConsoleQuickStartList) { dst.ListMeta = src.ListMeta }, + func(list *v1.ConsoleQuickStartList) []*v1.ConsoleQuickStart { + return gentype.ToPointerSlice(list.Items) + }, + func(list *v1.ConsoleQuickStartList, items []*v1.ConsoleQuickStart) { + list.Items = gentype.FromPointerSlice(items) + }, + ), + fake, + } +} diff --git a/vendor/github.com/openshift/client-go/console/clientset/versioned/typed/console/v1/fake/fake_consolesample.go b/vendor/github.com/openshift/client-go/console/clientset/versioned/typed/console/v1/fake/fake_consolesample.go new file mode 100644 index 000000000..55e67ac31 --- /dev/null +++ b/vendor/github.com/openshift/client-go/console/clientset/versioned/typed/console/v1/fake/fake_consolesample.go @@ -0,0 +1,35 @@ +// Code generated by client-gen. DO NOT EDIT. + +package fake + +import ( + v1 "github.com/openshift/api/console/v1" + consolev1 "github.com/openshift/client-go/console/applyconfigurations/console/v1" + typedconsolev1 "github.com/openshift/client-go/console/clientset/versioned/typed/console/v1" + gentype "k8s.io/client-go/gentype" +) + +// fakeConsoleSamples implements ConsoleSampleInterface +type fakeConsoleSamples struct { + *gentype.FakeClientWithListAndApply[*v1.ConsoleSample, *v1.ConsoleSampleList, *consolev1.ConsoleSampleApplyConfiguration] + Fake *FakeConsoleV1 +} + +func newFakeConsoleSamples(fake *FakeConsoleV1) typedconsolev1.ConsoleSampleInterface { + return &fakeConsoleSamples{ + gentype.NewFakeClientWithListAndApply[*v1.ConsoleSample, *v1.ConsoleSampleList, *consolev1.ConsoleSampleApplyConfiguration]( + fake.Fake, + "", + v1.SchemeGroupVersion.WithResource("consolesamples"), + v1.SchemeGroupVersion.WithKind("ConsoleSample"), + func() *v1.ConsoleSample { return &v1.ConsoleSample{} }, + func() *v1.ConsoleSampleList { return &v1.ConsoleSampleList{} }, + func(dst, src *v1.ConsoleSampleList) { dst.ListMeta = src.ListMeta }, + func(list *v1.ConsoleSampleList) []*v1.ConsoleSample { return gentype.ToPointerSlice(list.Items) }, + func(list *v1.ConsoleSampleList, items []*v1.ConsoleSample) { + list.Items = gentype.FromPointerSlice(items) + }, + ), + fake, + } +} diff --git a/vendor/github.com/openshift/client-go/console/clientset/versioned/typed/console/v1/fake/fake_consoleyamlsample.go b/vendor/github.com/openshift/client-go/console/clientset/versioned/typed/console/v1/fake/fake_consoleyamlsample.go new file mode 100644 index 000000000..fe399cd57 --- /dev/null +++ b/vendor/github.com/openshift/client-go/console/clientset/versioned/typed/console/v1/fake/fake_consoleyamlsample.go @@ -0,0 +1,37 @@ +// Code generated by client-gen. DO NOT EDIT. + +package fake + +import ( + v1 "github.com/openshift/api/console/v1" + consolev1 "github.com/openshift/client-go/console/applyconfigurations/console/v1" + typedconsolev1 "github.com/openshift/client-go/console/clientset/versioned/typed/console/v1" + gentype "k8s.io/client-go/gentype" +) + +// fakeConsoleYAMLSamples implements ConsoleYAMLSampleInterface +type fakeConsoleYAMLSamples struct { + *gentype.FakeClientWithListAndApply[*v1.ConsoleYAMLSample, *v1.ConsoleYAMLSampleList, *consolev1.ConsoleYAMLSampleApplyConfiguration] + Fake *FakeConsoleV1 +} + +func newFakeConsoleYAMLSamples(fake *FakeConsoleV1) typedconsolev1.ConsoleYAMLSampleInterface { + return &fakeConsoleYAMLSamples{ + gentype.NewFakeClientWithListAndApply[*v1.ConsoleYAMLSample, *v1.ConsoleYAMLSampleList, *consolev1.ConsoleYAMLSampleApplyConfiguration]( + fake.Fake, + "", + v1.SchemeGroupVersion.WithResource("consoleyamlsamples"), + v1.SchemeGroupVersion.WithKind("ConsoleYAMLSample"), + func() *v1.ConsoleYAMLSample { return &v1.ConsoleYAMLSample{} }, + func() *v1.ConsoleYAMLSampleList { return &v1.ConsoleYAMLSampleList{} }, + func(dst, src *v1.ConsoleYAMLSampleList) { dst.ListMeta = src.ListMeta }, + func(list *v1.ConsoleYAMLSampleList) []*v1.ConsoleYAMLSample { + return gentype.ToPointerSlice(list.Items) + }, + func(list *v1.ConsoleYAMLSampleList, items []*v1.ConsoleYAMLSample) { + list.Items = gentype.FromPointerSlice(items) + }, + ), + fake, + } +} diff --git a/vendor/github.com/openshift/client-go/console/clientset/versioned/typed/console/v1/generated_expansion.go b/vendor/github.com/openshift/client-go/console/clientset/versioned/typed/console/v1/generated_expansion.go new file mode 100644 index 000000000..8b3c38878 --- /dev/null +++ b/vendor/github.com/openshift/client-go/console/clientset/versioned/typed/console/v1/generated_expansion.go @@ -0,0 +1,19 @@ +// Code generated by client-gen. DO NOT EDIT. + +package v1 + +type ConsoleCLIDownloadExpansion interface{} + +type ConsoleExternalLogLinkExpansion interface{} + +type ConsoleLinkExpansion interface{} + +type ConsoleNotificationExpansion interface{} + +type ConsolePluginExpansion interface{} + +type ConsoleQuickStartExpansion interface{} + +type ConsoleSampleExpansion interface{} + +type ConsoleYAMLSampleExpansion interface{} diff --git a/vendor/modules.txt b/vendor/modules.txt index beaca2862..4a7481064 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -1348,6 +1348,14 @@ github.com/openshift/client-go/config/informers/externalversions/internalinterfa github.com/openshift/client-go/config/listers/config/v1 github.com/openshift/client-go/config/listers/config/v1alpha1 github.com/openshift/client-go/config/listers/config/v1alpha2 +github.com/openshift/client-go/console/applyconfigurations +github.com/openshift/client-go/console/applyconfigurations/console/v1 +github.com/openshift/client-go/console/applyconfigurations/internal +github.com/openshift/client-go/console/clientset/versioned +github.com/openshift/client-go/console/clientset/versioned/fake +github.com/openshift/client-go/console/clientset/versioned/scheme +github.com/openshift/client-go/console/clientset/versioned/typed/console/v1 +github.com/openshift/client-go/console/clientset/versioned/typed/console/v1/fake github.com/openshift/client-go/operator/applyconfigurations/internal github.com/openshift/client-go/operator/applyconfigurations/operator/v1 github.com/openshift/client-go/operator/clientset/versioned/scheme From da93f0c65b512c437981ba3f05b103037dd89de8 Mon Sep 17 00:00:00 2001 From: Arun Maurya Date: Thu, 11 Jun 2026 12:47:35 +0530 Subject: [PATCH 2/4] fix(e2e): use restricted security context for Vault Helm installer pod The vault-installer pod was rejected on clusters enforcing Pod Security restricted:latest because it ran with privileged=true. Helm install only needs API access via the service account, so use a restricted-compliant security context instead. Co-authored-by: Cursor --- test/e2e/utils_test.go | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/test/e2e/utils_test.go b/test/e2e/utils_test.go index 4240ef43d..ae269a541 100644 --- a/test/e2e/utils_test.go +++ b/test/e2e/utils_test.go @@ -1840,7 +1840,9 @@ func setupVaultServer(ctx context.Context, cfg *rest.Config, loader library.Dyna // Create Helm installer pod helmCmd := fmt.Sprintf("helm install %s ./vault -n %s --values /helm/custom-values.yaml", releaseName, namespace) - privileged := true + allowPrivilegeEscalation := false + runAsNonRoot := true + privileged := false installerPodName := "vault-installer" helmPod := &corev1.Pod{ ObjectMeta: metav1.ObjectMeta{ @@ -1863,7 +1865,12 @@ func setupVaultServer(ctx context.Context, cfg *rest.Config, loader library.Dyna }, }, SecurityContext: &corev1.SecurityContext{ - Privileged: &privileged, + AllowPrivilegeEscalation: &allowPrivilegeEscalation, + RunAsNonRoot: &runAsNonRoot, + Privileged: &privileged, + Capabilities: &corev1.Capabilities{ + Drop: []corev1.Capability{"ALL"}, + }, }, }, }, From 4e38ab24acdc30949c4550f70cbba8790e32c0b6 Mon Sep 17 00:00:00 2001 From: Arun Maurya Date: Thu, 11 Jun 2026 16:35:36 +0530 Subject: [PATCH 3/4] fix(e2e): set runAsUser on Vault Helm installer pod --- test/e2e/utils_test.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/test/e2e/utils_test.go b/test/e2e/utils_test.go index ae269a541..847ef02ac 100644 --- a/test/e2e/utils_test.go +++ b/test/e2e/utils_test.go @@ -1842,6 +1842,7 @@ func setupVaultServer(ctx context.Context, cfg *rest.Config, loader library.Dyna allowPrivilegeEscalation := false runAsNonRoot := true + runAsUser := int64(1001) privileged := false installerPodName := "vault-installer" helmPod := &corev1.Pod{ @@ -1867,6 +1868,7 @@ func setupVaultServer(ctx context.Context, cfg *rest.Config, loader library.Dyna SecurityContext: &corev1.SecurityContext{ AllowPrivilegeEscalation: &allowPrivilegeEscalation, RunAsNonRoot: &runAsNonRoot, + RunAsUser: &runAsUser, Privileged: &privileged, Capabilities: &corev1.Capabilities{ Drop: []corev1.Capability{"ALL"}, From 98caa8b621a540ec2a3f45e1860b905292ac6d3e Mon Sep 17 00:00:00 2001 From: Bharath B Date: Wed, 1 Jul 2026 16:58:50 +0530 Subject: [PATCH 4/4] NO-JIRA: Fix Vault e2e Helm installer pod PSA seccomp violation Signed-off-by: Bharath B --- test/e2e/utils_test.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/test/e2e/utils_test.go b/test/e2e/utils_test.go index 847ef02ac..25f8d1ae0 100644 --- a/test/e2e/utils_test.go +++ b/test/e2e/utils_test.go @@ -1853,6 +1853,11 @@ func setupVaultServer(ctx context.Context, cfg *rest.Config, loader library.Dyna Spec: corev1.PodSpec{ ServiceAccountName: serviceAccountName, RestartPolicy: corev1.RestartPolicyNever, + SecurityContext: &corev1.PodSecurityContext{ + SeccompProfile: &corev1.SeccompProfile{ + Type: corev1.SeccompProfileTypeRuntimeDefault, + }, + }, Containers: []corev1.Container{ { Name: "helm", @@ -1870,6 +1875,9 @@ func setupVaultServer(ctx context.Context, cfg *rest.Config, loader library.Dyna RunAsNonRoot: &runAsNonRoot, RunAsUser: &runAsUser, Privileged: &privileged, + SeccompProfile: &corev1.SeccompProfile{ + Type: corev1.SeccompProfileTypeRuntimeDefault, + }, Capabilities: &corev1.Capabilities{ Drop: []corev1.Capability{"ALL"}, },