login/logout placeholders

Signed-off-by: Josh Dolitsky <jdolitsky@gmail.com>
pull/5597/head
Josh Dolitsky 7 years ago
parent d4323c1da8
commit 67b8cea50f

@ -39,6 +39,8 @@ func newChartCmd(cfg *action.Configuration, out io.Writer) *cobra.Command {
Long: chartHelp,
}
cmd.AddCommand(
newChartLoginCmd(cfg, out),
newChartLogoutCmd(cfg, out),
newChartListCmd(cfg, out),
newChartExportCmd(cfg, out),
newChartPullCmd(cfg, out),

@ -0,0 +1,43 @@
/*
Copyright The Helm Authors.
Licensed 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
http://www.apache.org/licenses/LICENSE-2.0
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 main
import (
"io"
"github.com/spf13/cobra"
"helm.sh/helm/cmd/helm/require"
"helm.sh/helm/pkg/action"
)
const chartLoginDesc = `
Authenticate against a remote registry.
`
func newChartLoginCmd(cfg *action.Configuration, out io.Writer) *cobra.Command {
return &cobra.Command{
Use: "login [host]",
Short: "login to a registry",
Long: chartLoginDesc,
Args: require.MinimumNArgs(1),
RunE: func(cmd *cobra.Command, args []string) error {
host := args[0]
return action.NewChartLogin(cfg).Run(out, host, "myuser", "mypass")
},
}
}

@ -0,0 +1,43 @@
/*
Copyright The Helm Authors.
Licensed 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
http://www.apache.org/licenses/LICENSE-2.0
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 main
import (
"io"
"github.com/spf13/cobra"
"helm.sh/helm/cmd/helm/require"
"helm.sh/helm/pkg/action"
)
const chartLogoutDesc = `
Remove credentials stored for a remote registry.
`
func newChartLogoutCmd(cfg *action.Configuration, out io.Writer) *cobra.Command {
return &cobra.Command{
Use: "logout [host]",
Short: "logout from a registry",
Long: chartLogoutDesc,
Args: require.MinimumNArgs(1),
RunE: func(cmd *cobra.Command, args []string) error {
host := args[0]
return action.NewChartLogout(cfg).Run(out, host)
},
}
}

@ -0,0 +1,38 @@
/*
Copyright The Helm Authors.
Licensed 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
http://www.apache.org/licenses/LICENSE-2.0
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 action
import (
"io"
)
// ChartLogin performs a chart login operation.
type ChartLogin struct {
cfg *Configuration
}
// NewChartLogin creates a new ChartLogin object with the given configuration.
func NewChartLogin(cfg *Configuration) *ChartLogin {
return &ChartLogin{
cfg: cfg,
}
}
// Run executes the chart login operation
func (a *ChartLogin) Run(out io.Writer, host string, username string, password string) error {
return nil
}

@ -0,0 +1,38 @@
/*
Copyright The Helm Authors.
Licensed 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
http://www.apache.org/licenses/LICENSE-2.0
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 action
import (
"io"
)
// ChartLogin performs a chart login operation.
type ChartLogout struct {
cfg *Configuration
}
// NewChartLogin creates a new ChartLogin object with the given configuration.
func NewChartLogout(cfg *Configuration) *ChartLogout {
return &ChartLogout{
cfg: cfg,
}
}
// Run executes the chart login operation
func (a *ChartLogout) Run(out io.Writer, host string) error {
return nil
}

@ -25,7 +25,7 @@ import (
"github.com/BurntSushi/toml"
"github.com/Masterminds/sprig"
"github.com/pkg/errors"
"gopkg.in/yaml.v2"
yaml "gopkg.in/yaml.v2"
)
// funcMap returns a mapping of all of the functions that Engine has.

@ -29,7 +29,7 @@ import (
"time"
orascontent "github.com/deislabs/oras/pkg/content"
"github.com/docker/go-units"
units "github.com/docker/go-units"
checksum "github.com/opencontainers/go-digest"
ocispec "github.com/opencontainers/image-spec/specs-go/v1"
"github.com/pkg/errors"

Loading…
Cancel
Save