@@ -51,7 +51,7 @@ func NewInspectCommand(dockerCli command.Cli) *cobra.Command {
5151func runInspect (ctx context.Context , dockerCli command.Cli , opts inspectOptions ) error {
5252 var elementSearcher inspect.GetRefFunc
5353 switch opts .inspectType {
54- case "" , "container" , "image" , "node " , "network " , "service " , "volume " , "task " , "plugin " , "secret " :
54+ case "" , "config" , " container" , "image" , "network " , "node " , "plugin " , "secret " , "service " , "task " , "volume " :
5555 elementSearcher = inspectAll (ctx , dockerCli , opts .size , opts .inspectType )
5656 default :
5757 return errors .Errorf ("%q is not a valid value for --type" , opts .inspectType )
@@ -114,6 +114,12 @@ func inspectSecret(ctx context.Context, dockerCli command.Cli) inspect.GetRefFun
114114 }
115115}
116116
117+ func inspectConfig (ctx context.Context , dockerCLI command.Cli ) inspect.GetRefFunc {
118+ return func (ref string ) (any , []byte , error ) {
119+ return dockerCLI .Client ().ConfigInspectWithRaw (ctx , ref )
120+ }
121+ }
122+
117123func inspectAll (ctx context.Context , dockerCli command.Cli , getSize bool , typeConstraint string ) inspect.GetRefFunc {
118124 inspectAutodetect := []struct {
119125 objectType string
@@ -162,6 +168,11 @@ func inspectAll(ctx context.Context, dockerCli command.Cli, getSize bool, typeCo
162168 isSwarmObject : true ,
163169 objectInspector : inspectSecret (ctx , dockerCli ),
164170 },
171+ {
172+ objectType : "config" ,
173+ isSwarmObject : true ,
174+ objectInspector : inspectConfig (ctx , dockerCli ),
175+ },
165176 }
166177
167178 // isSwarmManager does an Info API call to verify that the daemon is
0 commit comments