
This change enables operators to SSH into a sub-cluster Jump Host from outside the base K8s cluster using a Node Port service. Operators authenticate using SSH authorized keys to the SIP CR. Signed-off-by: Drew Walters <andrew.walters@att.com> Change-Id: Ib1d94b5b0813e34014375d97f9189948af49f42c
50 lines
1.5 KiB
Go
50 lines
1.5 KiB
Go
/*
|
|
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
|
|
|
|
https://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 services
|
|
|
|
import (
|
|
"fmt"
|
|
|
|
airshipv1 "sipcluster/pkg/api/v1"
|
|
)
|
|
|
|
// ErrAuthTypeNotSupported is returned when wrong AuthType is provided
|
|
type ErrInfraServiceNotSupported struct {
|
|
Service airshipv1.SIPClusterService
|
|
}
|
|
|
|
func (e ErrInfraServiceNotSupported) Error() string {
|
|
return fmt.Sprintf("invalid Infrastructure Service: %v", e.Service)
|
|
}
|
|
|
|
// ErrInvalidAuthorizedKeyFormat occurs when an authorized key in the SIP CR does not meet the expected format.
|
|
type ErrInvalidAuthorizedKeyFormat struct {
|
|
SSHErr string
|
|
Key string
|
|
}
|
|
|
|
func (e ErrInvalidAuthorizedKeyFormat) Error() string {
|
|
return fmt.Sprintf("encountered invalid Authorized Key: %s. The invalid key is %s", e.SSHErr, e.Key)
|
|
}
|
|
|
|
// ErrMalformedRedfishAddress occurs when a Redfish address does not meet the expected format.
|
|
type ErrMalformedRedfishAddress struct {
|
|
Address string
|
|
}
|
|
|
|
func (e ErrMalformedRedfishAddress) Error() string {
|
|
return fmt.Sprintf("invalid Redfish BMC address %s", e.Address)
|
|
}
|