<#995 Fix delete secret for scoped secrets> Pull r...
# flyte-github
a
#995 Fix delete secret for scoped secrets Pull request opened by katrogan Before, we would inject project and domain from the config and delete would swallow 'not found' errors and happily report success. This follows the pattern we do for get secret: https://github.com/flyteorg/flyte-sdk/blob/main/src/flyte/cli/_get.py#L336-L339 and create secret https://github.com/flyteorg/flyte-sdk/blob/main/src/flyte/cli/_create.py#L171-L173 Testing Before
Copy code
FLYTECTL_CONFIG=.flyte/config.yaml  flyte delete secret --domain development katrina-dp-test
FLYTECTL_CONFIG=.flyte/config.yaml  flyte get secret --domain development katrina-dp-test

[
    {
        'id': {
            'name': 'katrina-dp-test',
            'organization': 'dogfood-gcp',
            'domain': 'development'
        },
        'secretMetadata': {
            'createdTime': '2026-04-21T17:00:12.063234Z',
            'secretStatus': {
                'overallStatus': 'FULLY_PRESENT',
                'clusterStatus': [
                    {
                        'cluster': {
                            'organization': 'dogfood-gcp',
                            'name': 'dogfood-gcp-dp'
                        },
                        'presenceStatus': 'PRESENT'
                    }
                ]
            }
        }
    }
]
After
Copy code
FLYTECTL_CONFIG=.flyte/config.yaml  flyte delete secret --domain development katrina-dp-test    
FLYTECTL_CONFIG=.flyte/config.yaml  flyte get secret --domain development katrina-dp-test                               
╭─ Error ────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ Requested object NOT FOUND. Please check your input. Error: rpc error: code = NotFound desc = failed to get secret name:"katrina-dp-test" organization:"dogfood-gcp" domain:"development": secret name:"katrina-dp-test"                       │
│ organization:"dogfood-gcp" domain:"development" not found in any cluster                                                                                                                                                                       │
╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
flyteorg/flyte-sdk