You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ozone.apache.org by ad...@apache.org on 2021/07/29 15:09:21 UTC

[ozone] branch master updated: HDDS-5328. Remove delete container command from admin CLI (#2456)

This is an automated email from the ASF dual-hosted git repository.

adoroszlai pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/ozone.git


The following commit(s) were added to refs/heads/master by this push:
     new 5da8b22  HDDS-5328. Remove delete container command from admin CLI (#2456)
5da8b22 is described below

commit 5da8b22dd863988f121112506bfdfc28d435d46a
Author: GeorgeJahad <gi...@blackbirdsystems.net>
AuthorDate: Thu Jul 29 08:09:09 2021 -0700

    HDDS-5328. Remove delete container command from admin CLI (#2456)
---
 .../hdds/scm/cli/container/ContainerCommands.java  |  1 -
 .../hdds/scm/cli/container/DeleteSubcommand.java   | 54 ----------------------
 .../src/main/smoketest/admincli/container.robot    |  4 --
 3 files changed, 59 deletions(-)

diff --git a/hadoop-hdds/tools/src/main/java/org/apache/hadoop/hdds/scm/cli/container/ContainerCommands.java b/hadoop-hdds/tools/src/main/java/org/apache/hadoop/hdds/scm/cli/container/ContainerCommands.java
index de1015d..00d678c 100644
--- a/hadoop-hdds/tools/src/main/java/org/apache/hadoop/hdds/scm/cli/container/ContainerCommands.java
+++ b/hadoop-hdds/tools/src/main/java/org/apache/hadoop/hdds/scm/cli/container/ContainerCommands.java
@@ -43,7 +43,6 @@ import picocli.CommandLine.Spec;
     subcommands = {
         ListSubcommand.class,
         InfoSubcommand.class,
-        DeleteSubcommand.class,
         CreateSubcommand.class,
         CloseSubcommand.class
     })
diff --git a/hadoop-hdds/tools/src/main/java/org/apache/hadoop/hdds/scm/cli/container/DeleteSubcommand.java b/hadoop-hdds/tools/src/main/java/org/apache/hadoop/hdds/scm/cli/container/DeleteSubcommand.java
deleted file mode 100644
index 62d1b8a..0000000
--- a/hadoop-hdds/tools/src/main/java/org/apache/hadoop/hdds/scm/cli/container/DeleteSubcommand.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- * <p>
- * http://www.apache.org/licenses/LICENSE-2.0
- * <p>
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.hadoop.hdds.scm.cli.container;
-
-import java.io.IOException;
-
-import org.apache.hadoop.hdds.cli.HddsVersionProvider;
-import org.apache.hadoop.hdds.scm.cli.ScmSubcommand;
-import org.apache.hadoop.hdds.scm.client.ScmClient;
-
-import static org.apache.hadoop.hdds.scm.cli.container.ContainerCommands.checkContainerExists;
-import picocli.CommandLine.Command;
-import picocli.CommandLine.Option;
-import picocli.CommandLine.Parameters;
-
-/**
- * This is the handler that process delete container command.
- */
-@Command(
-    name = "delete",
-    description = "Delete container",
-    mixinStandardHelpOptions = true,
-    versionProvider = HddsVersionProvider.class)
-public class DeleteSubcommand extends ScmSubcommand {
-
-  @Parameters(description = "Id of the container to close")
-  private long containerId;
-
-  @Option(names = {"-f",
-      "--force"}, description = "forcibly delete the container")
-  private boolean force;
-
-  @Override
-  public void execute(ScmClient scmClient) throws IOException {
-    checkContainerExists(scmClient, containerId);
-    scmClient.deleteContainer(containerId, force);
-  }
-}
diff --git a/hadoop-ozone/dist/src/main/smoketest/admincli/container.robot b/hadoop-ozone/dist/src/main/smoketest/admincli/container.robot
index dfdeb7c..a36db81 100644
--- a/hadoop-ozone/dist/src/main/smoketest/admincli/container.robot
+++ b/hadoop-ozone/dist/src/main/smoketest/admincli/container.robot
@@ -75,7 +75,6 @@ Incomplete command
                         Should contain   ${output}   Incomplete command
                         Should contain   ${output}   list
                         Should contain   ${output}   info
-                        Should contain   ${output}   delete
                         Should contain   ${output}   create
                         Should contain   ${output}   close
 
@@ -88,6 +87,3 @@ Cannot close container without admin privilege
 
 Cannot create container without admin privilege
     Requires admin privilege    ozone admin container create
-
-Cannot delete container without admin privilege
-    Requires admin privilege    ozone admin container delete "${CONTAINER}"

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@ozone.apache.org
For additional commands, e-mail: commits-help@ozone.apache.org