Uploaded image for project: 'OpenShift Installer'
  1. OpenShift Installer
  2. CORS-2656

Remove Context from GCP Destroy Struct

    XMLWordPrintable

Details

    • Story
    • Resolution: Done
    • Normal
    • None
    • None
    • None
    • None
    • 3
    • False
    • None
    • False
    • 3
    • Sprint 237, Sprint 236, Sprint 238

    Description

      When making a change to the uninstaller for GCP, the linter picked up an error:

       

       

      pkg/destroy/gcp/gcp.go:42:2: found a struct that contains a context.Context field (containedctx)
      	Context           context.Context 

       

       

      Contexts should not be added to structs. Instead the context should be created at the top level of the uninstaller OR a separate context can be used for each stage of the uninstallation process.

       

      Currently this error can be bypassed by adding:

      //nolint:containedctx 

      to the offending line

       

      Attachments

        Activity

          People

            rh-ee-bbarbach Brent Barbachem
            rh-ee-bbarbach Brent Barbachem
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: