Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove odo preference registry update command #5853

Merged
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 0 additions & 17 deletions docs/website/versioned_docs/version-3.0.0/overview/configure.md
Original file line number Diff line number Diff line change
Expand Up @@ -144,21 +144,4 @@ Successfully deleted registry

You can use the `--force` (or `-f`) flag to force the deletion of the registry without confirmation.

### Updating a registry
rm3l marked this conversation as resolved.
Show resolved Hide resolved

You can update the URL and/or the personal access token of a registry already registered with the command:

```
odo preference registry update
```

For example:

```
$ odo preference registry update MyRegistry https://otherregistry.example.com
? Are you sure you want to update registry "MyRegistry" Yes
Successfully updated registry
```

You can use the `--force` (or `-f`) flag to force the update of the registry without confirmation.

6 changes: 2 additions & 4 deletions pkg/odo/cli/preference/registry/registry.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,22 +23,20 @@ var registryDesc = ktemplates.LongDesc(`Configure devfile registry`)
func NewCmdRegistry(name, fullName string) *cobra.Command {
registryAddCmd := NewCmdAdd(addCommandName, util.GetFullName(fullName, addCommandName))
registryListCmd := NewCmdList(listCommandName, util.GetFullName(fullName, listCommandName))
registryUpdateCmd := NewCmdUpdate(updateCommandName, util.GetFullName(fullName, updateCommandName))
registryDeleteCmd := NewCmdDelete(deleteCommandName, util.GetFullName(fullName, deleteCommandName))

registryCmd := &cobra.Command{
Use: name,
Short: registryDesc,
Long: registryDesc,
Example: fmt.Sprintf("%s\n\n%s\n\n%s\n\n%s",
Example: fmt.Sprintf("%s\n\n%s\n\n%s",
registryAddCmd.Example,
registryListCmd.Example,
registryUpdateCmd.Example,
registryDeleteCmd.Example,
),
}

registryCmd.AddCommand(registryAddCmd, registryListCmd, registryUpdateCmd, registryDeleteCmd)
registryCmd.AddCommand(registryAddCmd, registryListCmd, registryDeleteCmd)
registryCmd.SetUsageTemplate(util.CmdUsageTemplate)
registryCmd.Annotations = map[string]string{"command": "main"}

Expand Down
137 changes: 0 additions & 137 deletions pkg/odo/cli/preference/registry/update.go

This file was deleted.

2 changes: 1 addition & 1 deletion pkg/registry/registry.go
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ func (o RegistryClient) ListDevfileStacks(registryName, devfileFlag, filterFlag
retrieveRegistryIndices.Add(util.ConcurrentTask{ToRun: func(errChannel chan error) {
registryDevfiles, err := getRegistryStacks(o.preferenceClient, registry)
if err != nil {
log.Warningf("Registry %s is not set up properly with error: %v, please check the registry URL and credential (refer `odo preference registry update --help`)\n", registry.Name, err)
log.Warningf("Registry %s is not set up properly with error: %v, please check the registry URL, and credential and add the registry again (refer `odo preference registry --help`)\n", registry.Name, err)
valaparthvi marked this conversation as resolved.
Show resolved Hide resolved
return
}

Expand Down
3 changes: 2 additions & 1 deletion tests/helper/helper_generic.go
Original file line number Diff line number Diff line change
Expand Up @@ -311,5 +311,6 @@ type ResourceInfo struct {
func SetDefaultDevfileRegistryAsStaging() {
const registryName string = "DefaultDevfileRegistry"
const addRegistryURL string = "https://registry.stage.devfile.io"
Cmd("odo", "preference", "registry", "update", registryName, addRegistryURL, "-f").ShouldPass()
Cmd("odo", "preference", "registry", "delete", registryName, "-f").ShouldPass()
Cmd("odo", "preference", "registry", "add", registryName, addRegistryURL).ShouldPass()
}
11 changes: 0 additions & 11 deletions tests/integration/devfile/cmd_devfile_registry_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ var _ = Describe("odo devfile registry command tests", func() {
// Use staging OCI-based registry for tests to avoid overload
const addRegistryURL string = "https://registry.stage.devfile.io"

const updateRegistryURL string = "http://www.example.com/update"
var commonVar helper.CommonVar

// This is run before every Spec (It)
Expand Down Expand Up @@ -89,10 +88,6 @@ var _ = Describe("odo devfile registry command tests", func() {
helper.MatchAllInOutput(output, []string{"No devfile registries added to the configuration. Refer `odo preference registry add -h` to add one"})
})

It("Should fail to update the registry, when registry is not present", func() {
helper.Cmd("odo", "preference", "registry", "update", registryName, updateRegistryURL, "-f").ShouldFail()
})

It("Should fail to delete the registry, when registry is not present", func() {
helper.Cmd("odo", "preference", "registry", "delete", registryName, "-f").ShouldFail()
})
Expand All @@ -119,12 +114,6 @@ var _ = Describe("odo devfile registry command tests", func() {
helper.Cmd("odo", "preference", "registry", "delete", registryName, "-f").ShouldPass()
})

It("should successfully update the registry", func() {
helper.Cmd("odo", "preference", "registry", "update", registryName, updateRegistryURL, "-f").ShouldPass()
output := helper.Cmd("odo", "preference", "registry", "list").ShouldPass().Out()
helper.MatchAllInOutput(output, []string{registryName, updateRegistryURL})
})

It("deleting registry and creating component with registry flag ", func() {
helper.Cmd("odo", "preference", "registry", "delete", registryName, "-f").ShouldPass()
helper.Cmd("odo", "init", "--name", "aname", "--devfile", "java-maven", "--devfile-registry", registryName).ShouldFail()
Expand Down