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

staticcheck:modify the import package alias #8253

Merged
merged 1 commit into from
Jan 6, 2020
Merged
Changes from all commits
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
24 changes: 12 additions & 12 deletions upup/pkg/fi/clientset_castore.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import (

"golang.org/x/crypto/ssh"
"k8s.io/apimachinery/pkg/api/errors"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/klog"
"k8s.io/kops/pkg/apis/kops"
kopsinternalversion "k8s.io/kops/pkg/client/clientset_generated/clientset/typed/kops/internalversion"
Expand Down Expand Up @@ -147,7 +147,7 @@ func parseKeyset(o *kops.Keyset) (*keyset, error) {

// loadKeyset gets the named keyset and the format of the Keyset.
func (c *ClientsetCAStore) loadKeyset(name string) (*keyset, error) {
o, err := c.clientset.Keysets(c.namespace).Get(name, v1.GetOptions{})
o, err := c.clientset.Keysets(c.namespace).Get(name, metav1.GetOptions{})
if err != nil {
if errors.IsNotFound(err) {
return nil, nil
Expand Down Expand Up @@ -271,7 +271,7 @@ func (c *ClientsetCAStore) FindCertificatePool(name string) (*CertificatePool, e

// FindCertificateKeyset implements CAStore::FindCertificateKeyset
func (c *ClientsetCAStore) FindCertificateKeyset(name string) (*kops.Keyset, error) {
o, err := c.clientset.Keysets(c.namespace).Get(name, v1.GetOptions{})
o, err := c.clientset.Keysets(c.namespace).Get(name, metav1.GetOptions{})
if err != nil {
if errors.IsNotFound(err) {
return nil, nil
Expand All @@ -286,7 +286,7 @@ func (c *ClientsetCAStore) ListKeysets() ([]*kops.Keyset, error) {
var items []*kops.Keyset

{
list, err := c.clientset.Keysets(c.namespace).List(v1.ListOptions{})
list, err := c.clientset.Keysets(c.namespace).List(metav1.ListOptions{})
if err != nil {
return nil, fmt.Errorf("error listing Keysets: %v", err)
}
Expand All @@ -313,7 +313,7 @@ func (c *ClientsetCAStore) ListSSHCredentials() ([]*kops.SSHCredential, error) {
var items []*kops.SSHCredential

{
list, err := c.clientset.SSHCredentials(c.namespace).List(v1.ListOptions{})
list, err := c.clientset.SSHCredentials(c.namespace).List(metav1.ListOptions{})
if err != nil {
return nil, fmt.Errorf("error listing SSHCredentials: %v", err)
}
Expand Down Expand Up @@ -421,7 +421,7 @@ func (c *ClientsetCAStore) FindPrivateKey(name string) (*pki.PrivateKey, error)

// FindPrivateKeyset implements CAStore::FindPrivateKeyset
func (c *ClientsetCAStore) FindPrivateKeyset(name string) (*kops.Keyset, error) {
o, err := c.clientset.Keysets(c.namespace).Get(name, v1.GetOptions{})
o, err := c.clientset.Keysets(c.namespace).Get(name, metav1.GetOptions{})
if err != nil {
if errors.IsNotFound(err) {
return nil, nil
Expand All @@ -447,7 +447,7 @@ func (c *ClientsetCAStore) CreateKeypair(signer string, id string, template *x50
func (c *ClientsetCAStore) addKey(name string, keysetType kops.KeysetType, item *kops.KeysetItem) error {
create := false
client := c.clientset.Keysets(c.namespace)
keyset, err := client.Get(name, v1.GetOptions{})
keyset, err := client.Get(name, metav1.GetOptions{})
if err != nil {
if errors.IsNotFound(err) {
keyset = nil
Expand Down Expand Up @@ -476,7 +476,7 @@ func (c *ClientsetCAStore) addKey(name string, keysetType kops.KeysetType, item

// DeleteKeysetItem deletes the specified key from the registry; deleting the whole keyset if it was the last one
func DeleteKeysetItem(client kopsinternalversion.KeysetInterface, name string, keysetType kops.KeysetType, id string) error {
keyset, err := client.Get(name, v1.GetOptions{})
keyset, err := client.Get(name, metav1.GetOptions{})
if err != nil {
if errors.IsNotFound(err) {
return nil
Expand All @@ -501,7 +501,7 @@ func DeleteKeysetItem(client kopsinternalversion.KeysetInterface, name string, k
return fmt.Errorf("KeysetItem %q not found in Keyset %q", id, name)
}
if len(newKeys) == 0 {
if err := client.Delete(name, &v1.DeleteOptions{}); err != nil {
if err := client.Delete(name, &metav1.DeleteOptions{}); err != nil {
return fmt.Errorf("error deleting Keyset %q: %v", name, err)
}
} else {
Expand All @@ -517,7 +517,7 @@ func DeleteKeysetItem(client kopsinternalversion.KeysetInterface, name string, k
func (c *ClientsetCAStore) addSshCredential(name string, publicKey string) error {
create := false
client := c.clientset.SSHCredentials(c.namespace)
sshCredential, err := client.Get(name, v1.GetOptions{})
sshCredential, err := client.Get(name, metav1.GetOptions{})
if err != nil {
if errors.IsNotFound(err) {
sshCredential = nil
Expand Down Expand Up @@ -546,7 +546,7 @@ func (c *ClientsetCAStore) addSshCredential(name string, publicKey string) error
// deleteSSHCredential deletes the specified SSHCredential from the registry
func (c *ClientsetCAStore) deleteSSHCredential(name string) error {
client := c.clientset.SSHCredentials(c.namespace)
err := client.Delete(name, &v1.DeleteOptions{})
err := client.Delete(name, &metav1.DeleteOptions{})
if err != nil {
return fmt.Errorf("error deleting SSHCredential %q: %v", name, err)
}
Expand Down Expand Up @@ -600,7 +600,7 @@ func (c *ClientsetCAStore) AddSSHPublicKey(name string, pubkey []byte) error {

// FindSSHPublicKeys implements CAStore::FindSSHPublicKeys
func (c *ClientsetCAStore) FindSSHPublicKeys(name string) ([]*kops.SSHCredential, error) {
o, err := c.clientset.SSHCredentials(c.namespace).Get(name, v1.GetOptions{})
o, err := c.clientset.SSHCredentials(c.namespace).Get(name, metav1.GetOptions{})
if err != nil {
if errors.IsNotFound(err) {
return nil, nil
Expand Down