blackducksoftware / synopsys-operator

Archived and moved this to https://github.com/blackducksoftware/synopsysctl
Apache License 2.0
10 stars 14 forks source link

Check if a release exists before creating the resource #1324

Closed mphammer closed 4 years ago

mphammer commented 4 years ago

New Error Message:

ERRO[0001] synopsyctl failed: failed to create Alert resources: release 'alt' already exists in namespace 'myalert'

Old Error Message:

ERRO[0002] synopsyctl failed: failed to create Alert resources: failed to run install: existing resource conflict: namespace: myalert, name: alt-alert-environs-secret, existing_kind: /v1, Kind=Secret, new_kind: /v1, Kind=Secret
rendered manifests contain a resource that already exists. Unable to continue with install
helm.sh/helm/v3/pkg/action.(*Install).Run
    /Users/hammer/go/pkg/mod/helm.sh/helm/v3@v3.1.1/pkg/action/install.go:258
github.com/blackducksoftware/synopsys-operator/pkg/util.CreateWithHelm3
    /Users/hammer/go/src/github.com/blackducksoftware/synopsys-operator/pkg/util/helm_helpers.go:115
github.com/blackducksoftware/synopsys-operator/pkg/synopsysctl.glob..func3
    /Users/hammer/go/src/github.com/blackducksoftware/synopsys-operator/pkg/synopsysctl/cmd_create.go:112
github.com/spf13/cobra.(*Command).execute
    /Users/hammer/go/pkg/mod/github.com/spf13/cobra@v0.0.5/command.go:826
github.com/spf13/cobra.(*Command).ExecuteC
    /Users/hammer/go/pkg/mod/github.com/spf13/cobra@v0.0.5/command.go:914
github.com/spf13/cobra.(*Command).Execute
    /Users/hammer/go/pkg/mod/github.com/spf13/cobra@v0.0.5/command.go:864
github.com/blackducksoftware/synopsys-operator/pkg/synopsysctl.Execute
    /Users/hammer/go/src/github.com/blackducksoftware/synopsys-operator/pkg/synopsysctl/cmd_root.go:102
main.main
    /Users/hammer/go/src/github.com/blackducksoftware/synopsys-operator/cmd/synopsysctl/main.go:33
runtime.main
    /usr/local/Cellar/go/1.13.8/libexec/src/runtime/proc.go:203
runtime.goexit
    /usr/local/Cellar/go/1.13.8/libexec/src/runtime/asm_amd64.s:1357
operator-r2d2 commented 4 years ago

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: mphammer, msenmurugan

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files: - ~~[OWNERS](https://github.com/blackducksoftware/synopsys-operator/blob/develop/OWNERS)~~ [mphammer,msenmurugan] Approvers can indicate their approval by writing `/approve` in a comment Approvers can cancel approval by writing `/approve cancel` in a comment