Chapter 3. Managing Builds


As an application developer, modify or delete the custom resources (CR) that are not used in builds. This helps in maintaining a clean and efficient build configuration.

3.1. Editing the resources

You can edit the resources that are created by buildah, source-to-image and buildpacks build processes using the oc CLI. You can modify the resources as needed in your project.

Prerequisites

  • You have installed the oc CLI.

Procedure

  1. Run the following command to open the YAML definition in the default editor:

    $ oc edit <resource_name> <build_resource_name>
    Copy to Clipboard Toggle word wrap

    where:

    <resource_name>
    Specifies the name of the resource (build, buildrun or buildstrategy)
    <build_resource_name>
    Specifies the name of the build resource that you want to edit.
  2. Edit the YAML definition and save the file.

3.2. Deleting a build resource

Delete a build resource created by the buildah, source-to-image (S2I), and buildpacks build processes using the oc CLI or the shp CLI. This cleanup ensures that unused build configurations are removed, keeping your project organized and efficient.

Prerequisites

  • You have installed the oc CLI.
  • Optional: You have installed the shp CLI.

Procedure

  • Delete a build resource by using the oc CLI or shp CLI:

    $ oc delete builds <build_resource_name>
    Copy to Clipboard Toggle word wrap
    $ shp build delete <build_resource_name>
    Copy to Clipboard Toggle word wrap

    where:

    <build_resource_name>
    Specifies the name of the build resource.

Verification

  • Verify that the build resource is deleted by using the oc CLI or shp CLI:

    $ oc get build | grep <build_resource_name>
    Copy to Clipboard Toggle word wrap
    $ shp build list | grep <build_resource_name>
    Copy to Clipboard Toggle word wrap

    where:

    <build_resource_name>

    Specifies the name of the build resource.

    If the build resource is successfully deleted, the commands do not return any output.

3.3. Deleting a buildrun resource

Delete a buildrun resource created by the buildah, source-to-image (S2I), and buildpacks build processes if it is not required in your project. Deleting the resources helps you clean up build configurations that are no longer required in your project.

Prerequisites

  • You have installed the oc CLI.
  • Optional: You have installed the shp CLI.

Procedure

  • Delete a build resource by using the oc CLI or shp CLI:

    $ oc delete buildrun <buildrun_resource_name>
    Copy to Clipboard Toggle word wrap
    $ shp build list | grep <buildrun_resource_name>
    Copy to Clipboard Toggle word wrap

    where:

    <buildrun_resource_name>

    Specifies the name of the buildrun resource.

    If the buildrun resource has been successfully deleted, the commands do not return any output.

Verification

  • Verify that the buildrun resource is deleted by using the oc CLI or shp CLI:

    $ oc get buildrun | grep <buildrun_resource_name>
    Copy to Clipboard Toggle word wrap
    $ shp buildrun list | grep <buildrun_resource_name>
    Copy to Clipboard Toggle word wrap

    where:

    <buildrun_resource_name>

    Specifies the name of the buildrun resource.

    If the buildrun resource is successfully deleted, the commands do not return any output.

3.4. Deleting a buildstrategy resource

Delete a buildstrategy resource to remove unused build configurations and keep your project clean and efficient.

Prerequisites

  • You have installed the oc CLI.
  • Optional: You have installed the shp CLI.

Procedure

  • Delete a buildstrategy resource by using the oc CLI:

    $ oc delete buildstrategy <buildstrategy_resource_name>
    Copy to Clipboard Toggle word wrap

    where:

    <buildstrategy_resource_name>
    Specifies the name of the buildstrategy resource.

Verification

  • Verify that the buildstrategy resource is deleted by using the oc CLI or shp CLI:

    $ oc get buildstrategy | grep <buildstrategy_resource_name>
    Copy to Clipboard Toggle word wrap
    $ shp buildstrategy list | grep <buildstrategy_resource_name>
    Copy to Clipboard Toggle word wrap

    where:

    <buildstrategy_resource_name>

    Specifies the name of the buildstrategy resource.

    If the buildstrategy resource has been successfully deleted, the commands do not return any output.

Red Hat logoGithubredditYoutubeTwitter

Learn

Try, buy, & sell

Communities

About Red Hat Documentation

We help Red Hat users innovate and achieve their goals with our products and services with content they can trust. Explore our recent updates.

Making open source more inclusive

Red Hat is committed to replacing problematic language in our code, documentation, and web properties. For more details, see the Red Hat Blog.

About Red Hat

We deliver hardened solutions that make it easier for enterprises to work across platforms and environments, from the core datacenter to the network edge.

Theme

© 2026 Red Hat
Back to top